package domain

import "time"

// SearchRequest represents an API-level request for advanced listings.
type SearchRequest struct {
	Query         string     `json:"query"`
	Page          int        `json:"page"`
	PageSize      int        `json:"page_size"`
	SortBy        string     `json:"sort_by"`
	SortOrder     string     `json:"sort_order"`
	CreatedAfter  *time.Time `json:"created_after,omitempty"`
	CreatedBefore *time.Time `json:"created_before,omitempty"`
}

// RecordSearchFilter contains normalized filtering inputs for repositories.
type RecordSearchFilter struct {
	Query         string
	SortBy        string
	SortOrder     string
	CreatedAfter  *time.Time
	CreatedBefore *time.Time
	Limit         int
	Offset        int
}

// PaginationResponse represents a paginated response.
type PaginationResponse[T any] struct {
	Items       []T   `json:"items"`
	TotalCount  int64 `json:"total_count"`
	CurrentPage int   `json:"current_page"`
	TotalPages  int   `json:"total_pages"`
}

// ProductPaginationResponse is a swagger-friendly pagination response for products.
type ProductPaginationResponse struct {
	Items       []Product `json:"items"`
	TotalCount  int64     `json:"total_count"`
	CurrentPage int       `json:"current_page"`
	TotalPages  int       `json:"total_pages"`
}
