@launchedla/snacktime
Advanced tools
Comparing version 0.0.37 to 0.0.38
@@ -221,2 +221,11 @@ "use strict"; | ||
}); | ||
test('FailedCancelOrder', async () => { | ||
expect(await snacktime.recordAction({ customerId: 123 }, { | ||
label: 'FailedCancelOrder', | ||
orderId: 123, | ||
variantIds: [123, 456, 789], | ||
cancelReason: 'test-reason', | ||
failureReason: 'order already cancelled', | ||
})).toBe(true); | ||
}); | ||
}); | ||
@@ -223,0 +232,0 @@ describe('getActions', () => { |
@@ -6,3 +6,3 @@ export interface RecordActionRequiredProps { | ||
} | ||
export declare type Action = UpdatedBundleAction | CronSwappedPatternsAction | CronSwappedAddOnsAction | ChangedShipDateAction | RedeemedOfferAction | RedeemedLoyaltyKeyAction | RedeemedBirthdayGiftAction | AcceptedCancellationSaveAction | CancellationDeflectedAction | CancelledBundleAction | CancelledOrderAction | OrderNowAction | SwapOutOfStockPatternsReportAction | RemoveOOSAddOnsReportAction | ExamineInsufficientInventoryErrorsReportAction | CampaignAddOnVariantsAddedAction | AddQuickAddOnAction | ChargeFailedAction | ShipmentNotificationSentAction | RepairedBundleAction | RepairedBundlesReportAction; | ||
export declare type Action = UpdatedBundleAction | CronSwappedPatternsAction | CronSwappedAddOnsAction | ChangedShipDateAction | RedeemedOfferAction | RedeemedLoyaltyKeyAction | RedeemedBirthdayGiftAction | AcceptedCancellationSaveAction | CancellationDeflectedAction | CancelledBundleAction | CancelledOrderAction | FailedOrderCancelAction | OrderNowAction | SwapOutOfStockPatternsReportAction | RemoveOOSAddOnsReportAction | ExamineInsufficientInventoryErrorsReportAction | CampaignAddOnVariantsAddedAction | AddQuickAddOnAction | ChargeFailedAction | ShipmentNotificationSentAction | RepairedBundleAction | RepairedBundlesReportAction; | ||
export interface UpdatedBundleAction extends CommonProps { | ||
@@ -69,8 +69,9 @@ label: 'UpdatedBundle'; | ||
export declare type CancelledBundleAction = CancelledBundleActionBase | CancelledBundleActionWithOtherReason; | ||
export interface CancelledOrderAction extends CommonProps { | ||
export interface CancelledOrderAction extends CancelledOrderActionBase { | ||
label: 'CancelledOrder'; | ||
orderId: number; | ||
variantIds: number[]; | ||
cancelReason?: string; | ||
} | ||
export interface FailedOrderCancelAction extends CancelledOrderActionBase { | ||
label: 'FailedCancelOrder'; | ||
failureReason?: string; | ||
} | ||
export interface OrderNowAction extends CommonProps { | ||
@@ -182,2 +183,7 @@ label: 'OrderNow'; | ||
}; | ||
interface CancelledOrderActionBase extends CommonProps { | ||
orderId: number; | ||
variantIds: number[]; | ||
cancelReason?: string; | ||
} | ||
interface CancelledBundleActionBase extends CommonProps { | ||
@@ -184,0 +190,0 @@ label: 'CancelledBundle'; |
{ | ||
"name": "@launchedla/snacktime", | ||
"version": "0.0.37", | ||
"version": "0.0.38", | ||
"description": "Snacktime is a wrapper for the Launched LA internal database that will replicate into Snowflake. It is a replacement for Shopify metafields and an enhanced place to store event-driven data.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -311,2 +311,17 @@ import Snacktime from './' | ||
}) | ||
test('FailedCancelOrder', async () => { | ||
expect( | ||
await snacktime.recordAction( | ||
{ customerId: 123 }, | ||
{ | ||
label: 'FailedCancelOrder', | ||
orderId: 123, | ||
variantIds: [123, 456, 789], | ||
cancelReason: 'test-reason', | ||
failureReason: 'order already cancelled', | ||
} | ||
) | ||
).toBe(true) | ||
}) | ||
}) | ||
@@ -313,0 +328,0 @@ |
@@ -19,2 +19,3 @@ export interface RecordActionRequiredProps { | ||
| CancelledOrderAction | ||
| FailedOrderCancelAction | ||
| OrderNowAction | ||
@@ -102,9 +103,11 @@ | SwapOutOfStockPatternsReportAction | ||
export interface CancelledOrderAction extends CommonProps { | ||
export interface CancelledOrderAction extends CancelledOrderActionBase { | ||
label: 'CancelledOrder' | ||
orderId: number | ||
variantIds: number[] | ||
cancelReason?: string | ||
} | ||
export interface FailedOrderCancelAction extends CancelledOrderActionBase { | ||
label: 'FailedCancelOrder' | ||
failureReason?: string | ||
} | ||
export interface OrderNowAction extends CommonProps { | ||
@@ -235,2 +238,8 @@ label: 'OrderNow' | ||
interface CancelledOrderActionBase extends CommonProps { | ||
orderId: number | ||
variantIds: number[] | ||
cancelReason?: string | ||
} | ||
interface CancelledBundleActionBase extends CommonProps { | ||
@@ -237,0 +246,0 @@ label: 'CancelledBundle' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
788760
2029