diff --git a/internal/domain/category/spec.go b/internal/domain/category/spec.go index ebaf438..203f57e 100644 --- a/internal/domain/category/spec.go +++ b/internal/domain/category/spec.go @@ -5,14 +5,18 @@ import ( ) type Category struct { - ID string `json:"id" gorm:"primaryKey"` - Name string `json:"name"` - Code string `json:"code"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + ID string `json:"id" gorm:"primaryKey"` + Name string `json:"name"` + Code string `json:"code"` + 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"` + Name string `json:"name" validate:"required"` + Code string `json:"code" validate:"required"` + Description string `json:"description"` + Sequence int `json:"sequence"` } diff --git a/internal/services/category/update.go b/internal/services/category/update.go index adea362..78bc39e 100644 --- a/internal/services/category/update.go +++ b/internal/services/category/update.go @@ -7,10 +7,12 @@ import ( func (i *impl) Update(categoryID string, spec categorydomain.CategoryReq) error { updateData := categorydomain.Category{ - ID: categoryID, - Name: spec.Name, - Code: spec.Code, - UpdatedAt: timeutils.Now(), + ID: categoryID, + Name: spec.Name, + Code: spec.Code, + Description: spec.Description, + Sequence: spec.Sequence, + UpdatedAt: timeutils.Now(), } if err := i.categoryRepo.Update(updateData); err != nil {