11package models
22
3+ // ###############################################################################
4+ // Stock Model
5+ // ###############################################################################
6+
37import "go.mongodb.org/mongo-driver/bson/primitive"
48
9+ // Stock represents a stock entity
510type Stock struct {
611 ID primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
712 Name string `json:"name" bson:"name"`
@@ -11,22 +16,23 @@ type Stock struct {
1116 Purification string `json:"purification" bson:"purification"`
1217}
1318
19+ // StockResponse represents a response containing a list of stocks
1420type StockResponse struct {
1521 Stocks []Stock `json:"stocks"`
1622}
1723
18-
24+ // PurificationRequest represents a request to calculate purification amount
1925type PurificationRequest struct {
2026 StartDate string `json:"start_date" validate:"required,datetime=2006-01-02"`
2127 EndDate string `json:"end_date" validate:"required,datetime=2006-01-02"`
2228 NumberOfStocks int `json:"number_of_stocks" validate:"required,gt=0"`
2329 StockCode string `json:"stock_code" validate:"required"`
2430}
2531
26-
32+ // PurificationResponse represents a response containing the purification amount
2733type PurificationResponse struct {
2834 ID primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
2935 PurificationAmount float64 `json:"purification_amount"`
3036 DaysHeld int `json:"days_held"`
3137 PurificationRate float64 `json:"purification_rate"`
32- }
38+ }
0 commit comments