feat: site stock
This commit is contained in:
@@ -284,6 +284,7 @@ func (h *Handler) toProductResponse(resp *entity.Product) response.Product {
|
||||
SiteID: resp.SiteID,
|
||||
IsSeasonTicket: resp.IsSeasonTicket,
|
||||
IsWeekendTicket: resp.IsWeekendTicket,
|
||||
Stock: resp.Stock,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -324,6 +324,7 @@ func (h *Handler) toProductResponseList(products []entity.Product) []response.Pr
|
||||
Description: product.Description,
|
||||
CreatedAt: product.CreatedAt.Format(time.RFC3339),
|
||||
UpdatedAt: product.UpdatedAt.Format(time.RFC3339),
|
||||
Stock: product.Stock,
|
||||
})
|
||||
}
|
||||
return res
|
||||
|
||||
@@ -37,6 +37,7 @@ type Product struct {
|
||||
IsSeasonTicket bool `json:"is_season_ticket"`
|
||||
Status string `json:"status"`
|
||||
Description string `json:"description" validate:"required"`
|
||||
Stock int64 `json:"stock"`
|
||||
}
|
||||
|
||||
func (e *Product) ToEntity() *entity.Product {
|
||||
@@ -46,5 +47,6 @@ func (e *Product) ToEntity() *entity.Product {
|
||||
Price: e.Price,
|
||||
Status: e.Status,
|
||||
Description: e.Description,
|
||||
Stock: e.Stock,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ func (r *Site) ToEntity(createdBy int64) *entity.Site {
|
||||
Status: p.Status,
|
||||
Description: p.Description,
|
||||
CreatedBy: createdBy,
|
||||
Stock: p.Stock,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user