50 lines
1.9 KiB
Go
50 lines
1.9 KiB
Go
package contract
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type CreateCategoryRequest struct {
|
|
Name string `json:"name" validate:"required,min=1,max=255"`
|
|
Description *string `json:"description,omitempty"`
|
|
BusinessType *string `json:"business_type,omitempty"`
|
|
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type UpdateCategoryRequest struct {
|
|
Name *string `json:"name,omitempty" validate:"omitempty,min=1,max=255"`
|
|
Description *string `json:"description,omitempty"`
|
|
BusinessType *string `json:"business_type,omitempty"`
|
|
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type ListCategoriesRequest struct {
|
|
OrganizationID *uuid.UUID `json:"organization_id,omitempty"`
|
|
BusinessType string `json:"business_type,omitempty"`
|
|
Search string `json:"search,omitempty"`
|
|
Page int `json:"page" validate:"required,min=1"`
|
|
Limit int `json:"limit" validate:"required,min=1,max=100"`
|
|
}
|
|
|
|
// Category Response DTOs
|
|
type CategoryResponse struct {
|
|
ID uuid.UUID `json:"id"`
|
|
OrganizationID uuid.UUID `json:"organization_id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description"`
|
|
BusinessType string `json:"business_type"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type ListCategoriesResponse struct {
|
|
Categories []CategoryResponse `json:"categories"`
|
|
TotalCount int `json:"total_count"`
|
|
Page int `json:"page"`
|
|
Limit int `json:"limit"`
|
|
TotalPages int `json:"total_pages"`
|
|
}
|