From 50a6890e39b9537cee2e2fddd48f9e8e9c2bbd56 Mon Sep 17 00:00:00 2001 From: Steeve Pastorelli Date: Fri, 31 Aug 2018 18:41:00 +0100 Subject: [PATCH] Add status_transitions filters to the List Orders params --- order.go | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/order.go b/order.go index 32611a648e..5d7cf1144a 100644 --- a/order.go +++ b/order.go @@ -139,12 +139,25 @@ type OrderList struct { // OrderListParams is the set of parameters that can be used when listing orders. type OrderListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer *string `form:"customer"` - IDs []*string `form:"ids"` - Status *string `form:"status"` + ListParams `form:"*"` + Created *int64 `form:"created"` + CreatedRange *RangeQueryParams `form:"created"` + Customer *string `form:"customer"` + IDs []*string `form:"ids"` + Status *string `form:"status"` + StatusTransitions *StatusTransitionsFilterParams `form:"status_transitions"` +} + +// StatusTransitionsFilterParams are parameters that can used to filter on status_transition when listing orders. +type StatusTransitionsFilterParams struct { + Canceled *int64 `form:"canceled"` + CanceledRange *RangeQueryParams `form:"canceled"` + Fulfilled *int64 `form:"fulfiled"` + FulfilledRange *RangeQueryParams `form:"fulfilled"` + Paid *int64 `form:"paid"` + PaidRange *RangeQueryParams `form:"paid"` + Returned *int64 `form:"returned"` + ReturnedRange *RangeQueryParams `form:"returned"` } // StatusTransitions are the timestamps at which the order status was updated.