Feat[BE]: refactored Chickin createone and implement approvals and add more needed constant

This commit is contained in:
aguhh18
2025-10-31 15:33:31 +07:00
parent c91d84b652
commit 219a6a39ed
17 changed files with 485 additions and 415 deletions
@@ -3,7 +3,7 @@ package validation
type Create struct {
ProjectFlockKandangId uint `json:"project_flock_kandang_id" validate:"required,number,min=1"`
ChickInDate string `json:"chick_in_date" validate:"required,datetime=2006-01-02"`
Note string `json:"note" validate:"omitempty`
Note string `json:"note" validate:"omitempty"`
}
type Update struct {
@@ -16,3 +16,9 @@ type Query struct {
Limit int `query:"limit" validate:"omitempty,number,min=1,max=100"`
ProjectFlockKandangId uint `query:"project_flock_kandang_id" validate:"omitempty,number,min=1"`
}
type Approve struct {
Action string `json:"action" validate:"required_strict"`
ApprovableIds []uint `json:"approvable_ids" validate:"required_strict,min=1,dive,gt=0"`
Notes *string `json:"notes,omitempty" validate:"omitempty,max=500"`
}