- Adjusted .prettierrc to ensure consistent formatting with a newline at the end of the file. - Reformatted eslint.config.mjs for improved readability by aligning array elements. - Updated pnpm-lock.yaml to use single quotes for consistency across dependencies. - Simplified worktree setup in .cursor/worktrees.json for cleaner configuration. - Enhanced documentation in .cursor/plans to clarify architecture refactoring. - Refactored various service files for improved readability and maintainability, including rate-limiting and auth services. - Updated imports and exports across multiple files for consistency and clarity. - Improved error handling and logging in service methods to enhance debugging capabilities. - Streamlined utility functions for better performance and maintainability across the domain packages.
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
/**
|
|
* Subscriptions Domain - Contract
|
|
*
|
|
* Constants and types for the subscriptions domain.
|
|
* All validated types are derived from schemas (see schema.ts).
|
|
*/
|
|
|
|
// ============================================================================
|
|
// Subscription Status Constants
|
|
// ============================================================================
|
|
|
|
export const SUBSCRIPTION_STATUS = {
|
|
ACTIVE: "Active",
|
|
INACTIVE: "Inactive",
|
|
PENDING: "Pending",
|
|
CANCELLED: "Cancelled",
|
|
SUSPENDED: "Suspended",
|
|
TERMINATED: "Terminated",
|
|
COMPLETED: "Completed",
|
|
} as const;
|
|
|
|
// ============================================================================
|
|
// Subscription Billing Cycle Constants
|
|
// ============================================================================
|
|
|
|
export const SUBSCRIPTION_CYCLE = {
|
|
MONTHLY: "Monthly",
|
|
QUARTERLY: "Quarterly",
|
|
SEMI_ANNUALLY: "Semi-Annually",
|
|
ANNUALLY: "Annually",
|
|
BIENNIALLY: "Biennially",
|
|
TRIENNIALLY: "Triennially",
|
|
ONE_TIME: "One-time",
|
|
FREE: "Free",
|
|
} as const;
|
|
|
|
// ============================================================================
|
|
// Re-export Types from Schema (Schema-First Approach)
|
|
// ============================================================================
|
|
|
|
export type {
|
|
SubscriptionStatus,
|
|
SubscriptionCycle,
|
|
Subscription,
|
|
SubscriptionList,
|
|
SubscriptionQueryParams,
|
|
SubscriptionQuery,
|
|
} from "./schema.js";
|