feat: update Category model and request struct to use pointers for description and sequence fields
This commit is contained in:
@@ -8,15 +8,15 @@ type Category struct {
|
||||
ID string `json:"id" gorm:"primaryKey"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Description string `json:"description"`
|
||||
Sequence int `json:"sequence"`
|
||||
Description *string `json:"description"`
|
||||
Sequence *int `json:"sequence"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CategoryReq struct {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
Sequence int `json:"sequence"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
Description *string `json:"description"`
|
||||
Sequence *int `json:"sequence"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user