2025-07-18 20:10:29 +07:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Category struct {
|
|
|
|
|
ID uuid.UUID
|
|
|
|
|
OrganizationID uuid.UUID
|
|
|
|
|
Name string
|
|
|
|
|
Description *string
|
|
|
|
|
ImageURL *string
|
2025-10-06 22:46:01 +07:00
|
|
|
Order int
|
2025-07-18 20:10:29 +07:00
|
|
|
IsActive bool
|
|
|
|
|
CreatedAt time.Time
|
|
|
|
|
UpdatedAt time.Time
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type CreateCategoryRequest struct {
|
|
|
|
|
OrganizationID uuid.UUID `validate:"required"`
|
|
|
|
|
Name string `validate:"required,min=1,max=255"`
|
|
|
|
|
Description *string `validate:"omitempty,max=1000"`
|
|
|
|
|
ImageURL *string `validate:"omitempty,url"`
|
2025-10-06 22:46:01 +07:00
|
|
|
Order int `validate:"min=0"`
|
2025-07-18 20:10:29 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UpdateCategoryRequest struct {
|
|
|
|
|
Name *string `validate:"omitempty,min=1,max=255"`
|
|
|
|
|
Description *string `validate:"omitempty,max=1000"`
|
|
|
|
|
ImageURL *string `validate:"omitempty,url"`
|
2025-10-06 22:46:01 +07:00
|
|
|
Order *int `validate:"omitempty,min=0"`
|
2025-07-18 20:10:29 +07:00
|
|
|
IsActive *bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type CategoryResponse struct {
|
|
|
|
|
ID uuid.UUID
|
|
|
|
|
OrganizationID uuid.UUID
|
|
|
|
|
Name string
|
|
|
|
|
Description *string
|
|
|
|
|
ImageURL *string
|
2025-10-06 22:46:01 +07:00
|
|
|
Order int
|
2025-07-18 20:10:29 +07:00
|
|
|
IsActive bool
|
|
|
|
|
CreatedAt time.Time
|
|
|
|
|
UpdatedAt time.Time
|
|
|
|
|
}
|