- Remove backend Medusa.js (TypeScript) e substitui pelo backend Go (saveinmed-performance-core) - Corrige testes auth.test.ts: alinha paths de API (v1/ sem barra inicial) e campo access_token - Corrige GroupedProductCard.test.tsx: ajusta distância formatada (toFixed) e troca userEvent por fireEvent com fakeTimers - Corrige AuthContext.test.tsx: usa vi.hoisted() para mocks e corrige parênteses no waitFor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
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"`
|
|
}
|