import { CouponName, SubscriptionPlanName } from '.'; import { DatabaseModel, Id, Milliseconds, PriceInteger } from '..'; import { GroupId } from '../group'; import { UserId } from '../user'; import { SubscriptionCancelReason } from './SubscriptionCancel'; export declare type SubscriptionId = string; export interface Subscription extends DatabaseModel { id: SubscriptionId; /** Name of the Subscription type (ex. Nestling). Must map to a SubscriptionMetadata. */ plan: SubscriptionPlanName; user: UserId; /** Payments ID of the user. */ userPaymentsId?: Id; monthlyPriceUSD: PriceInteger; startTimestamp?: Milliseconds; endTimestamp?: Milliseconds; /** If unstarted, determines the duration after startTimestamp for the subscription to end. */ durationFromStart?: Milliseconds; isStarted?: boolean; isCanceled: boolean; cancelReason?: SubscriptionCancelReason; maximumAssociatedUsers?: number; /** User IDs of users this plan includes. */ associatedUsers?: UserId[]; institution?: GroupId; /** Coupon name of the coupon used in this order. */ coupon?: CouponName; /** ID of the user who referred the user. */ referrer?: UserId; }