mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-06-09 15:07:49 +00:00
feat: add date range filter to marketing list API
Added start_date, end_date, and filter_by query parameters to the GET /api/marketing/ endpoint. Users can now filter marketing records by a date range using either so_date (Sales Order date, default) or created_at as the target column. Changes: - validation: added StartDate, EndDate (YYYY-MM-DD format), and FilterBy (oneof: so_date, created_at) to DeliveryOrderQuery struct - controller: parse the three new query params in GetAll handler - service: apply >=start / <end+1day date range filter in the query modifier using the existing utils.ParseDateRangeForQuery helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,9 @@ type DeliveryOrderQuery struct {
|
||||
WarehouseID uint `query:"warehouse_id" validate:"omitempty,gt=0"`
|
||||
SortBy string `query:"sort_by" validate:"omitempty,oneof=so_number so_date status customer grand_total created_at"`
|
||||
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"`
|
||||
FilterBy string `query:"filter_by" validate:"omitempty,oneof=so_date created_at"`
|
||||
}
|
||||
|
||||
type DeliveryOrderApprove struct {
|
||||
|
||||
Reference in New Issue
Block a user