- 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.
91 lines
2.1 KiB
TypeScript
91 lines
2.1 KiB
TypeScript
/**
|
|
* Orders Domain
|
|
*
|
|
* Exports all order-related contracts, schemas, and provider mappers.
|
|
*
|
|
* Types are derived from Zod schemas (Schema-First Approach)
|
|
*/
|
|
|
|
// Business types and constants
|
|
export {
|
|
type OrderCreationType,
|
|
type OrderStatus,
|
|
type OrderType,
|
|
type OrderTypeValue,
|
|
type UserMapping,
|
|
// Checkout types
|
|
type CheckoutItem,
|
|
type CheckoutTotals,
|
|
type CheckoutCart,
|
|
type OrderCreateResponse,
|
|
type OrderFulfillmentValidationResult,
|
|
// Constants
|
|
ORDER_TYPE,
|
|
ORDER_STATUS,
|
|
ACTIVATION_TYPE,
|
|
type ActivationTypeValue,
|
|
SIM_TYPE,
|
|
type SimTypeValue,
|
|
ACCESS_MODE,
|
|
type AccessModeValue,
|
|
ORDER_FULFILLMENT_ERROR_CODE,
|
|
type OrderFulfillmentErrorCode,
|
|
} from "./contract.js";
|
|
|
|
// Schemas (includes derived types)
|
|
export * from "./schema.js";
|
|
|
|
// Validation (extended business rules)
|
|
export * from "./validation.js";
|
|
|
|
// Utilities
|
|
export * from "./utils.js";
|
|
export * from "./events.js";
|
|
export {
|
|
buildSimOrderConfigurations,
|
|
normalizeBillingCycle,
|
|
normalizeOrderSelections,
|
|
buildOrderDisplayItems,
|
|
categorizeOrderItem,
|
|
type BuildSimOrderConfigurationsOptions,
|
|
type OrderStatusDescriptor,
|
|
type OrderStatusInput,
|
|
type OrderStatusState,
|
|
type OrderStatusTone,
|
|
type OrderServiceCategory,
|
|
type OrderTotalsInputItem,
|
|
deriveOrderStatusDescriptor,
|
|
getOrderServiceCategory,
|
|
calculateOrderTotals,
|
|
formatScheduledDate,
|
|
} from "./helpers.js";
|
|
// Re-export types for convenience
|
|
export type {
|
|
// Order item types
|
|
OrderItemSummary,
|
|
OrderItemDetails,
|
|
// Order types
|
|
OrderSummary,
|
|
OrderDetails,
|
|
// Query and creation types
|
|
OrderQueryParams,
|
|
OrderConfigurationsAddress,
|
|
OrderConfigurations,
|
|
CreateOrderRequest,
|
|
OrderBusinessValidation,
|
|
SfOrderIdParam,
|
|
// Display types
|
|
OrderDisplayItem,
|
|
OrderDisplayItemCategory,
|
|
OrderDisplayItemCharge,
|
|
OrderDisplayItemChargeKind,
|
|
} from "./schema.js";
|
|
|
|
// Provider adapters
|
|
export * as Providers from "./providers/index.js";
|
|
|
|
// Re-export provider types for convenience
|
|
export * from "./providers/whmcs/raw.types.js";
|
|
export * from "./providers/salesforce/raw.types.js";
|
|
export * from "./providers/salesforce/field-map.js";
|