mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
25 lines
1.3 KiB
Go
25 lines
1.3 KiB
Go
package validation
|
|
|
|
type Create struct {
|
|
Name string `json:"name" validate:"required_strict,min=3"`
|
|
}
|
|
|
|
type Update struct {
|
|
Name *string `json:"name,omitempty" validate:"omitempty"`
|
|
}
|
|
|
|
type Query struct {
|
|
Page int `query:"page" validate:"omitempty,number,min=1,gt=0"`
|
|
Limit int `query:"limit" validate:"omitempty,number,min=1,max=100,gt=0"`
|
|
Search string `query:"search" validate:"omitempty,max=50"`
|
|
TransactionTypes []string `query:"transaction_types" validate:"omitempty,dive,max=50"`
|
|
BankIDs []uint `query:"bank_ids" validate:"omitempty,dive,gt=0"`
|
|
CustomerIDs []uint `query:"customer_ids" validate:"omitempty,dive,gt=0"`
|
|
SupplierIDs []uint `query:"supplier_ids" validate:"omitempty,dive,gt=0"`
|
|
SortDate string `query:"sort_date" validate:"omitempty,oneof=created_at payment_date"`
|
|
SortBy string `query:"sort_by" validate:"omitempty,oneof=payment_code reference_number transaction_type customer_name payment_date created_at payment_method bank expense_amount income_amount"`
|
|
SortOrder string `query:"sort_order" validate:"omitempty,oneof=asc desc"`
|
|
StartDate string `query:"start_date" validate:"omitempty,datetime=2006-01-02"`
|
|
EndDate string `query:"end_date" validate:"omitempty,datetime=2006-01-02"`
|
|
}
|