From ff9909eaef9556ecd7b673c4b55a5a54921d6ddf Mon Sep 17 00:00:00 2001 From: David Remer Date: Tue, 20 Jun 2023 15:59:56 +0300 Subject: [PATCH] Add OrderSection types [PREMIUM-224] --- .../mailpoet/analytics/store/types.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/store/types.ts b/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/store/types.ts index 8a70595e8c..95240faf11 100644 --- a/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/store/types.ts +++ b/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/store/types.ts @@ -56,6 +56,45 @@ export type Query = { after: string | undefined; before: string | undefined; }; + +export type CustomerData = { + id: number; + email: string; + first_name: string; + last_name: string; + avatar: string; +}; +type LineItemData = { + id: number; + name: string; + quantity: number; +}; + +export type OrderDetails = { + id: number; + status: { + id: string; + name: string; + }; + total: number; + products: LineItemData[]; +}; + +export type OrderData = { + date: string; + customer: CustomerData; + details: OrderDetails; + email: { + id: number; + subject: string; + }; +}; + +type OrderSectionData = SectionData & OrderData[]; + +export type OrderSection = Section & { + data: undefined | OrderSectionData; +}; export type State = { automation: Automation; sections: Record;