@aptly-as/types
Version:
Aptly types and enums
55 lines (54 loc) • 1.51 kB
TypeScript
import { AptlyBaseSchema } from './extends.js';
import { AptlyModuleSchema } from './module.js';
import { AptlyOrganizationSchema } from './organization.js';
export declare enum AptlyPlanRecurring {
None = 0,
Monthly = 1,
Yearly = 12
}
export declare enum AptlyPlanTier {
Free = 0,
Subscription = 1
}
export type AptlyPlan = AptlyPlanSchema<string, string>;
export interface AptlyPlanSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
tier: AptlyPlanTier;
isDefaultFreeTier: boolean;
slug: string;
description: string;
modules: (ID | AptlyModuleSchema<ID, DATE>)[];
listed: boolean;
featuredWeight: number;
organization: ID | AptlyOrganizationSchema<ID, DATE> | null;
copiedPlan: ID | null;
recurring: AptlyPlanRecurring;
recurringAt: DATE | null;
subscription: {
monthly: number;
yearly: number;
};
lastPaymentAt: DATE | null;
nextPaymentAt: DATE | null;
user: {
freeQuantity: number;
monthly: number;
};
unit: {
freeQuantity: number;
amount: number;
};
offer: {
freeQuantity: number;
monthlyQuantity: number;
amount: number;
};
}
export type AptlyPlanInstalled = AptlyPlanInstalledSchema<string, string>;
export interface AptlyPlanInstalledSchema<ID, DATE> extends AptlyPlanSchema<ID, DATE> {
organization: ID;
copiedPlan: ID;
listed: false;
lastPaymentAt: DATE;
nextPaymentAt: DATE;
recurringAt: DATE;
}