@@ -7,59 +7,59 @@ import (
77
88// Item represents a product item
99type Item struct {
10- ID int `json:"id" db:"id"`
11- ItemID string `json:"itemId" db:"itemId"`
12- Name string `json:"name" db:"name"`
13- Price int `json:"price" db:"price"`
14- Stock int `json:"stock" db:"stock"`
15- IsDeleted bool `json:"isDeleted" db:"isDeleted"`
16- CreatedAt time.Time `json:"createdAt" db:"createdAt"`
17- UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
10+ ID int `json:"id" db:"id"`
11+ ItemID string `json:"itemId" db:"itemId"`
12+ Name string `json:"name" db:"name"`
13+ Price int `json:"price" db:"price"`
14+ Stock int `json:"stock" db:"stock"`
15+ IsDeleted bool `json:"isDeleted" db:"isDeleted"`
16+ CreatedAt time.Time `json:"createdAt" db:"createdAt"`
17+ UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
1818}
1919
2020// Store represents a store
2121type Store struct {
22- ID int `json:"id" db:"id"`
23- StoreID string `json:"storeId" db:"storeId"`
24- Name string `json:"name" db:"name"`
25- CreatedAt time.Time `json:"createdAt" db:"createdAt"`
26- UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
22+ ID int `json:"id" db:"id"`
23+ StoreID string `json:"storeId" db:"storeId"`
24+ Name string `json:"name" db:"name"`
25+ CreatedAt time.Time `json:"createdAt" db:"createdAt"`
26+ UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
2727}
2828
2929// Staff represents a staff member
3030type Staff struct {
31- ID int `json:"id" db:"id"`
32- StaffID string `json:"staffId" db:"staffId"`
33- Name string `json:"name" db:"name"`
34- CreatedAt time.Time `json:"createdAt" db:"createdAt"`
35- UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
31+ ID int `json:"id" db:"id"`
32+ StaffID string `json:"staffId" db:"staffId"`
33+ Name string `json:"name" db:"name"`
34+ CreatedAt time.Time `json:"createdAt" db:"createdAt"`
35+ UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
3636}
3737
3838// Sale represents a sale transaction
3939type Sale struct {
40- ID int `json:"id" db:"id"`
41- StoreID int `json:"storeId" db:"storeId"`
42- StaffID int `json:"staffId" db:"staffId"`
43- TotalPrice int `json:"totalPrice" db:"totalPrice"`
44- Deposit int `json:"deposit" db:"deposit"`
45- SaleAt time.Time `json:"saleAt" db:"saleAt"`
46- Details []SaleDetail `json:"details,omitempty"`
47- Store * Store `json:"store,omitempty"`
48- Staff * Staff `json:"staff,omitempty"`
49- CreatedAt time.Time `json:"createdAt" db:"createdAt"`
50- UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
40+ ID int `json:"id" db:"id"`
41+ StoreID int `json:"storeId" db:"storeId"`
42+ StaffID int `json:"staffId" db:"staffId"`
43+ TotalPrice int `json:"totalPrice" db:"totalPrice"`
44+ Deposit int `json:"deposit" db:"deposit"`
45+ SaleAt time.Time `json:"saleAt" db:"saleAt"`
46+ Details []SaleDetail `json:"details,omitempty"`
47+ Store * Store `json:"store,omitempty"`
48+ Staff * Staff `json:"staff,omitempty"`
49+ CreatedAt time.Time `json:"createdAt" db:"createdAt"`
50+ UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
5151}
5252
5353// SaleDetail represents a sale detail item
5454type SaleDetail struct {
55- ID int `json:"id" db:"id"`
56- SaleID int `json:"saleId" db:"saleId"`
57- ItemID int `json:"itemId" db:"itemId"`
58- Quantity int `json:"quantity" db:"quantity"`
59- Price int `json:"price" db:"price"`
60- Item * Item `json:"item,omitempty"`
61- CreatedAt time.Time `json:"createdAt" db:"createdAt"`
62- UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
55+ ID int `json:"id" db:"id"`
56+ SaleID int `json:"saleId" db:"saleId"`
57+ ItemID int `json:"itemId" db:"itemId"`
58+ Quantity int `json:"quantity" db:"quantity"`
59+ Price int `json:"price" db:"price"`
60+ Item * Item `json:"item,omitempty"`
61+ CreatedAt time.Time `json:"createdAt" db:"createdAt"`
62+ UpdatedAt time.Time `json:"updatedAt" db:"updatedAt"`
6363}
6464
6565// Setting represents a configuration setting
@@ -103,4 +103,4 @@ func (nt NullTime) Value() (driver.Value, error) {
103103 return nil , nil
104104 }
105105 return nt .Time , nil
106- }
106+ }
0 commit comments