28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
|
package cart
|
||
|
|
||
|
import (
|
||
|
"github.com/uptrace/bun"
|
||
|
"relynolli-server/models/catalog"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type DBFuser struct {
|
||
|
bun.BaseModel `bun:"table:b_sale_fuser"`
|
||
|
Id int64 `bun:"ID,pk" json:"id"`
|
||
|
Code string `bun:"CODE,default:md5(now())" json:"code" json:"code"`
|
||
|
UserId int64 `bun:"USER_ID,nullzero" json:"userId"`
|
||
|
DateInserted time.Time `bun:"DATE_INSERT" json:"dateInserted"`
|
||
|
DateUpdated time.Time `bun:"DATE_UPDATE" json:"dateUpdated"`
|
||
|
}
|
||
|
|
||
|
type DBCart struct {
|
||
|
bun.BaseModel `bun:"table:api_cart"`
|
||
|
Id int64 `bun:"id,pk" json:"id"`
|
||
|
FuserId int64 `bun:"fuser_id" json:"fuserId"`
|
||
|
ProductId int64 `bun:"product_id" json:"productId"`
|
||
|
PriceTypeId int64 `bun:"price_type_id" json:"priceTypeId"`
|
||
|
Quantity int64 `bun:"quantity" json:"quantity"`
|
||
|
Fuser *DBFuser `bun:"rel:belongs-to,join:fuser_id=ID" json:"fuser"`
|
||
|
Product *catalog.DBCatalog `bun:"rel:belongs-to,join:product_id=id" json:"product"`
|
||
|
}
|