- Updated InvoicesController, NotificationsController, OrdersController, and SubscriptionsController to replace inline parameter validation with Zod DTOs, enhancing code maintainability and clarity. - Introduced new DTOs for invoice and notification ID parameters, ensuring consistent validation across endpoints. - Refactored service method calls to utilize the new DTOs, improving type safety and reducing potential errors. - Cleaned up unused imports and optimized code structure for better readability.
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
/**
|
|
* Subscriptions Domain
|
|
*
|
|
* Exports all subscription-related contracts, schemas, and provider mappers.
|
|
*
|
|
* Types are derived from Zod schemas (Schema-First Approach)
|
|
*/
|
|
|
|
// Constants
|
|
export { SUBSCRIPTION_STATUS, SUBSCRIPTION_CYCLE } from "./contract.js";
|
|
|
|
// Schemas (includes derived types)
|
|
export * from "./schema.js";
|
|
|
|
// Re-export types for convenience
|
|
export type {
|
|
SubscriptionStatus,
|
|
SubscriptionCycle,
|
|
Subscription,
|
|
SubscriptionArray,
|
|
SubscriptionList,
|
|
SubscriptionIdParam,
|
|
SubscriptionQueryParams,
|
|
SubscriptionQuery,
|
|
SubscriptionStats,
|
|
SimActionResponse,
|
|
SimPlanChangeResult,
|
|
// Internet cancellation types
|
|
InternetCancellationMonth,
|
|
InternetCancellationPreview,
|
|
InternetCancelRequest,
|
|
} from "./schema.js";
|
|
|
|
// Re-export schemas for validation
|
|
export {
|
|
internetCancellationMonthSchema,
|
|
internetCancellationPreviewSchema,
|
|
internetCancelRequestSchema,
|
|
} from "./schema.js";
|
|
|
|
// Provider adapters
|
|
export * as Providers from "./providers/index.js";
|
|
|
|
// Re-export provider raw types (request and response)
|
|
export type {
|
|
// Request params
|
|
WhmcsGetClientsProductsParams,
|
|
// Response types
|
|
WhmcsProductListResponse,
|
|
} from "./providers/whmcs/raw.types.js";
|
|
|
|
export { whmcsProductListResponseSchema } from "./providers/whmcs/raw.types.js";
|