mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
fix(BE): multiple filter, all search
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
package validation
|
||||
|
||||
type Create struct {
|
||||
Name string `json:"name" validate:"required_strict,min=3"`
|
||||
Name string `json:"name" validate:"required_strict,min=3"`
|
||||
}
|
||||
|
||||
type Update struct {
|
||||
Name *string `json:"name,omitempty" validate:"omitempty"`
|
||||
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"`
|
||||
TransactionType string `query:"transaction_type" validate:"omitempty,max=50"`
|
||||
BankId *uint `query:"bank_id" validate:"omitempty,number,gt=0"`
|
||||
CustomerId *uint `query:"customer_id" validate:"omitempty,number,gt=0"`
|
||||
SupplierId *uint `query:"supplier_id" validate:"omitempty,number,gt=0"`
|
||||
SortDate string `query:"sort_date" validate:"omitempty,oneof=created_at payment_date"`
|
||||
StartDate string `query:"start_date" validate:"omitempty,datetime=2006-01-02"`
|
||||
EndDate string `query:"end_date" validate:"omitempty,datetime=2006-01-02"`
|
||||
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"`
|
||||
StartDate string `query:"start_date" validate:"omitempty,datetime=2006-01-02"`
|
||||
EndDate string `query:"end_date" validate:"omitempty,datetime=2006-01-02"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user