Commit 5f018562 authored by fodorpatrik2000's avatar fodorpatrik2000 👻
Browse files

structs for payout

parent 6f7cb8d8
......@@ -53,6 +53,27 @@ type Session struct {
User *User `pg:"rel:has-one,join_fk:user_schacc"`
}
type Payout struct {
Id string `pg:"id,pk,default:gen_random_uuid()"`
ProdGroupID string `pg:"product_group_id"`
Amount int64 `pg:"amount"`
Date time.Time `pg:"date,default:now()"`
ProductGroup *ProductGroup `pg:"rel:has-one,join_fk:product_group_id"`
}
type ProductGroup struct {
Id string `pg:"id,pk,default:gen_random_uuid()"`
Name string `pg:"name"`
}
type ProductCategories struct {
Id string `pg:"id,pk,default:gen_random_uuid()"`
ProdID string `pg:"product_id"`
ProdGroupID string `pg:"product_group_id"`
Product *Product `pg:"rel:has-one,join_fk:product_id"`
ProductGroup *ProductGroup `pg:"rel:has-one,join_fk:product_group_id"`
}
var db = pg.Connect(&pg.Options{
Addr: func() string {
host := env.String("POSTGRES", "localhost")
......@@ -78,6 +99,9 @@ func init() {
(*User)(nil),
(*Spend)(nil),
(*Session)(nil),
(*ProductGroup)(nil),
(*ProductCategories)(nil),
(*Payout)(nil),
}
for _, model := range models {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment