fin-check-api/types/types.go

62 lines
1.9 KiB
Go
Raw Normal View History

2024-08-02 22:36:25 +02:00
package types
2024-08-12 17:31:07 +02:00
import "time"
2024-08-02 22:36:25 +02:00
// User struct for requests
type User struct {
Username string `json:"username" binding:"required" example:"testUser"`
Password string `json:"password" binding:"required" example:"strongPassLol"`
}
// User Account
type Account struct {
ID uint `json:"id" example:"1"`
Token string `json:"token" example:"Fvs-MnxiEs5dnqMp2mSDIJigPbiIUs6Snk1xxiqPmUc="`
}
2024-08-03 07:06:07 +02:00
type Message struct {
Message string `json:"message" example:"Success!"`
}
2024-08-02 22:36:25 +02:00
type ErrorResponse struct {
Message string `json:"message" example:"Error: you stink"`
}
2024-08-03 07:06:07 +02:00
type DbCard struct {
ID uint `json:"id" example:"1"`
2024-08-03 07:06:07 +02:00
Name string `json:"name" example:"CreditCard"`
Value uint64 `json:"value" example:"1000"`
HaveCreditLine bool `json:"have_credit_line" example:"true"`
CreditLine uint64 `json:"credit_line" example:"500000"`
}
2024-08-03 12:39:42 +02:00
type DbCategory struct {
ID uint `json:"id" example:"1"`
Name string `json:"name" example:"Moldova"`
// Parent is used as a infinite sub-category structure
// Can be 0
ParentID uint `json:"parent_id" example:"0"`
UserID uint `json:"user_id" example:"1"`
}
2024-08-12 17:31:07 +02:00
type DbDebt struct {
ID uint `json:"id" example:"1"`
CardID uint `json:"card_id" example:"1"`
Comment string `json:"comment" example:"pizza"`
Value uint64 `json:"value" example:"20000"`
IOwe bool `json:"i_owe" example:"true"`
Date time.Time `json:"date" example:"29/11/2001 12:00"`
DateEnd time.Time `json:"date_end" example:"29/12/2001 12:00"`
Finished bool `json:"finished" example:"false"`
UserID uint `json:"user_id" example:"1"`
}
2024-08-14 17:20:51 +02:00
type DbIncome struct {
ID uint `json:"id" example:"1"`
CardID uint `json:"card_id" example:"1"`
Comment string `json:"comment" example:"pizza"`
Value uint64 `json:"value" example:"20000"`
Date time.Time `json:"date" example:"29/11/2001 12:00"`
UserID uint `json:"user_id" example:"1"`
}