Skip to content

Commit

Permalink
[DEV-10111] Change types and refactor enums
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadxali committed Feb 22, 2023
1 parent 028170f commit dfd2002
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions src/endpoints/PricingTables/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,9 @@ export interface PricingTable {
options: Option[];
}

export enum BillingCycle {
MONTH = 'month',
YEAR = 'year',
}

export enum Currency {
EUR = 'eur',
USD = 'usd',
}

export enum OptionId {
STARTER = 'starter',
CORE = 'core',
PREMIUM = 'premium',
}

export enum LimitDisplayName {
STORIES = 'Stories',
USERS = 'Users',
SITES = 'Sites',
CONTACTS = 'Contacts',
EMAIL_SENDS = 'Email sends',
CUSTOM_SENDER_ADDRESSES = 'Custom sender addresses',
}

export interface Option {
id: `${OptionId}`;
display_name: string | null;
id: string;
display_name: string;
description: string | null;
overview_features_list: PlanFeatureRef[];
limits: Limit[];
Expand All @@ -44,16 +19,16 @@ export interface PlanFeatureRef {

export interface Limit {
id: string;
display_name: `${LimitDisplayName}`;
display_name: string;
value: null | number;
per: null | string;
}

export interface Price {
billing_cycle: `${BillingCycle}`;
currency: `${Currency}`;
unit_amount: number;
unit: string;
billing_cycle: string;
currency: string;
amount: number;
unit: string | null;
}

export interface AddOn {
Expand Down

0 comments on commit dfd2002

Please sign in to comment.