Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
fix: import correct parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jun 22, 2020
1 parent b269d84 commit 48ab7c9
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/sections/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,20 +291,24 @@ export type ListOrderItems = GetInterface<typeof ListOrderItems>
export interface GetOrderParameters {
AmazonOrderId: string[]
}
export interface ListOrderParameters {
CreatedAfter?: Date
CreatedBefore?: Date
LastUpdatedAfter?: Date
LastUpdatedBefore?: Date
OrderStatus?: (keyof typeof OrderStatus)[]
MarketplaceId: string[]
FulfillmentChannel?: (keyof typeof FulfillmentChannel)[]
PaymentMethod?: (keyof typeof PaymentMethod)[]
BuyerEmail?: string
SellerOrderId?: string
MaxResultsPerPage?: number
EasyShipShipmentStatus?: (keyof typeof EasyShipShipmentStatus)[]
}

export type ListOrderParameters = RequireOnlyOne<
{
CreatedAfter?: Date
CreatedBefore?: Date
LastUpdatedAfter?: Date
LastUpdatedBefore?: Date
OrderStatus?: (keyof typeof OrderStatus)[]
MarketplaceId: string[]
FulfillmentChannel?: (keyof typeof FulfillmentChannel)[]
PaymentMethod?: (keyof typeof PaymentMethod)[]
BuyerEmail?: string
SellerOrderId?: string
MaxResultsPerPage?: number
EasyShipShipmentStatus?: (keyof typeof EasyShipShipmentStatus)[]
},
'CreatedAfter' | 'LastUpdatedAfter'
>

export interface ListOrderItemsParameters {
AmazonOrderId: string
Expand All @@ -330,9 +334,7 @@ const canonicalizeParameters = (parameters: ListOrderParameters) => {
export class Orders {
constructor(private httpClient: HttpClient) {}

async listOrders(
parameters: RequireOnlyOne<ListOrderParameters, 'CreatedAfter' | 'LastUpdatedAfter'>,
): Promise<[ListOrders, RequestMeta]> {
async listOrders(parameters: ListOrderParameters): Promise<[ListOrders, RequestMeta]> {
const [response, meta] = await this.httpClient.request('POST', {
resource: Resource.Orders,
version: ORDERS_API_VERSION,
Expand Down

0 comments on commit 48ab7c9

Please sign in to comment.