81 lines
3.3 KiB
TypeScript
81 lines
3.3 KiB
TypeScript
export declare function addPeriod(date: Date, period: string): Date;
|
|
export declare function getPlans(): Promise<Record<string, Record<string, Record<string, number>>>>;
|
|
export declare function getProviders(): {
|
|
amanpay: boolean;
|
|
paypal: boolean;
|
|
};
|
|
export declare function getPlanFeatures(): any;
|
|
export declare function getSubscription(companyId: string): any;
|
|
export declare function getInvoices(companyId: string): any;
|
|
export declare function getEvents(companyId: string): any;
|
|
export declare function getEventsBySubscriptionId(subscriptionId: string): any;
|
|
export declare function getEntitlement(companyId: string): Promise<{
|
|
companyId: string;
|
|
subscriptionId: any;
|
|
subscriptionStatus: any;
|
|
accessLevel: import("./subscription.policy").AccessLevel;
|
|
plan: any;
|
|
currentPeriodEnd: any;
|
|
}>;
|
|
export declare function startTrial(companyId: string, plan: string, billingPeriod: string, currency: string): Promise<any>;
|
|
export declare function handleAmanpayWebhook(event: any, rawBody?: string | Buffer): Promise<{
|
|
duplicate: boolean;
|
|
result?: void | undefined;
|
|
}>;
|
|
export declare function handlePaypalWebhook(event: any, rawBody?: string | Buffer): Promise<{
|
|
duplicate: boolean;
|
|
result?: void | undefined;
|
|
}>;
|
|
export declare function checkout(companyId: string, body: {
|
|
plan: 'STARTER' | 'GROWTH' | 'PRO';
|
|
billingPeriod: 'MONTHLY' | 'ANNUAL';
|
|
currency: 'MAD';
|
|
provider: 'AMANPAY' | 'PAYPAL';
|
|
successUrl: string;
|
|
failureUrl: string;
|
|
}): Promise<{
|
|
invoice: any;
|
|
checkoutUrl: string;
|
|
}>;
|
|
export declare function capturePaypal(companyId: string, paypalOrderId: string): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
export declare function changePlan(companyId: string, data: {
|
|
plan: any;
|
|
billingPeriod: any;
|
|
currency: string;
|
|
}): any;
|
|
export declare function cancel(companyId: string, mode?: 'period_end' | 'immediate', reason?: string): Promise<any>;
|
|
export declare function resume(companyId: string): Promise<any>;
|
|
export declare function reactivate(companyId: string, body: {
|
|
plan: 'STARTER' | 'GROWTH' | 'PRO';
|
|
billingPeriod: 'MONTHLY' | 'ANNUAL';
|
|
currency: 'MAD';
|
|
provider: 'AMANPAY' | 'PAYPAL';
|
|
successUrl: string;
|
|
failureUrl: string;
|
|
}): Promise<{
|
|
invoice: any;
|
|
checkoutUrl: string;
|
|
}>;
|
|
export declare function runTrialExpirationJob(): Promise<any>;
|
|
export declare function runPaymentPendingTimeoutJob(): Promise<any>;
|
|
export declare function runPastDueTimeoutJob(): Promise<any>;
|
|
export declare function runSuspensionTimeoutJob(): Promise<any>;
|
|
export declare function runPeriodEndCancellationJob(): Promise<any>;
|
|
export declare function adminExtendTrial(subscriptionId: string, extraDays: number, adminId: string, reason: string): Promise<{
|
|
trialEndAt: Date;
|
|
}>;
|
|
export declare function adminExtendGracePeriod(subscriptionId: string, extraDays: number, adminId: string, reason: string): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
export declare function adminCancelSubscription(subscriptionId: string, adminId: string, reason: string): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
export declare function adminReactivateSubscription(subscriptionId: string, adminId: string, reason: string): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
export declare function adminSuspendSubscription(subscriptionId: string, adminId: string, reason: string): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
//# sourceMappingURL=subscription.service.d.ts.map
|