aditya.siregar 4f5950543e init
2025-07-18 20:10:29 +07:00

50 lines
1.2 KiB
Go

package contract
import "time"
type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message"`
Details map[string]interface{} `json:"details,omitempty"`
Code int `json:"code"`
}
type ValidationErrorResponse struct {
Error string `json:"error"`
Message string `json:"message"`
Details map[string]string `json:"details"`
Code int `json:"code"`
}
type SuccessResponse struct {
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
type PaginationRequest struct {
Page int `json:"page" validate:"min=1"`
Limit int `json:"limit" validate:"min=1,max=100"`
}
type PaginationResponse struct {
TotalCount int `json:"total_count"`
Page int `json:"page"`
Limit int `json:"limit"`
TotalPages int `json:"total_pages"`
}
type SearchRequest struct {
Query string `json:"query,omitempty"`
}
type DateRangeRequest struct {
From *time.Time `json:"from,omitempty"`
To *time.Time `json:"to,omitempty"`
}
type HealthResponse struct {
Status string `json:"status"`
Timestamp time.Time `json:"timestamp"`
Version string `json:"version"`
}