/** * The Period interface for sending data to the server. */ export interface PeriodRequest { subscription: string; start_at: string; end_at: string | null; } /** * The Period interface for receiving data from the server. */ export interface PeriodResponse { id: string; user_subscription: string; subscription: string; start_at: string; end_at: string | null; invoice: string | null; } /** * The Redux Period interface for periods saved on the server. */ export interface SavedStorePeriod { id: string; userSubscription: string; subscription: string; startAt: string; endAt: string | null; invoice: string | null; } /** * The Redux Period interface for pre-saved periods. */ export interface StorePeriod { subscription: string; startAt: string; endAt: string | null; } /** * The types of subscriptions */ export declare type SubscriptionType = "standard" | "professional" | "free" | "lifetime"; /** * The status of the subscription */ export declare type SubscriptionStatus = "active" | "inactive" | "non-renewal"; /** * The Redux UserSubscription interface for pre-saved user subscriptions. * * This interface is used to store data in our store before we send it to our API to create a new UserSubscription */ export interface StoreUserSubscription { id?: string; status: SubscriptionStatus; discount?: string | null; period?: StorePeriod; subscriptionType: SubscriptionType; isExpired?: boolean; subscriptionInterval?: number; price?: number; userId: string; lastRenewal?: string | null; subscription: string; } /** * The Redux UserSubscription interface for user subscriptions saved on the server. * * This interface is used to store the data retrieved from the API. */ export interface SavedStoreUserSubscription { id: string; status: SubscriptionStatus; discount: string | null; period: StorePeriod; subscriptionType: SubscriptionType; isExpired: boolean; subscriptionInterval: number; price: number; userId: string; lastRenewal: string | null; subscription: string; } /** * The UserSubscription interface for sending data to the server. */ export interface APIUserSubscriptionRequest { id?: string; status: SubscriptionStatus; discount?: string | null; period?: PeriodRequest; subscription_type: SubscriptionType; is_expired?: boolean; subscription_interval?: number; price?: number; user_id: string; last_renewal?: string | null; subscription: string; } /** * The UserSubscription interface for receiving data from the server. */ export interface APIUserSubscriptionResponse { id?: string; status: SubscriptionStatus; discount: string | null; period: PeriodResponse; subscription_type: SubscriptionType; is_expired: boolean; subscription_interval: number; price: number; user_id: string; last_renewal: string | null; subscription: string; }