diff --git a/CODEBASE_ANALYSIS.md b/CODEBASE_ANALYSIS.md index 10935081..a981d032 100644 --- a/CODEBASE_ANALYSIS.md +++ b/CODEBASE_ANALYSIS.md @@ -1,186 +1,18 @@ -# Codebase Analysis: Remaining Errors & Redundancies +# Codebase Analysis (October 2025) -## πŸ”΄ **Critical Type Errors** +## βœ… Recent Cleanup +- **Checkout contracts unified**: `checkoutBuildCartRequestSchema` and the wrapped response now live in `@customer-portal/domain/orders`. Both the NestJS controller and service import the shared types, eliminating local Zod definitions and ad-hoc request shapes. +- **SIM configuration aligned**: The catalog store and `useSimConfigure` hook persist state that maps directly to `simConfigureFormSchema`. Validation now delegates to the domain schema, and UI state uses the shared field names (`selectedAddons`, `scheduledActivationDate`, etc.). +- **Dashboard metadata centralized**: Invoice/service activity metadata schemas moved into `@customer-portal/domain/dashboard`, and the portal utilities reuse them rather than maintaining local copies. +- **UI totals reuse domain types**: `EnhancedOrderSummary` now aliases `CheckoutTotals`, keeping the presentation layer in lockstep with the API contract. +- **Build artefacts removed**: Legacy `dist/` folders under `apps/bff` and `packages/*` were deleted and remain ignored so future builds stay out of version control. -### 1. **Portal API Client Method Case Issue** -**Location**: `apps/portal/src/features/checkout/services/checkout.service.ts` -```typescript -// ❌ ERROR: Property 'post' does not exist on type 'ApiClient'. Did you mean 'POST'? -return apiClient.post("/checkout/cart", { ... }); -await apiClient.post("/checkout/validate", cart); -``` +## πŸ” Follow-Up Opportunities +- **Auth workflow audit**: Re-run a focused review of the WHMCS link workflow and mapping services to confirm no lingering loose types (the earlier report flagged placeholder valuesβ€”verify after the latest merges). +- **Portal checkout transforms**: Consider using `simConfigureFormToRequest` when serialising SIM selections into cart params so the client sends the same payload shape the BFF expects. +- **End-to-end validation run**: Execute `pnpm lint && pnpm type-check` once the workspace stabilises to catch any regressions introduced outside the touched files. -**Fix**: Use uppercase method names -```typescript -return apiClient.POST("/checkout/cart", { ... }); -await apiClient.POST("/checkout/validate", cart); -``` - -### 2. **PricingTier Export Issue** -**Location**: `apps/portal/src/features/catalog/components/index.ts:29` -```typescript -// ❌ ERROR: Module declares 'PricingTier' locally, but it is not exported -export type { PricingDisplayProps, PricingTier } from "./base/PricingDisplay"; -``` - -**Fix**: Remove PricingTier from local export since it's now imported from domain -```typescript -export type { PricingDisplayProps } from "./base/PricingDisplay"; -``` - -### 3. **Checkout Hook Type Issue** -**Location**: `apps/portal/src/features/checkout/hooks/useCheckout.ts:115` -```typescript -// ❌ ERROR: Type 'null' is not assignable to parameter type 'OrderConfigurations | undefined' -const cart = await checkoutService.buildCart(orderType, selections, simConfig); -``` - -**Fix**: Handle null case -```typescript -const cart = await checkoutService.buildCart(orderType, selections, simConfig || undefined); -``` - -### 4. **Response Helper Type Issue** -**Location**: `apps/portal/src/lib/api/response-helpers.ts:91` -```typescript -// ❌ ERROR: Property 'data' is missing in type -``` - -**Fix**: Ensure response structure matches expected type - ---- - -## 🟠 **High Priority Redundancies** - -### 1. **SIM Action Request Types Duplication** -**Location**: `apps/portal/src/features/subscriptions/services/sim-actions.service.ts` - -**Problem**: Portal defines its own request types instead of using domain types -```typescript -// ❌ Portal defines locally -export interface TopUpRequest { - quotaMb: number; -} - -export interface ChangePlanRequest { - newPlanCode: string; - assignGlobalIp: boolean; - scheduledAt?: string; -} -``` - -**Domain already has** (`packages/domain/sim/schema.ts`): -```typescript -// βœ… Domain has validated types -export type SimTopUpRequest = z.infer; -export type SimPlanChangeRequest = z.infer; -export type SimCancelRequest = z.infer; -``` - -**Impact**: -- Portal types lack validation (no min/max for quotaMb, no format validation for scheduledAt) -- Types could diverge over time -- No runtime type checking before API calls - -### 2. **SIM Configuration Schema Missing** -**Location**: `apps/portal/src/features/catalog/hooks/useSimConfigure.ts` - -**Problem**: Broken imports from wrong domain -```typescript -// ❌ Wrong imports -import { - simConfigureFormSchema, // Does not exist - simConfigureFormToRequest, // Does not exist - type SimConfigureFormData, // Does not exist - type SimType, // Exists in domain/sim - type ActivationType, // Does not exist in billing - type MnpData, // Does not exist in billing -} from "@customer-portal/domain/billing"; // Wrong domain -``` - -**Fix**: Create proper schemas in domain/sim or domain/orders - ---- - -## 🟑 **Medium Priority Issues** - -### 3. **BFF Auth Workflow Type Issues** -**Location**: `apps/bff/src/modules/auth/infra/workflows/workflows/whmcs-link-workflow.service.ts` - -**Problem**: Type '{}' is not assignable to type 'string' -```typescript -// Lines 144-147: Empty object assignments to string fields -``` - -**Fix**: Ensure proper string values or handle empty cases - -### 4. **Prisma Type Issue** -**Location**: `apps/bff/src/modules/id-mappings/mappings.service.ts:71` - -**Problem**: `Prisma.IdMapping` does not exist -```typescript -// ❌ ERROR: Namespace has no exported member 'IdMapping' -``` - -**Fix**: Check Prisma schema or use correct type name - -### 5. **Users Service Type Issue** -**Location**: `apps/bff/src/modules/users/users.service.ts:535` - -**Problem**: Type '{}' is not assignable to type 'string' -```typescript -// Line 535: Empty object assignment to string field -``` - ---- - -## 🟒 **Low Priority Cleanup Opportunities** - -### 6. **Validation Schema Organization** -**Current State**: Good separation between `common/validation.ts` and `toolkit/validation/` -**Recommendation**: Keep current structure, toolkit is for utilities, common is for validation - -### 7. **Domain Package Structure** -**Current State**: Well-organized with clear separation -**Recommendation**: No changes needed, follows good DDD principles - -### 8. **BFF Service Architecture** -**Current State**: Good separation of concerns -**Recommendation**: Consider extracting shared validation logic to domain layer - ---- - -## πŸ“‹ **Implementation Priority** - -### **Phase 1: Fix Critical Type Errors** (30 minutes) -1. Fix API client method case (`post` β†’ `POST`) -2. Remove PricingTier from local export -3. Handle null simConfig in checkout hook -4. Fix response helper type issue - -### **Phase 2: Remove Type Duplications** (1 hour) -1. Replace Portal SIM request types with domain types -2. Create missing SIM configuration schemas -3. Update imports to use correct domain - -### **Phase 3: Fix BFF Type Issues** (30 minutes) -1. Fix auth workflow string assignments -2. Fix Prisma type reference -3. Fix users service string assignment - -### **Phase 4: Cleanup & Documentation** (30 minutes) -1. Update any remaining documentation -2. Run full type check -3. Verify all functionality works - ---- - -## 🎯 **Success Criteria** - -- βœ… All TypeScript errors resolved -- βœ… No duplicate type definitions between Portal and Domain -- βœ… All validation schemas centralized in Domain -- βœ… Portal uses Domain types exclusively -- βœ… BFF uses Domain types exclusively -- βœ… All tests passing -- βœ… Type checking passes across all workspaces +## 🎯 Next Recommended Steps +1. **Type-check sweep** – run the workspace type checker and fix residual errors, paying special attention to auth and user modules. +2. **Checkout flow trace** – ensure the BFF and portal both serialise/deserialise SIM selections via the shared helpers (avoids stale query-param parsing edge cases). +3. **Documentation refresh** – propagate the new ownership model (domain-first schemas) into any onboarding or architecture docs so future engineers default to the shared packages. diff --git a/VALIDATION_DUPLICATION_REPORT.md b/VALIDATION_DUPLICATION_REPORT.md deleted file mode 100644 index e6893753..00000000 --- a/VALIDATION_DUPLICATION_REPORT.md +++ /dev/null @@ -1,521 +0,0 @@ -# Validation Duplication Report: BFF vs Portal - -**Date**: October 8, 2025 -**Scope**: Cross-layer validation type duplication analysis - ---- - -## Executive Summary - -After fixing frontend form duplication with domain schemas, I found **additional type duplication** between the portal and domain layers. The portal is defining its own request types instead of importing validated types from the domain layer. - -**Status**: πŸ”΄ Duplication Found -**Impact**: Medium - Types work but lack validation, could diverge over time -**Effort to Fix**: Low (1-2 hours) - ---- - -## Duplication Found - -### Issue #1: SIM Action Request Types Duplicated - -**Location**: `apps/portal/src/features/subscriptions/services/sim-actions.service.ts` - -**Portal defines** (lines 3-15): -```typescript -export interface TopUpRequest { - quotaMb: number; -} - -export interface ChangePlanRequest { - newPlanCode: string; - assignGlobalIp: boolean; - scheduledAt?: string; -} - -export interface CancelRequest { - scheduledAt: string; -} -``` - -**Domain already has** (`packages/domain/sim/schema.ts`): -```typescript -export const simTopUpRequestSchema = z.object({ - quotaMb: z - .number() - .int() - .min(100, "Quota must be at least 100MB") - .max(51200, "Quota must be 50GB or less"), -}); - -export const simPlanChangeRequestSchema = z.object({ - newPlanCode: z.string().min(1, "New plan code is required"), - assignGlobalIp: z.boolean().optional(), - scheduledAt: z - .string() - .regex(/^\d{8}$/, "Scheduled date must be in YYYYMMDD format") - .optional(), -}); - -export const simCancelRequestSchema = z.object({ - scheduledAt: z - .string() - .regex(/^\d{8}$/, "Scheduled date must be in YYYYMMDD format") - .optional(), -}); - -// Exported types -export type SimTopUpRequest = z.infer; -export type SimPlanChangeRequest = z.infer; -export type SimCancelRequest = z.infer; -``` - -**Problems**: -1. ❌ Portal types lack validation (no min/max for quotaMb, no format validation for scheduledAt) -2. ❌ Portal types use different names (TopUpRequest vs SimTopUpRequest) -3. ❌ Field types differ (assignGlobalIp is required in portal but optional in domain) -4. ❌ No single source of truth - types could diverge over time -5. ❌ Portal doesn't benefit from Zod validation rules - -**Impact**: -- Medium priority - The portal service works, but requests aren't validated client-side -- Data could be sent in wrong format (e.g., scheduledAt as "2024-10-08" instead of "20241008") -- No runtime type checking before API calls - ---- - -### Issue #2: SIM Configuration Schema Missing - -**Location**: `apps/portal/src/features/catalog/hooks/useSimConfigure.ts` (lines 7-14) - -**Portal attempts to import**: -```typescript -import { - simConfigureFormSchema, // ❌ Does not exist - simConfigureFormToRequest, // ❌ Does not exist - type SimConfigureFormData, // ❌ Does not exist - type SimType, // βœ… Exists in domain/sim - type ActivationType, // ❌ Does not exist in billing - type MnpData, // ❌ Does not exist in billing -} from "@customer-portal/domain/billing"; // ❌ Wrong domain -``` - -**Problems**: -1. ❌ Imports from wrong domain (billing instead of sim/orders) -2. ❌ Schemas don't exist yet in any domain -3. ❌ This is likely causing TypeScript errors - -**Impact**: -- High priority - Broken imports -- SIM configuration flow may not be working correctly -- Need to create proper schemas in domain layer - ---- - -## BFF Layer Analysis - -### βœ… BFF Correctly Uses Domain Schemas - -The BFF layer is **following the correct pattern**: - -**Example 1: Auth Controller** -```typescript -// apps/bff/src/modules/auth/presentation/http/auth.controller.ts -import { - signupRequestSchema, - passwordResetRequestSchema, - passwordResetSchema, - setPasswordRequestSchema, - linkWhmcsRequestSchema, - // ... all from domain -} from "@customer-portal/domain/auth"; - -@UsePipes(new ZodValidationPipe(signupRequestSchema)) -async signup(@Body() body: SignupRequest) { - // ... -} -``` - -**Example 2: Orders Controller** -```typescript -// apps/bff/src/modules/orders/orders.controller.ts -import { - createOrderRequestSchema, - type CreateOrderRequest, -} from "@customer-portal/domain/orders"; - -@UsePipes(new ZodValidationPipe(createOrderRequestSchema)) -async create(@Body() body: CreateOrderRequest) { - // ... -} -``` - -**Example 3: Subscriptions Controller** -```typescript -// apps/bff/src/modules/subscriptions/subscriptions.controller.ts -import { - simTopupRequestSchema, - simChangePlanRequestSchema, - simCancelRequestSchema, - simFeaturesRequestSchema, - type SimTopupRequest, - type SimChangePlanRequest, - type SimCancelRequest, - type SimFeaturesRequest, -} from "@customer-portal/domain/sim"; - -@UsePipes(new ZodValidationPipe(simTopupRequestSchema)) -async topUp(@Body() body: SimTopupRequest) { - // ... -} -``` - -**Why BFF is correct**: -- βœ… Imports validation schemas from domain -- βœ… Uses ZodValidationPipe for runtime validation -- βœ… Uses domain types for type safety -- βœ… No duplicate type definitions -- βœ… Single source of truth - ---- - -## Portal Layer Issues - -### ❌ Portal Sometimes Bypasses Domain Types - -The portal defines its own types for API calls instead of importing from domain: - -**Problem Pattern**: -```typescript -// Portal defines its own simple types -export interface TopUpRequest { - quotaMb: number; -} - -// But domain has validated types -export type SimTopUpRequest = z.infer; - -// Portal should be using domain types -import type { SimTopUpRequest } from "@customer-portal/domain/sim"; -``` - -**Why this is problematic**: -1. No client-side validation before API calls -2. Types could diverge from backend expectations -3. Harder to maintain consistency -4. Duplicates type definitions -5. Loses validation rules (min/max, regex patterns, etc.) - ---- - -## Comparison: What's Working vs. What's Not - -### βœ… Good Examples (Portal correctly uses domain) - -```typescript -// apps/portal/src/features/orders/services/orders.service.ts -import type { CreateOrderRequest } from "@customer-portal/domain/orders"; - -async function createOrder(payload: CreateOrderRequest) { - // Uses domain type directly -} -``` - -```typescript -// apps/portal/src/features/auth/stores/auth.store.ts -import type { - LoginRequest, - SignupRequest, - LinkWhmcsRequest -} from "@customer-portal/domain/auth"; - -// Uses domain types for all auth operations -``` - -### ❌ Bad Examples (Portal defines own types) - -```typescript -// apps/portal/src/features/subscriptions/services/sim-actions.service.ts - -// ❌ BAD - Duplicates domain types -export interface TopUpRequest { - quotaMb: number; -} - -// βœ… GOOD - Should be: -import type { SimTopUpRequest } from "@customer-portal/domain/sim"; -``` - ---- - -## Recommended Fixes - -### Fix #1: Replace Portal SIM Types with Domain Types - -**File**: `apps/portal/src/features/subscriptions/services/sim-actions.service.ts` - -**Current** (lines 1-16): -```typescript -import { apiClient, getDataOrDefault } from "@/lib/api"; - -export interface TopUpRequest { - quotaMb: number; -} - -export interface ChangePlanRequest { - newPlanCode: string; - assignGlobalIp: boolean; - scheduledAt?: string; -} - -export interface CancelRequest { - scheduledAt: string; -} -``` - -**Should be**: -```typescript -import { apiClient, getDataOrDefault } from "@/lib/api"; -import type { - SimTopUpRequest, - SimPlanChangeRequest, - SimCancelRequest -} from "@customer-portal/domain/sim"; - -// Remove duplicate type definitions -// Types are now imported from domain -``` - -**Update service methods**: -```typescript -export const simActionsService = { - async topUp(subscriptionId: string, request: SimTopUpRequest): Promise { - await apiClient.POST("/api/subscriptions/{subscriptionId}/sim/top-up", { - params: { path: { subscriptionId } }, - body: request, - }); - }, - - async changePlan(subscriptionId: string, request: SimPlanChangeRequest): Promise { - await apiClient.POST("/api/subscriptions/{subscriptionId}/sim/change-plan", { - params: { path: { subscriptionId } }, - body: request, - }); - }, - - async cancel(subscriptionId: string, request: SimCancelRequest): Promise { - await apiClient.POST("/api/subscriptions/{subscriptionId}/sim/cancel", { - params: { path: { subscriptionId } }, - body: request, - }); - }, -}; -``` - -**Benefits**: -- βœ… Single source of truth -- βœ… Types match backend exactly -- βœ… Can add client-side validation using domain schemas -- βœ… Less code to maintain - ---- - -### Fix #2: Create Missing SIM Configuration Schemas - -**Files to create/update**: -1. `packages/domain/sim/schema.ts` - Add configuration schemas -2. `apps/portal/src/features/catalog/hooks/useSimConfigure.ts` - Fix imports - -**Add to domain** (`packages/domain/sim/schema.ts`): -```typescript -// SIM Configuration Form Schema (for frontend) -export const simConfigureFormSchema = z.object({ - simType: z.enum(["eSIM", "Physical SIM"]), - eid: z.string().min(15).optional(), - selectedAddons: z.array(z.string()), - activationType: z.enum(["Immediate", "Scheduled"]), - scheduledActivationDate: z.string().regex(/^\d{8}$/).optional(), - wantsMnp: z.boolean(), - mnpData: z.object({ - reservationNumber: z.string(), - expiryDate: z.string().regex(/^\d{8}$/), - phoneNumber: z.string(), - mvnoAccountNumber: z.string().optional(), - portingLastName: z.string().optional(), - portingFirstName: z.string().optional(), - portingLastNameKatakana: z.string().optional(), - portingFirstNameKatakana: z.string().optional(), - portingGender: z.string().optional(), - portingDateOfBirth: z.string().regex(/^\d{8}$/).optional(), - }).optional(), -}); - -export type SimConfigureFormData = z.infer; -export type ActivationType = "Immediate" | "Scheduled"; -export type MnpData = z.infer["mnpData"]; - -// Transform function to convert form data to API request -export function simConfigureFormToRequest( - formData: SimConfigureFormData -): SimOrderActivationRequest { - // Transform logic here - return { - // ... - }; -} -``` - -**Update portal hook** (`apps/portal/src/features/catalog/hooks/useSimConfigure.ts`): -```typescript -import { - simConfigureFormSchema, - simConfigureFormToRequest, - type SimConfigureFormData, - type ActivationType, - type MnpData, -} from "@customer-portal/domain/sim"; // βœ… Correct domain - -import type { SimType } from "@customer-portal/domain/sim"; // βœ… Already exists -``` - ---- - -## Implementation Plan - -### Phase 1: Fix Portal SIM Action Types (30 minutes) - -**Priority**: Medium -**Impact**: Improves type safety, enables client validation - -Tasks: -- [ ] Update `apps/portal/src/features/subscriptions/services/sim-actions.service.ts` -- [ ] Remove duplicate type definitions -- [ ] Import types from `@customer-portal/domain/sim` -- [ ] Update all usages in components -- [ ] Verify TypeScript compilation - ---- - -### Phase 2: Create SIM Configuration Schemas (1-2 hours) - -**Priority**: High (fixes broken imports) -**Impact**: Enables SIM configuration flow - -Tasks: -- [ ] Create `simConfigureFormSchema` in `packages/domain/sim/schema.ts` -- [ ] Export types: `SimConfigureFormData`, `ActivationType`, `MnpData` -- [ ] Create `simConfigureFormToRequest()` transform function -- [ ] Update exports in `packages/domain/sim/index.ts` -- [ ] Fix imports in `apps/portal/src/features/catalog/hooks/useSimConfigure.ts` -- [ ] Test SIM configuration flow - ---- - -### Phase 3: Add Client-Side Validation (Optional, 1 hour) - -**Priority**: Low -**Impact**: Better UX with early validation - -Tasks: -- [ ] Add Zod validation in portal services before API calls -- [ ] Show validation errors to users before submitting -- [ ] Use same validation rules as backend - -Example: -```typescript -async topUp(subscriptionId: string, request: SimTopUpRequest) { - // Validate before API call - const validated = simTopUpRequestSchema.parse(request); - - await apiClient.POST("/api/subscriptions/{subscriptionId}/sim/top-up", { - params: { path: { subscriptionId } }, - body: validated, - }); -} -``` - ---- - -## Testing Strategy - -### After Fix #1 (Portal SIM Types) -1. Import and use domain types in portal service -2. Verify TypeScript compilation succeeds -3. Test SIM top-up, plan change, and cancel flows -4. Verify API receives correctly formatted data - -### After Fix #2 (SIM Configuration) -1. Verify all imports resolve correctly -2. Test SIM configuration form -3. Verify form validation works -4. Test API submission with form data - ---- - -## Benefits of Fixes - -### Current State Issues -- ❌ Duplicate type definitions -- ❌ No client-side validation -- ❌ Types could diverge from backend -- ❌ Broken imports in SIM configuration -- ❌ No validation for date formats, min/max values - -### After Fixes -- βœ… Single source of truth for all types -- βœ… Type safety across layers -- βœ… Option to add client-side validation -- βœ… All imports working correctly -- βœ… Validation rules enforced (formats, ranges, etc.) -- βœ… Less code to maintain -- βœ… Consistency guaranteed - ---- - -## Summary - -### Current Architecture - -``` -Domain Layer (packages/domain/sim) -β”œβ”€β”€ Schemas with validation βœ… -β”œβ”€β”€ Types inferred from schemas βœ… -└── Exported for reuse βœ… - -BFF Layer (apps/bff) -β”œβ”€β”€ Imports domain schemas βœ… -β”œβ”€β”€ Uses ZodValidationPipe βœ… -└── No duplication βœ… - -Portal Layer (apps/portal) -β”œβ”€β”€ Sometimes imports domain types ⚠️ -β”œβ”€β”€ Sometimes defines own types ❌ -└── Missing schemas (SIM config) ❌ -``` - -### Target Architecture - -``` -Domain Layer -└── Single source of truth for all schemas and types - -BFF Layer -└── Uses domain schemas via ZodValidationPipe - -Portal Layer -└── Uses domain types for all API calls - └── Optional: Add client validation using domain schemas -``` - ---- - -## Related Documents - -- [Frontend Validation Patterns](./docs/validation/FRONTEND_VALIDATION_PATTERNS.md) -- [Validation Audit Summary](./VALIDATION_AUDIT_SUMMARY.md) -- [Validation Patterns Guide](./docs/validation/VALIDATION_PATTERNS.md) - ---- - -**Next Steps**: Review and approve fixes, then implement in priority order. - diff --git a/apps/bff/src/modules/orders/controllers/checkout.controller.ts b/apps/bff/src/modules/orders/controllers/checkout.controller.ts index b37d7e0d..c13f1672 100644 --- a/apps/bff/src/modules/orders/controllers/checkout.controller.ts +++ b/apps/bff/src/modules/orders/controllers/checkout.controller.ts @@ -5,20 +5,14 @@ import { CheckoutService } from "../services/checkout.service"; import { CheckoutCart, checkoutCartSchema, - OrderConfigurations, + checkoutBuildCartRequestSchema, + checkoutBuildCartResponseSchema, + type CheckoutBuildCartRequest, } from "@customer-portal/domain/orders"; import { apiSuccessResponseSchema } from "@customer-portal/domain/common"; import { z } from "zod"; import type { RequestWithUser } from "@bff/modules/auth/auth.types"; -// Request schemas for checkout endpoints -const buildCartRequestSchema = z.object({ - orderType: z.string(), - selections: z.record(z.string(), z.string()), - configuration: z.any().optional(), -}); - -const buildCartResponseSchema = apiSuccessResponseSchema(checkoutCartSchema); const validateCartResponseSchema = apiSuccessResponseSchema(z.object({ valid: z.boolean() })); @Controller("checkout") @@ -29,10 +23,10 @@ export class CheckoutController { ) {} @Post("cart") - @UsePipes(new ZodValidationPipe(buildCartRequestSchema)) + @UsePipes(new ZodValidationPipe(checkoutBuildCartRequestSchema)) async buildCart( @Request() req: RequestWithUser, - @Body() body: z.infer + @Body() body: CheckoutBuildCartRequest ) { this.logger.log("Building checkout cart", { userId: req.user?.id, @@ -43,10 +37,10 @@ export class CheckoutController { const cart = await this.checkoutService.buildCart( body.orderType, body.selections, - body.configuration as OrderConfigurations + body.configuration ); - return buildCartResponseSchema.parse({ + return checkoutBuildCartResponseSchema.parse({ success: true, data: cart, }); diff --git a/apps/bff/src/modules/orders/services/checkout.service.ts b/apps/bff/src/modules/orders/services/checkout.service.ts index c5e71cf6..4c089cdb 100644 --- a/apps/bff/src/modules/orders/services/checkout.service.ts +++ b/apps/bff/src/modules/orders/services/checkout.service.ts @@ -7,6 +7,9 @@ import { checkoutCartSchema, OrderConfigurations, ORDER_TYPE, + type OrderTypeValue, + type OrderSelections, + buildOrderConfigurations, } from "@customer-portal/domain/orders"; import type { InternetPlanCatalogItem, @@ -34,8 +37,8 @@ export class CheckoutService { * Build checkout cart from order type and selections */ async buildCart( - orderType: string, - selections: Record, + orderType: OrderTypeValue, + selections: OrderSelections, configuration?: OrderConfigurations ): Promise { this.logger.log("Building checkout cart", { orderType, selections }); @@ -60,10 +63,13 @@ export class CheckoutService { throw new BadRequestException(`Unsupported order type: ${orderType}`); } + const configurationPayload: OrderConfigurations = + configuration ?? buildOrderConfigurations(selections); + const cart: CheckoutCart = { items, totals, - configuration: configuration || ({} as OrderConfigurations), + configuration: configurationPayload, }; // Validate the cart using domain schema @@ -136,9 +142,7 @@ export class CheckoutService { /** * Build Internet order cart */ - private async buildInternetCart( - selections: Record - ): Promise<{ items: CheckoutItem[] }> { + private async buildInternetCart(selections: OrderSelections): Promise<{ items: CheckoutItem[] }> { const items: CheckoutItem[] = []; const plans: InternetPlanCatalogItem[] = await this.internetCatalogService.getPlans(); const addons: InternetAddonCatalogItem[] = await this.internetCatalogService.getAddons(); @@ -209,9 +213,7 @@ export class CheckoutService { /** * Build SIM order cart */ - private async buildSimCart( - selections: Record - ): Promise<{ items: CheckoutItem[] }> { + private async buildSimCart(selections: OrderSelections): Promise<{ items: CheckoutItem[] }> { const items: CheckoutItem[] = []; const plans: SimCatalogProduct[] = await this.simCatalogService.getPlans(); const activationFees: SimActivationFeeCatalogItem[] = @@ -286,9 +288,7 @@ export class CheckoutService { /** * Build VPN order cart */ - private async buildVpnCart( - selections: Record - ): Promise<{ items: CheckoutItem[] }> { + private async buildVpnCart(selections: OrderSelections): Promise<{ items: CheckoutItem[] }> { const items: CheckoutItem[] = []; const plans: VpnCatalogProduct[] = await this.vpnCatalogService.getPlans(); const activationFees: VpnCatalogProduct[] = await this.vpnCatalogService.getActivationFees(); @@ -339,7 +339,7 @@ export class CheckoutService { /** * Collect addon references from selections */ - private collectAddonRefs(selections: Record): string[] { + private collectAddonRefs(selections: OrderSelections): string[] { const refs = new Set(); // Handle various addon selection formats diff --git a/apps/portal/src/features/catalog/components/base/EnhancedOrderSummary.tsx b/apps/portal/src/features/catalog/components/base/EnhancedOrderSummary.tsx index e1a57762..2bfeadbc 100644 --- a/apps/portal/src/features/catalog/components/base/EnhancedOrderSummary.tsx +++ b/apps/portal/src/features/catalog/components/base/EnhancedOrderSummary.tsx @@ -11,6 +11,7 @@ import { useRouter } from "next/navigation"; // Align with shared catalog contracts import type { CatalogProductBase } from "@customer-portal/domain/catalog"; +import type { CheckoutTotals } from "@customer-portal/domain/orders"; // Enhanced order item representation for UI summary export type OrderItem = CatalogProductBase & { @@ -27,13 +28,11 @@ export interface OrderConfiguration { } // Totals summary for UI; base fields mirror API aggregates -export interface OrderTotals { - monthlyTotal: number; - oneTimeTotal: number; +export type OrderTotals = CheckoutTotals & { annualTotal?: number; discountAmount?: number; taxAmount?: number; -} +}; export interface EnhancedOrderSummaryProps { // Core order data diff --git a/apps/portal/src/features/catalog/components/internet/InternetPlanCard.tsx b/apps/portal/src/features/catalog/components/internet/InternetPlanCard.tsx index 8bdc0b84..c3491791 100644 --- a/apps/portal/src/features/catalog/components/internet/InternetPlanCard.tsx +++ b/apps/portal/src/features/catalog/components/internet/InternetPlanCard.tsx @@ -148,8 +148,8 @@ export function InternetPlanCard({
- Configure {plan.name} -
- {plan.internetPlanTier && ( +
+ {plan.internetPlanTier ? ( <> β€’ - )} + ) : null} {plan.name} - {plan.monthlyPrice && plan.monthlyPrice > 0 && ( + {plan.monthlyPrice && plan.monthlyPrice > 0 ? ( <> β€’ Β₯{plan.monthlyPrice.toLocaleString()}/month - )} + ) : null}
); diff --git a/apps/portal/src/features/catalog/hooks/useSimConfigure.ts b/apps/portal/src/features/catalog/hooks/useSimConfigure.ts index 9810889a..6218252a 100644 --- a/apps/portal/src/features/catalog/hooks/useSimConfigure.ts +++ b/apps/portal/src/features/catalog/hooks/useSimConfigure.ts @@ -4,10 +4,12 @@ import { useEffect, useCallback } from "react"; import { useRouter, useSearchParams } from "next/navigation"; import { useSimCatalog, useSimPlan } from "."; import { useCatalogStore } from "../services/catalog.store"; -import type { - SimCardType, - ActivationType, - MnpData, +import { + simConfigureFormSchema, + type SimConfigureFormData, + type SimCardType, + type ActivationType, + type MnpData, } from "@customer-portal/domain/sim"; import type { SimCatalogProduct, @@ -98,7 +100,7 @@ export function useSimConfigure(planId?: string): UseSimConfigureResult { }, [setConfig]); const setSelectedAddons = useCallback((value: string[]) => { - setConfig({ addonSkus: value }); + setConfig({ selectedAddons: value }); }, [setConfig]); const setActivationType = useCallback((value: ActivationType) => { @@ -106,7 +108,7 @@ export function useSimConfigure(planId?: string): UseSimConfigureResult { }, [setConfig]); const setScheduledActivationDate = useCallback((value: string) => { - setConfig({ scheduledDate: value }); + setConfig({ scheduledActivationDate: value }); }, [setConfig]); const setWantsMnp = useCallback((value: boolean) => { @@ -123,27 +125,52 @@ export function useSimConfigure(planId?: string): UseSimConfigureResult { // Basic validation const validate = useCallback((): boolean => { - if (!configState.planSku) return false; - - // eSIM requires EID - if (configState.simType === "eSIM" && !configState.eid.trim()) { + if (!configState.planSku) { return false; } - // Scheduled activation requires date - if (configState.activationType === "Scheduled" && !configState.scheduledDate) { - return false; - } - - // MNP requires basic fields - if (configState.wantsMnp) { - const { reservationNumber, expiryDate, phoneNumber } = configState.mnpData; - if (!reservationNumber || !expiryDate || !phoneNumber) { - return false; + const trimOptional = (value?: string | null) => { + if (typeof value !== "string") { + return undefined; } - } + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : undefined; + }; - return true; + const formData: SimConfigureFormData = { + simType: configState.simType, + eid: trimOptional(configState.eid), + selectedAddons: configState.selectedAddons, + activationType: configState.activationType, + scheduledActivationDate: + configState.activationType === "Scheduled" + ? trimOptional(configState.scheduledActivationDate) + : undefined, + wantsMnp: configState.wantsMnp, + mnpData: configState.wantsMnp + ? { + reservationNumber: configState.mnpData.reservationNumber.trim(), + expiryDate: configState.mnpData.expiryDate.trim(), + phoneNumber: configState.mnpData.phoneNumber.trim(), + mvnoAccountNumber: trimOptional(configState.mnpData.mvnoAccountNumber), + portingLastName: trimOptional(configState.mnpData.portingLastName), + portingFirstName: trimOptional(configState.mnpData.portingFirstName), + portingLastNameKatakana: trimOptional(configState.mnpData.portingLastNameKatakana), + portingFirstNameKatakana: trimOptional( + configState.mnpData.portingFirstNameKatakana + ), + portingGender: trimOptional(configState.mnpData.portingGender), + portingDateOfBirth: trimOptional(configState.mnpData.portingDateOfBirth), + } + : undefined, + }; + + try { + simConfigureFormSchema.parse(formData); + return true; + } catch { + return false; + } }, [configState]); return { @@ -155,11 +182,11 @@ export function useSimConfigure(planId?: string): UseSimConfigureResult { setSimType, eid: configState.eid, setEid, - selectedAddons: configState.addonSkus, + selectedAddons: configState.selectedAddons, setSelectedAddons, activationType: configState.activationType, setActivationType, - scheduledActivationDate: configState.scheduledDate, + scheduledActivationDate: configState.scheduledActivationDate, setScheduledActivationDate, wantsMnp: configState.wantsMnp, setWantsMnp, diff --git a/apps/portal/src/features/catalog/services/catalog.store.ts b/apps/portal/src/features/catalog/services/catalog.store.ts index 82e68b0e..8a9f4d07 100644 --- a/apps/portal/src/features/catalog/services/catalog.store.ts +++ b/apps/portal/src/features/catalog/services/catalog.store.ts @@ -8,13 +8,24 @@ import { create } from "zustand"; import { persist, createJSONStorage } from "zustand/middleware"; -import type { SimCardType, ActivationType, MnpData } from "@customer-portal/domain/sim"; +import { + simConfigureFormSchema, + type SimCardType, + type ActivationType, + type MnpData, +} from "@customer-portal/domain/sim"; +import { + buildSimOrderConfigurations, + normalizeOrderSelections, + type OrderConfigurations, + type OrderSelections, +} from "@customer-portal/domain/orders"; // ============================================================================ // Types // ============================================================================ -export type InternetAccessMode = "IPoE-BYOR" | "PPPoE"; +export type InternetAccessMode = "IPoE-BYOR" | "IPoE-HGW" | "PPPoE"; export interface InternetConfigState { planSku: string | null; @@ -28,9 +39,9 @@ export interface SimConfigState { planSku: string | null; simType: SimCardType; eid: string; - addonSkus: string[]; + selectedAddons: string[]; activationType: ActivationType; - scheduledDate: string; + scheduledActivationDate: string; wantsMnp: boolean; mnpData: MnpData; currentStep: number; @@ -50,6 +61,7 @@ interface CatalogStore { // Checkout transition helpers buildInternetCheckoutParams: () => URLSearchParams | null; buildSimCheckoutParams: () => URLSearchParams | null; + buildServiceOrderConfigurations: () => OrderConfigurations | undefined; restoreInternetFromParams: (params: URLSearchParams) => void; restoreSimFromParams: (params: URLSearchParams) => void; } @@ -70,9 +82,9 @@ const initialSimState: SimConfigState = { planSku: null, simType: "eSIM", eid: "", - addonSkus: [], + selectedAddons: [], activationType: "Immediate", - scheduledDate: "", + scheduledActivationDate: "", wantsMnp: false, mnpData: { reservationNumber: "", @@ -89,6 +101,58 @@ const initialSimState: SimConfigState = { currentStep: 1, }; +const trimToUndefined = (value: string | null | undefined): string | undefined => { + if (typeof value !== "string") return undefined; + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : undefined; +}; + +const selectionsToSearchParams = (selections: OrderSelections): URLSearchParams => { + const params = new URLSearchParams(); + Object.entries(selections).forEach(([key, value]) => { + if (typeof value === "string") { + params.set(key, value); + } + }); + return params; +}; + +const normalizeSelectionsFromParams = (params: URLSearchParams): OrderSelections => { + const raw: Record = {}; + params.forEach((value, key) => { + if (key !== "type") { + raw[key] = value; + } + }); + return normalizeOrderSelections(raw); +}; + +const parseAddonList = (value?: string | null): string[] => + value + ? value + .split(",") + .map(entry => entry.trim()) + .filter(Boolean) + : []; + +const coalescePlanSku = (selections: OrderSelections): string | null => { + const candidates = [ + selections.planSku, + selections.plan, + selections.planIdSku, + selections.planId, + ].filter((candidate): candidate is string => typeof candidate === "string"); + + for (const candidate of candidates) { + const trimmed = candidate.trim(); + if (trimmed.length > 0) { + return trimmed; + } + } + + return null; +}; + // ============================================================================ // Store // ============================================================================ @@ -132,23 +196,24 @@ export const useCatalogStore = create()( buildInternetCheckoutParams: () => { const { internet } = get(); - + if (!internet.planSku || !internet.accessMode || !internet.installationSku) { return null; } - const params = new URLSearchParams({ - type: "internet", + const rawSelections: Record = { plan: internet.planSku, accessMode: internet.accessMode, installationSku: internet.installationSku, - }); + }; - // Addon format: comma-separated string for BFF if (internet.addonSkus.length > 0) { - params.set("addons", internet.addonSkus.join(",")); + rawSelections.addons = internet.addonSkus.join(","); } + const selections = normalizeOrderSelections(rawSelections); + const params = selectionsToSearchParams(selections); + params.set("type", "internet"); return params; }, @@ -159,51 +224,89 @@ export const useCatalogStore = create()( return null; } - const params = new URLSearchParams({ - type: "sim", + const rawSelections: Record = { plan: sim.planSku, simType: sim.simType, activationType: sim.activationType, - }); + }; - // eSIM requires EID - if (sim.simType === "eSIM" && sim.eid) { - params.set("eid", sim.eid); + const eid = trimToUndefined(sim.eid); + if (sim.simType === "eSIM" && eid) { + rawSelections.eid = eid; } - // Scheduled activation - if (sim.activationType === "Scheduled" && sim.scheduledDate) { - params.set("scheduledAt", sim.scheduledDate); + const scheduledAt = trimToUndefined(sim.scheduledActivationDate); + if (sim.activationType === "Scheduled" && scheduledAt) { + rawSelections.scheduledAt = scheduledAt; } - // Addons - if (sim.addonSkus.length > 0) { - params.set("addons", sim.addonSkus.join(",")); + if (sim.selectedAddons.length > 0) { + rawSelections.addons = sim.selectedAddons.join(","); } - // MNP configuration (serialize as JSON for checkout) if (sim.wantsMnp) { - params.set("isMnp", "true"); - // Serialize MNP data to pass to checkout - params.set("mnpData", JSON.stringify(sim.mnpData)); + rawSelections.isMnp = "true"; + const mnp = sim.mnpData; + if (mnp.reservationNumber) rawSelections.mnpNumber = mnp.reservationNumber.trim(); + if (mnp.expiryDate) rawSelections.mnpExpiry = mnp.expiryDate.trim(); + if (mnp.phoneNumber) rawSelections.mnpPhone = mnp.phoneNumber.trim(); + if (mnp.mvnoAccountNumber) rawSelections.mvnoAccountNumber = mnp.mvnoAccountNumber.trim(); + if (mnp.portingLastName) rawSelections.portingLastName = mnp.portingLastName.trim(); + if (mnp.portingFirstName) rawSelections.portingFirstName = mnp.portingFirstName.trim(); + if (mnp.portingLastNameKatakana) + rawSelections.portingLastNameKatakana = mnp.portingLastNameKatakana.trim(); + if (mnp.portingFirstNameKatakana) + rawSelections.portingFirstNameKatakana = mnp.portingFirstNameKatakana.trim(); + if (mnp.portingGender) rawSelections.portingGender = mnp.portingGender; + if (mnp.portingDateOfBirth) + rawSelections.portingDateOfBirth = mnp.portingDateOfBirth.trim(); } + const selections = normalizeOrderSelections(rawSelections); + const params = selectionsToSearchParams(selections); + params.set("type", "sim"); return params; }, + buildServiceOrderConfigurations: () => { + const { sim } = get(); + try { + const formData = simConfigureFormSchema.parse({ + simType: sim.simType, + eid: trimToUndefined(sim.eid), + selectedAddons: sim.selectedAddons, + activationType: sim.activationType, + scheduledActivationDate: trimToUndefined(sim.scheduledActivationDate), + wantsMnp: sim.wantsMnp, + mnpData: sim.wantsMnp + ? { + reservationNumber: trimToUndefined(sim.mnpData.reservationNumber) ?? "", + expiryDate: trimToUndefined(sim.mnpData.expiryDate) ?? "", + phoneNumber: trimToUndefined(sim.mnpData.phoneNumber) ?? "", + mvnoAccountNumber: trimToUndefined(sim.mnpData.mvnoAccountNumber), + portingLastName: trimToUndefined(sim.mnpData.portingLastName), + portingFirstName: trimToUndefined(sim.mnpData.portingFirstName), + portingLastNameKatakana: trimToUndefined(sim.mnpData.portingLastNameKatakana), + portingFirstNameKatakana: trimToUndefined(sim.mnpData.portingFirstNameKatakana), + portingGender: trimToUndefined(sim.mnpData.portingGender), + portingDateOfBirth: trimToUndefined(sim.mnpData.portingDateOfBirth), + } + : undefined, + }); + + return buildSimOrderConfigurations(formData); + } catch (error) { + console.warn("Failed to build SIM order configurations from store state", error); + return undefined; + } + }, + restoreInternetFromParams: (params: URLSearchParams) => { - const planSku = params.get("plan"); - const accessMode = params.get("accessMode") as InternetAccessMode | null; - const installationSku = params.get("installationSku"); - - // Parse addons (support both comma-separated and multiple params for backward compat) - const addonsParam = params.get("addons"); - const addonSkuParams = params.getAll("addonSku"); - const addonSkus = addonsParam - ? addonsParam.split(",").map(s => s.trim()).filter(Boolean) - : addonSkuParams.length > 0 - ? addonSkuParams - : []; + const selections = normalizeSelectionsFromParams(params); + const planSku = coalescePlanSku(selections); + const accessMode = selections.accessMode as InternetAccessMode | undefined; + const installationSku = trimToUndefined(selections.installationSku) ?? null; + const selectedAddons = parseAddonList(selections.addons); set(state => ({ internet: { @@ -211,50 +314,54 @@ export const useCatalogStore = create()( ...(planSku && { planSku }), ...(accessMode && { accessMode }), ...(installationSku && { installationSku }), - addonSkus, + addonSkus: selectedAddons, }, })); }, restoreSimFromParams: (params: URLSearchParams) => { - const planSku = params.get("plan"); - const simType = params.get("simType") as SimCardType | null; - const eid = params.get("eid"); - const activationType = params.get("activationType") as ActivationType | null; - const scheduledAt = params.get("scheduledAt"); - const isMnp = params.get("isMnp") === "true"; - - // Parse addons - const addonsParam = params.get("addons"); - const addonSkuParams = params.getAll("addonSku"); - const addonSkus = addonsParam - ? addonsParam.split(",").map(s => s.trim()).filter(Boolean) - : addonSkuParams.length > 0 - ? addonSkuParams - : []; + const selections = normalizeSelectionsFromParams(params); + const planSku = coalescePlanSku(selections); + const simType = selections.simType as SimCardType | undefined; + const activationType = selections.activationType as ActivationType | undefined; + const eid = trimToUndefined(selections.eid) ?? ""; + const scheduledActivationDate = trimToUndefined(selections.scheduledAt) ?? ""; + const wantsMnp = selections.isMnp === "true"; + const selectedAddons = parseAddonList(selections.addons); - // Parse MNP data - let mnpData = initialSimState.mnpData; - const mnpDataParam = params.get("mnpData"); - if (mnpDataParam) { - try { - mnpData = JSON.parse(mnpDataParam); - } catch (e) { - console.warn("Failed to parse MNP data from params", e); - } - } + const mnpData = wantsMnp + ? { + ...initialSimState.mnpData, + reservationNumber: trimToUndefined(selections.mnpNumber) ?? "", + expiryDate: trimToUndefined(selections.mnpExpiry) ?? "", + phoneNumber: trimToUndefined(selections.mnpPhone) ?? "", + mvnoAccountNumber: trimToUndefined(selections.mvnoAccountNumber) ?? "", + portingLastName: trimToUndefined(selections.portingLastName) ?? "", + portingFirstName: trimToUndefined(selections.portingFirstName) ?? "", + portingLastNameKatakana: trimToUndefined(selections.portingLastNameKatakana) ?? "", + portingFirstNameKatakana: + trimToUndefined(selections.portingFirstNameKatakana) ?? "", + portingGender: + selections.portingGender === "Male" || + selections.portingGender === "Female" || + selections.portingGender === "Corporate/Other" + ? selections.portingGender + : "", + portingDateOfBirth: trimToUndefined(selections.portingDateOfBirth) ?? "", + } + : { ...initialSimState.mnpData }; set(state => ({ sim: { ...state.sim, ...(planSku && { planSku }), ...(simType && { simType }), - ...(eid && { eid }), ...(activationType && { activationType }), - ...(scheduledAt && { scheduledDate: scheduledAt }), - wantsMnp: isMnp, + eid, + scheduledActivationDate, + wantsMnp, mnpData, - addonSkus, + selectedAddons, }, })); }, @@ -293,5 +400,3 @@ export const clearCatalogStore = () => { localStorage.removeItem('catalog-config-store'); } }; - - diff --git a/apps/portal/src/features/checkout/hooks/useCheckout.ts b/apps/portal/src/features/checkout/hooks/useCheckout.ts index c9888085..47a53a77 100644 --- a/apps/portal/src/features/checkout/hooks/useCheckout.ts +++ b/apps/portal/src/features/checkout/hooks/useCheckout.ts @@ -15,7 +15,10 @@ import type { AsyncState } from "@customer-portal/domain/toolkit"; import { useActiveSubscriptions } from "@/features/subscriptions/hooks/useSubscriptions"; import { ORDER_TYPE, - orderConfigurationsSchema, + buildOrderConfigurations, + normalizeOrderSelections, + type OrderSelections, + type OrderConfigurations, type OrderTypeValue, type CheckoutCart, } from "@customer-portal/domain/orders"; @@ -83,32 +86,36 @@ export function useCheckout() { } }, [params]); - const selections = useMemo(() => { - const obj: Record = {}; - params.forEach((v, k) => { - if (k !== "type") obj[k] = v; + const { selections, configurations } = useMemo(() => { + const rawSelections: Record = {}; + params.forEach((value, key) => { + if (key !== "type") { + rawSelections[key] = value; + } }); - return obj; - }, [params]); - - const simConfig = useMemo(() => { - if (orderType !== ORDER_TYPE.SIM) { - return null; - } - - const rawConfig = params.get("simConfig"); - if (!rawConfig) { - return null; - } try { - const parsed = JSON.parse(rawConfig) as unknown; - return orderConfigurationsSchema.parse(parsed); + const normalizedSelections = normalizeOrderSelections(rawSelections); + let configuration: OrderConfigurations | undefined; + + try { + configuration = buildOrderConfigurations(normalizedSelections); + } catch (error) { + console.warn("Failed to derive order configurations from selections", error); + } + + return { + selections: normalizedSelections, + configurations: configuration, + }; } catch (error) { - console.warn("Failed to parse SIM order configuration from query params", error); - return null; + console.warn("Failed to normalize checkout selections", error); + return { + selections: rawSelections as unknown as OrderSelections, + configurations: undefined, + }; } - }, [orderType, params]); + }, [params]); useEffect(() => { if (orderType !== ORDER_TYPE.INTERNET || !hasActiveInternetSubscription) { @@ -146,7 +153,7 @@ export function useCheckout() { } // Build cart using BFF service - const cart = await checkoutService.buildCart(orderType, selections, simConfig || undefined); + const cart = await checkoutService.buildCart(orderType, selections, configurations); if (!mounted) return; @@ -162,7 +169,7 @@ export function useCheckout() { return () => { mounted = false; }; - }, [isAuthenticated, orderType, params, selections, simConfig]); + }, [isAuthenticated, orderType, params, selections, configurations]); const handleSubmitOrder = useCallback(async () => { try { diff --git a/apps/portal/src/features/checkout/services/checkout.service.ts b/apps/portal/src/features/checkout/services/checkout.service.ts index 63fc9ce3..b24f50ac 100644 --- a/apps/portal/src/features/checkout/services/checkout.service.ts +++ b/apps/portal/src/features/checkout/services/checkout.service.ts @@ -1,5 +1,10 @@ import { apiClient, getDataOrThrow } from "@/lib/api"; -import type { CheckoutCart, OrderConfigurations } from "@customer-portal/domain/orders"; +import type { + CheckoutCart, + OrderConfigurations, + OrderSelections, + OrderTypeValue, +} from "@customer-portal/domain/orders"; import type { ApiSuccessResponse } from "@customer-portal/domain/common"; export const checkoutService = { @@ -7,8 +12,8 @@ export const checkoutService = { * Build checkout cart from order type and selections */ async buildCart( - orderType: string, - selections: Record, + orderType: OrderTypeValue, + selections: OrderSelections, configuration?: OrderConfigurations ): Promise { const response = await apiClient.POST>("/api/checkout/cart", { diff --git a/apps/portal/src/features/dashboard/utils/dashboard.utils.ts b/apps/portal/src/features/dashboard/utils/dashboard.utils.ts index d39d2cc5..8ebafa19 100644 --- a/apps/portal/src/features/dashboard/utils/dashboard.utils.ts +++ b/apps/portal/src/features/dashboard/utils/dashboard.utils.ts @@ -3,8 +3,9 @@ * Helper functions for dashboard data processing and formatting */ -import { z } from "zod"; -import type { +import { + invoiceActivityMetadataSchema, + serviceActivityMetadataSchema, Activity, ActivityFilter, ActivityFilterConfig, @@ -123,28 +124,6 @@ export function getActivityIconGradient(activityType: Activity["type"]): string return gradientMap[activityType] || "from-gray-500 to-slate-500"; } -const invoiceActivityMetadataSchema = z - .object({ - amount: z.number(), - currency: z.string().optional(), - dueDate: z.string().optional(), - invoiceNumber: z.string().optional(), - status: z.string().optional(), - }) - .partial() - .refine(data => typeof data.amount === "number", { - message: "amount is required", - path: ["amount"], - }); - -const serviceActivityMetadataSchema = z - .object({ - productName: z.string().optional(), - registrationDate: z.string().optional(), - status: z.string().optional(), - }) - .partial(); - const currencyFormatterCache = new Map(); const formatCurrency = (amount: number, currency?: string) => { diff --git a/packages/domain/auth/contract.d.ts b/packages/domain/auth/contract.d.ts deleted file mode 100644 index daebd052..00000000 --- a/packages/domain/auth/contract.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export declare const AUTH_ERROR_CODE: { - readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS"; - readonly EMAIL_NOT_VERIFIED: "EMAIL_NOT_VERIFIED"; - readonly ACCOUNT_LOCKED: "ACCOUNT_LOCKED"; - readonly MFA_REQUIRED: "MFA_REQUIRED"; - readonly INVALID_TOKEN: "INVALID_TOKEN"; - readonly TOKEN_EXPIRED: "TOKEN_EXPIRED"; - readonly PASSWORD_TOO_WEAK: "PASSWORD_TOO_WEAK"; - readonly EMAIL_ALREADY_EXISTS: "EMAIL_ALREADY_EXISTS"; - readonly WHMCS_ACCOUNT_NOT_FOUND: "WHMCS_ACCOUNT_NOT_FOUND"; - readonly SALESFORCE_ACCOUNT_NOT_FOUND: "SALESFORCE_ACCOUNT_NOT_FOUND"; - readonly LINKING_FAILED: "LINKING_FAILED"; -}; -export type AuthErrorCode = (typeof AUTH_ERROR_CODE)[keyof typeof AUTH_ERROR_CODE]; -export declare const TOKEN_TYPE: { - readonly BEARER: "Bearer"; -}; -export type TokenTypeValue = (typeof TOKEN_TYPE)[keyof typeof TOKEN_TYPE]; -export declare const GENDER: { - readonly MALE: "male"; - readonly FEMALE: "female"; - readonly OTHER: "other"; -}; -export type GenderValue = (typeof GENDER)[keyof typeof GENDER]; -export type { LoginRequest, SignupRequest, PasswordResetRequest, ResetPasswordRequest, SetPasswordRequest, ChangePasswordRequest, LinkWhmcsRequest, ValidateSignupRequest, UpdateCustomerProfileRequest, AccountStatusRequest, SsoLinkRequest, CheckPasswordNeededRequest, RefreshTokenRequest, AuthTokens, AuthResponse, SignupResult, PasswordChangeResult, SsoLinkResponse, CheckPasswordNeededResponse, AuthError, } from './schema'; diff --git a/packages/domain/auth/contract.js b/packages/domain/auth/contract.js deleted file mode 100644 index 1a9bf54f..00000000 --- a/packages/domain/auth/contract.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GENDER = exports.TOKEN_TYPE = exports.AUTH_ERROR_CODE = void 0; -exports.AUTH_ERROR_CODE = { - INVALID_CREDENTIALS: "INVALID_CREDENTIALS", - EMAIL_NOT_VERIFIED: "EMAIL_NOT_VERIFIED", - ACCOUNT_LOCKED: "ACCOUNT_LOCKED", - MFA_REQUIRED: "MFA_REQUIRED", - INVALID_TOKEN: "INVALID_TOKEN", - TOKEN_EXPIRED: "TOKEN_EXPIRED", - PASSWORD_TOO_WEAK: "PASSWORD_TOO_WEAK", - EMAIL_ALREADY_EXISTS: "EMAIL_ALREADY_EXISTS", - WHMCS_ACCOUNT_NOT_FOUND: "WHMCS_ACCOUNT_NOT_FOUND", - SALESFORCE_ACCOUNT_NOT_FOUND: "SALESFORCE_ACCOUNT_NOT_FOUND", - LINKING_FAILED: "LINKING_FAILED", -}; -exports.TOKEN_TYPE = { - BEARER: "Bearer", -}; -exports.GENDER = { - MALE: "male", - FEMALE: "female", - OTHER: "other", -}; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/auth/contract.js.map b/packages/domain/auth/contract.js.map deleted file mode 100644 index 47282a92..00000000 --- a/packages/domain/auth/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":";;;AAWa,QAAA,eAAe,GAAG;IAC7B,mBAAmB,EAAE,qBAAqB;IAC1C,kBAAkB,EAAE,oBAAoB;IACxC,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,iBAAiB,EAAE,mBAAmB;IACtC,oBAAoB,EAAE,sBAAsB;IAC5C,uBAAuB,EAAE,yBAAyB;IAClD,4BAA4B,EAAE,8BAA8B;IAC5D,cAAc,EAAE,gBAAgB;CACxB,CAAC;AAQE,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;CACR,CAAC;AAQE,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC"} \ No newline at end of file diff --git a/packages/domain/auth/index.d.ts b/packages/domain/auth/index.d.ts deleted file mode 100644 index 2352ed80..00000000 --- a/packages/domain/auth/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { AUTH_ERROR_CODE, TOKEN_TYPE, GENDER, type AuthErrorCode, type TokenTypeValue, type GenderValue, } from "./contract"; -export type { LoginRequest, SignupRequest, PasswordResetRequest, ResetPasswordRequest, SetPasswordRequest, ChangePasswordRequest, LinkWhmcsRequest, ValidateSignupRequest, UpdateCustomerProfileRequest, AccountStatusRequest, SsoLinkRequest, CheckPasswordNeededRequest, RefreshTokenRequest, AuthTokens, AuthResponse, SignupResult, PasswordChangeResult, SsoLinkResponse, CheckPasswordNeededResponse, AuthError, } from "./contract"; -export { loginRequestSchema, signupInputSchema, signupRequestSchema, passwordResetRequestSchema, passwordResetSchema, setPasswordRequestSchema, changePasswordRequestSchema, linkWhmcsRequestSchema, validateSignupRequestSchema, updateCustomerProfileRequestSchema, updateProfileRequestSchema, updateAddressRequestSchema, accountStatusRequestSchema, ssoLinkRequestSchema, checkPasswordNeededRequestSchema, refreshTokenRequestSchema, authTokensSchema, authResponseSchema, signupResultSchema, passwordChangeResultSchema, ssoLinkResponseSchema, checkPasswordNeededResponseSchema, } from "./schema"; diff --git a/packages/domain/auth/index.js b/packages/domain/auth/index.js deleted file mode 100644 index 7dcf7be7..00000000 --- a/packages/domain/auth/index.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkPasswordNeededResponseSchema = exports.ssoLinkResponseSchema = exports.passwordChangeResultSchema = exports.signupResultSchema = exports.authResponseSchema = exports.authTokensSchema = exports.refreshTokenRequestSchema = exports.checkPasswordNeededRequestSchema = exports.ssoLinkRequestSchema = exports.accountStatusRequestSchema = exports.updateAddressRequestSchema = exports.updateProfileRequestSchema = exports.updateCustomerProfileRequestSchema = exports.validateSignupRequestSchema = exports.linkWhmcsRequestSchema = exports.changePasswordRequestSchema = exports.setPasswordRequestSchema = exports.passwordResetSchema = exports.passwordResetRequestSchema = exports.signupRequestSchema = exports.signupInputSchema = exports.loginRequestSchema = exports.GENDER = exports.TOKEN_TYPE = exports.AUTH_ERROR_CODE = void 0; -var contract_1 = require("./contract"); -Object.defineProperty(exports, "AUTH_ERROR_CODE", { enumerable: true, get: function () { return contract_1.AUTH_ERROR_CODE; } }); -Object.defineProperty(exports, "TOKEN_TYPE", { enumerable: true, get: function () { return contract_1.TOKEN_TYPE; } }); -Object.defineProperty(exports, "GENDER", { enumerable: true, get: function () { return contract_1.GENDER; } }); -var schema_1 = require("./schema"); -Object.defineProperty(exports, "loginRequestSchema", { enumerable: true, get: function () { return schema_1.loginRequestSchema; } }); -Object.defineProperty(exports, "signupInputSchema", { enumerable: true, get: function () { return schema_1.signupInputSchema; } }); -Object.defineProperty(exports, "signupRequestSchema", { enumerable: true, get: function () { return schema_1.signupRequestSchema; } }); -Object.defineProperty(exports, "passwordResetRequestSchema", { enumerable: true, get: function () { return schema_1.passwordResetRequestSchema; } }); -Object.defineProperty(exports, "passwordResetSchema", { enumerable: true, get: function () { return schema_1.passwordResetSchema; } }); -Object.defineProperty(exports, "setPasswordRequestSchema", { enumerable: true, get: function () { return schema_1.setPasswordRequestSchema; } }); -Object.defineProperty(exports, "changePasswordRequestSchema", { enumerable: true, get: function () { return schema_1.changePasswordRequestSchema; } }); -Object.defineProperty(exports, "linkWhmcsRequestSchema", { enumerable: true, get: function () { return schema_1.linkWhmcsRequestSchema; } }); -Object.defineProperty(exports, "validateSignupRequestSchema", { enumerable: true, get: function () { return schema_1.validateSignupRequestSchema; } }); -Object.defineProperty(exports, "updateCustomerProfileRequestSchema", { enumerable: true, get: function () { return schema_1.updateCustomerProfileRequestSchema; } }); -Object.defineProperty(exports, "updateProfileRequestSchema", { enumerable: true, get: function () { return schema_1.updateProfileRequestSchema; } }); -Object.defineProperty(exports, "updateAddressRequestSchema", { enumerable: true, get: function () { return schema_1.updateAddressRequestSchema; } }); -Object.defineProperty(exports, "accountStatusRequestSchema", { enumerable: true, get: function () { return schema_1.accountStatusRequestSchema; } }); -Object.defineProperty(exports, "ssoLinkRequestSchema", { enumerable: true, get: function () { return schema_1.ssoLinkRequestSchema; } }); -Object.defineProperty(exports, "checkPasswordNeededRequestSchema", { enumerable: true, get: function () { return schema_1.checkPasswordNeededRequestSchema; } }); -Object.defineProperty(exports, "refreshTokenRequestSchema", { enumerable: true, get: function () { return schema_1.refreshTokenRequestSchema; } }); -Object.defineProperty(exports, "authTokensSchema", { enumerable: true, get: function () { return schema_1.authTokensSchema; } }); -Object.defineProperty(exports, "authResponseSchema", { enumerable: true, get: function () { return schema_1.authResponseSchema; } }); -Object.defineProperty(exports, "signupResultSchema", { enumerable: true, get: function () { return schema_1.signupResultSchema; } }); -Object.defineProperty(exports, "passwordChangeResultSchema", { enumerable: true, get: function () { return schema_1.passwordChangeResultSchema; } }); -Object.defineProperty(exports, "ssoLinkResponseSchema", { enumerable: true, get: function () { return schema_1.ssoLinkResponseSchema; } }); -Object.defineProperty(exports, "checkPasswordNeededResponseSchema", { enumerable: true, get: function () { return schema_1.checkPasswordNeededResponseSchema; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/auth/index.js.map b/packages/domain/auth/index.js.map deleted file mode 100644 index 8c84c093..00000000 --- a/packages/domain/auth/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAeA,uCAOoB;AANlB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,kGAAA,MAAM,OAAA;AAqCR,mCA4BkB;AA1BhB,4GAAA,kBAAkB,OAAA;AAClB,2GAAA,iBAAiB,OAAA;AACjB,6GAAA,mBAAmB,OAAA;AACnB,oHAAA,0BAA0B,OAAA;AAC1B,6GAAA,mBAAmB,OAAA;AACnB,kHAAA,wBAAwB,OAAA;AACxB,qHAAA,2BAA2B,OAAA;AAC3B,gHAAA,sBAAsB,OAAA;AACtB,qHAAA,2BAA2B,OAAA;AAC3B,4HAAA,kCAAkC,OAAA;AAClC,oHAAA,0BAA0B,OAAA;AAC1B,oHAAA,0BAA0B,OAAA;AAC1B,oHAAA,0BAA0B,OAAA;AAC1B,8GAAA,oBAAoB,OAAA;AACpB,0HAAA,gCAAgC,OAAA;AAChC,mHAAA,yBAAyB,OAAA;AAGzB,0GAAA,gBAAgB,OAAA;AAGhB,4GAAA,kBAAkB,OAAA;AAClB,4GAAA,kBAAkB,OAAA;AAClB,oHAAA,0BAA0B,OAAA;AAC1B,+GAAA,qBAAqB,OAAA;AACrB,2HAAA,iCAAiC,OAAA"} \ No newline at end of file diff --git a/packages/domain/auth/schema.d.ts b/packages/domain/auth/schema.d.ts deleted file mode 100644 index a24d8079..00000000 --- a/packages/domain/auth/schema.d.ts +++ /dev/null @@ -1,349 +0,0 @@ -import { z } from "zod"; -export declare const loginRequestSchema: z.ZodObject<{ - email: z.ZodString; - password: z.ZodString; -}, z.core.$strip>; -export declare const signupInputSchema: z.ZodObject<{ - email: z.ZodString; - password: z.ZodString; - firstName: z.ZodString; - lastName: z.ZodString; - company: z.ZodOptional; - phone: z.ZodString; - sfNumber: z.ZodString; - address: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; - }, z.core.$strip>>; - nationality: z.ZodOptional; - dateOfBirth: z.ZodOptional; - gender: z.ZodOptional>; - acceptTerms: z.ZodBoolean; - marketingConsent: z.ZodOptional; -}, z.core.$strip>; -export declare const signupRequestSchema: z.ZodPipe; - phone: z.ZodString; - sfNumber: z.ZodString; - address: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; - }, z.core.$strip>>; - nationality: z.ZodOptional; - dateOfBirth: z.ZodOptional; - gender: z.ZodOptional>; - acceptTerms: z.ZodBoolean; - marketingConsent: z.ZodOptional; -}, z.core.$strip>, z.ZodTransform<{ - firstname: string; - lastname: string; - companyname: string | undefined; - phonenumber: string; - email: string; - password: string; - firstName: string; - lastName: string; - phone: string; - sfNumber: string; - acceptTerms: boolean; - company?: string | undefined; - address?: { - address1?: string | null | undefined; - address2?: string | null | undefined; - city?: string | null | undefined; - state?: string | null | undefined; - postcode?: string | null | undefined; - country?: string | null | undefined; - countryCode?: string | null | undefined; - phoneNumber?: string | null | undefined; - phoneCountryCode?: string | null | undefined; - } | undefined; - nationality?: string | undefined; - dateOfBirth?: string | undefined; - gender?: "male" | "female" | "other" | undefined; - marketingConsent?: boolean | undefined; -}, { - email: string; - password: string; - firstName: string; - lastName: string; - phone: string; - sfNumber: string; - acceptTerms: boolean; - company?: string | undefined; - address?: { - address1?: string | null | undefined; - address2?: string | null | undefined; - city?: string | null | undefined; - state?: string | null | undefined; - postcode?: string | null | undefined; - country?: string | null | undefined; - countryCode?: string | null | undefined; - phoneNumber?: string | null | undefined; - phoneCountryCode?: string | null | undefined; - } | undefined; - nationality?: string | undefined; - dateOfBirth?: string | undefined; - gender?: "male" | "female" | "other" | undefined; - marketingConsent?: boolean | undefined; -}>>; -export declare const passwordResetRequestSchema: z.ZodObject<{ - email: z.ZodString; -}, z.core.$strip>; -export declare const passwordResetSchema: z.ZodObject<{ - token: z.ZodString; - password: z.ZodString; -}, z.core.$strip>; -export declare const setPasswordRequestSchema: z.ZodObject<{ - email: z.ZodString; - password: z.ZodString; -}, z.core.$strip>; -export declare const changePasswordRequestSchema: z.ZodObject<{ - currentPassword: z.ZodString; - newPassword: z.ZodString; -}, z.core.$strip>; -export declare const linkWhmcsRequestSchema: z.ZodObject<{ - email: z.ZodString; - password: z.ZodString; -}, z.core.$strip>; -export declare const validateSignupRequestSchema: z.ZodObject<{ - sfNumber: z.ZodString; -}, z.core.$strip>; -export declare const updateCustomerProfileRequestSchema: z.ZodObject<{ - firstname: z.ZodOptional; - lastname: z.ZodOptional; - companyname: z.ZodOptional; - phonenumber: z.ZodOptional; - address1: z.ZodOptional; - address2: z.ZodOptional; - city: z.ZodOptional; - state: z.ZodOptional; - postcode: z.ZodOptional; - country: z.ZodOptional; - language: z.ZodOptional; -}, z.core.$strip>; -export declare const updateProfileRequestSchema: z.ZodObject<{ - firstname: z.ZodOptional; - lastname: z.ZodOptional; - companyname: z.ZodOptional; - phonenumber: z.ZodOptional; - address1: z.ZodOptional; - address2: z.ZodOptional; - city: z.ZodOptional; - state: z.ZodOptional; - postcode: z.ZodOptional; - country: z.ZodOptional; - language: z.ZodOptional; -}, z.core.$strip>; -export declare const updateAddressRequestSchema: z.ZodObject<{ - firstname: z.ZodOptional; - lastname: z.ZodOptional; - companyname: z.ZodOptional; - phonenumber: z.ZodOptional; - address1: z.ZodOptional; - address2: z.ZodOptional; - city: z.ZodOptional; - state: z.ZodOptional; - postcode: z.ZodOptional; - country: z.ZodOptional; - language: z.ZodOptional; -}, z.core.$strip>; -export declare const accountStatusRequestSchema: z.ZodObject<{ - email: z.ZodString; -}, z.core.$strip>; -export declare const ssoLinkRequestSchema: z.ZodObject<{ - destination: z.ZodOptional; -}, z.core.$strip>; -export declare const checkPasswordNeededRequestSchema: z.ZodObject<{ - email: z.ZodString; -}, z.core.$strip>; -export declare const refreshTokenRequestSchema: z.ZodObject<{ - refreshToken: z.ZodOptional; - deviceId: z.ZodOptional; -}, z.core.$strip>; -export declare const authTokensSchema: z.ZodObject<{ - accessToken: z.ZodString; - refreshToken: z.ZodString; - expiresAt: z.ZodString; - refreshExpiresAt: z.ZodString; - tokenType: z.ZodLiteral<"Bearer">; -}, z.core.$strip>; -export declare const authResponseSchema: z.ZodObject<{ - user: z.ZodObject<{ - id: z.ZodString; - email: z.ZodString; - role: z.ZodEnum<{ - USER: "USER"; - ADMIN: "ADMIN"; - }>; - emailVerified: z.ZodBoolean; - mfaEnabled: z.ZodBoolean; - lastLoginAt: z.ZodOptional; - createdAt: z.ZodString; - updatedAt: z.ZodString; - firstname: z.ZodOptional>; - lastname: z.ZodOptional>; - fullname: z.ZodOptional>; - companyname: z.ZodOptional>; - phonenumber: z.ZodOptional>; - language: z.ZodOptional>; - currencyCode: z.ZodOptional>; - address: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; - tokens: z.ZodObject<{ - accessToken: z.ZodString; - refreshToken: z.ZodString; - expiresAt: z.ZodString; - refreshExpiresAt: z.ZodString; - tokenType: z.ZodLiteral<"Bearer">; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const signupResultSchema: z.ZodObject<{ - user: z.ZodObject<{ - id: z.ZodString; - email: z.ZodString; - role: z.ZodEnum<{ - USER: "USER"; - ADMIN: "ADMIN"; - }>; - emailVerified: z.ZodBoolean; - mfaEnabled: z.ZodBoolean; - lastLoginAt: z.ZodOptional; - createdAt: z.ZodString; - updatedAt: z.ZodString; - firstname: z.ZodOptional>; - lastname: z.ZodOptional>; - fullname: z.ZodOptional>; - companyname: z.ZodOptional>; - phonenumber: z.ZodOptional>; - language: z.ZodOptional>; - currencyCode: z.ZodOptional>; - address: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; - tokens: z.ZodObject<{ - accessToken: z.ZodString; - refreshToken: z.ZodString; - expiresAt: z.ZodString; - refreshExpiresAt: z.ZodString; - tokenType: z.ZodLiteral<"Bearer">; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const passwordChangeResultSchema: z.ZodObject<{ - user: z.ZodObject<{ - id: z.ZodString; - email: z.ZodString; - role: z.ZodEnum<{ - USER: "USER"; - ADMIN: "ADMIN"; - }>; - emailVerified: z.ZodBoolean; - mfaEnabled: z.ZodBoolean; - lastLoginAt: z.ZodOptional; - createdAt: z.ZodString; - updatedAt: z.ZodString; - firstname: z.ZodOptional>; - lastname: z.ZodOptional>; - fullname: z.ZodOptional>; - companyname: z.ZodOptional>; - phonenumber: z.ZodOptional>; - language: z.ZodOptional>; - currencyCode: z.ZodOptional>; - address: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; - tokens: z.ZodObject<{ - accessToken: z.ZodString; - refreshToken: z.ZodString; - expiresAt: z.ZodString; - refreshExpiresAt: z.ZodString; - tokenType: z.ZodLiteral<"Bearer">; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const ssoLinkResponseSchema: z.ZodObject<{ - url: z.ZodURL; - expiresAt: z.ZodString; -}, z.core.$strip>; -export declare const checkPasswordNeededResponseSchema: z.ZodObject<{ - needsPasswordSet: z.ZodBoolean; - userExists: z.ZodBoolean; - email: z.ZodOptional; -}, z.core.$strip>; -export type LoginRequest = z.infer; -export type SignupRequest = z.infer; -export type PasswordResetRequest = z.infer; -export type ResetPasswordRequest = z.infer; -export type SetPasswordRequest = z.infer; -export type ChangePasswordRequest = z.infer; -export type LinkWhmcsRequest = z.infer; -export type ValidateSignupRequest = z.infer; -export type UpdateCustomerProfileRequest = z.infer; -export type AccountStatusRequest = z.infer; -export type SsoLinkRequest = z.infer; -export type CheckPasswordNeededRequest = z.infer; -export type RefreshTokenRequest = z.infer; -export type AuthTokens = z.infer; -export type AuthResponse = z.infer; -export type SignupResult = z.infer; -export type PasswordChangeResult = z.infer; -export type SsoLinkResponse = z.infer; -export type CheckPasswordNeededResponse = z.infer; -export interface AuthError { - code: "INVALID_CREDENTIALS" | "EMAIL_NOT_VERIFIED" | "ACCOUNT_LOCKED" | "MFA_REQUIRED" | "INVALID_TOKEN" | "TOKEN_EXPIRED" | "PASSWORD_TOO_WEAK" | "EMAIL_ALREADY_EXISTS" | "WHMCS_ACCOUNT_NOT_FOUND" | "SALESFORCE_ACCOUNT_NOT_FOUND" | "LINKING_FAILED"; - message: string; - details?: unknown; -} diff --git a/packages/domain/auth/schema.js b/packages/domain/auth/schema.js deleted file mode 100644 index a6e858b2..00000000 --- a/packages/domain/auth/schema.js +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkPasswordNeededResponseSchema = exports.ssoLinkResponseSchema = exports.passwordChangeResultSchema = exports.signupResultSchema = exports.authResponseSchema = exports.authTokensSchema = exports.refreshTokenRequestSchema = exports.checkPasswordNeededRequestSchema = exports.ssoLinkRequestSchema = exports.accountStatusRequestSchema = exports.updateAddressRequestSchema = exports.updateProfileRequestSchema = exports.updateCustomerProfileRequestSchema = exports.validateSignupRequestSchema = exports.linkWhmcsRequestSchema = exports.changePasswordRequestSchema = exports.setPasswordRequestSchema = exports.passwordResetSchema = exports.passwordResetRequestSchema = exports.signupRequestSchema = exports.signupInputSchema = exports.loginRequestSchema = void 0; -const zod_1 = require("zod"); -const schema_1 = require("../common/schema"); -const schema_2 = require("../customer/schema"); -const genderEnum = zod_1.z.enum(["male", "female", "other"]); -exports.loginRequestSchema = zod_1.z.object({ - email: schema_1.emailSchema, - password: zod_1.z.string().min(1, "Password is required"), -}); -exports.signupInputSchema = zod_1.z.object({ - email: schema_1.emailSchema, - password: schema_1.passwordSchema, - firstName: schema_1.nameSchema, - lastName: schema_1.nameSchema, - company: zod_1.z.string().optional(), - phone: schema_1.phoneSchema, - sfNumber: zod_1.z.string().min(6, "Customer number must be at least 6 characters"), - address: schema_2.addressSchema.optional(), - nationality: zod_1.z.string().optional(), - dateOfBirth: zod_1.z.string().optional(), - gender: genderEnum.optional(), - acceptTerms: zod_1.z.boolean(), - marketingConsent: zod_1.z.boolean().optional(), -}); -exports.signupRequestSchema = exports.signupInputSchema.transform(data => ({ - ...data, - firstname: data.firstName, - lastname: data.lastName, - companyname: data.company, - phonenumber: data.phone, -})); -exports.passwordResetRequestSchema = zod_1.z.object({ email: schema_1.emailSchema }); -exports.passwordResetSchema = zod_1.z.object({ - token: zod_1.z.string().min(1, "Reset token is required"), - password: schema_1.passwordSchema, -}); -exports.setPasswordRequestSchema = zod_1.z.object({ - email: schema_1.emailSchema, - password: schema_1.passwordSchema, -}); -exports.changePasswordRequestSchema = zod_1.z.object({ - currentPassword: zod_1.z.string().min(1, "Current password is required"), - newPassword: schema_1.passwordSchema, -}); -exports.linkWhmcsRequestSchema = zod_1.z.object({ - email: schema_1.emailSchema, - password: zod_1.z.string().min(1, "Password is required"), -}); -exports.validateSignupRequestSchema = zod_1.z.object({ - sfNumber: zod_1.z.string().min(1, "Customer number is required"), -}); -exports.updateCustomerProfileRequestSchema = zod_1.z.object({ - firstname: schema_1.nameSchema.optional(), - lastname: schema_1.nameSchema.optional(), - companyname: zod_1.z.string().max(100).optional(), - phonenumber: schema_1.phoneSchema.optional(), - address1: zod_1.z.string().max(200).optional(), - address2: zod_1.z.string().max(200).optional(), - city: zod_1.z.string().max(100).optional(), - state: zod_1.z.string().max(100).optional(), - postcode: zod_1.z.string().max(20).optional(), - country: zod_1.z.string().length(2).optional(), - language: zod_1.z.string().max(10).optional(), -}); -exports.updateProfileRequestSchema = exports.updateCustomerProfileRequestSchema; -exports.updateAddressRequestSchema = exports.updateCustomerProfileRequestSchema; -exports.accountStatusRequestSchema = zod_1.z.object({ - email: schema_1.emailSchema, -}); -exports.ssoLinkRequestSchema = zod_1.z.object({ - destination: zod_1.z.string().optional(), -}); -exports.checkPasswordNeededRequestSchema = zod_1.z.object({ - email: schema_1.emailSchema, -}); -exports.refreshTokenRequestSchema = zod_1.z.object({ - refreshToken: zod_1.z.string().min(1, "Refresh token is required").optional(), - deviceId: zod_1.z.string().optional(), -}); -exports.authTokensSchema = zod_1.z.object({ - accessToken: zod_1.z.string().min(1, "Access token is required"), - refreshToken: zod_1.z.string().min(1, "Refresh token is required"), - expiresAt: zod_1.z.string().min(1, "Access token expiry required"), - refreshExpiresAt: zod_1.z.string().min(1, "Refresh token expiry required"), - tokenType: zod_1.z.literal("Bearer"), -}); -exports.authResponseSchema = zod_1.z.object({ - user: schema_2.userSchema, - tokens: exports.authTokensSchema, -}); -exports.signupResultSchema = zod_1.z.object({ - user: schema_2.userSchema, - tokens: exports.authTokensSchema, -}); -exports.passwordChangeResultSchema = zod_1.z.object({ - user: schema_2.userSchema, - tokens: exports.authTokensSchema, -}); -exports.ssoLinkResponseSchema = zod_1.z.object({ - url: zod_1.z.url(), - expiresAt: zod_1.z.string(), -}); -exports.checkPasswordNeededResponseSchema = zod_1.z.object({ - needsPasswordSet: zod_1.z.boolean(), - userExists: zod_1.z.boolean(), - email: zod_1.z.email().optional(), -}); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/auth/schema.js.map b/packages/domain/auth/schema.js.map deleted file mode 100644 index 8ccf7c46..00000000 --- a/packages/domain/auth/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAYA,6BAAwB;AAExB,6CAAwF;AACxF,+CAA+D;AAM/D,MAAM,UAAU,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAE1C,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,oBAAW;IAClB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;CACpD,CAAC,CAAC;AAMU,QAAA,i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,CAAC,GAAG,CAAC,CAAC,EAAE,8BAA8B,CAAC;IAC5D,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,+BAA+B,CAAC;IACpE,SAAS,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;CAC/B,CAAC,CAAC;AASU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,mBAAU;IAChB,MAAM,EAAE,wBAAgB;CACzB,CAAC,CAAC;AAKU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,mBAAU;IAChB,MAAM,EAAE,wBAAgB;CACzB,CAAC,CAAC;AAKU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,mBAAU;IAChB,MAAM,EAAE,wBAAgB;CACzB,CAAC,CAAC;AAKU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,GAAG,EAAE,OAAC,CAAC,GAAG,EAAE;IACZ,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAKU,QAAA,iCAAiC,GAAG,OAAC,CAAC,MAAM,CAAC;IACxD,gBAAgB,EAAE,OAAC,CAAC,OAAO,EAAE;IAC7B,UAAU,EAAE,OAAC,CAAC,OAAO,EAAE;IACvB,KAAK,EAAE,OAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/billing/constants.d.ts b/packages/domain/billing/constants.d.ts deleted file mode 100644 index ef10cde5..00000000 --- a/packages/domain/billing/constants.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export declare const INVOICE_PAGINATION: { - readonly MIN_LIMIT: 1; - readonly MAX_LIMIT: 100; - readonly DEFAULT_LIMIT: 10; - readonly DEFAULT_PAGE: 1; -}; -export declare const VALID_INVOICE_STATUSES: readonly ["Paid", "Unpaid", "Cancelled", "Overdue", "Collections"]; -export declare const VALID_INVOICE_LIST_STATUSES: readonly ["Paid", "Unpaid", "Cancelled", "Overdue", "Collections"]; -export declare function isValidInvoiceStatus(status: string): boolean; -export declare function isValidPaginationLimit(limit: number): boolean; -export declare function sanitizePaginationLimit(limit: number): number; -export declare function sanitizePaginationPage(page: number): number; -export type ValidInvoiceStatus = (typeof VALID_INVOICE_STATUSES)[number]; -export type ValidInvoiceListStatus = (typeof VALID_INVOICE_LIST_STATUSES)[number]; diff --git a/packages/domain/billing/constants.js b/packages/domain/billing/constants.js deleted file mode 100644 index 0b6fb1a5..00000000 --- a/packages/domain/billing/constants.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.VALID_INVOICE_LIST_STATUSES = exports.VALID_INVOICE_STATUSES = exports.INVOICE_PAGINATION = void 0; -exports.isValidInvoiceStatus = isValidInvoiceStatus; -exports.isValidPaginationLimit = isValidPaginationLimit; -exports.sanitizePaginationLimit = sanitizePaginationLimit; -exports.sanitizePaginationPage = sanitizePaginationPage; -exports.INVOICE_PAGINATION = { - MIN_LIMIT: 1, - MAX_LIMIT: 100, - DEFAULT_LIMIT: 10, - DEFAULT_PAGE: 1, -}; -exports.VALID_INVOICE_STATUSES = [ - "Paid", - "Unpaid", - "Cancelled", - "Overdue", - "Collections", -]; -exports.VALID_INVOICE_LIST_STATUSES = [ - "Paid", - "Unpaid", - "Cancelled", - "Overdue", - "Collections", -]; -function isValidInvoiceStatus(status) { - return exports.VALID_INVOICE_STATUSES.includes(status); -} -function isValidPaginationLimit(limit) { - return limit >= exports.INVOICE_PAGINATION.MIN_LIMIT && limit <= exports.INVOICE_PAGINATION.MAX_LIMIT; -} -function sanitizePaginationLimit(limit) { - return Math.max(exports.INVOICE_PAGINATION.MIN_LIMIT, Math.min(exports.INVOICE_PAGINATION.MAX_LIMIT, Math.floor(limit))); -} -function sanitizePaginationPage(page) { - return Math.max(exports.INVOICE_PAGINATION.DEFAULT_PAGE, Math.floor(page)); -} -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/packages/domain/billing/constants.js.map b/packages/domain/billing/constants.js.map deleted file mode 100644 index 5702b78b..00000000 --- a/packages/domain/billing/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":";;;AAkDA,oDAEC;AAKD,wDAEC;AAKD,0DAKC;AAKD,wDAEC;AA/DY,QAAA,kBAAkB,GAAG;IAChC,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,GAAG;IACd,aAAa,EAAE,EAAE;IACjB,YAAY,EAAE,CAAC;CACP,CAAC;AAME,QAAA,sBAAsB,GAAG;IACpC,MAAM;IACN,QAAQ;IACR,WAAW;IACX,SAAS;IACT,aAAa;CACL,CAAC;AAKE,QAAA,2BAA2B,GAAG;IACzC,MAAM;IACN,QAAQ;IACR,WAAW;IACX,SAAS;IACT,aAAa;CACL,CAAC;AASX,SAAgB,oBAAoB,CAAC,MAAc;IACjD,OAAO,8BAAsB,CAAC,QAAQ,CAAC,MAAa,CAAC,CAAC;AACxD,CAAC;AAKD,SAAgB,sBAAsB,CAAC,KAAa;IAClD,OAAO,KAAK,IAAI,0BAAkB,CAAC,SAAS,IAAI,KAAK,IAAI,0BAAkB,CAAC,SAAS,CAAC;AACxF,CAAC;AAKD,SAAgB,uBAAuB,CAAC,KAAa;IACnD,OAAO,IAAI,CAAC,GAAG,CACb,0BAAkB,CAAC,SAAS,EAC5B,IAAI,CAAC,GAAG,CAAC,0BAAkB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAC1D,CAAC;AACJ,CAAC;AAKD,SAAgB,sBAAsB,CAAC,IAAY;IACjD,OAAO,IAAI,CAAC,GAAG,CAAC,0BAAkB,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC"} \ No newline at end of file diff --git a/packages/domain/billing/contract.d.ts b/packages/domain/billing/contract.d.ts deleted file mode 100644 index a9325c70..00000000 --- a/packages/domain/billing/contract.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare const INVOICE_STATUS: { - readonly DRAFT: "Draft"; - readonly PENDING: "Pending"; - readonly PAID: "Paid"; - readonly UNPAID: "Unpaid"; - readonly OVERDUE: "Overdue"; - readonly CANCELLED: "Cancelled"; - readonly REFUNDED: "Refunded"; - readonly COLLECTIONS: "Collections"; -}; -export type { InvoiceStatus, InvoiceItem, Invoice, InvoicePagination, InvoiceList, InvoiceSsoLink, PaymentInvoiceRequest, BillingSummary, InvoiceQueryParams, InvoiceListQuery, } from './schema'; diff --git a/packages/domain/billing/contract.js b/packages/domain/billing/contract.js deleted file mode 100644 index 163ef94c..00000000 --- a/packages/domain/billing/contract.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.INVOICE_STATUS = void 0; -exports.INVOICE_STATUS = { - DRAFT: "Draft", - PENDING: "Pending", - PAID: "Paid", - UNPAID: "Unpaid", - OVERDUE: "Overdue", - CANCELLED: "Cancelled", - REFUNDED: "Refunded", - COLLECTIONS: "Collections", -}; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/billing/contract.js.map b/packages/domain/billing/contract.js.map deleted file mode 100644 index c9f99aec..00000000 --- a/packages/domain/billing/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":";;;AAWa,QAAA,cAAc,GAAG;IAC5B,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;CAClB,CAAC"} \ No newline at end of file diff --git a/packages/domain/billing/index.d.ts b/packages/domain/billing/index.d.ts deleted file mode 100644 index 293296b0..00000000 --- a/packages/domain/billing/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { INVOICE_STATUS } from "./contract"; -export * from "./constants"; -export * from "./schema"; -export type { InvoiceStatus, InvoiceItem, Invoice, InvoicePagination, InvoiceList, InvoiceSsoLink, PaymentInvoiceRequest, BillingSummary, InvoiceQueryParams, InvoiceListQuery, } from './schema'; -export * as Providers from "./providers/index"; -export type { WhmcsGetInvoicesParams, WhmcsCreateInvoiceParams, WhmcsUpdateInvoiceParams, WhmcsCapturePaymentParams, WhmcsInvoiceListResponse, WhmcsInvoiceResponse, WhmcsCreateInvoiceResponse, WhmcsUpdateInvoiceResponse, WhmcsCapturePaymentResponse, WhmcsCurrency, WhmcsCurrenciesResponse, } from "./providers/whmcs/raw.types"; diff --git a/packages/domain/billing/index.js b/packages/domain/billing/index.js deleted file mode 100644 index 54537714..00000000 --- a/packages/domain/billing/index.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Providers = exports.INVOICE_STATUS = void 0; -var contract_1 = require("./contract"); -Object.defineProperty(exports, "INVOICE_STATUS", { enumerable: true, get: function () { return contract_1.INVOICE_STATUS; } }); -__exportStar(require("./constants"), exports); -__exportStar(require("./schema"), exports); -exports.Providers = __importStar(require("./providers/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/billing/index.js.map b/packages/domain/billing/index.js.map deleted file mode 100644 index f9522edb..00000000 --- a/packages/domain/billing/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,8CAA4B;AAG5B,2CAAyB;AAiBzB,+DAA+C"} \ No newline at end of file diff --git a/packages/domain/billing/providers/index.d.ts b/packages/domain/billing/providers/index.d.ts deleted file mode 100644 index 29a86401..00000000 --- a/packages/domain/billing/providers/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as WhmcsMapper from "./whmcs/mapper"; -import * as WhmcsRaw from "./whmcs/raw.types"; -export declare const Whmcs: { - mapper: typeof WhmcsMapper; - raw: typeof WhmcsRaw; - transformWhmcsInvoice(rawInvoice: unknown, options?: WhmcsMapper.TransformInvoiceOptions): import("..").Invoice; - transformWhmcsInvoices(rawInvoices: unknown[], options?: WhmcsMapper.TransformInvoiceOptions): import("..").Invoice[]; -}; -export { WhmcsMapper, WhmcsRaw }; -export * from "./whmcs/mapper"; -export * from "./whmcs/raw.types"; diff --git a/packages/domain/billing/providers/index.js b/packages/domain/billing/providers/index.js deleted file mode 100644 index 34a15b7b..00000000 --- a/packages/domain/billing/providers/index.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WhmcsRaw = exports.WhmcsMapper = exports.Whmcs = void 0; -const WhmcsMapper = __importStar(require("./whmcs/mapper")); -exports.WhmcsMapper = WhmcsMapper; -const WhmcsRaw = __importStar(require("./whmcs/raw.types")); -exports.WhmcsRaw = WhmcsRaw; -exports.Whmcs = { - ...WhmcsMapper, - mapper: WhmcsMapper, - raw: WhmcsRaw, -}; -__exportStar(require("./whmcs/mapper"), exports); -__exportStar(require("./whmcs/raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/billing/providers/index.js.map b/packages/domain/billing/providers/index.js.map deleted file mode 100644 index 47259257..00000000 --- a/packages/domain/billing/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4DAA8C;AASrC,kCAAW;AARpB,4DAA8C;AAQxB,4BAAQ;AANjB,QAAA,KAAK,GAAG;IACnB,GAAG,WAAW;IACd,MAAM,EAAE,WAAW;IACnB,GAAG,EAAE,QAAQ;CACd,CAAC;AAGF,iDAA+B;AAC/B,oDAAkC"} \ No newline at end of file diff --git a/packages/domain/billing/providers/whmcs/mapper.d.ts b/packages/domain/billing/providers/whmcs/mapper.d.ts deleted file mode 100644 index fec2a3a0..00000000 --- a/packages/domain/billing/providers/whmcs/mapper.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Invoice } from "../../contract"; -export interface TransformInvoiceOptions { - defaultCurrencyCode?: string; - defaultCurrencySymbol?: string; -} -export declare function transformWhmcsInvoice(rawInvoice: unknown, options?: TransformInvoiceOptions): Invoice; -export declare function transformWhmcsInvoices(rawInvoices: unknown[], options?: TransformInvoiceOptions): Invoice[]; diff --git a/packages/domain/billing/providers/whmcs/mapper.js b/packages/domain/billing/providers/whmcs/mapper.js deleted file mode 100644 index 75ccd81c..00000000 --- a/packages/domain/billing/providers/whmcs/mapper.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.transformWhmcsInvoice = transformWhmcsInvoice; -exports.transformWhmcsInvoices = transformWhmcsInvoices; -const schema_1 = require("../../schema"); -const raw_types_1 = require("./raw.types"); -const STATUS_MAP = { - draft: "Draft", - pending: "Pending", - "payment pending": "Pending", - paid: "Paid", - unpaid: "Unpaid", - cancelled: "Cancelled", - canceled: "Cancelled", - overdue: "Overdue", - refunded: "Refunded", - collections: "Collections", -}; -function mapStatus(status) { - const normalized = status?.trim().toLowerCase(); - if (!normalized) { - throw new Error("Invoice status missing"); - } - const mapped = STATUS_MAP[normalized]; - if (!mapped) { - throw new Error(`Unsupported WHMCS invoice status: ${status}`); - } - return mapped; -} -function parseAmount(amount) { - if (typeof amount === "number") { - return amount; - } - if (!amount) { - return 0; - } - const cleaned = String(amount).replace(/[^\d.-]/g, ""); - const parsed = Number.parseFloat(cleaned); - return Number.isNaN(parsed) ? 0 : parsed; -} -function formatDate(input) { - if (!input) { - return undefined; - } - const date = new Date(input); - if (Number.isNaN(date.getTime())) { - return undefined; - } - return date.toISOString(); -} -function mapItems(rawItems) { - if (!rawItems) - return []; - const parsed = raw_types_1.whmcsInvoiceItemsRawSchema.parse(rawItems); - const itemArray = Array.isArray(parsed.item) ? parsed.item : [parsed.item]; - return itemArray.map(item => ({ - id: item.id, - description: item.description, - amount: parseAmount(item.amount), - quantity: 1, - type: item.type, - serviceId: typeof item.relid === "number" && item.relid > 0 ? item.relid : undefined, - })); -} -function transformWhmcsInvoice(rawInvoice, options = {}) { - const whmcsInvoice = raw_types_1.whmcsInvoiceRawSchema.parse(rawInvoice); - const currency = whmcsInvoice.currencycode || options.defaultCurrencyCode || "JPY"; - const currencySymbol = whmcsInvoice.currencyprefix || - whmcsInvoice.currencysuffix || - options.defaultCurrencySymbol; - const invoice = { - id: whmcsInvoice.invoiceid ?? whmcsInvoice.id ?? 0, - number: whmcsInvoice.invoicenum || `INV-${whmcsInvoice.invoiceid}`, - status: mapStatus(whmcsInvoice.status), - currency, - currencySymbol, - total: parseAmount(whmcsInvoice.total), - subtotal: parseAmount(whmcsInvoice.subtotal), - tax: parseAmount(whmcsInvoice.tax) + parseAmount(whmcsInvoice.tax2), - issuedAt: formatDate(whmcsInvoice.date || whmcsInvoice.datecreated), - dueDate: formatDate(whmcsInvoice.duedate), - paidDate: formatDate(whmcsInvoice.datepaid), - description: whmcsInvoice.notes || undefined, - items: mapItems(whmcsInvoice.items), - }; - return schema_1.invoiceSchema.parse(invoice); -} -function transformWhmcsInvoices(rawInvoices, options = {}) { - return rawInvoices.map(raw => transformWhmcsInvoice(raw, options)); -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/billing/providers/whmcs/mapper.js.map b/packages/domain/billing/providers/whmcs/mapper.js.map deleted file mode 100644 index 80c5869c..00000000 --- a/packages/domain/billing/providers/whmcs/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;AA4FA,sDAgCC;AAKD,wDAKC;AA/HD,yCAA6C;AAC7C,2CAKqB;AAQrB,MAAM,UAAU,GAAsC;IACpD,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,SAAS;IAC5B,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,WAAW;IACrB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEF,SAAS,SAAS,CAAC,MAAc;IAC/B,MAAM,UAAU,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAChD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,MAAmC;IACtD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,MAAM,CA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AAK,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC;KACpC,CAAC;IAGF,OAAO,sBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAKD,SAAgB,sBAAsB,CACpC,WAAsB,EACtB,UAAmC,EAAE;IAErC,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"} \ No newline at end of file diff --git a/packages/domain/billing/providers/whmcs/raw.types.d.ts b/packages/domain/billing/providers/whmcs/raw.types.d.ts deleted file mode 100644 index 3a3ba16f..00000000 --- a/packages/domain/billing/providers/whmcs/raw.types.d.ts +++ /dev/null @@ -1,287 +0,0 @@ -import { z } from "zod"; -export interface WhmcsGetInvoicesParams { - userid?: number; - status?: "Paid" | "Unpaid" | "Cancelled" | "Overdue" | "Collections"; - limitstart?: number; - limitnum?: number; - orderby?: "id" | "invoicenum" | "date" | "duedate" | "total" | "status"; - order?: "ASC" | "DESC"; - [key: string]: unknown; -} -export interface WhmcsCreateInvoiceParams { - userid: number; - status?: "Draft" | "Paid" | "Unpaid" | "Cancelled" | "Refunded" | "Collections" | "Overdue" | "Payment Pending"; - sendnotification?: boolean; - paymentmethod?: string; - taxrate?: number; - taxrate2?: number; - date?: string; - duedate?: string; - notes?: string; - itemdescription1?: string; - itemamount1?: number; - itemtaxed1?: boolean; - itemdescription2?: string; - itemamount2?: number; - itemtaxed2?: boolean; - [key: string]: unknown; -} -export interface WhmcsUpdateInvoiceParams { - invoiceid: number; - status?: "Draft" | "Paid" | "Unpaid" | "Cancelled" | "Refunded" | "Collections" | "Overdue"; - duedate?: string; - notes?: string; - [key: string]: unknown; -} -export interface WhmcsCapturePaymentParams { - invoiceid: number; - cvv?: string; - cardnum?: string; - cccvv?: string; - cardtype?: string; - cardexp?: string; - paymentmethodid?: number; - transid?: string; - gateway?: string; - [key: string]: unknown; -} -export declare const whmcsInvoiceItemRawSchema: z.ZodObject<{ - id: z.ZodNumber; - type: z.ZodString; - relid: z.ZodNumber; - description: z.ZodString; - amount: z.ZodUnion; - taxed: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsInvoiceItemRaw = z.infer; -export declare const whmcsInvoiceItemsRawSchema: z.ZodObject<{ - item: z.ZodUnion; - taxed: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - taxed: z.ZodOptional; - }, z.core.$strip>>]>; -}, z.core.$strip>; -export type WhmcsInvoiceItemsRaw = z.infer; -export declare const whmcsInvoiceRawSchema: z.ZodObject<{ - invoiceid: z.ZodNumber; - invoicenum: z.ZodString; - userid: z.ZodNumber; - date: z.ZodString; - duedate: z.ZodString; - subtotal: z.ZodString; - credit: z.ZodString; - tax: z.ZodString; - tax2: z.ZodString; - total: z.ZodString; - balance: z.ZodOptional; - status: z.ZodString; - paymentmethod: z.ZodString; - notes: z.ZodOptional; - ccgateway: z.ZodOptional; - items: z.ZodOptional; - taxed: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - taxed: z.ZodOptional; - }, z.core.$strip>>]>; - }, z.core.$strip>>; - transactions: z.ZodOptional; - id: z.ZodOptional; - clientid: z.ZodOptional; - datecreated: z.ZodOptional; - paymentmethodname: z.ZodOptional; - currencycode: z.ZodOptional; - currencyprefix: z.ZodOptional; - currencysuffix: z.ZodOptional; - lastcaptureattempt: z.ZodOptional; - taxrate: z.ZodOptional; - taxrate2: z.ZodOptional; - datepaid: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsInvoiceRaw = z.infer; -export declare const whmcsInvoiceListResponseSchema: z.ZodObject<{ - invoices: z.ZodObject<{ - invoice: z.ZodArray; - status: z.ZodString; - paymentmethod: z.ZodString; - notes: z.ZodOptional; - ccgateway: z.ZodOptional; - items: z.ZodOptional; - taxed: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - taxed: z.ZodOptional; - }, z.core.$strip>>]>; - }, z.core.$strip>>; - transactions: z.ZodOptional; - id: z.ZodOptional; - clientid: z.ZodOptional; - datecreated: z.ZodOptional; - paymentmethodname: z.ZodOptional; - currencycode: z.ZodOptional; - currencyprefix: z.ZodOptional; - currencysuffix: z.ZodOptional; - lastcaptureattempt: z.ZodOptional; - taxrate: z.ZodOptional; - taxrate2: z.ZodOptional; - datepaid: z.ZodOptional; - }, z.core.$strip>>; - }, z.core.$strip>; - totalresults: z.ZodNumber; - numreturned: z.ZodNumber; - startnumber: z.ZodNumber; -}, z.core.$strip>; -export type WhmcsInvoiceListResponse = z.infer; -export declare const whmcsInvoiceResponseSchema: z.ZodObject<{ - invoiceid: z.ZodNumber; - invoicenum: z.ZodString; - userid: z.ZodNumber; - date: z.ZodString; - duedate: z.ZodString; - subtotal: z.ZodString; - credit: z.ZodString; - tax: z.ZodString; - tax2: z.ZodString; - total: z.ZodString; - balance: z.ZodOptional; - status: z.ZodString; - paymentmethod: z.ZodString; - notes: z.ZodOptional; - ccgateway: z.ZodOptional; - items: z.ZodOptional; - taxed: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - taxed: z.ZodOptional; - }, z.core.$strip>>]>; - }, z.core.$strip>>; - id: z.ZodOptional; - clientid: z.ZodOptional; - datecreated: z.ZodOptional; - paymentmethodname: z.ZodOptional; - currencycode: z.ZodOptional; - currencyprefix: z.ZodOptional; - currencysuffix: z.ZodOptional; - lastcaptureattempt: z.ZodOptional; - taxrate: z.ZodOptional; - taxrate2: z.ZodOptional; - datepaid: z.ZodOptional; - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - transactions: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsInvoiceResponse = z.infer; -export declare const whmcsCreateInvoiceResponseSchema: z.ZodObject<{ - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - invoiceid: z.ZodNumber; - status: z.ZodString; - message: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsCreateInvoiceResponse = z.infer; -export declare const whmcsUpdateInvoiceResponseSchema: z.ZodObject<{ - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - invoiceid: z.ZodNumber; - status: z.ZodString; - message: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsUpdateInvoiceResponse = z.infer; -export declare const whmcsCapturePaymentResponseSchema: z.ZodObject<{ - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - invoiceid: z.ZodNumber; - status: z.ZodString; - transactionid: z.ZodOptional; - amount: z.ZodOptional; - fees: z.ZodOptional; - message: z.ZodOptional; - error: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsCapturePaymentResponse = z.infer; -export declare const whmcsCurrencySchema: z.ZodObject<{ - id: z.ZodNumber; - code: z.ZodString; - prefix: z.ZodString; - suffix: z.ZodString; - format: z.ZodString; - rate: z.ZodString; -}, z.core.$strip>; -export type WhmcsCurrency = z.infer; -export declare const whmcsCurrenciesResponseSchema: z.ZodObject<{ - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - totalresults: z.ZodNumber; - currencies: z.ZodObject<{ - currency: z.ZodArray>; - }, z.core.$strip>; -}, z.core.$strip>; -export type WhmcsCurrenciesResponse = z.infer; diff --git a/packages/domain/billing/providers/whmcs/raw.types.js b/packages/domain/billing/providers/whmcs/raw.types.js deleted file mode 100644 index 159c7ea4..00000000 --- a/packages/domain/billing/providers/whmcs/raw.types.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.whmcsCurrenciesResponseSchema = exports.whmcsCurrencySchema = exports.whmcsCapturePaymentResponseSchema = exports.whmcsUpdateInvoiceResponseSchema = exports.whmcsCreateInvoiceResponseSchema = exports.whmcsInvoiceResponseSchema = exports.whmcsInvoiceListResponseSchema = exports.whmcsInvoiceRawSchema = exports.whmcsInvoiceItemsRawSchema = exports.whmcsInvoiceItemRawSchema = void 0; -const zod_1 = require("zod"); -exports.whmcsInvoiceItemRawSchema = zod_1.z.object({ - id: zod_1.z.number(), - type: zod_1.z.string(), - relid: zod_1.z.number(), - description: zod_1.z.string(), - amount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]), - taxed: zod_1.z.number().optional(), -}); -exports.whmcsInvoiceItemsRawSchema = zod_1.z.object({ - item: zod_1.z.union([exports.whmcsInvoiceItemRawSchema, zod_1.z.array(exports.whmcsInvoiceItemRawSchema)]), -}); -exports.whmcsInvoiceRawSchema = zod_1.z.object({ - invoiceid: zod_1.z.number(), - invoicenum: zod_1.z.string(), - userid: zod_1.z.number(), - date: zod_1.z.string(), - duedate: zod_1.z.string(), - subtotal: zod_1.z.string(), - credit: zod_1.z.string(), - tax: zod_1.z.string(), - tax2: zod_1.z.string(), - total: zod_1.z.string(), - balance: zod_1.z.string().optional(), - status: zod_1.z.string(), - paymentmethod: zod_1.z.string(), - notes: zod_1.z.string().optional(), - ccgateway: zod_1.z.boolean().optional(), - items: exports.whmcsInvoiceItemsRawSchema.optional(), - transactions: zod_1.z.unknown().optional(), - id: zod_1.z.number().optional(), - clientid: zod_1.z.number().optional(), - datecreated: zod_1.z.string().optional(), - paymentmethodname: zod_1.z.string().optional(), - currencycode: zod_1.z.string().optional(), - currencyprefix: zod_1.z.string().optional(), - currencysuffix: zod_1.z.string().optional(), - lastcaptureattempt: zod_1.z.string().optional(), - taxrate: zod_1.z.string().optional(), - taxrate2: zod_1.z.string().optional(), - datepaid: zod_1.z.string().optional(), -}); -exports.whmcsInvoiceListResponseSchema = zod_1.z.object({ - invoices: zod_1.z.object({ - invoice: zod_1.z.array(exports.whmcsInvoiceRawSchema), - }), - totalresults: zod_1.z.number(), - numreturned: zod_1.z.number(), - startnumber: zod_1.z.number(), -}); -exports.whmcsInvoiceResponseSchema = exports.whmcsInvoiceRawSchema.extend({ - result: zod_1.z.enum(["success", "error"]), - transactions: zod_1.z.unknown().optional(), -}); -exports.whmcsCreateInvoiceResponseSchema = zod_1.z.object({ - result: zod_1.z.enum(["success", "error"]), - invoiceid: zod_1.z.number(), - status: zod_1.z.string(), - message: zod_1.z.string().optional(), -}); -exports.whmcsUpdateInvoiceResponseSchema = zod_1.z.object({ - result: zod_1.z.enum(["success", "error"]), - invoiceid: zod_1.z.number(), - status: zod_1.z.string(), - message: zod_1.z.string().optional(), -}); -exports.whmcsCapturePaymentResponseSchema = zod_1.z.object({ - result: zod_1.z.enum(["success", "error"]), - invoiceid: zod_1.z.number(), - status: zod_1.z.string(), - transactionid: zod_1.z.string().optional(), - amount: zod_1.z.number().optional(), - fees: zod_1.z.number().optional(), - message: zod_1.z.string().optional(), - error: zod_1.z.string().optional(), -}); -exports.whmcsCurrencySchema = zod_1.z.object({ - id: zod_1.z.number(), - code: zod_1.z.string(), - prefix: zod_1.z.string(), - suffix: zod_1.z.string(), - format: zod_1.z.string(), - rate: zod_1.z.string(), -}); -exports.whmcsCurrenciesResponseSchema = zod_1.z.object({ - result: zod_1.z.enum(["success", "error"]), - totalresults: zod_1.z.number(), - currencies: zod_1.z.object({ - currency: zod_1.z.array(exports.whmcsCurrencySchema), - }), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/billing/providers/whmcs/raw.types.js.map b/packages/domain/billing/providers/whmcs/raw.types.js.map deleted file mode 100644 index fb20f911..00000000 --- a/packages/domain/billing/providers/whmcs/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAUA,6BAAwB;AAoFX,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,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,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAOU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;QACnB,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,2BAAmB,CAAC;KACvC,CAAC;CACH,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/billing/schema.d.ts b/packages/domain/billing/schema.d.ts deleted file mode 100644 index 423be3d8..00000000 --- a/packages/domain/billing/schema.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -import { z } from "zod"; -export declare const invoiceStatusSchema: z.ZodEnum<{ - Pending: "Pending"; - Cancelled: "Cancelled"; - Draft: "Draft"; - Paid: "Paid"; - Unpaid: "Unpaid"; - Overdue: "Overdue"; - Refunded: "Refunded"; - Collections: "Collections"; -}>; -export declare const invoiceItemSchema: z.ZodObject<{ - id: z.ZodNumber; - description: z.ZodString; - amount: z.ZodNumber; - quantity: z.ZodOptional; - type: z.ZodString; - serviceId: z.ZodOptional; -}, z.core.$strip>; -export declare const invoiceSchema: z.ZodObject<{ - id: z.ZodNumber; - number: z.ZodString; - status: z.ZodEnum<{ - Pending: "Pending"; - Cancelled: "Cancelled"; - Draft: "Draft"; - Paid: "Paid"; - Unpaid: "Unpaid"; - Overdue: "Overdue"; - Refunded: "Refunded"; - Collections: "Collections"; - }>; - currency: z.ZodString; - currencySymbol: z.ZodOptional; - total: z.ZodNumber; - subtotal: z.ZodNumber; - tax: z.ZodNumber; - issuedAt: z.ZodOptional; - dueDate: z.ZodOptional; - paidDate: z.ZodOptional; - pdfUrl: z.ZodOptional; - paymentUrl: z.ZodOptional; - description: z.ZodOptional; - items: z.ZodOptional; - type: z.ZodString; - serviceId: z.ZodOptional; - }, z.core.$strip>>>; - daysOverdue: z.ZodOptional; -}, z.core.$strip>; -export declare const invoicePaginationSchema: z.ZodObject<{ - page: z.ZodNumber; - totalPages: z.ZodNumber; - totalItems: z.ZodNumber; - nextCursor: z.ZodOptional; -}, z.core.$strip>; -export declare const invoiceListSchema: z.ZodObject<{ - invoices: z.ZodArray; - currency: z.ZodString; - currencySymbol: z.ZodOptional; - total: z.ZodNumber; - subtotal: z.ZodNumber; - tax: z.ZodNumber; - issuedAt: z.ZodOptional; - dueDate: z.ZodOptional; - paidDate: z.ZodOptional; - pdfUrl: z.ZodOptional; - paymentUrl: z.ZodOptional; - description: z.ZodOptional; - items: z.ZodOptional; - type: z.ZodString; - serviceId: z.ZodOptional; - }, z.core.$strip>>>; - daysOverdue: z.ZodOptional; - }, z.core.$strip>>; - pagination: z.ZodObject<{ - page: z.ZodNumber; - totalPages: z.ZodNumber; - totalItems: z.ZodNumber; - nextCursor: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const invoiceSsoLinkSchema: z.ZodObject<{ - url: z.ZodString; - expiresAt: z.ZodString; -}, z.core.$strip>; -export declare const paymentInvoiceRequestSchema: z.ZodObject<{ - invoiceId: z.ZodNumber; - paymentMethodId: z.ZodOptional; - gatewayName: z.ZodOptional; - amount: z.ZodOptional; -}, z.core.$strip>; -export declare const billingSummarySchema: z.ZodObject<{ - totalOutstanding: z.ZodNumber; - totalOverdue: z.ZodNumber; - totalPaid: z.ZodNumber; - currency: z.ZodString; - currencySymbol: z.ZodOptional; - invoiceCount: z.ZodObject<{ - total: z.ZodNumber; - unpaid: z.ZodNumber; - overdue: z.ZodNumber; - paid: z.ZodNumber; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const invoiceQueryParamsSchema: z.ZodObject<{ - page: z.ZodOptional>; - limit: z.ZodOptional>; - status: z.ZodOptional>; - dateFrom: z.ZodOptional; - dateTo: z.ZodOptional; -}, z.core.$strip>; -export type InvoiceQueryParams = z.infer; -export declare const invoiceListQuerySchema: z.ZodObject<{ - page: z.ZodOptional>; - limit: z.ZodOptional>; - status: z.ZodOptional>; -}, z.core.$strip>; -export type InvoiceListQuery = z.infer; -export type InvoiceStatus = z.infer; -export type InvoiceItem = z.infer; -export type Invoice = z.infer; -export type InvoicePagination = z.infer; -export type InvoiceList = z.infer; -export type InvoiceSsoLink = z.infer; -export type PaymentInvoiceRequest = z.infer; -export type BillingSummary = z.infer; diff --git a/packages/domain/billing/schema.js b/packages/domain/billing/schema.js deleted file mode 100644 index a21dd88e..00000000 --- a/packages/domain/billing/schema.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.invoiceListQuerySchema = exports.invoiceQueryParamsSchema = exports.billingSummarySchema = exports.paymentInvoiceRequestSchema = exports.invoiceSsoLinkSchema = exports.invoiceListSchema = exports.invoicePaginationSchema = exports.invoiceSchema = exports.invoiceItemSchema = exports.invoiceStatusSchema = void 0; -const zod_1 = require("zod"); -exports.invoiceStatusSchema = zod_1.z.enum([ - "Draft", - "Pending", - "Paid", - "Unpaid", - "Overdue", - "Cancelled", - "Refunded", - "Collections", -]); -exports.invoiceItemSchema = zod_1.z.object({ - id: zod_1.z.number().int().positive("Invoice item id must be positive"), - description: zod_1.z.string().min(1, "Description is required"), - amount: zod_1.z.number(), - quantity: zod_1.z.number().int().positive("Quantity must be positive").optional(), - type: zod_1.z.string().min(1, "Item type is required"), - serviceId: zod_1.z.number().int().positive().optional(), -}); -exports.invoiceSchema = zod_1.z.object({ - id: zod_1.z.number().int().positive("Invoice id must be positive"), - number: zod_1.z.string().min(1, "Invoice number is required"), - status: exports.invoiceStatusSchema, - currency: zod_1.z.string().min(1, "Currency is required"), - currencySymbol: zod_1.z.string().min(1, "Currency symbol is required").optional(), - total: zod_1.z.number(), - subtotal: zod_1.z.number(), - tax: zod_1.z.number(), - issuedAt: zod_1.z.string().optional(), - dueDate: zod_1.z.string().optional(), - paidDate: zod_1.z.string().optional(), - pdfUrl: zod_1.z.string().optional(), - paymentUrl: zod_1.z.string().optional(), - description: zod_1.z.string().optional(), - items: zod_1.z.array(exports.invoiceItemSchema).optional(), - daysOverdue: zod_1.z.number().int().nonnegative().optional(), -}); -exports.invoicePaginationSchema = zod_1.z.object({ - page: zod_1.z.number().int().nonnegative(), - totalPages: zod_1.z.number().int().nonnegative(), - totalItems: zod_1.z.number().int().nonnegative(), - nextCursor: zod_1.z.string().optional(), -}); -exports.invoiceListSchema = zod_1.z.object({ - invoices: zod_1.z.array(exports.invoiceSchema), - pagination: exports.invoicePaginationSchema, -}); -exports.invoiceSsoLinkSchema = zod_1.z.object({ - url: zod_1.z.string().url(), - expiresAt: zod_1.z.string(), -}); -exports.paymentInvoiceRequestSchema = zod_1.z.object({ - invoiceId: zod_1.z.number().int().positive(), - paymentMethodId: zod_1.z.number().int().positive().optional(), - gatewayName: zod_1.z.string().optional(), - amount: zod_1.z.number().positive().optional(), -}); -exports.billingSummarySchema = zod_1.z.object({ - totalOutstanding: zod_1.z.number(), - totalOverdue: zod_1.z.number(), - totalPaid: zod_1.z.number(), - currency: zod_1.z.string(), - currencySymbol: zod_1.z.string().optional(), - invoiceCount: zod_1.z.object({ - total: zod_1.z.number().int().min(0), - unpaid: zod_1.z.number().int().min(0), - overdue: zod_1.z.number().int().min(0), - paid: zod_1.z.number().int().min(0), - }), -}); -exports.invoiceQueryParamsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().optional(), - limit: zod_1.z.coerce.number().int().positive().max(100).optional(), - status: exports.invoiceStatusSchema.optional(), - dateFrom: zod_1.z.string().datetime().optional(), - dateTo: zod_1.z.string().datetime().optional(), -}); -const invoiceListStatusSchema = zod_1.z.enum(["Paid", "Unpaid", "Cancelled", "Overdue", "Collections"]); -exports.invoiceListQuerySchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().optional(), - limit: zod_1.z.coerce.number().int().positive().max(100).optional(), - status: invoiceListStatusSchema.optional(), -}); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/billing/schema.js.map b/packages/domain/billing/schema.js.map deleted file mode 100644 index f64f5871..00000000 --- a/packages/domain/billing/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAOA,6BAAwB;AAGX,QAAA,mBAAmB,GAAG,OAAC,CAAC,IAAI,CAAC;IACxC,OAAO;IACP,SAAS;IACT,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,aAAa;CACd,CAAC,CAAC;AAGU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACjE,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,yBAAyB,CAAC;IACzD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE;IAC3E,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,uBAAuB,CAAC;IAChD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAGU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC5D,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC;IACvD,MAAM,EAAE,2BAAmB;IAC3B,QAAQ,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CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/catalog/contract.d.ts b/packages/domain/catalog/contract.d.ts deleted file mode 100644 index f393b96d..00000000 --- a/packages/domain/catalog/contract.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface SalesforceProductFieldMap { - sku: string; - portalCategory: string; - portalCatalog: string; - portalAccessible: string; - itemClass: string; - billingCycle: string; - whmcsProductId: string; - whmcsProductName: string; - internetPlanTier: string; - internetOfferingType: string; - displayOrder: string; - bundledAddon: string; - isBundledAddon: string; - simDataSize: string; - simPlanType: string; - simHasFamilyDiscount: string; - vpnRegion: string; -} -export type { CatalogProductBase, CatalogPricebookEntry, InternetCatalogProduct, InternetPlanTemplate, InternetPlanCatalogItem, InternetInstallationCatalogItem, InternetAddonCatalogItem, SimCatalogProduct, SimActivationFeeCatalogItem, VpnCatalogProduct, CatalogProduct, } from './schema'; diff --git a/packages/domain/catalog/contract.js b/packages/domain/catalog/contract.js deleted file mode 100644 index b47942b1..00000000 --- a/packages/domain/catalog/contract.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/catalog/contract.js.map b/packages/domain/catalog/contract.js.map deleted file mode 100644 index 3cab6a3a..00000000 --- a/packages/domain/catalog/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domain/catalog/index.d.ts b/packages/domain/catalog/index.d.ts deleted file mode 100644 index d5fcd437..00000000 --- a/packages/domain/catalog/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { type SalesforceProductFieldMap } from "./contract"; -export * from "./schema"; -export type { CatalogProductBase, CatalogPricebookEntry, InternetCatalogProduct, InternetPlanTemplate, InternetPlanCatalogItem, InternetInstallationCatalogItem, InternetAddonCatalogItem, SimCatalogProduct, SimActivationFeeCatalogItem, VpnCatalogProduct, CatalogProduct, } from './schema'; -export * as Providers from "./providers/index"; -export * from "./providers/salesforce/raw.types"; -export type { WhmcsCatalogProduct, WhmcsCatalogProductListResponse, } from "./providers/whmcs/raw.types"; diff --git a/packages/domain/catalog/index.js b/packages/domain/catalog/index.js deleted file mode 100644 index a6370d47..00000000 --- a/packages/domain/catalog/index.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Providers = void 0; -__exportStar(require("./schema"), exports); -exports.Providers = __importStar(require("./providers/index")); -__exportStar(require("./providers/salesforce/raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/catalog/index.js.map b/packages/domain/catalog/index.js.map deleted file mode 100644 index bfdb1997..00000000 --- a/packages/domain/catalog/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,2CAAyB;AAsBzB,+DAA+C;AAG/C,mEAAiD"} \ No newline at end of file diff --git a/packages/domain/catalog/providers/index.d.ts b/packages/domain/catalog/providers/index.d.ts deleted file mode 100644 index 96f439e0..00000000 --- a/packages/domain/catalog/providers/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as SalesforceMapper from "./salesforce/mapper"; -import * as SalesforceRaw from "./salesforce/raw.types"; -import * as WhmcsRaw from "./whmcs/raw.types"; -export declare const Salesforce: { - mapper: typeof SalesforceMapper; - raw: typeof SalesforceRaw; - mapInternetPlan(product: SalesforceRaw.SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforceRaw.SalesforcePricebookEntryRecord): import("..").InternetPlanCatalogItem; - mapInternetInstallation(product: SalesforceRaw.SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforceRaw.SalesforcePricebookEntryRecord): import("..").InternetInstallationCatalogItem; - mapInternetAddon(product: SalesforceRaw.SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforceRaw.SalesforcePricebookEntryRecord): import("..").InternetAddonCatalogItem; - mapSimProduct(product: SalesforceRaw.SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforceRaw.SalesforcePricebookEntryRecord): import("..").SimCatalogProduct; - mapSimActivationFee(product: SalesforceRaw.SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforceRaw.SalesforcePricebookEntryRecord): import("..").SimActivationFeeCatalogItem; - mapVpnProduct(product: SalesforceRaw.SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforceRaw.SalesforcePricebookEntryRecord): import("..").VpnCatalogProduct; - extractPricebookEntry(record: SalesforceRaw.SalesforceProduct2WithPricebookEntries): SalesforceRaw.SalesforcePricebookEntryRecord | undefined; -}; -export declare const Whmcs: { - raw: typeof WhmcsRaw; -}; -export { SalesforceMapper, SalesforceRaw, WhmcsRaw }; -export * from "./salesforce/mapper"; -export * from "./salesforce/raw.types"; -export * from "./whmcs/raw.types"; diff --git a/packages/domain/catalog/providers/index.js b/packages/domain/catalog/providers/index.js deleted file mode 100644 index 123da7f9..00000000 --- a/packages/domain/catalog/providers/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WhmcsRaw = exports.SalesforceRaw = exports.SalesforceMapper = exports.Whmcs = exports.Salesforce = void 0; -const SalesforceMapper = __importStar(require("./salesforce/mapper")); -exports.SalesforceMapper = SalesforceMapper; -const SalesforceRaw = __importStar(require("./salesforce/raw.types")); -exports.SalesforceRaw = SalesforceRaw; -const WhmcsRaw = __importStar(require("./whmcs/raw.types")); -exports.WhmcsRaw = WhmcsRaw; -exports.Salesforce = { - ...SalesforceMapper, - mapper: SalesforceMapper, - raw: SalesforceRaw, -}; -exports.Whmcs = { - raw: WhmcsRaw, -}; -__exportStar(require("./salesforce/mapper"), exports); -__exportStar(require("./salesforce/raw.types"), exports); -__exportStar(require("./whmcs/raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/catalog/providers/index.js.map b/packages/domain/catalog/providers/index.js.map deleted file mode 100644 index 8ad23f21..00000000 --- a/packages/domain/catalog/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,sEAAwD;AAc/C,4CAAgB;AAbzB,sEAAwD;AAa7B,sCAAa;AAZxC,4DAA8C;AAYJ,4BAAQ;AAVrC,QAAA,UAAU,GAAG;IACxB,GAAG,gBAAgB;IACnB,MAAM,EAAE,gBAAgB;IACxB,GAAG,EAAE,aAAa;CACnB,CAAC;AAEW,QAAA,KAAK,GAAG;IACnB,GAAG,EAAE,QAAQ;CACd,CAAC;AAGF,sDAAoC;AACpC,yDAAuC;AACvC,oDAAkC"} \ No newline at end of file diff --git a/packages/domain/catalog/providers/salesforce/mapper.d.ts b/packages/domain/catalog/providers/salesforce/mapper.d.ts deleted file mode 100644 index 571e3d25..00000000 --- a/packages/domain/catalog/providers/salesforce/mapper.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { InternetPlanCatalogItem, InternetInstallationCatalogItem, InternetAddonCatalogItem, SimCatalogProduct, SimActivationFeeCatalogItem, VpnCatalogProduct } from "../../contract"; -import type { SalesforceProduct2WithPricebookEntries, SalesforcePricebookEntryRecord } from "./raw.types"; -export declare function mapInternetPlan(product: SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforcePricebookEntryRecord): InternetPlanCatalogItem; -export declare function mapInternetInstallation(product: SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforcePricebookEntryRecord): InternetInstallationCatalogItem; -export declare function mapInternetAddon(product: SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforcePricebookEntryRecord): InternetAddonCatalogItem; -export declare function mapSimProduct(product: SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforcePricebookEntryRecord): SimCatalogProduct; -export declare function mapSimActivationFee(product: SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforcePricebookEntryRecord): SimActivationFeeCatalogItem; -export declare function mapVpnProduct(product: SalesforceProduct2WithPricebookEntries, pricebookEntry?: SalesforcePricebookEntryRecord): VpnCatalogProduct; -export declare function extractPricebookEntry(record: SalesforceProduct2WithPricebookEntries): SalesforcePricebookEntryRecord | undefined; diff --git a/packages/domain/catalog/providers/salesforce/mapper.js b/packages/domain/catalog/providers/salesforce/mapper.js deleted file mode 100644 index ec876a70..00000000 --- a/packages/domain/catalog/providers/salesforce/mapper.js +++ /dev/null @@ -1,186 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapInternetPlan = mapInternetPlan; -exports.mapInternetInstallation = mapInternetInstallation; -exports.mapInternetAddon = mapInternetAddon; -exports.mapSimProduct = mapSimProduct; -exports.mapSimActivationFee = mapSimActivationFee; -exports.mapVpnProduct = mapVpnProduct; -exports.extractPricebookEntry = extractPricebookEntry; -const DEFAULT_PLAN_TEMPLATE = { - tierDescription: "Standard plan", - description: undefined, - features: undefined, -}; -function getTierTemplate(tier) { - if (!tier) { - return DEFAULT_PLAN_TEMPLATE; - } - const normalized = tier.toLowerCase(); - switch (normalized) { - case "silver": - return { - tierDescription: "Simple package with broadband-modem and ISP only", - description: "Simple package with broadband-modem and ISP only", - features: [ - "NTT modem + ISP connection", - "Two ISP connection protocols: IPoE (recommended) or PPPoE", - "Self-configuration of router (you provide your own)", - "Monthly: Β₯6,000 | One-time: Β₯22,800", - ], - }; - case "gold": - return { - tierDescription: "Standard all-inclusive package with basic Wi-Fi", - description: "Standard all-inclusive package with basic Wi-Fi", - features: [ - "NTT modem + wireless router (rental)", - "ISP (IPoE) configured automatically within 24 hours", - "Basic wireless router included", - "Optional: TP-LINK RE650 range extender (Β₯500/month)", - "Monthly: Β₯6,500 | One-time: Β₯22,800", - ], - }; - case "platinum": - return { - tierDescription: "Tailored set up with premier Wi-Fi management support", - description: "Tailored set up with premier Wi-Fi management support - Recommended for homes & apartments larger than 50mΒ²", - features: [ - "NTT modem + Netgear INSIGHT Wi-Fi routers", - "Cloud management support for remote router management", - "Automatic updates and quicker support", - "Seamless wireless network setup", - "Monthly: Β₯6,500 | One-time: Β₯22,800", - "Cloud management: Β₯500/month per router", - ], - }; - default: - return { - tierDescription: `${tier} plan`, - description: undefined, - features: undefined, - }; - } -} -function coerceNumber(value) { - if (typeof value === "number") - return value; - if (typeof value === "string") { - const parsed = Number.parseFloat(value); - return Number.isFinite(parsed) ? parsed : undefined; - } - return undefined; -} -function inferInstallationTypeFromSku(sku) { - const normalized = sku.toLowerCase(); - if (normalized.includes("24")) - return "24-Month"; - if (normalized.includes("12")) - return "12-Month"; - return "One-time"; -} -function baseProduct(product, pricebookEntry) { - const sku = product.StockKeepingUnit ?? ""; - const base = { - id: product.Id, - sku, - name: product.Name ?? sku, - }; - if (product.Description) - base.description = product.Description; - if (product.Billing_Cycle__c) - base.billingCycle = product.Billing_Cycle__c; - if (typeof product.Catalog_Order__c === "number") - base.displayOrder = product.Catalog_Order__c; - const billingCycle = product.Billing_Cycle__c?.toLowerCase(); - const unitPrice = coerceNumber(pricebookEntry?.UnitPrice); - if (unitPrice !== undefined) { - base.unitPrice = unitPrice; - if (billingCycle === "monthly") { - base.monthlyPrice = unitPrice; - } - else if (billingCycle) { - base.oneTimePrice = unitPrice; - } - } - return base; -} -function mapInternetPlan(product, pricebookEntry) { - const base = baseProduct(product, pricebookEntry); - const tier = product.Internet_Plan_Tier__c ?? undefined; - const offeringType = product.Internet_Offering_Type__c ?? undefined; - const tierData = getTierTemplate(tier); - return { - ...base, - internetPlanTier: tier, - internetOfferingType: offeringType, - features: tierData.features, - catalogMetadata: { - tierDescription: tierData.tierDescription, - features: tierData.features, - isRecommended: tier === "Gold", - }, - description: base.description ?? tierData.description, - }; -} -function mapInternetInstallation(product, pricebookEntry) { - const base = baseProduct(product, pricebookEntry); - return { - ...base, - catalogMetadata: { - installationTerm: inferInstallationTypeFromSku(base.sku), - }, - }; -} -function mapInternetAddon(product, pricebookEntry) { - const base = baseProduct(product, pricebookEntry); - const bundledAddonId = product.Bundled_Addon__c ?? undefined; - const isBundledAddon = product.Is_Bundled_Addon__c ?? false; - return { - ...base, - bundledAddonId, - isBundledAddon, - }; -} -function mapSimProduct(product, pricebookEntry) { - const base = baseProduct(product, pricebookEntry); - const dataSize = product.SIM_Data_Size__c ?? undefined; - const planType = product.SIM_Plan_Type__c ?? undefined; - const hasFamilyDiscount = product.SIM_Has_Family_Discount__c ?? false; - const bundledAddonId = product.Bundled_Addon__c ?? undefined; - const isBundledAddon = product.Is_Bundled_Addon__c ?? false; - return { - ...base, - simDataSize: dataSize, - simPlanType: planType, - simHasFamilyDiscount: hasFamilyDiscount, - bundledAddonId, - isBundledAddon, - }; -} -function mapSimActivationFee(product, pricebookEntry) { - const simProduct = mapSimProduct(product, pricebookEntry); - return { - ...simProduct, - catalogMetadata: { - isDefault: true, - }, - }; -} -function mapVpnProduct(product, pricebookEntry) { - const base = baseProduct(product, pricebookEntry); - const vpnRegion = product.VPN_Region__c ?? undefined; - return { - ...base, - vpnRegion, - }; -} -function extractPricebookEntry(record) { - const entries = record.PricebookEntries?.records; - if (!Array.isArray(entries) || entries.length === 0) { - return undefined; - } - const activeEntry = entries.find(e => e.IsActive === true); - return activeEntry ?? entries[0]; -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/catalog/providers/salesforce/mapper.js.map b/packages/domain/catalog/providers/salesforce/mapper.js.map deleted file mode 100644 index 5d34fd88..00000000 --- a/packages/domain/catalog/providers/salesforce/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;AA+IA,0CAqBC;AAED,0DAYC;AAED,4CAaC;AAMD,sCAmBC;AAED,kDAYC;AAMD,sCAWC;AAMD,sDAWC;AAjPD,MAAM,qBAAqB,GAAyB;IAClD,eAAe,EAAE,eAAe;IAChC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF,SAAS,eAAe,CAAC,IAAa;IACpC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACtC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO;gBACL,eAAe,EAAE,kDAAkD;gBACnE,WAAW,EAAE,kDAAkD;gBAC/D,QAAQ,EAAE;oBACR,4BAA4B;oBAC5B,2DAA2D;oBAC3D,qDAAqD;oBACrD,qCAAqC;iBACtC;aACF,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,eAAe,EAAE,iDAAiD;gBAClE,WAAW,EAAE,iDAAiD;gBAC9D,QAAQ,EAAE;oBACR,sCAAsC;oBACtC,qDAAqD;oBACrD,gCAAgC;oBAChC,qDAAqD;oBACrD,qCAAqC;iBACtC;aACF,CAAC;QACJ,KAAK,UAAU;YACb,OAAO;gBACL,eAAe,EAAE,uDAAuD;gBACxE,WAAW,EACT,6GAA6G;gBAC/G,QAAQ,EAAE;oBACR,2CAA2C;oBAC3C,uDAAuD;oBACvD,uCAAuC;oBACvC,iCAAiC;oBACjC,qCAAqC;oBACrC,yCAAyC;iBAC1C;aACF,CAAC;QACJ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AAE;YACf,SAAS,EAAE,IAAI;SAChB;KACF,CAAC;AACJ,CAAC;AAMD,SAAgB,aAAa,CAC3B,OAA+C,EAC/C,cAA+C;IAE/C,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,IAAI,SAAS,CAAC;IAErD,OAAO;QACL,GAAG,IAAI;QACP,SAAS;KACV,CAAC;AACJ,CAAC;AAMD,SAAgB,qBAAqB,CACnC,MAA8C;IAE9C,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;IAC3D,OAAO,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/packages/domain/catalog/providers/salesforce/raw.types.d.ts b/packages/domain/catalog/providers/salesforce/raw.types.d.ts deleted file mode 100644 index b3d15764..00000000 --- a/packages/domain/catalog/providers/salesforce/raw.types.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { z } from "zod"; -export declare const salesforceProduct2RecordSchema: z.ZodObject<{ - Id: z.ZodString; - Name: z.ZodOptional; - StockKeepingUnit: z.ZodOptional; - Description: z.ZodOptional; - Product2Categories1__c: z.ZodOptional>; - Portal_Catalog__c: z.ZodOptional>; - Portal_Accessible__c: z.ZodOptional>; - Item_Class__c: z.ZodOptional>; - Billing_Cycle__c: z.ZodOptional>; - Catalog_Order__c: z.ZodOptional>; - Bundled_Addon__c: z.ZodOptional>; - Is_Bundled_Addon__c: z.ZodOptional>; - Internet_Plan_Tier__c: z.ZodOptional>; - Internet_Offering_Type__c: z.ZodOptional>; - Feature_List__c: z.ZodOptional>; - SIM_Data_Size__c: z.ZodOptional>; - SIM_Plan_Type__c: z.ZodOptional>; - SIM_Has_Family_Discount__c: z.ZodOptional>; - VPN_Region__c: z.ZodOptional>; - WH_Product_ID__c: z.ZodOptional>; - WH_Product_Name__c: z.ZodOptional>; - Price__c: z.ZodOptional>; - Monthly_Price__c: z.ZodOptional>; - One_Time_Price__c: z.ZodOptional>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; -}, z.core.$strip>; -export type SalesforceProduct2Record = z.infer; -export declare const salesforcePricebookEntryRecordSchema: z.ZodObject<{ - Id: z.ZodString; - Name: z.ZodOptional; - UnitPrice: z.ZodOptional>>; - Pricebook2Id: z.ZodOptional>; - Product2Id: z.ZodOptional>; - IsActive: z.ZodOptional>; - Product2: z.ZodOptional; - StockKeepingUnit: z.ZodOptional; - Description: z.ZodOptional; - Product2Categories1__c: z.ZodOptional>; - Portal_Catalog__c: z.ZodOptional>; - Portal_Accessible__c: z.ZodOptional>; - Item_Class__c: z.ZodOptional>; - Billing_Cycle__c: z.ZodOptional>; - Catalog_Order__c: z.ZodOptional>; - Bundled_Addon__c: z.ZodOptional>; - Is_Bundled_Addon__c: z.ZodOptional>; - Internet_Plan_Tier__c: z.ZodOptional>; - Internet_Offering_Type__c: z.ZodOptional>; - Feature_List__c: z.ZodOptional>; - SIM_Data_Size__c: z.ZodOptional>; - SIM_Plan_Type__c: z.ZodOptional>; - SIM_Has_Family_Discount__c: z.ZodOptional>; - VPN_Region__c: z.ZodOptional>; - WH_Product_ID__c: z.ZodOptional>; - WH_Product_Name__c: z.ZodOptional>; - Price__c: z.ZodOptional>; - Monthly_Price__c: z.ZodOptional>; - One_Time_Price__c: z.ZodOptional>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; - }, z.core.$strip>>>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; -}, z.core.$strip>; -export type SalesforcePricebookEntryRecord = z.infer; -export declare const salesforceProduct2WithPricebookEntriesSchema: z.ZodObject<{ - Id: z.ZodString; - Name: z.ZodOptional; - StockKeepingUnit: z.ZodOptional; - Description: z.ZodOptional; - Product2Categories1__c: z.ZodOptional>; - Portal_Catalog__c: z.ZodOptional>; - Portal_Accessible__c: z.ZodOptional>; - Item_Class__c: z.ZodOptional>; - Billing_Cycle__c: z.ZodOptional>; - Catalog_Order__c: z.ZodOptional>; - Bundled_Addon__c: z.ZodOptional>; - Is_Bundled_Addon__c: z.ZodOptional>; - Internet_Plan_Tier__c: z.ZodOptional>; - Internet_Offering_Type__c: z.ZodOptional>; - Feature_List__c: z.ZodOptional>; - SIM_Data_Size__c: z.ZodOptional>; - SIM_Plan_Type__c: z.ZodOptional>; - SIM_Has_Family_Discount__c: z.ZodOptional>; - VPN_Region__c: z.ZodOptional>; - WH_Product_ID__c: z.ZodOptional>; - WH_Product_Name__c: z.ZodOptional>; - Price__c: z.ZodOptional>; - Monthly_Price__c: z.ZodOptional>; - One_Time_Price__c: z.ZodOptional>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; - PricebookEntries: z.ZodOptional; - UnitPrice: z.ZodOptional>>; - Pricebook2Id: z.ZodOptional>; - Product2Id: z.ZodOptional>; - IsActive: z.ZodOptional>; - Product2: z.ZodOptional; - StockKeepingUnit: z.ZodOptional; - Description: z.ZodOptional; - Product2Categories1__c: z.ZodOptional>; - Portal_Catalog__c: z.ZodOptional>; - Portal_Accessible__c: z.ZodOptional>; - Item_Class__c: z.ZodOptional>; - Billing_Cycle__c: z.ZodOptional>; - Catalog_Order__c: z.ZodOptional>; - Bundled_Addon__c: z.ZodOptional>; - Is_Bundled_Addon__c: z.ZodOptional>; - Internet_Plan_Tier__c: z.ZodOptional>; - Internet_Offering_Type__c: z.ZodOptional>; - Feature_List__c: z.ZodOptional>; - SIM_Data_Size__c: z.ZodOptional>; - SIM_Plan_Type__c: z.ZodOptional>; - SIM_Has_Family_Discount__c: z.ZodOptional>; - VPN_Region__c: z.ZodOptional>; - WH_Product_ID__c: z.ZodOptional>; - WH_Product_Name__c: z.ZodOptional>; - Price__c: z.ZodOptional>; - Monthly_Price__c: z.ZodOptional>; - One_Time_Price__c: z.ZodOptional>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; - }, z.core.$strip>>>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; - }, z.core.$strip>>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type SalesforceProduct2WithPricebookEntries = z.infer; diff --git a/packages/domain/catalog/providers/salesforce/raw.types.js b/packages/domain/catalog/providers/salesforce/raw.types.js deleted file mode 100644 index ae14fa06..00000000 --- a/packages/domain/catalog/providers/salesforce/raw.types.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.salesforceProduct2WithPricebookEntriesSchema = exports.salesforcePricebookEntryRecordSchema = exports.salesforceProduct2RecordSchema = void 0; -const zod_1 = require("zod"); -exports.salesforceProduct2RecordSchema = zod_1.z.object({ - Id: zod_1.z.string(), - Name: zod_1.z.string().optional(), - StockKeepingUnit: zod_1.z.string().optional(), - Description: zod_1.z.string().optional(), - Product2Categories1__c: zod_1.z.string().nullable().optional(), - Portal_Catalog__c: zod_1.z.boolean().nullable().optional(), - Portal_Accessible__c: zod_1.z.boolean().nullable().optional(), - Item_Class__c: zod_1.z.string().nullable().optional(), - Billing_Cycle__c: zod_1.z.string().nullable().optional(), - Catalog_Order__c: zod_1.z.number().nullable().optional(), - Bundled_Addon__c: zod_1.z.string().nullable().optional(), - Is_Bundled_Addon__c: zod_1.z.boolean().nullable().optional(), - Internet_Plan_Tier__c: zod_1.z.string().nullable().optional(), - Internet_Offering_Type__c: zod_1.z.string().nullable().optional(), - Feature_List__c: zod_1.z.string().nullable().optional(), - SIM_Data_Size__c: zod_1.z.string().nullable().optional(), - SIM_Plan_Type__c: zod_1.z.string().nullable().optional(), - SIM_Has_Family_Discount__c: zod_1.z.boolean().nullable().optional(), - VPN_Region__c: zod_1.z.string().nullable().optional(), - WH_Product_ID__c: zod_1.z.number().nullable().optional(), - WH_Product_Name__c: zod_1.z.string().nullable().optional(), - Price__c: zod_1.z.number().nullable().optional(), - Monthly_Price__c: zod_1.z.number().nullable().optional(), - One_Time_Price__c: zod_1.z.number().nullable().optional(), - CreatedDate: zod_1.z.string().optional(), - LastModifiedDate: zod_1.z.string().optional(), -}); -exports.salesforcePricebookEntryRecordSchema = zod_1.z.object({ - Id: zod_1.z.string(), - Name: zod_1.z.string().optional(), - UnitPrice: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).nullable().optional(), - Pricebook2Id: zod_1.z.string().nullable().optional(), - Product2Id: zod_1.z.string().nullable().optional(), - IsActive: zod_1.z.boolean().nullable().optional(), - Product2: exports.salesforceProduct2RecordSchema.nullable().optional(), - CreatedDate: zod_1.z.string().optional(), - LastModifiedDate: zod_1.z.string().optional(), -}); -exports.salesforceProduct2WithPricebookEntriesSchema = exports.salesforceProduct2RecordSchema.extend({ - PricebookEntries: zod_1.z.object({ - records: zod_1.z.array(exports.salesforcePricebookEntryRecordSchema).optional(), - }).optional(), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/catalog/providers/salesforce/raw.types.js.map b/packages/domain/catalog/providers/salesforce/raw.types.js.map deleted file mode 100644 index 779767cb..00000000 --- a/packages/domain/catalog/providers/salesforce/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAMX,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,gBAAgB,EAAE,OAAC,CAAC,MAAM,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AA8B,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9D,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAQU,QAAA,4CAA4C,GAAG,sCAA8B,CAAC,MAAM,CAAC;IAChG,gBAAgB,EAAE,OAAC,CAAC,MAAM,CAAC;QACzB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,4CAAoC,CAAC,CAAC,QAAQ,EAAE;KAClE,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/catalog/providers/whmcs/raw.types.d.ts b/packages/domain/catalog/providers/whmcs/raw.types.d.ts deleted file mode 100644 index 490b4ffe..00000000 --- a/packages/domain/catalog/providers/whmcs/raw.types.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { z } from "zod"; -declare const whmcsCatalogProductSchema: z.ZodObject<{ - pid: z.ZodNumber; - gid: z.ZodNumber; - name: z.ZodString; - description: z.ZodString; - module: z.ZodString; - paytype: z.ZodString; - pricing: z.ZodRecord>; -}, z.core.$strip>; -export type WhmcsCatalogProduct = z.infer; -export declare const whmcsCatalogProductListResponseSchema: z.ZodObject<{ - products: z.ZodObject<{ - product: z.ZodArray>; - }, z.core.$strip>>; - }, z.core.$strip>; - totalresults: z.ZodNumber; -}, z.core.$strip>; -export type WhmcsCatalogProductListResponse = z.infer; -export {}; diff --git a/packages/domain/catalog/providers/whmcs/raw.types.js b/packages/domain/catalog/providers/whmcs/raw.types.js deleted file mode 100644 index 833495c0..00000000 --- a/packages/domain/catalog/providers/whmcs/raw.types.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.whmcsCatalogProductListResponseSchema = void 0; -const zod_1 = require("zod"); -const whmcsCatalogProductPricingCycleSchema = zod_1.z.object({ - prefix: zod_1.z.string(), - suffix: zod_1.z.string(), - msetupfee: zod_1.z.string(), - qsetupfee: zod_1.z.string(), - ssetupfee: zod_1.z.string(), - asetupfee: zod_1.z.string(), - bsetupfee: zod_1.z.string(), - tsetupfee: zod_1.z.string(), - monthly: zod_1.z.string(), - quarterly: zod_1.z.string(), - semiannually: zod_1.z.string(), - annually: zod_1.z.string(), - biennially: zod_1.z.string(), - triennially: zod_1.z.string(), -}); -const whmcsCatalogProductSchema = zod_1.z.object({ - pid: zod_1.z.number(), - gid: zod_1.z.number(), - name: zod_1.z.string(), - description: zod_1.z.string(), - module: zod_1.z.string(), - paytype: zod_1.z.string(), - pricing: zod_1.z.record(zod_1.z.string(), whmcsCatalogProductPricingCycleSchema), -}); -exports.whmcsCatalogProductListResponseSchema = zod_1.z.object({ - products: zod_1.z.object({ - product: zod_1.z.array(whmcsCatalogProductSchema), - }), - totalresults: zod_1.z.number(), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/catalog/providers/whmcs/raw.types.js.map b/packages/domain/catalog/providers/whmcs/raw.types.js.map deleted file mode 100644 index 03ccce95..00000000 --- a/packages/domain/catalog/providers/whmcs/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAMxB,MAAM,qCAAqC,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAMH,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,qCAAqC,CAAC;CACrE,CAAC,CAAC;AAWU,QAAA,qCAAqC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5D,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC;KAC5C,CAAC;IACF,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/catalog/schema.d.ts b/packages/domain/catalog/schema.d.ts deleted file mode 100644 index 783fc61f..00000000 --- a/packages/domain/catalog/schema.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { z } from "zod"; -export declare const catalogProductBaseSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; -}, z.core.$strip>; -export declare const catalogPricebookEntrySchema: z.ZodObject<{ - id: z.ZodOptional; - name: z.ZodOptional; - unitPrice: z.ZodOptional; - pricebook2Id: z.ZodOptional; - product2Id: z.ZodOptional; - isActive: z.ZodOptional; -}, z.core.$strip>; -export declare const internetCatalogProductSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; - internetPlanTier: z.ZodOptional; - internetOfferingType: z.ZodOptional; - features: z.ZodOptional>; -}, z.core.$strip>; -export declare const internetPlanTemplateSchema: z.ZodObject<{ - tierDescription: z.ZodString; - description: z.ZodOptional; - features: z.ZodOptional>; -}, z.core.$strip>; -export declare const internetPlanCatalogItemSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; - internetPlanTier: z.ZodOptional; - internetOfferingType: z.ZodOptional; - features: z.ZodOptional>; - catalogMetadata: z.ZodOptional; - features: z.ZodOptional>; - isRecommended: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const internetInstallationCatalogItemSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; - internetPlanTier: z.ZodOptional; - internetOfferingType: z.ZodOptional; - features: z.ZodOptional>; - catalogMetadata: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const internetAddonCatalogItemSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; - internetPlanTier: z.ZodOptional; - internetOfferingType: z.ZodOptional; - features: z.ZodOptional>; - isBundledAddon: z.ZodOptional; - bundledAddonId: z.ZodOptional; -}, z.core.$strip>; -export declare const simCatalogProductSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; - simDataSize: z.ZodOptional; - simPlanType: z.ZodOptional; - simHasFamilyDiscount: z.ZodOptional; - isBundledAddon: z.ZodOptional; - bundledAddonId: z.ZodOptional; -}, z.core.$strip>; -export declare const simActivationFeeCatalogItemSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; - simDataSize: z.ZodOptional; - simPlanType: z.ZodOptional; - simHasFamilyDiscount: z.ZodOptional; - isBundledAddon: z.ZodOptional; - bundledAddonId: z.ZodOptional; - catalogMetadata: z.ZodOptional>; -}, z.core.$strip>; -export declare const vpnCatalogProductSchema: z.ZodObject<{ - id: z.ZodString; - sku: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - displayOrder: z.ZodOptional; - billingCycle: z.ZodOptional; - monthlyPrice: z.ZodOptional; - oneTimePrice: z.ZodOptional; - unitPrice: z.ZodOptional; - vpnRegion: z.ZodOptional; -}, z.core.$strip>; -export type CatalogProductBase = z.infer; -export type CatalogPricebookEntry = z.infer; -export type InternetCatalogProduct = z.infer; -export type InternetPlanTemplate = z.infer; -export type InternetPlanCatalogItem = z.infer; -export type InternetInstallationCatalogItem = z.infer; -export type InternetAddonCatalogItem = z.infer; -export type SimCatalogProduct = z.infer; -export type SimActivationFeeCatalogItem = z.infer; -export type VpnCatalogProduct = z.infer; -export type CatalogProduct = InternetPlanCatalogItem | InternetInstallationCatalogItem | InternetAddonCatalogItem | SimCatalogProduct | SimActivationFeeCatalogItem | VpnCatalogProduct | CatalogProductBase; diff --git a/packages/domain/catalog/schema.js b/packages/domain/catalog/schema.js deleted file mode 100644 index 0f16790e..00000000 --- a/packages/domain/catalog/schema.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.vpnCatalogProductSchema = exports.simActivationFeeCatalogItemSchema = exports.simCatalogProductSchema = exports.internetAddonCatalogItemSchema = exports.internetInstallationCatalogItemSchema = exports.internetPlanCatalogItemSchema = exports.internetPlanTemplateSchema = exports.internetCatalogProductSchema = exports.catalogPricebookEntrySchema = exports.catalogProductBaseSchema = void 0; -const zod_1 = require("zod"); -exports.catalogProductBaseSchema = zod_1.z.object({ - id: zod_1.z.string(), - sku: zod_1.z.string(), - name: zod_1.z.string(), - description: zod_1.z.string().optional(), - displayOrder: zod_1.z.number().optional(), - billingCycle: zod_1.z.string().optional(), - monthlyPrice: zod_1.z.number().optional(), - oneTimePrice: zod_1.z.number().optional(), - unitPrice: zod_1.z.number().optional(), -}); -exports.catalogPricebookEntrySchema = zod_1.z.object({ - id: zod_1.z.string().optional(), - name: zod_1.z.string().optional(), - unitPrice: zod_1.z.number().optional(), - pricebook2Id: zod_1.z.string().optional(), - product2Id: zod_1.z.string().optional(), - isActive: zod_1.z.boolean().optional(), -}); -exports.internetCatalogProductSchema = exports.catalogProductBaseSchema.extend({ - internetPlanTier: zod_1.z.string().optional(), - internetOfferingType: zod_1.z.string().optional(), - features: zod_1.z.array(zod_1.z.string()).optional(), -}); -exports.internetPlanTemplateSchema = zod_1.z.object({ - tierDescription: zod_1.z.string(), - description: zod_1.z.string().optional(), - features: zod_1.z.array(zod_1.z.string()).optional(), -}); -exports.internetPlanCatalogItemSchema = exports.internetCatalogProductSchema.extend({ - catalogMetadata: zod_1.z.object({ - tierDescription: zod_1.z.string().optional(), - features: zod_1.z.array(zod_1.z.string()).optional(), - isRecommended: zod_1.z.boolean().optional(), - }).optional(), -}); -exports.internetInstallationCatalogItemSchema = exports.internetCatalogProductSchema.extend({ - catalogMetadata: zod_1.z.object({ - installationTerm: zod_1.z.enum(["One-time", "12-Month", "24-Month"]), - }).optional(), -}); -exports.internetAddonCatalogItemSchema = exports.internetCatalogProductSchema.extend({ - isBundledAddon: zod_1.z.boolean().optional(), - bundledAddonId: zod_1.z.string().optional(), -}); -exports.simCatalogProductSchema = exports.catalogProductBaseSchema.extend({ - simDataSize: zod_1.z.string().optional(), - simPlanType: zod_1.z.string().optional(), - simHasFamilyDiscount: zod_1.z.boolean().optional(), - isBundledAddon: zod_1.z.boolean().optional(), - bundledAddonId: zod_1.z.string().optional(), -}); -exports.simActivationFeeCatalogItemSchema = exports.simCatalogProductSchema.extend({ - catalogMetadata: zod_1.z.object({ - isDefault: zod_1.z.boolean(), - }).optional(), -}); -exports.vpnCatalogProductSchema = exports.catalogProductBaseSchema.extend({ - vpnRegion: zod_1.z.string().optional(), -}); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/catalog/schema.js.map b/packages/domain/catalog/schema.js.map deleted file mode 100644 index 6b07a9e7..00000000 --- a/packages/domain/catalog/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAMX,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,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CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAEU,QAAA,iCAAiC,GAAG,+BAAuB,CAAC,MAAM,CAAC;IAC9E,eAAe,EAAE,OAAC,CAAC,MAAM,CAAC;QACxB,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE;KACvB,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC;AAMU,QAAA,uBAAuB,GAAG,gCAAwB,CAAC,MAAM,CAAC;IACrE,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/common/index.d.ts b/packages/domain/common/index.d.ts deleted file mode 100644 index 96f38f9a..00000000 --- a/packages/domain/common/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./types"; -export * from "./schema"; -export * from "./validation"; -export * as CommonProviders from "./providers/index"; -export type { WhmcsResponse, WhmcsErrorResponse } from "./providers/whmcs"; -export type { SalesforceResponse } from "./providers/salesforce"; diff --git a/packages/domain/common/index.js b/packages/domain/common/index.js deleted file mode 100644 index faf1f7e5..00000000 --- a/packages/domain/common/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CommonProviders = void 0; -__exportStar(require("./types"), exports); -__exportStar(require("./schema"), exports); -__exportStar(require("./validation"), exports); -exports.CommonProviders = __importStar(require("./providers/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/common/index.js.map b/packages/domain/common/index.js.map deleted file mode 100644 index b7326c0f..00000000 --- a/packages/domain/common/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,0CAAwB;AACxB,2CAAyB;AACzB,+CAA6B;AAG7B,qEAAqD"} \ No newline at end of file diff --git a/packages/domain/common/providers/index.d.ts b/packages/domain/common/providers/index.d.ts deleted file mode 100644 index 5333fd36..00000000 --- a/packages/domain/common/providers/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * as Whmcs from "./whmcs"; -export * as Salesforce from "./salesforce/index"; diff --git a/packages/domain/common/providers/index.js b/packages/domain/common/providers/index.js deleted file mode 100644 index 1e946991..00000000 --- a/packages/domain/common/providers/index.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Salesforce = exports.Whmcs = void 0; -exports.Whmcs = __importStar(require("./whmcs")); -exports.Salesforce = __importStar(require("./salesforce/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/common/providers/index.js.map b/packages/domain/common/providers/index.js.map deleted file mode 100644 index 1f5108f8..00000000 --- a/packages/domain/common/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,iDAAiC;AACjC,iEAAiD"} \ No newline at end of file diff --git a/packages/domain/common/providers/salesforce.d.ts b/packages/domain/common/providers/salesforce.d.ts deleted file mode 100644 index e41d4ec3..00000000 --- a/packages/domain/common/providers/salesforce.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { z } from "zod"; -declare const salesforceResponseBaseSchema: z.ZodObject<{ - totalSize: z.ZodNumber; - done: z.ZodBoolean; - records: z.ZodArray; -}, z.core.$strip>; -type SalesforceResponseBase = z.infer; -export type SalesforceResponse = Omit & { - records: TRecord[]; -}; -export declare const salesforceResponseSchema: (recordSchema: TRecord) => z.ZodObject<{ - totalSize: z.ZodNumber; - done: z.ZodBoolean; - records: z.ZodArray; -}, z.core.$strip>; -export {}; diff --git a/packages/domain/common/providers/salesforce.js b/packages/domain/common/providers/salesforce.js deleted file mode 100644 index 64df8c9e..00000000 --- a/packages/domain/common/providers/salesforce.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.salesforceResponseSchema = void 0; -const zod_1 = require("zod"); -const salesforceResponseBaseSchema = zod_1.z.object({ - totalSize: zod_1.z.number(), - done: zod_1.z.boolean(), - records: zod_1.z.array(zod_1.z.unknown()), -}); -const salesforceResponseSchema = (recordSchema) => salesforceResponseBaseSchema.extend({ - records: zod_1.z.array(recordSchema), -}); -exports.salesforceResponseSchema = salesforceResponseSchema; -//# sourceMappingURL=salesforce.js.map \ No newline at end of file diff --git a/packages/domain/common/providers/salesforce.js.map b/packages/domain/common/providers/salesforce.js.map deleted file mode 100644 index 65afb1b3..00000000 --- a/packages/domain/common/providers/salesforce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salesforce.js","sourceRoot":"","sources":["salesforce.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AASxB,MAAM,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE;IACjB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC;CAC9B,CAAC,CAAC;AAkBI,MAAM,wBAAwB,GAAG,CAA+B,YAAqB,EAAE,EAAE,CAC9F,4BAA4B,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,YAAY,CAAC;CAC/B,CAAC,CAAC;AAHQ,QAAA,wBAAwB,4BAGhC"} \ No newline at end of file diff --git a/packages/domain/common/providers/salesforce/index.d.ts b/packages/domain/common/providers/salesforce/index.d.ts deleted file mode 100644 index 570730a3..00000000 --- a/packages/domain/common/providers/salesforce/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./raw.types"; diff --git a/packages/domain/common/providers/salesforce/index.js b/packages/domain/common/providers/salesforce/index.js deleted file mode 100644 index 1615044c..00000000 --- a/packages/domain/common/providers/salesforce/index.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/common/providers/salesforce/index.js.map b/packages/domain/common/providers/salesforce/index.js.map deleted file mode 100644 index b826da2b..00000000 --- a/packages/domain/common/providers/salesforce/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"} \ No newline at end of file diff --git a/packages/domain/common/providers/salesforce/raw.types.d.ts b/packages/domain/common/providers/salesforce/raw.types.d.ts deleted file mode 100644 index 3bb5b4f0..00000000 --- a/packages/domain/common/providers/salesforce/raw.types.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { z } from "zod"; -export declare const salesforceQueryResultSchema: (recordSchema: TRecord) => z.ZodObject<{ - totalSize: z.ZodNumber; - done: z.ZodBoolean; - records: z.ZodArray; -}, z.core.$strip>; -export interface SalesforceQueryResult { - totalSize: number; - done: boolean; - records: TRecord[]; -} diff --git a/packages/domain/common/providers/salesforce/raw.types.js b/packages/domain/common/providers/salesforce/raw.types.js deleted file mode 100644 index acfc86df..00000000 --- a/packages/domain/common/providers/salesforce/raw.types.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.salesforceQueryResultSchema = void 0; -const zod_1 = require("zod"); -const salesforceQueryResultSchema = (recordSchema) => zod_1.z.object({ - totalSize: zod_1.z.number(), - done: zod_1.z.boolean(), - records: zod_1.z.array(recordSchema), -}); -exports.salesforceQueryResultSchema = salesforceQueryResultSchema; -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/common/providers/salesforce/raw.types.js.map b/packages/domain/common/providers/salesforce/raw.types.js.map deleted file mode 100644 index 44652a75..00000000 --- a/packages/domain/common/providers/salesforce/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAUjB,MAAM,2BAA2B,GAAG,CAA+B,YAAqB,EAAE,EAAE,CACjG,OAAC,CAAC,MAAM,CAAC;IACP,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE;IACjB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,YAAY,CAAC;CAC/B,CAAC,CAAC;AALQ,QAAA,2BAA2B,+BAKnC"} \ No newline at end of file diff --git a/packages/domain/common/providers/whmcs.d.ts b/packages/domain/common/providers/whmcs.d.ts deleted file mode 100644 index bff639e4..00000000 --- a/packages/domain/common/providers/whmcs.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { z } from "zod"; -declare const whmcsResponseBaseSchema: z.ZodObject<{ - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - message: z.ZodOptional; -}, z.core.$strip>; -type WhmcsResponseBase = z.infer; -export type WhmcsResponse = WhmcsResponseBase & { - data?: T; -}; -export declare const whmcsResponseSchema: (dataSchema: T) => z.ZodObject<{ - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - message: z.ZodOptional; - data: z.ZodOptional; -}, z.core.$strip>; -export declare const whmcsErrorResponseSchema: z.ZodObject<{ - result: z.ZodLiteral<"error">; - message: z.ZodString; - errorcode: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsErrorResponse = z.infer; -export {}; diff --git a/packages/domain/common/providers/whmcs.js b/packages/domain/common/providers/whmcs.js deleted file mode 100644 index cd6a0963..00000000 --- a/packages/domain/common/providers/whmcs.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.whmcsErrorResponseSchema = exports.whmcsResponseSchema = void 0; -const zod_1 = require("zod"); -const whmcsResponseBaseSchema = zod_1.z.object({ - result: zod_1.z.enum(["success", "error"]), - message: zod_1.z.string().optional(), -}); -const whmcsResponseSchema = (dataSchema) => whmcsResponseBaseSchema.extend({ - data: dataSchema.optional(), -}); -exports.whmcsResponseSchema = whmcsResponseSchema; -exports.whmcsErrorResponseSchema = zod_1.z.object({ - result: zod_1.z.literal("error"), - message: zod_1.z.string(), - errorcode: zod_1.z.string().optional(), -}); -//# sourceMappingURL=whmcs.js.map \ No newline at end of file diff --git a/packages/domain/common/providers/whmcs.js.map b/packages/domain/common/providers/whmcs.js.map deleted file mode 100644 index 9e5d8a4e..00000000 --- a/packages/domain/common/providers/whmcs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"whmcs.js","sourceRoot":"","sources":["whmcs.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AASxB,MAAM,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAkBI,MAAM,mBAAmB,GAAG,CAAyB,UAAa,EAAE,EAAE,CAC3E,uBAAuB,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAHQ,QAAA,mBAAmB,uBAG3B;AASQ,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/common/schema.d.ts b/packages/domain/common/schema.d.ts deleted file mode 100644 index cebfaff8..00000000 --- a/packages/domain/common/schema.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { z } from "zod"; -export declare const emailSchema: z.ZodString; -export declare const passwordSchema: z.ZodString; -export declare const nameSchema: z.ZodString; -export declare const phoneSchema: z.ZodString; -export declare const countryCodeSchema: z.ZodString; -export declare const currencyCodeSchema: z.ZodString; -export declare const timestampSchema: z.ZodString; -export declare const dateSchema: z.ZodString; -export declare const moneyAmountSchema: z.ZodNumber; -export declare const percentageSchema: z.ZodNumber; -export declare const genderEnum: z.ZodEnum<{ - male: "male"; - female: "female"; - other: "other"; -}>; -export declare const statusEnum: z.ZodEnum<{ - active: "active"; - inactive: "inactive"; - pending: "pending"; - suspended: "suspended"; -}>; -export declare const priorityEnum: z.ZodEnum<{ - low: "low"; - medium: "medium"; - high: "high"; - urgent: "urgent"; -}>; -export declare const categoryEnum: z.ZodEnum<{ - technical: "technical"; - billing: "billing"; - account: "account"; - general: "general"; -}>; -export declare const billingCycleEnum: z.ZodEnum<{ - Monthly: "Monthly"; - Quarterly: "Quarterly"; - Annually: "Annually"; - Onetime: "Onetime"; - Free: "Free"; -}>; -export declare const subscriptionBillingCycleEnum: z.ZodEnum<{ - Monthly: "Monthly"; - Quarterly: "Quarterly"; - Annually: "Annually"; - Free: "Free"; - "Semi-Annually": "Semi-Annually"; - Biennially: "Biennially"; - Triennially: "Triennially"; - "One-time": "One-time"; -}>; -export declare const apiSuccessResponseSchema: (dataSchema: T) => z.ZodObject<{ - success: z.ZodLiteral; - data: T; -}, z.core.$strip>; -export declare const apiErrorResponseSchema: z.ZodObject<{ - success: z.ZodLiteral; - error: z.ZodObject<{ - code: z.ZodString; - message: z.ZodString; - details: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const apiResponseSchema: (dataSchema: T) => z.ZodDiscriminatedUnion<[z.ZodObject<{ - success: z.ZodLiteral; - data: T; -}, z.core.$strip>, z.ZodObject<{ - success: z.ZodLiteral; - error: z.ZodObject<{ - code: z.ZodString; - message: z.ZodString; - details: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>], "success">; -export declare const paginationParamsSchema: z.ZodObject<{ - page: z.ZodDefault>>; - limit: z.ZodDefault>>; - offset: z.ZodOptional>; -}, z.core.$strip>; -export declare const paginatedResponseSchema: (itemSchema: T) => z.ZodObject<{ - items: z.ZodArray; - total: z.ZodNumber; - page: z.ZodNumber; - limit: z.ZodNumber; - hasMore: z.ZodBoolean; -}, z.core.$strip>; -export declare const filterParamsSchema: z.ZodObject<{ - search: z.ZodOptional; - sortBy: z.ZodOptional; - sortOrder: z.ZodOptional>; -}, z.core.$strip>; -export declare const queryParamsSchema: z.ZodObject<{ - page: z.ZodDefault>>; - limit: z.ZodDefault>>; - offset: z.ZodOptional>; - search: z.ZodOptional; - sortBy: z.ZodOptional; - sortOrder: z.ZodOptional>; -}, z.core.$strip>; diff --git a/packages/domain/common/schema.js b/packages/domain/common/schema.js deleted file mode 100644 index 09db8182..00000000 --- a/packages/domain/common/schema.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.queryParamsSchema = exports.filterParamsSchema = exports.paginatedResponseSchema = exports.paginationParamsSchema = exports.apiResponseSchema = exports.apiErrorResponseSchema = exports.apiSuccessResponseSchema = exports.subscriptionBillingCycleEnum = exports.billingCycleEnum = exports.categoryEnum = exports.priorityEnum = exports.statusEnum = exports.genderEnum = exports.percentageSchema = exports.moneyAmountSchema = exports.dateSchema = exports.timestampSchema = exports.currencyCodeSchema = exports.countryCodeSchema = exports.phoneSchema = exports.nameSchema = exports.passwordSchema = exports.emailSchema = void 0; -const zod_1 = require("zod"); -exports.emailSchema = zod_1.z - .string() - .email("Please enter a valid email address") - .toLowerCase() - .trim(); -exports.passwordSchema = zod_1.z - .string() - .min(8, "Password must be at least 8 characters") - .regex(/[A-Z]/, "Password must contain at least one uppercase letter") - .regex(/[a-z]/, "Password must contain at least one lowercase letter") - .regex(/[0-9]/, "Password must contain at least one number") - .regex(/[^A-Za-z0-9]/, "Password must contain at least one special character"); -exports.nameSchema = zod_1.z.string().min(1, "Name is required").max(100, "Name must be less than 100 characters").trim(); -exports.phoneSchema = zod_1.z - .string() - .regex(/^[+]?[0-9\s\-()]{7,20}$/u, "Please enter a valid phone number") - .trim(); -exports.countryCodeSchema = zod_1.z.string().length(2, "Country code must be 2 characters"); -exports.currencyCodeSchema = zod_1.z.string().length(3, "Currency code must be 3 characters"); -exports.timestampSchema = zod_1.z.string().datetime("Invalid timestamp format"); -exports.dateSchema = zod_1.z.string().date("Invalid date format"); -exports.moneyAmountSchema = zod_1.z.number().int().nonnegative("Amount must be non-negative"); -exports.percentageSchema = zod_1.z.number().min(0).max(100, "Percentage must be between 0 and 100"); -exports.genderEnum = zod_1.z.enum(["male", "female", "other"]); -exports.statusEnum = zod_1.z.enum(["active", "inactive", "pending", "suspended"]); -exports.priorityEnum = zod_1.z.enum(["low", "medium", "high", "urgent"]); -exports.categoryEnum = zod_1.z.enum(["technical", "billing", "account", "general"]); -exports.billingCycleEnum = zod_1.z.enum(["Monthly", "Quarterly", "Annually", "Onetime", "Free"]); -exports.subscriptionBillingCycleEnum = zod_1.z.enum([ - "Monthly", - "Quarterly", - "Semi-Annually", - "Annually", - "Biennially", - "Triennially", - "One-time", - "Free", -]); -const apiSuccessResponseSchema = (dataSchema) => zod_1.z.object({ - success: zod_1.z.literal(true), - data: dataSchema, -}); -exports.apiSuccessResponseSchema = apiSuccessResponseSchema; -exports.apiErrorResponseSchema = zod_1.z.object({ - success: zod_1.z.literal(false), - error: zod_1.z.object({ - code: zod_1.z.string(), - message: zod_1.z.string(), - details: zod_1.z.unknown().optional(), - }), -}); -const apiResponseSchema = (dataSchema) => zod_1.z.discriminatedUnion("success", [ - (0, exports.apiSuccessResponseSchema)(dataSchema), - exports.apiErrorResponseSchema, -]); -exports.apiResponseSchema = apiResponseSchema; -exports.paginationParamsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().optional().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).optional().default(20), - offset: zod_1.z.coerce.number().int().nonnegative().optional(), -}); -const paginatedResponseSchema = (itemSchema) => zod_1.z.object({ - items: zod_1.z.array(itemSchema), - total: zod_1.z.number().int().nonnegative(), - page: zod_1.z.number().int().positive(), - limit: zod_1.z.number().int().positive(), - hasMore: zod_1.z.boolean(), -}); -exports.paginatedResponseSchema = paginatedResponseSchema; -exports.filterParamsSchema = zod_1.z.object({ - search: zod_1.z.string().optional(), - sortBy: zod_1.z.string().optional(), - sortOrder: zod_1.z.enum(["asc", "desc"]).optional(), -}); -exports.queryParamsSchema = exports.paginationParamsSchema.merge(exports.filterParamsSchema); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/common/schema.js.map b/packages/domain/common/schema.js.map deleted file mode 100644 index 04bb1d07..00000000 --- a/packages/domain/common/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAEX,QAAA,WAAW,GAAG,OAAC;KACzB,MAAM,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AkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,SAAS,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAKU,QAAA,iBAAiB,GAAG,8BAAsB,CAAC,KAAK,CAAC,0BAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/common/types.d.ts b/packages/domain/common/types.d.ts deleted file mode 100644 index aac151db..00000000 --- a/packages/domain/common/types.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -export type IsoDateTimeString = string; -export type EmailAddress = string; -export type PhoneNumber = string; -export type Currency = "JPY" | "USD" | "EUR"; -export type UserId = string & { - readonly __brand: "UserId"; -}; -export type AccountId = string & { - readonly __brand: "AccountId"; -}; -export type OrderId = string & { - readonly __brand: "OrderId"; -}; -export type InvoiceId = string & { - readonly __brand: "InvoiceId"; -}; -export type ProductId = string & { - readonly __brand: "ProductId"; -}; -export type SimId = string & { - readonly __brand: "SimId"; -}; -export type WhmcsClientId = number & { - readonly __brand: "WhmcsClientId"; -}; -export type WhmcsInvoiceId = number & { - readonly __brand: "WhmcsInvoiceId"; -}; -export type WhmcsProductId = number & { - readonly __brand: "WhmcsProductId"; -}; -export type SalesforceContactId = string & { - readonly __brand: "SalesforceContactId"; -}; -export type SalesforceAccountId = string & { - readonly __brand: "SalesforceAccountId"; -}; -export type SalesforceCaseId = string & { - readonly __brand: "SalesforceCaseId"; -}; -export interface ApiSuccessResponse { - success: true; - data: T; -} -export interface ApiErrorResponse { - success: false; - error: { - code: string; - message: string; - details?: unknown; - }; -} -export type ApiResponse = ApiSuccessResponse | ApiErrorResponse; -export interface PaginationParams { - page?: number; - limit?: number; - offset?: number; -} -export interface PaginatedResponse { - items: T[]; - total: number; - page: number; - limit: number; - hasMore: boolean; -} -export interface FilterParams { - search?: string; - sortBy?: string; - sortOrder?: "asc" | "desc"; -} -export type QueryParams = PaginationParams & FilterParams; diff --git a/packages/domain/common/types.js b/packages/domain/common/types.js deleted file mode 100644 index 11e638d1..00000000 --- a/packages/domain/common/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/packages/domain/common/types.js.map b/packages/domain/common/types.js.map deleted file mode 100644 index 8da0887a..00000000 --- a/packages/domain/common/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domain/common/validation.d.ts b/packages/domain/common/validation.d.ts deleted file mode 100644 index 5bf2ba0d..00000000 --- a/packages/domain/common/validation.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { z } from "zod"; -export declare const uuidSchema: z.ZodString; -export declare const requiredStringSchema: z.ZodString; -export declare const salesforceIdSchema: z.ZodString; -export declare const customerNumberSchema: z.ZodString; -export declare function normalizeAndValidateEmail(email: string): string; -export declare function validateUuidV4OrThrow(id: string): string; -export declare function isValidEmail(email: string): boolean; -export declare function isValidUuid(id: string): boolean; -export declare const urlSchema: z.ZodString; -export declare function validateUrlOrThrow(url: string): string; -export declare function validateUrl(url: string): { - isValid: boolean; - errors: string[]; -}; -export declare function isValidUrl(url: string): boolean; diff --git a/packages/domain/common/validation.js b/packages/domain/common/validation.js deleted file mode 100644 index 6ff3f4e3..00000000 --- a/packages/domain/common/validation.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.urlSchema = exports.customerNumberSchema = exports.salesforceIdSchema = exports.requiredStringSchema = exports.uuidSchema = void 0; -exports.normalizeAndValidateEmail = normalizeAndValidateEmail; -exports.validateUuidV4OrThrow = validateUuidV4OrThrow; -exports.isValidEmail = isValidEmail; -exports.isValidUuid = isValidUuid; -exports.validateUrlOrThrow = validateUrlOrThrow; -exports.validateUrl = validateUrl; -exports.isValidUrl = isValidUrl; -const zod_1 = require("zod"); -exports.uuidSchema = zod_1.z.string().uuid(); -exports.requiredStringSchema = zod_1.z.string().min(1, "This field is required").trim(); -exports.salesforceIdSchema = zod_1.z - .string() - .length(18, "Salesforce ID must be 18 characters") - .regex(/^[A-Za-z0-9]+$/, "Salesforce ID must be alphanumeric") - .trim(); -exports.customerNumberSchema = zod_1.z.string().min(1, "Customer number is required").trim(); -function normalizeAndValidateEmail(email) { - const emailValidationSchema = zod_1.z.string().email().transform(e => e.toLowerCase().trim()); - return emailValidationSchema.parse(email); -} -function validateUuidV4OrThrow(id) { - try { - return exports.uuidSchema.parse(id); - } - catch { - throw new Error("Invalid user ID format"); - } -} -function isValidEmail(email) { - return zod_1.z.string().email().safeParse(email).success; -} -function isValidUuid(id) { - return exports.uuidSchema.safeParse(id).success; -} -exports.urlSchema = zod_1.z.string().url(); -function validateUrlOrThrow(url) { - try { - return exports.urlSchema.parse(url); - } - catch { - throw new Error("Invalid URL format"); - } -} -function validateUrl(url) { - const result = exports.urlSchema.safeParse(url); - return { - isValid: result.success, - errors: result.success ? [] : result.error.issues.map(i => i.message), - }; -} -function isValidUrl(url) { - return exports.urlSchema.safeParse(url).success; -} -//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/packages/domain/common/validation.js.map b/packages/domain/common/validation.js.map deleted file mode 100644 index a81f4ae0..00000000 --- a/packages/domain/common/validation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;;AA4CA,8DAGC;AAUD,sDAMC;AAKD,oCAEC;AAKD,kCAEC;AAeD,gDAMC;AAQD,kCAMC;AAKD,gCAEC;AAhHD,6BAAwB;AAKX,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,IAA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AAU1C,SAAgB,kBAAkB,CAAC,GAAW;IAC5C,IAAI,CAAC;QACH,OAAO,iBAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAQD,SAAgB,WAAW,CAAC,GAAW;IACrC,MAAM,MAAM,GAAG,iBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACxC,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;KACtE,CAAC;AACJ,CAAC;AAKD,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,iBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/packages/domain/customer/contract.d.ts b/packages/domain/customer/contract.d.ts deleted file mode 100644 index c9329c79..00000000 --- a/packages/domain/customer/contract.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export declare const USER_ROLE: { - readonly USER: "USER"; - readonly ADMIN: "ADMIN"; -}; -export type UserRoleValue = (typeof USER_ROLE)[keyof typeof USER_ROLE]; -export interface SalesforceAccountFieldMap { - internetEligibility: string; - customerNumber: string; -} -export interface SalesforceAccountRecord { - Id: string; - Name?: string | null; - WH_Account__c?: string | null; - [key: string]: unknown; -} -export type { User, UserAuth, UserRole, Address, AddressFormData, } from './schema'; diff --git a/packages/domain/customer/contract.js b/packages/domain/customer/contract.js deleted file mode 100644 index 8c001708..00000000 --- a/packages/domain/customer/contract.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.USER_ROLE = void 0; -exports.USER_ROLE = { - USER: "USER", - ADMIN: "ADMIN", -}; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/customer/contract.js.map b/packages/domain/customer/contract.js.map deleted file mode 100644 index eedda80b..00000000 --- a/packages/domain/customer/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":";;;AAaa,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACN,CAAC"} \ No newline at end of file diff --git a/packages/domain/customer/index.d.ts b/packages/domain/customer/index.d.ts deleted file mode 100644 index 57908a14..00000000 --- a/packages/domain/customer/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { USER_ROLE, type UserRoleValue } from "./contract"; -export type { User, UserAuth, UserRole, Address, AddressFormData, } from "./schema"; -export { userSchema, userAuthSchema, addressSchema, addressFormSchema, combineToUser, addressFormToRequest, } from "./schema"; -export * as Providers from "./providers/index"; -export type { WhmcsAddClientParams, WhmcsValidateLoginParams, WhmcsCreateSsoTokenParams, WhmcsClientResponse, WhmcsAddClientResponse, WhmcsValidateLoginResponse, WhmcsSsoResponse, } from "./providers/whmcs/raw.types"; -export type { SalesforceAccountFieldMap, SalesforceAccountRecord, } from "./contract"; diff --git a/packages/domain/customer/index.js b/packages/domain/customer/index.js deleted file mode 100644 index 2830d696..00000000 --- a/packages/domain/customer/index.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Providers = exports.addressFormToRequest = exports.combineToUser = exports.addressFormSchema = exports.addressSchema = exports.userAuthSchema = exports.userSchema = exports.USER_ROLE = void 0; -var contract_1 = require("./contract"); -Object.defineProperty(exports, "USER_ROLE", { enumerable: true, get: function () { return contract_1.USER_ROLE; } }); -var schema_1 = require("./schema"); -Object.defineProperty(exports, "userSchema", { enumerable: true, get: function () { return schema_1.userSchema; } }); -Object.defineProperty(exports, "userAuthSchema", { enumerable: true, get: function () { return schema_1.userAuthSchema; } }); -Object.defineProperty(exports, "addressSchema", { enumerable: true, get: function () { return schema_1.addressSchema; } }); -Object.defineProperty(exports, "addressFormSchema", { enumerable: true, get: function () { return schema_1.addressFormSchema; } }); -Object.defineProperty(exports, "combineToUser", { enumerable: true, get: function () { return schema_1.combineToUser; } }); -Object.defineProperty(exports, "addressFormToRequest", { enumerable: true, get: function () { return schema_1.addressFormToRequest; } }); -exports.Providers = __importStar(require("./providers/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/customer/index.js.map b/packages/domain/customer/index.js.map deleted file mode 100644 index 9499d6dd..00000000 --- a/packages/domain/customer/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,uCAA2D;AAAlD,qGAAA,SAAS,OAAA;AAkBlB,mCASkB;AARhB,oGAAA,UAAU,OAAA;AACV,wGAAA,cAAc,OAAA;AACd,uGAAA,aAAa,OAAA;AACb,2GAAA,iBAAiB,OAAA;AAGjB,uGAAA,aAAa,OAAA;AACb,8GAAA,oBAAoB,OAAA;AAetB,+DAA+C"} \ No newline at end of file diff --git a/packages/domain/customer/providers/index.d.ts b/packages/domain/customer/providers/index.d.ts deleted file mode 100644 index c247657d..00000000 --- a/packages/domain/customer/providers/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * as Portal from "./portal/index"; -export * as Whmcs from "./whmcs/index"; diff --git a/packages/domain/customer/providers/index.js b/packages/domain/customer/providers/index.js deleted file mode 100644 index bf4e3420..00000000 --- a/packages/domain/customer/providers/index.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Whmcs = exports.Portal = void 0; -exports.Portal = __importStar(require("./portal/index")); -exports.Whmcs = __importStar(require("./whmcs/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/customer/providers/index.js.map b/packages/domain/customer/providers/index.js.map deleted file mode 100644 index 3be6ec1e..00000000 --- a/packages/domain/customer/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,yDAAyC;AACzC,uDAAuC"} \ No newline at end of file diff --git a/packages/domain/customer/providers/portal/index.d.ts b/packages/domain/customer/providers/portal/index.d.ts deleted file mode 100644 index b41d25bd..00000000 --- a/packages/domain/customer/providers/portal/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./mapper"; -export * from "./types"; diff --git a/packages/domain/customer/providers/portal/index.js b/packages/domain/customer/providers/portal/index.js deleted file mode 100644 index 733f73d1..00000000 --- a/packages/domain/customer/providers/portal/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./mapper"), exports); -__exportStar(require("./types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/customer/providers/portal/index.js.map b/packages/domain/customer/providers/portal/index.js.map deleted file mode 100644 index cb6f60c4..00000000 --- a/packages/domain/customer/providers/portal/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,2CAAyB;AACzB,0CAAwB"} \ No newline at end of file diff --git a/packages/domain/customer/providers/portal/mapper.d.ts b/packages/domain/customer/providers/portal/mapper.d.ts deleted file mode 100644 index 02fa8431..00000000 --- a/packages/domain/customer/providers/portal/mapper.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PrismaUserRaw } from "./types"; -import type { UserAuth } from "../../schema"; -export declare function mapPrismaUserToUserAuth(raw: PrismaUserRaw): UserAuth; diff --git a/packages/domain/customer/providers/portal/mapper.js b/packages/domain/customer/providers/portal/mapper.js deleted file mode 100644 index c8bbe0bd..00000000 --- a/packages/domain/customer/providers/portal/mapper.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapPrismaUserToUserAuth = mapPrismaUserToUserAuth; -const schema_1 = require("../../schema"); -function mapPrismaUserToUserAuth(raw) { - return schema_1.userAuthSchema.parse({ - id: raw.id, - email: raw.email, - role: raw.role, - mfaEnabled: !!raw.mfaSecret, - emailVerified: raw.emailVerified, - lastLoginAt: raw.lastLoginAt?.toISOString(), - createdAt: raw.createdAt.toISOString(), - updatedAt: raw.updatedAt.toISOString(), - }); -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/customer/providers/portal/mapper.js.map b/packages/domain/customer/providers/portal/mapper.js.map deleted file mode 100644 index f518e6fa..00000000 --- a/packages/domain/customer/providers/portal/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;AAkBA,0DAWC;AAvBD,yCAA8C;AAY9C,SAAgB,uBAAuB,CAAC,GAAkB;IACxD,OAAO,uBAAc,CAAC,KAAK,CAAC;QAC1B,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS;QAC3B,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE;QAC3C,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE;QACtC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE;KACvC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/packages/domain/customer/providers/portal/types.d.ts b/packages/domain/customer/providers/portal/types.d.ts deleted file mode 100644 index 53813339..00000000 --- a/packages/domain/customer/providers/portal/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { UserRole } from "../../schema"; -export interface PrismaUserRaw { - id: string; - email: string; - passwordHash: string | null; - role: UserRole; - mfaSecret: string | null; - emailVerified: boolean; - failedLoginAttempts: number; - lockedUntil: Date | null; - lastLoginAt: Date | null; - createdAt: Date; - updatedAt: Date; -} diff --git a/packages/domain/customer/providers/portal/types.js b/packages/domain/customer/providers/portal/types.js deleted file mode 100644 index 11e638d1..00000000 --- a/packages/domain/customer/providers/portal/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/packages/domain/customer/providers/portal/types.js.map b/packages/domain/customer/providers/portal/types.js.map deleted file mode 100644 index 8da0887a..00000000 --- a/packages/domain/customer/providers/portal/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domain/customer/providers/whmcs/index.d.ts b/packages/domain/customer/providers/whmcs/index.d.ts deleted file mode 100644 index 4fdc6902..00000000 --- a/packages/domain/customer/providers/whmcs/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./mapper"; -export * from "./raw.types"; -export type { WhmcsClient, EmailPreferences, SubUser, Stats } from "../../schema"; diff --git a/packages/domain/customer/providers/whmcs/index.js b/packages/domain/customer/providers/whmcs/index.js deleted file mode 100644 index f128c698..00000000 --- a/packages/domain/customer/providers/whmcs/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./mapper"), exports); -__exportStar(require("./raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/customer/providers/whmcs/index.js.map b/packages/domain/customer/providers/whmcs/index.js.map deleted file mode 100644 index bdadf74f..00000000 --- a/packages/domain/customer/providers/whmcs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAOA,2CAAyB;AACzB,8CAA4B"} \ No newline at end of file diff --git a/packages/domain/customer/providers/whmcs/mapper.d.ts b/packages/domain/customer/providers/whmcs/mapper.d.ts deleted file mode 100644 index f576bcba..00000000 --- a/packages/domain/customer/providers/whmcs/mapper.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WhmcsClient, Address } from "../../schema"; -import { type WhmcsClient as WhmcsRawClient, type WhmcsClientResponse } from "./raw.types"; -export declare const parseWhmcsClientResponse: (raw: unknown) => WhmcsClientResponse; -export declare function transformWhmcsClientResponse(response: unknown): WhmcsClient; -export declare function transformWhmcsClient(raw: WhmcsRawClient): WhmcsClient; -export declare const transformWhmcsClientAddress: (raw: unknown) => Address | undefined; -export declare const prepareWhmcsClientAddressUpdate: (address: Partial
) => Record; diff --git a/packages/domain/customer/providers/whmcs/mapper.js b/packages/domain/customer/providers/whmcs/mapper.js deleted file mode 100644 index ed8d76a0..00000000 --- a/packages/domain/customer/providers/whmcs/mapper.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.prepareWhmcsClientAddressUpdate = exports.transformWhmcsClientAddress = exports.parseWhmcsClientResponse = void 0; -exports.transformWhmcsClientResponse = transformWhmcsClientResponse; -exports.transformWhmcsClient = transformWhmcsClient; -const schema_1 = require("../../schema"); -const raw_types_1 = require("./raw.types"); -const parseWhmcsClientResponse = (raw) => raw_types_1.whmcsClientResponseSchema.parse(raw); -exports.parseWhmcsClientResponse = parseWhmcsClientResponse; -function transformWhmcsClientResponse(response) { - const parsed = (0, exports.parseWhmcsClientResponse)(response); - return transformWhmcsClient(parsed.client); -} -function transformWhmcsClient(raw) { - return schema_1.whmcsClientSchema.parse({ - ...raw, - address: normalizeAddress(raw), - }); -} -function normalizeAddress(client) { - const address = schema_1.addressSchema.parse({ - address1: client.address1 ?? null, - address2: client.address2 ?? null, - city: client.city ?? null, - state: client.fullstate ?? client.state ?? null, - postcode: client.postcode ?? null, - country: client.country ?? null, - countryCode: client.countrycode ?? null, - phoneNumber: client.phonenumberformatted ?? client.phonenumber ?? null, - phoneCountryCode: client.phonecc ?? null, - }); - const hasValues = Object.values(address).some(v => v !== undefined && v !== null && v !== ""); - return hasValues ? address : undefined; -} -const transformWhmcsClientAddress = (raw) => { - const client = raw_types_1.whmcsClientSchema.parse(raw); - return normalizeAddress(client); -}; -exports.transformWhmcsClientAddress = transformWhmcsClientAddress; -const prepareWhmcsClientAddressUpdate = (address) => { - const update = {}; - if (address.address1 !== undefined) - update.address1 = address.address1 ?? ""; - if (address.address2 !== undefined) - update.address2 = address.address2 ?? ""; - if (address.city !== undefined) - update.city = address.city ?? ""; - if (address.state !== undefined) - update.state = address.state ?? ""; - if (address.postcode !== undefined) - update.postcode = address.postcode ?? ""; - if (address.country !== undefined) - update.country = address.country ?? ""; - if (address.countryCode !== undefined) - update.countrycode = address.countryCode ?? ""; - if (address.phoneNumber !== undefined) - update.phonenumber = address.phoneNumber ?? ""; - if (address.phoneCountryCode !== undefined) - update.phonecc = address.phoneCountryCode ?? ""; - return update; -}; -exports.prepareWhmcsClientAddressUpdate = prepareWhmcsClientAddressUpdate; -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/customer/providers/whmcs/mapper.js.map b/packages/domain/customer/providers/whmcs/mapper.js.map deleted file mode 100644 index 2ac4860e..00000000 --- a/packages/domain/customer/providers/whmcs/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;;AA2BA,oEAGC;AASD,oDAMC;AAnCD,yCAAgE;AAChE,2CAKqB;AAKd,MAAM,wBAAwB,GAAG,CAAC,GAAY,EAAuB,EAAE,CAC5E,qCAAyB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAD1B,QAAA,wBAAwB,4BACE;AAKvC,SAAgB,4BAA4B,CAAC,QAAiB;IAC5D,MAAM,MAAM,GAAG,IAAA,gCAAwB,EAAC,QAAQ,CAAC,CAAC;IAClD,OAAO,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AASD,SAAgB,oBAAoB,CAAC,GAAmB;IACtD,OAAO,0BAAiB,CAAC,KAAK,CAAC;QAC7B,GAAG,GAAG;QAEN,OAAO,EAAE,gBAAgB,CAAC,GAAG,CAAC;KAC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,SAAS;QAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC7E,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC7E,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IACjE,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;IACpE,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC7E,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IAC1E,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;QAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;IACtF,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;QAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;IACtF,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS;QAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,gBAAgB,IAAI,EAAE,CAAC;IAC5F,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAdW,QAAA,+BAA+B,mCAc1C"} \ No newline at end of file diff --git a/packages/domain/customer/providers/whmcs/raw.types.d.ts b/packages/domain/customer/providers/whmcs/raw.types.d.ts deleted file mode 100644 index 78322557..00000000 --- a/packages/domain/customer/providers/whmcs/raw.types.d.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { z } from "zod"; -export interface WhmcsValidateLoginParams { - email: string; - password2: string; - [key: string]: unknown; -} -export interface WhmcsAddClientParams { - firstname: string; - lastname: string; - email: string; - address1?: string; - city?: string; - state?: string; - postcode?: string; - country?: string; - phonenumber?: string; - password2: string; - companyname?: string; - currency?: string; - groupid?: number; - customfields?: Record; - language?: string; - clientip?: string; - notes?: string; - marketing_emails_opt_in?: boolean; - no_email?: boolean; - [key: string]: unknown; -} -export interface WhmcsCreateSsoTokenParams { - client_id: number; - destination?: string; - sso_redirect_path?: string; - [key: string]: unknown; -} -export declare const whmcsCustomFieldSchema: z.ZodObject<{ - id: z.ZodUnion; - value: z.ZodNullable>; - name: z.ZodOptional; - type: z.ZodOptional; -}, z.core.$loose>; -export declare const whmcsUserSchema: z.ZodObject<{ - id: z.ZodUnion; - name: z.ZodString; - email: z.ZodString; - is_owner: z.ZodOptional>; -}, z.core.$loose>; -export declare const whmcsEmailPreferencesSchema: z.ZodOptional>>; -export declare const whmcsClientSchema: z.ZodObject<{ - client_id: z.ZodOptional>; - owner_user_id: z.ZodOptional>; - userid: z.ZodOptional>; - id: z.ZodUnion; - uuid: z.ZodOptional; - firstname: z.ZodOptional; - lastname: z.ZodOptional; - fullname: z.ZodOptional; - companyname: z.ZodOptional; - email: z.ZodString; - address1: z.ZodOptional; - address2: z.ZodOptional; - city: z.ZodOptional; - state: z.ZodOptional; - fullstate: z.ZodOptional; - statecode: z.ZodOptional; - postcode: z.ZodOptional; - country: z.ZodOptional; - countrycode: z.ZodOptional; - phonecc: z.ZodOptional; - phonenumber: z.ZodOptional; - phonenumberformatted: z.ZodOptional; - telephoneNumber: z.ZodOptional; - tax_id: z.ZodOptional; - currency: z.ZodOptional>; - currency_code: z.ZodOptional; - defaultgateway: z.ZodOptional; - defaultpaymethodid: z.ZodOptional>; - language: z.ZodOptional; - status: z.ZodOptional; - notes: z.ZodOptional; - datecreated: z.ZodOptional; - lastlogin: z.ZodOptional; - email_preferences: z.ZodOptional>>; - allowSingleSignOn: z.ZodOptional>; - email_verified: z.ZodOptional>; - marketing_emails_opt_in: z.ZodOptional>; - isOptedInToMarketingEmails: z.ZodOptional>; - phoneNumber: z.ZodOptional; - customfields: z.ZodOptional; - value: z.ZodNullable>; - name: z.ZodOptional; - type: z.ZodOptional; - }, z.core.$loose>>, z.ZodObject<{ - customfield: z.ZodUnion; - value: z.ZodNullable>; - name: z.ZodOptional; - type: z.ZodOptional; - }, z.core.$loose>, z.ZodArray; - value: z.ZodNullable>; - name: z.ZodOptional; - type: z.ZodOptional; - }, z.core.$loose>>]>; - }, z.core.$loose>]>>; - users: z.ZodOptional; - name: z.ZodString; - email: z.ZodString; - is_owner: z.ZodOptional>; - }, z.core.$loose>, z.ZodArray; - name: z.ZodString; - email: z.ZodString; - is_owner: z.ZodOptional>; - }, z.core.$loose>>]>; - }, z.core.$loose>>; -}, z.core.$catchall>; -export declare const whmcsClientStatsSchema: z.ZodOptional>>; -export declare const whmcsClientResponseSchema: z.ZodObject<{ - result: z.ZodOptional; - client_id: z.ZodOptional>; - client: z.ZodObject<{ - client_id: z.ZodOptional>; - owner_user_id: z.ZodOptional>; - userid: z.ZodOptional>; - id: z.ZodUnion; - uuid: z.ZodOptional; - firstname: z.ZodOptional; - lastname: z.ZodOptional; - fullname: z.ZodOptional; - companyname: z.ZodOptional; - email: z.ZodString; - address1: z.ZodOptional; - address2: z.ZodOptional; - city: z.ZodOptional; - state: z.ZodOptional; - fullstate: z.ZodOptional; - statecode: z.ZodOptional; - postcode: z.ZodOptional; - country: z.ZodOptional; - countrycode: z.ZodOptional; - phonecc: z.ZodOptional; - phonenumber: z.ZodOptional; - phonenumberformatted: z.ZodOptional; - telephoneNumber: z.ZodOptional; - tax_id: z.ZodOptional; - currency: z.ZodOptional>; - currency_code: z.ZodOptional; - defaultgateway: z.ZodOptional; - defaultpaymethodid: z.ZodOptional>; - language: z.ZodOptional; - status: z.ZodOptional; - notes: z.ZodOptional; - datecreated: z.ZodOptional; - lastlogin: z.ZodOptional; - email_preferences: z.ZodOptional>>; - allowSingleSignOn: z.ZodOptional>; - email_verified: z.ZodOptional>; - marketing_emails_opt_in: z.ZodOptional>; - isOptedInToMarketingEmails: z.ZodOptional>; - phoneNumber: z.ZodOptional; - customfields: z.ZodOptional; - value: z.ZodNullable>; - name: z.ZodOptional; - type: z.ZodOptional; - }, z.core.$loose>>, z.ZodObject<{ - customfield: z.ZodUnion; - value: z.ZodNullable>; - name: z.ZodOptional; - type: z.ZodOptional; - }, z.core.$loose>, z.ZodArray; - value: z.ZodNullable>; - name: z.ZodOptional; - type: z.ZodOptional; - }, z.core.$loose>>]>; - }, z.core.$loose>]>>; - users: z.ZodOptional; - name: z.ZodString; - email: z.ZodString; - is_owner: z.ZodOptional>; - }, z.core.$loose>, z.ZodArray; - name: z.ZodString; - email: z.ZodString; - is_owner: z.ZodOptional>; - }, z.core.$loose>>]>; - }, z.core.$loose>>; - }, z.core.$catchall>; - stats: z.ZodOptional>>; -}, z.core.$catchall>; -export type WhmcsCustomField = z.infer; -export type WhmcsUser = z.infer; -export type WhmcsClient = z.infer; -export type WhmcsClientResponse = z.infer; -export declare const whmcsAddClientResponseSchema: z.ZodObject<{ - clientid: z.ZodNumber; -}, z.core.$strip>; -export type WhmcsAddClientResponse = z.infer; -export declare const whmcsValidateLoginResponseSchema: z.ZodObject<{ - userid: z.ZodNumber; - passwordhash: z.ZodString; - pwresetkey: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsValidateLoginResponse = z.infer; -export declare const whmcsSsoResponseSchema: z.ZodObject<{ - redirect_url: z.ZodString; -}, z.core.$strip>; -export type WhmcsSsoResponse = z.infer; -export type WhmcsClientStats = z.infer; diff --git a/packages/domain/customer/providers/whmcs/raw.types.js b/packages/domain/customer/providers/whmcs/raw.types.js deleted file mode 100644 index eaa3775d..00000000 --- a/packages/domain/customer/providers/whmcs/raw.types.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.whmcsSsoResponseSchema = exports.whmcsValidateLoginResponseSchema = exports.whmcsAddClientResponseSchema = exports.whmcsClientResponseSchema = exports.whmcsClientStatsSchema = exports.whmcsClientSchema = exports.whmcsEmailPreferencesSchema = exports.whmcsUserSchema = exports.whmcsCustomFieldSchema = void 0; -const zod_1 = require("zod"); -const booleanLike = zod_1.z.union([zod_1.z.boolean(), zod_1.z.number(), zod_1.z.string()]); -const numberLike = zod_1.z.union([zod_1.z.number(), zod_1.z.string()]); -exports.whmcsCustomFieldSchema = zod_1.z - .object({ - id: numberLike, - value: zod_1.z.string().optional().nullable(), - name: zod_1.z.string().optional(), - type: zod_1.z.string().optional(), -}) - .passthrough(); -exports.whmcsUserSchema = zod_1.z - .object({ - id: numberLike, - name: zod_1.z.string(), - email: zod_1.z.string(), - is_owner: booleanLike.optional(), -}) - .passthrough(); -exports.whmcsEmailPreferencesSchema = zod_1.z - .record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()])) - .optional(); -const customFieldsSchema = zod_1.z - .union([ - zod_1.z.array(exports.whmcsCustomFieldSchema), - zod_1.z - .object({ - customfield: zod_1.z.union([exports.whmcsCustomFieldSchema, zod_1.z.array(exports.whmcsCustomFieldSchema)]), - }) - .passthrough(), -]) - .optional(); -const usersSchema = zod_1.z - .object({ user: zod_1.z.union([exports.whmcsUserSchema, zod_1.z.array(exports.whmcsUserSchema)]) }) - .passthrough() - .optional(); -exports.whmcsClientSchema = zod_1.z - .object({ - client_id: numberLike.optional(), - owner_user_id: numberLike.optional(), - userid: numberLike.optional(), - id: numberLike, - uuid: zod_1.z.string().optional(), - firstname: zod_1.z.string().optional(), - lastname: zod_1.z.string().optional(), - fullname: zod_1.z.string().optional(), - companyname: zod_1.z.string().optional(), - email: zod_1.z.string(), - address1: zod_1.z.string().optional(), - address2: zod_1.z.string().optional(), - city: zod_1.z.string().optional(), - state: zod_1.z.string().optional(), - fullstate: zod_1.z.string().optional(), - statecode: zod_1.z.string().optional(), - postcode: zod_1.z.string().optional(), - country: zod_1.z.string().optional(), - countrycode: zod_1.z.string().optional(), - phonecc: zod_1.z.string().optional(), - phonenumber: zod_1.z.string().optional(), - phonenumberformatted: zod_1.z.string().optional(), - telephoneNumber: zod_1.z.string().optional(), - tax_id: zod_1.z.string().optional(), - currency: numberLike.optional(), - currency_code: zod_1.z.string().optional(), - defaultgateway: zod_1.z.string().optional(), - defaultpaymethodid: numberLike.optional(), - language: zod_1.z.string().optional(), - status: zod_1.z.string().optional(), - notes: zod_1.z.string().optional(), - datecreated: zod_1.z.string().optional(), - lastlogin: zod_1.z.string().optional(), - email_preferences: exports.whmcsEmailPreferencesSchema, - allowSingleSignOn: booleanLike.optional(), - email_verified: booleanLike.optional(), - marketing_emails_opt_in: booleanLike.optional(), - isOptedInToMarketingEmails: booleanLike.optional(), - phoneNumber: zod_1.z.string().optional(), - customfields: customFieldsSchema, - users: usersSchema, -}) - .catchall(zod_1.z.unknown()); -exports.whmcsClientStatsSchema = zod_1.z - .record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()])) - .optional(); -exports.whmcsClientResponseSchema = zod_1.z - .object({ - result: zod_1.z.string().optional(), - client_id: numberLike.optional(), - client: exports.whmcsClientSchema, - stats: exports.whmcsClientStatsSchema, -}) - .catchall(zod_1.z.unknown()); -exports.whmcsAddClientResponseSchema = zod_1.z.object({ - clientid: zod_1.z.number(), -}); -exports.whmcsValidateLoginResponseSchema = zod_1.z.object({ - userid: zod_1.z.number(), - passwordhash: zod_1.z.string(), - pwresetkey: zod_1.z.string().optional(), -}); -exports.whmcsSsoResponseSchema = zod_1.z.object({ - redirect_url: zod_1.z.string(), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/customer/providers/whmcs/raw.types.js.map b/packages/domain/customer/providers/whmcs/raw.types.js.map deleted file mode 100644 index b89261ed..00000000 --- a/packages/domain/customer/providers/whmcs/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":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AM,EAAE;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/customer/schema.d.ts b/packages/domain/customer/schema.d.ts deleted file mode 100644 index b9894205..00000000 --- a/packages/domain/customer/schema.d.ts +++ /dev/null @@ -1,293 +0,0 @@ -import { z } from "zod"; -export declare const addressSchema: z.ZodObject<{ - address1: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; -}, z.core.$strip>; -export declare const addressFormSchema: z.ZodObject<{ - address1: z.ZodString; - address2: z.ZodOptional; - city: z.ZodString; - state: z.ZodString; - postcode: z.ZodString; - country: z.ZodString; - countryCode: z.ZodOptional; - phoneNumber: z.ZodOptional; - phoneCountryCode: z.ZodOptional; -}, z.core.$strip>; -export declare const userAuthSchema: z.ZodObject<{ - id: z.ZodString; - email: z.ZodString; - role: z.ZodEnum<{ - USER: "USER"; - ADMIN: "ADMIN"; - }>; - emailVerified: z.ZodBoolean; - mfaEnabled: z.ZodBoolean; - lastLoginAt: z.ZodOptional; - createdAt: z.ZodString; - updatedAt: z.ZodString; -}, z.core.$strip>; -declare const emailPreferencesSchema: z.ZodPipe>; - invoice: z.ZodOptional>; - support: z.ZodOptional>; - product: z.ZodOptional>; - domain: z.ZodOptional>; - affiliate: z.ZodOptional>; -}, z.core.$strip>, z.ZodTransform<{ - general: boolean | null | undefined; - invoice: boolean | null | undefined; - support: boolean | null | undefined; - product: boolean | null | undefined; - domain: boolean | null | undefined; - affiliate: boolean | null | undefined; -}, { - general?: string | number | boolean | undefined; - invoice?: string | number | boolean | undefined; - support?: string | number | boolean | undefined; - product?: string | number | boolean | undefined; - domain?: string | number | boolean | undefined; - affiliate?: string | number | boolean | undefined; -}>>; -declare const subUserSchema: z.ZodPipe; - name: z.ZodString; - email: z.ZodString; - is_owner: z.ZodOptional>; -}, z.core.$strip>, z.ZodTransform<{ - id: number; - name: string; - email: string; - is_owner: boolean | null | undefined; -}, { - id: string | number; - name: string; - email: string; - is_owner?: string | number | boolean | undefined; -}>>; -declare const statsSchema: z.ZodOptional>>; -export declare const whmcsClientSchema: z.ZodPipe; - email: z.ZodString; - firstname: z.ZodOptional>; - lastname: z.ZodOptional>; - fullname: z.ZodOptional>; - companyname: z.ZodOptional>; - phonenumber: z.ZodOptional>; - phonenumberformatted: z.ZodOptional>; - telephoneNumber: z.ZodOptional>; - status: z.ZodOptional>; - language: z.ZodOptional>; - defaultgateway: z.ZodOptional>; - defaultpaymethodid: z.ZodOptional>>; - currency: z.ZodOptional>>; - currency_code: z.ZodOptional>; - tax_id: z.ZodOptional>; - allowSingleSignOn: z.ZodOptional>>; - email_verified: z.ZodOptional>>; - marketing_emails_opt_in: z.ZodOptional>>; - notes: z.ZodOptional>; - datecreated: z.ZodOptional>; - lastlogin: z.ZodOptional>; - address: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; - }, z.core.$strip>>>; - email_preferences: z.ZodOptional>; - invoice: z.ZodOptional>; - support: z.ZodOptional>; - product: z.ZodOptional>; - domain: z.ZodOptional>; - affiliate: z.ZodOptional>; - }, z.core.$strip>, z.ZodTransform<{ - general: boolean | null | undefined; - invoice: boolean | null | undefined; - support: boolean | null | undefined; - product: boolean | null | undefined; - domain: boolean | null | undefined; - affiliate: boolean | null | undefined; - }, { - general?: string | number | boolean | undefined; - invoice?: string | number | boolean | undefined; - support?: string | number | boolean | undefined; - product?: string | number | boolean | undefined; - domain?: string | number | boolean | undefined; - affiliate?: string | number | boolean | undefined; - }>>>>; - customfields: z.ZodOptional>; - users: z.ZodOptional; - name: z.ZodString; - email: z.ZodString; - is_owner: z.ZodOptional>; - }, z.core.$strip>, z.ZodTransform<{ - id: number; - name: string; - email: string; - is_owner: boolean | null | undefined; - }, { - id: string | number; - name: string; - email: string; - is_owner?: string | number | boolean | undefined; - }>>>>; - stats: z.ZodOptional>>>; -}, z.core.$strip>, z.ZodTransform<{ - id: number; - allowSingleSignOn: boolean | null | undefined; - email_verified: boolean | null | undefined; - marketing_emails_opt_in: boolean | null | undefined; - defaultpaymethodid: number | null; - currency: number | null; - email: string; - firstname?: string | null | undefined; - lastname?: string | null | undefined; - fullname?: string | null | undefined; - companyname?: string | null | undefined; - phonenumber?: string | null | undefined; - phonenumberformatted?: string | null | undefined; - telephoneNumber?: string | null | undefined; - status?: string | null | undefined; - language?: string | null | undefined; - defaultgateway?: string | null | undefined; - currency_code?: string | null | undefined; - tax_id?: string | null | undefined; - notes?: string | null | undefined; - datecreated?: string | null | undefined; - lastlogin?: string | null | undefined; - address?: { - address1?: string | null | undefined; - address2?: string | null | undefined; - city?: string | null | undefined; - state?: string | null | undefined; - postcode?: string | null | undefined; - country?: string | null | undefined; - countryCode?: string | null | undefined; - phoneNumber?: string | null | undefined; - phoneCountryCode?: string | null | undefined; - } | null | undefined; - email_preferences?: { - general: boolean | null | undefined; - invoice: boolean | null | undefined; - support: boolean | null | undefined; - product: boolean | null | undefined; - domain: boolean | null | undefined; - affiliate: boolean | null | undefined; - } | null | undefined; - customfields?: Record | undefined; - users?: { - id: number; - name: string; - email: string; - is_owner: boolean | null | undefined; - }[] | undefined; - stats?: Record | undefined; -}, { - id: string | number; - email: string; - firstname?: string | null | undefined; - lastname?: string | null | undefined; - fullname?: string | null | undefined; - companyname?: string | null | undefined; - phonenumber?: string | null | undefined; - phonenumberformatted?: string | null | undefined; - telephoneNumber?: string | null | undefined; - status?: string | null | undefined; - language?: string | null | undefined; - defaultgateway?: string | null | undefined; - defaultpaymethodid?: string | number | null | undefined; - currency?: string | number | null | undefined; - currency_code?: string | null | undefined; - tax_id?: string | null | undefined; - allowSingleSignOn?: string | number | boolean | null | undefined; - email_verified?: string | number | boolean | null | undefined; - marketing_emails_opt_in?: string | number | boolean | null | undefined; - notes?: string | null | undefined; - datecreated?: string | null | undefined; - lastlogin?: string | null | undefined; - address?: { - address1?: string | null | undefined; - address2?: string | null | undefined; - city?: string | null | undefined; - state?: string | null | undefined; - postcode?: string | null | undefined; - country?: string | null | undefined; - countryCode?: string | null | undefined; - phoneNumber?: string | null | undefined; - phoneCountryCode?: string | null | undefined; - } | null | undefined; - email_preferences?: { - general: boolean | null | undefined; - invoice: boolean | null | undefined; - support: boolean | null | undefined; - product: boolean | null | undefined; - domain: boolean | null | undefined; - affiliate: boolean | null | undefined; - } | null | undefined; - customfields?: Record | undefined; - users?: { - id: number; - name: string; - email: string; - is_owner: boolean | null | undefined; - }[] | undefined; - stats?: Record | undefined; -}>>; -export declare const userSchema: z.ZodObject<{ - id: z.ZodString; - email: z.ZodString; - role: z.ZodEnum<{ - USER: "USER"; - ADMIN: "ADMIN"; - }>; - emailVerified: z.ZodBoolean; - mfaEnabled: z.ZodBoolean; - lastLoginAt: z.ZodOptional; - createdAt: z.ZodString; - updatedAt: z.ZodString; - firstname: z.ZodOptional>; - lastname: z.ZodOptional>; - fullname: z.ZodOptional>; - companyname: z.ZodOptional>; - phonenumber: z.ZodOptional>; - language: z.ZodOptional>; - currencyCode: z.ZodOptional>; - address: z.ZodOptional>; - address2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postcode: z.ZodOptional>; - country: z.ZodOptional>; - countryCode: z.ZodOptional>; - phoneNumber: z.ZodOptional>; - phoneCountryCode: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare function addressFormToRequest(form: AddressFormData): Address; -export declare function combineToUser(userAuth: UserAuth, whmcsClient: WhmcsClient): User; -export type User = z.infer; -export type UserAuth = z.infer; -export type UserRole = "USER" | "ADMIN"; -export type Address = z.infer; -export type AddressFormData = z.infer; -export type WhmcsClient = z.infer; -export type EmailPreferences = z.infer; -export type SubUser = z.infer; -export type Stats = z.infer; -export { emailPreferencesSchema, subUserSchema, statsSchema }; diff --git a/packages/domain/customer/schema.js b/packages/domain/customer/schema.js deleted file mode 100644 index bb3ba81e..00000000 --- a/packages/domain/customer/schema.js +++ /dev/null @@ -1,174 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.statsSchema = exports.subUserSchema = exports.emailPreferencesSchema = exports.userSchema = exports.whmcsClientSchema = exports.userAuthSchema = exports.addressFormSchema = exports.addressSchema = void 0; -exports.addressFormToRequest = addressFormToRequest; -exports.combineToUser = combineToUser; -const zod_1 = require("zod"); -const schema_1 = require("../common/schema"); -const stringOrNull = zod_1.z.union([zod_1.z.string(), zod_1.z.null()]); -const booleanLike = zod_1.z.union([zod_1.z.boolean(), zod_1.z.number(), zod_1.z.string()]); -const numberLike = zod_1.z.union([zod_1.z.number(), zod_1.z.string()]); -const normalizeBoolean = (value) => { - if (value === undefined) - return undefined; - if (value === null) - return null; - if (typeof value === "boolean") - return value; - if (typeof value === "number") - return value === 1; - if (typeof value === "string") { - const normalized = value.trim().toLowerCase(); - return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "on"; - } - return null; -}; -exports.addressSchema = zod_1.z.object({ - address1: stringOrNull.optional(), - address2: stringOrNull.optional(), - city: stringOrNull.optional(), - state: stringOrNull.optional(), - postcode: stringOrNull.optional(), - country: stringOrNull.optional(), - countryCode: stringOrNull.optional(), - phoneNumber: stringOrNull.optional(), - phoneCountryCode: stringOrNull.optional(), -}); -exports.addressFormSchema = zod_1.z.object({ - address1: zod_1.z.string().min(1, "Address line 1 is required").max(200, "Address line 1 is too long").trim(), - address2: zod_1.z.string().max(200, "Address line 2 is too long").trim().optional(), - city: zod_1.z.string().min(1, "City is required").max(100, "City name is too long").trim(), - state: zod_1.z.string().min(1, "State/Prefecture is required").max(100, "State/Prefecture name is too long").trim(), - postcode: zod_1.z.string().min(1, "Postcode is required").max(20, "Postcode is too long").trim(), - country: zod_1.z.string().min(1, "Country is required").max(100, "Country name is too long").trim(), - countryCode: schema_1.countryCodeSchema.optional(), - phoneNumber: zod_1.z.string().optional(), - phoneCountryCode: zod_1.z.string().optional(), -}); -exports.userAuthSchema = zod_1.z.object({ - id: zod_1.z.string().uuid(), - email: zod_1.z.string().email(), - role: zod_1.z.enum(["USER", "ADMIN"]), - emailVerified: zod_1.z.boolean(), - mfaEnabled: zod_1.z.boolean(), - lastLoginAt: zod_1.z.string().optional(), - createdAt: zod_1.z.string(), - updatedAt: zod_1.z.string(), -}); -const emailPreferencesSchema = zod_1.z.object({ - general: booleanLike.optional(), - invoice: booleanLike.optional(), - support: booleanLike.optional(), - product: booleanLike.optional(), - domain: booleanLike.optional(), - affiliate: booleanLike.optional(), -}).transform(prefs => ({ - general: normalizeBoolean(prefs.general), - invoice: normalizeBoolean(prefs.invoice), - support: normalizeBoolean(prefs.support), - product: normalizeBoolean(prefs.product), - domain: normalizeBoolean(prefs.domain), - affiliate: normalizeBoolean(prefs.affiliate), -})); -exports.emailPreferencesSchema = emailPreferencesSchema; -const subUserSchema = zod_1.z.object({ - id: numberLike, - name: zod_1.z.string(), - email: zod_1.z.string(), - is_owner: booleanLike.optional(), -}).transform(user => ({ - id: Number(user.id), - name: user.name, - email: user.email, - is_owner: normalizeBoolean(user.is_owner), -})); -exports.subUserSchema = subUserSchema; -const statsSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()])).optional(); -exports.statsSchema = statsSchema; -exports.whmcsClientSchema = zod_1.z.object({ - id: numberLike, - email: zod_1.z.string(), - firstname: zod_1.z.string().nullable().optional(), - lastname: zod_1.z.string().nullable().optional(), - fullname: zod_1.z.string().nullable().optional(), - companyname: zod_1.z.string().nullable().optional(), - phonenumber: zod_1.z.string().nullable().optional(), - phonenumberformatted: zod_1.z.string().nullable().optional(), - telephoneNumber: zod_1.z.string().nullable().optional(), - status: zod_1.z.string().nullable().optional(), - language: zod_1.z.string().nullable().optional(), - defaultgateway: zod_1.z.string().nullable().optional(), - defaultpaymethodid: numberLike.nullable().optional(), - currency: numberLike.nullable().optional(), - currency_code: zod_1.z.string().nullable().optional(), - tax_id: zod_1.z.string().nullable().optional(), - allowSingleSignOn: booleanLike.nullable().optional(), - email_verified: booleanLike.nullable().optional(), - marketing_emails_opt_in: booleanLike.nullable().optional(), - notes: zod_1.z.string().nullable().optional(), - datecreated: zod_1.z.string().nullable().optional(), - lastlogin: zod_1.z.string().nullable().optional(), - address: exports.addressSchema.nullable().optional(), - email_preferences: emailPreferencesSchema.nullable().optional(), - customfields: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(), - users: zod_1.z.array(subUserSchema).optional(), - stats: statsSchema.optional(), -}).transform(data => ({ - ...data, - id: typeof data.id === 'number' ? data.id : Number(data.id), - allowSingleSignOn: normalizeBoolean(data.allowSingleSignOn), - email_verified: normalizeBoolean(data.email_verified), - marketing_emails_opt_in: normalizeBoolean(data.marketing_emails_opt_in), - defaultpaymethodid: data.defaultpaymethodid ? Number(data.defaultpaymethodid) : null, - currency: data.currency ? Number(data.currency) : null, -})); -exports.userSchema = exports.userAuthSchema.extend({ - firstname: zod_1.z.string().nullable().optional(), - lastname: zod_1.z.string().nullable().optional(), - fullname: zod_1.z.string().nullable().optional(), - companyname: zod_1.z.string().nullable().optional(), - phonenumber: zod_1.z.string().nullable().optional(), - language: zod_1.z.string().nullable().optional(), - currencyCode: zod_1.z.string().nullable().optional(), - address: exports.addressSchema.optional(), -}); -function addressFormToRequest(form) { - const emptyToNull = (value) => { - if (value === undefined) - return undefined; - const trimmed = value?.trim(); - return trimmed ? trimmed : null; - }; - return exports.addressSchema.parse({ - address1: emptyToNull(form.address1), - address2: emptyToNull(form.address2 ?? null), - city: emptyToNull(form.city), - state: emptyToNull(form.state), - postcode: emptyToNull(form.postcode), - country: emptyToNull(form.country), - countryCode: emptyToNull(form.countryCode ?? null), - phoneNumber: emptyToNull(form.phoneNumber ?? null), - phoneCountryCode: emptyToNull(form.phoneCountryCode ?? null), - }); -} -function combineToUser(userAuth, whmcsClient) { - return exports.userSchema.parse({ - id: userAuth.id, - email: userAuth.email, - role: userAuth.role, - emailVerified: userAuth.emailVerified, - mfaEnabled: userAuth.mfaEnabled, - lastLoginAt: userAuth.lastLoginAt, - createdAt: userAuth.createdAt, - updatedAt: userAuth.updatedAt, - firstname: whmcsClient.firstname || null, - lastname: whmcsClient.lastname || null, - fullname: whmcsClient.fullname || null, - companyname: whmcsClient.companyname || null, - phonenumber: whmcsClient.phonenumberformatted || whmcsClient.phonenumber || whmcsClient.telephoneNumber || null, - language: whmcsClient.language || null, - currencyCode: whmcsClient.currency_code || null, - address: whmcsClient.address || undefined, - }); -} -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/customer/schema.js.map b/packages/domain/customer/schema.js.map deleted file mode 100644 index c1950fac..00000000 --- a/packages/domain/customer/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AA+OA,oDAkBC;AAYD,sCAsBC;AAvRD,6BAAwB;AAExB,6CAAqD;AAMrD,MAAM,YAAY,GAAG,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACrD,MAAM,WAAW,GAAG,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACnE,MAAM,UAAU,GAAG,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAKrD,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAA8B,EAAE;IACtE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,KAAK,KAA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AE,QAAQ,CAAC,WAAW;QACjC,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,SAAS,EAAE,QAAQ,CAAC,SAAS;QAG7B,SAAS,EAAE,WAAW,CAAC,SAAS,IAAI,IAAI;QACxC,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,IAAI;QACtC,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,IAAI;QACtC,WAAW,EAAE,WAAW,CAAC,WAAW,IAAI,IAAI;QAC5C,WAAW,EAAE,WAAW,CAAC,oBAAoB,IAAI,WAAW,CAAC,WAAW,IAAI,WAAW,CAAC,eAAe,IAAI,IAAI;QAC/G,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,IAAI;QACtC,YAAY,EAAE,WAAW,CAAC,aAAa,IAAI,IAAI;QAC/C,OAAO,EAAE,WAAW,CAAC,OAAO,IAAI,SAAS;KAC1C,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/packages/domain/dashboard/contract.d.ts b/packages/domain/dashboard/contract.d.ts deleted file mode 100644 index 88acb593..00000000 --- a/packages/domain/dashboard/contract.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { IsoDateTimeString } from "../common/types"; -import type { Invoice } from "../billing/contract"; -export type ActivityType = "invoice_created" | "invoice_paid" | "service_activated" | "case_created" | "case_closed"; -export interface Activity { - id: string; - type: ActivityType; - title: string; - description?: string; - date: IsoDateTimeString; - relatedId?: number; - metadata?: Record; -} -export interface DashboardStats { - activeSubscriptions: number; - unpaidInvoices: number; - openCases: number; - recentOrders?: number; - totalSpent?: number; - currency: string; -} -export interface NextInvoice { - id: number; - dueDate: IsoDateTimeString; - amount: number; - currency: string; -} -export interface DashboardSummary { - stats: DashboardStats; - nextInvoice: NextInvoice | null; - recentActivity: Activity[]; -} -export interface DashboardError { - code: string; - message: string; - details?: Record; -} -export type ActivityFilter = "all" | "billing" | "orders" | "support"; -export interface ActivityFilterConfig { - key: ActivityFilter; - label: string; - types?: ActivityType[]; -} -export interface DashboardSummaryResponse extends DashboardSummary { - invoices?: Invoice[]; -} diff --git a/packages/domain/dashboard/contract.js b/packages/domain/dashboard/contract.js deleted file mode 100644 index b47942b1..00000000 --- a/packages/domain/dashboard/contract.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/dashboard/contract.js.map b/packages/domain/dashboard/contract.js.map deleted file mode 100644 index 3cab6a3a..00000000 --- a/packages/domain/dashboard/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domain/dashboard/index.d.ts b/packages/domain/dashboard/index.d.ts deleted file mode 100644 index 52ef7a81..00000000 --- a/packages/domain/dashboard/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./contract"; diff --git a/packages/domain/dashboard/index.js b/packages/domain/dashboard/index.js deleted file mode 100644 index 28d53086..00000000 --- a/packages/domain/dashboard/index.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./contract"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/dashboard/index.js.map b/packages/domain/dashboard/index.js.map deleted file mode 100644 index 0b846a2d..00000000 --- a/packages/domain/dashboard/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,6CAA2B"} \ No newline at end of file diff --git a/packages/domain/dashboard/schema.ts b/packages/domain/dashboard/schema.ts index a8c94298..f1fb340a 100644 --- a/packages/domain/dashboard/schema.ts +++ b/packages/domain/dashboard/schema.ts @@ -19,6 +19,28 @@ export const activitySchema = z.object({ metadata: z.record(z.string(), z.unknown()).optional(), }); +export const invoiceActivityMetadataSchema = z + .object({ + amount: z.number(), + currency: z.string().optional(), + dueDate: z.string().optional(), + invoiceNumber: z.string().optional(), + status: z.string().optional(), + }) + .partial() + .refine(data => typeof data.amount === "number", { + message: "amount is required", + path: ["amount"], + }); + +export const serviceActivityMetadataSchema = z + .object({ + productName: z.string().optional(), + registrationDate: z.string().optional(), + status: z.string().optional(), + }) + .partial(); + export const dashboardStatsSchema = z.object({ activeSubscriptions: z.number().int().nonnegative(), unpaidInvoices: z.number().int().nonnegative(), @@ -58,3 +80,6 @@ export const activityFilterConfigSchema = z.object({ export const dashboardSummaryResponseSchema = dashboardSummarySchema.extend({ invoices: z.array(invoiceSchema).optional(), }); + +export type InvoiceActivityMetadata = z.infer; +export type ServiceActivityMetadata = z.infer; diff --git a/packages/domain/mappings/contract.d.ts b/packages/domain/mappings/contract.d.ts deleted file mode 100644 index b08f9f02..00000000 --- a/packages/domain/mappings/contract.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { IsoDateTimeString } from "../common/types"; -export interface UserIdMapping { - id: string; - userId: string; - whmcsClientId: number; - sfAccountId?: string | null; - createdAt: IsoDateTimeString | Date; - updatedAt: IsoDateTimeString | Date; -} -export interface CreateMappingRequest { - userId: string; - whmcsClientId: number; - sfAccountId?: string; -} -export interface UpdateMappingRequest { - whmcsClientId?: number; - sfAccountId?: string; -} -export interface MappingValidationResult { - isValid: boolean; - errors: string[]; - warnings: string[]; -} diff --git a/packages/domain/mappings/contract.js b/packages/domain/mappings/contract.js deleted file mode 100644 index b47942b1..00000000 --- a/packages/domain/mappings/contract.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/mappings/contract.js.map b/packages/domain/mappings/contract.js.map deleted file mode 100644 index 3cab6a3a..00000000 --- a/packages/domain/mappings/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domain/mappings/index.d.ts b/packages/domain/mappings/index.d.ts deleted file mode 100644 index 94bbacaa..00000000 --- a/packages/domain/mappings/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./contract"; -export * from "./schema"; -export * from "./validation"; -export type { MappingSearchFilters, MappingStats, BulkMappingOperation, BulkMappingResult, } from "./schema"; -export type { MappingValidationResult } from "./contract"; diff --git a/packages/domain/mappings/index.js b/packages/domain/mappings/index.js deleted file mode 100644 index b675b689..00000000 --- a/packages/domain/mappings/index.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./contract"), exports); -__exportStar(require("./schema"), exports); -__exportStar(require("./validation"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/mappings/index.js.map b/packages/domain/mappings/index.js.map deleted file mode 100644 index 63dd843e..00000000 --- a/packages/domain/mappings/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,6CAA2B;AAC3B,2CAAyB;AACzB,+CAA6B"} \ No newline at end of file diff --git a/packages/domain/mappings/schema.d.ts b/packages/domain/mappings/schema.d.ts deleted file mode 100644 index eb53c676..00000000 --- a/packages/domain/mappings/schema.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { z } from "zod"; -import type { CreateMappingRequest, UpdateMappingRequest, UserIdMapping } from "./contract"; -export declare const createMappingRequestSchema: z.ZodType; -export declare const updateMappingRequestSchema: z.ZodType; -export declare const userIdMappingSchema: z.ZodType; -export declare const mappingSearchFiltersSchema: z.ZodObject<{ - userId: z.ZodOptional; - whmcsClientId: z.ZodOptional; - sfAccountId: z.ZodOptional; - hasWhmcsMapping: z.ZodOptional; - hasSfMapping: z.ZodOptional; -}, z.core.$strip>; -export declare const mappingStatsSchema: z.ZodObject<{ - totalMappings: z.ZodNumber; - whmcsMappings: z.ZodNumber; - salesforceMappings: z.ZodNumber; - completeMappings: z.ZodNumber; - orphanedMappings: z.ZodNumber; -}, z.core.$strip>; -export declare const bulkMappingOperationSchema: z.ZodObject<{ - operation: z.ZodEnum<{ - create: "create"; - update: "update"; - delete: "delete"; - }>; - mappings: z.ZodUnion>>, z.ZodArray>>, z.ZodArray]>; -}, z.core.$strip>; -export declare const bulkMappingResultSchema: z.ZodObject<{ - successful: z.ZodNumber; - failed: z.ZodNumber; - errors: z.ZodArray>; -}, z.core.$strip>; -export type MappingSearchFilters = z.infer; -export type MappingStats = z.infer; -export type BulkMappingOperation = z.infer; -export type BulkMappingResult = z.infer; diff --git a/packages/domain/mappings/schema.js b/packages/domain/mappings/schema.js deleted file mode 100644 index 7b93d6bb..00000000 --- a/packages/domain/mappings/schema.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bulkMappingResultSchema = exports.bulkMappingOperationSchema = exports.mappingStatsSchema = exports.mappingSearchFiltersSchema = exports.userIdMappingSchema = exports.updateMappingRequestSchema = exports.createMappingRequestSchema = void 0; -const zod_1 = require("zod"); -exports.createMappingRequestSchema = zod_1.z.object({ - userId: zod_1.z.string().uuid(), - whmcsClientId: zod_1.z.number().int().positive(), - sfAccountId: zod_1.z - .string() - .min(1, "Salesforce account ID must be at least 1 character") - .optional(), -}); -exports.updateMappingRequestSchema = zod_1.z.object({ - whmcsClientId: zod_1.z.number().int().positive().optional(), - sfAccountId: zod_1.z - .string() - .min(1, "Salesforce account ID must be at least 1 character") - .optional(), -}); -exports.userIdMappingSchema = zod_1.z.object({ - id: zod_1.z.string().uuid(), - userId: zod_1.z.string().uuid(), - whmcsClientId: zod_1.z.number().int().positive(), - sfAccountId: zod_1.z.string().nullable().optional(), - createdAt: zod_1.z.union([zod_1.z.string(), zod_1.z.date()]), - updatedAt: zod_1.z.union([zod_1.z.string(), zod_1.z.date()]), -}); -exports.mappingSearchFiltersSchema = zod_1.z.object({ - userId: zod_1.z.string().uuid().optional(), - whmcsClientId: zod_1.z.number().int().positive().optional(), - sfAccountId: zod_1.z.string().optional(), - hasWhmcsMapping: zod_1.z.boolean().optional(), - hasSfMapping: zod_1.z.boolean().optional(), -}); -exports.mappingStatsSchema = zod_1.z.object({ - totalMappings: zod_1.z.number().int().nonnegative(), - whmcsMappings: zod_1.z.number().int().nonnegative(), - salesforceMappings: zod_1.z.number().int().nonnegative(), - completeMappings: zod_1.z.number().int().nonnegative(), - orphanedMappings: zod_1.z.number().int().nonnegative(), -}); -exports.bulkMappingOperationSchema = zod_1.z.object({ - operation: zod_1.z.enum(["create", "update", "delete"]), - mappings: zod_1.z.union([ - zod_1.z.array(exports.createMappingRequestSchema), - zod_1.z.array(exports.updateMappingRequestSchema), - zod_1.z.array(zod_1.z.string().uuid()), - ]), -}); -exports.bulkMappingResultSchema = zod_1.z.object({ - successful: zod_1.z.number().int().nonnegative(), - failed: zod_1.z.number().int().nonnegative(), - errors: zod_1.z.array(zod_1.z.object({ - index: zod_1.z.number().int().nonnegative(), - error: zod_1.z.string(), - data: zod_1.z.unknown(), - })), -}); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/mappings/schema.js.map b/packages/domain/mappings/schema.js.map deleted file mode 100644 index cce33661..00000000 --- a/packages/domain/mappings/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAIA,6BAAwB;AAOX,QAAA,0BAA0B,GAAoC,OAAC,CAAC,MAAM,CAAC;IAClF,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACzB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC1C,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,oDAAoD,CAAC;SAC5D,QAAQ,EAAE;CACd,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAoC,OAAC,CAAC,MAAM,CAAC;IAClF,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACrD,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,oDAAoD,CAAC;SAC5D,QAAQ,EAAE;CACd,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAA6B,OAAC,CAAC,MAAM,CAAC;IACpE,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACzB,aAAa,EAAE,OAAC,CAAC,M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GAAG,EAAE,CAAC,WAAW,EAAE;CACjD,CAAC,CAAC;AAMU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,SAAS,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjD,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC;QAChB,OAAC,CAAC,KAAK,CAAC,kCAA0B,CAAC;QACnC,OAAC,CAAC,KAAK,CAAC,kCAA0B,CAAC;QACnC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;KAC3B,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC1C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACtC,MAAM,EAAE,OAAC,CAAC,KAAK,CACb,OAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACrC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;QACjB,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE;KAClB,CAAC,CACH;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/mappings/validation.d.ts b/packages/domain/mappings/validation.d.ts deleted file mode 100644 index 0d93c136..00000000 --- a/packages/domain/mappings/validation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CreateMappingRequest, UpdateMappingRequest, UserIdMapping, MappingValidationResult } from "./contract"; -export declare function checkMappingCompleteness(request: CreateMappingRequest | UserIdMapping): string[]; -export declare function validateNoConflicts(request: CreateMappingRequest, existingMappings: UserIdMapping[]): MappingValidationResult; -export declare function validateDeletion(mapping: UserIdMapping | null | undefined): MappingValidationResult; -export declare function sanitizeCreateRequest(request: CreateMappingRequest): CreateMappingRequest; -export declare function sanitizeUpdateRequest(request: UpdateMappingRequest): UpdateMappingRequest; diff --git a/packages/domain/mappings/validation.js b/packages/domain/mappings/validation.js deleted file mode 100644 index 0c2c86ea..00000000 --- a/packages/domain/mappings/validation.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkMappingCompleteness = checkMappingCompleteness; -exports.validateNoConflicts = validateNoConflicts; -exports.validateDeletion = validateDeletion; -exports.sanitizeCreateRequest = sanitizeCreateRequest; -exports.sanitizeUpdateRequest = sanitizeUpdateRequest; -function checkMappingCompleteness(request) { - const warnings = []; - if (!request.sfAccountId) { - warnings.push("Salesforce account ID not provided - mapping will be incomplete"); - } - return warnings; -} -function validateNoConflicts(request, existingMappings) { - const errors = []; - const warnings = []; - const duplicateUser = existingMappings.find(m => m.userId === request.userId); - if (duplicateUser) { - errors.push(`User ${request.userId} already has a mapping`); - } - const duplicateWhmcs = existingMappings.find(m => m.whmcsClientId === request.whmcsClientId); - if (duplicateWhmcs) { - errors.push(`WHMCS client ${request.whmcsClientId} is already mapped to user ${duplicateWhmcs.userId}`); - } - if (request.sfAccountId) { - const duplicateSf = existingMappings.find(m => m.sfAccountId === request.sfAccountId); - if (duplicateSf) { - warnings.push(`Salesforce account ${request.sfAccountId} is already mapped to user ${duplicateSf.userId}`); - } - } - return { isValid: errors.length === 0, errors, warnings }; -} -function validateDeletion(mapping) { - const errors = []; - const warnings = []; - if (!mapping) { - errors.push("Cannot delete non-existent mapping"); - return { isValid: false, errors, warnings }; - } - warnings.push("Deleting this mapping will prevent access to WHMCS/Salesforce data for this user"); - if (mapping.sfAccountId) { - warnings.push("This mapping includes Salesforce integration - deletion will affect case management"); - } - return { isValid: true, errors, warnings }; -} -function sanitizeCreateRequest(request) { - return { - userId: request.userId?.trim(), - whmcsClientId: request.whmcsClientId, - sfAccountId: request.sfAccountId?.trim() || undefined, - }; -} -function sanitizeUpdateRequest(request) { - const sanitized = {}; - if (request.whmcsClientId !== undefined) { - sanitized.whmcsClientId = request.whmcsClientId; - } - if (request.sfAccountId !== undefined) { - sanitized.sfAccountId = request.sfAccountId?.trim() || undefined; - } - return sanitized; -} -//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/packages/domain/mappings/validation.js.map b/packages/domain/mappings/validation.js.map deleted file mode 100644 index 34445071..00000000 --- a/packages/domain/mappings/validation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;AAwBA,4DAMC;AASD,kDA8BC;AASD,4CAmBC;AAQD,sDAMC;AAQD,sDAYC;AA3GD,SAAgB,wBAAwB,CAAC,OAA6C;IACpF,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACzB,QAAQ,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AASD,SAAgB,mBAAmB,CACjC,OAA6B,EAC7B,gBAAiC;IAEjC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAG9B,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9E,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,MAAM,wBAAwB,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,cAAc,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7F,IAAI,cAAc,EAAE,CAAC;QAC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WAAW,EAAE,IAAI,EAAE,IAAI,SAAS;KACtD,CAAC;AACJ,CAAC;AAQD,SAAgB,qBAAqB,CAAC,OAA6B;IACjE,MAAM,SAAS,GAAkC,EAAE,CAAC;IAEpD,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACxC,SAAS,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAClD,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACtC,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IACnE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"} \ No newline at end of file diff --git a/packages/domain/orders/contract.d.ts b/packages/domain/orders/contract.d.ts deleted file mode 100644 index 924bb388..00000000 --- a/packages/domain/orders/contract.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { UserIdMapping } from "../mappings/contract"; -export declare const ORDER_TYPE: { - readonly INTERNET: "Internet"; - readonly SIM: "SIM"; - readonly VPN: "VPN"; - readonly OTHER: "Other"; -}; -export type OrderTypeValue = (typeof ORDER_TYPE)[keyof typeof ORDER_TYPE]; -export declare const ORDER_STATUS: { - readonly DRAFT: "Draft"; - readonly ACTIVATED: "Activated"; - readonly PENDING: "Pending"; - readonly FAILED: "Failed"; - readonly CANCELLED: "Cancelled"; -}; -export type OrderStatusValue = (typeof ORDER_STATUS)[keyof typeof ORDER_STATUS]; -export declare const ACTIVATION_TYPE: { - readonly IMMEDIATE: "Immediate"; - readonly SCHEDULED: "Scheduled"; -}; -export type ActivationTypeValue = (typeof ACTIVATION_TYPE)[keyof typeof ACTIVATION_TYPE]; -export declare const SIM_TYPE: { - readonly ESIM: "eSIM"; - readonly PHYSICAL: "Physical SIM"; -}; -export type SimTypeValue = (typeof SIM_TYPE)[keyof typeof SIM_TYPE]; -export declare const ORDER_FULFILLMENT_ERROR_CODE: { - readonly PAYMENT_METHOD_MISSING: "PAYMENT_METHOD_MISSING"; - readonly ORDER_NOT_FOUND: "ORDER_NOT_FOUND"; - readonly WHMCS_ERROR: "WHMCS_ERROR"; - readonly MAPPING_ERROR: "MAPPING_ERROR"; - readonly VALIDATION_ERROR: "VALIDATION_ERROR"; - readonly SALESFORCE_ERROR: "SALESFORCE_ERROR"; - readonly PROVISIONING_ERROR: "PROVISIONING_ERROR"; -}; -export type OrderFulfillmentErrorCode = (typeof ORDER_FULFILLMENT_ERROR_CODE)[keyof typeof ORDER_FULFILLMENT_ERROR_CODE]; -export type OrderCreationType = "Internet" | "SIM" | "VPN" | "Other"; -export type OrderStatus = string; -export type OrderType = string; -export type UserMapping = Pick; -export type { OrderItemSummary, OrderItemDetails, OrderSummary, OrderDetails, OrderQueryParams, OrderConfigurationsAddress, OrderConfigurations, CreateOrderRequest, OrderBusinessValidation, SfOrderIdParam, } from './schema'; diff --git a/packages/domain/orders/contract.js b/packages/domain/orders/contract.js deleted file mode 100644 index ab4ef252..00000000 --- a/packages/domain/orders/contract.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ORDER_FULFILLMENT_ERROR_CODE = exports.SIM_TYPE = exports.ACTIVATION_TYPE = exports.ORDER_STATUS = exports.ORDER_TYPE = void 0; -exports.ORDER_TYPE = { - INTERNET: "Internet", - SIM: "SIM", - VPN: "VPN", - OTHER: "Other", -}; -exports.ORDER_STATUS = { - DRAFT: "Draft", - ACTIVATED: "Activated", - PENDING: "Pending", - FAILED: "Failed", - CANCELLED: "Cancelled", -}; -exports.ACTIVATION_TYPE = { - IMMEDIATE: "Immediate", - SCHEDULED: "Scheduled", -}; -exports.SIM_TYPE = { - ESIM: "eSIM", - PHYSICAL: "Physical SIM", -}; -exports.ORDER_FULFILLMENT_ERROR_CODE = { - PAYMENT_METHOD_MISSING: "PAYMENT_METHOD_MISSING", - ORDER_NOT_FOUND: "ORDER_NOT_FOUND", - WHMCS_ERROR: "WHMCS_ERROR", - MAPPING_ERROR: "MAPPING_ERROR", - VALIDATION_ERROR: "VALIDATION_ERROR", - SALESFORCE_ERROR: "SALESFORCE_ERROR", - PROVISIONING_ERROR: "PROVISIONING_ERROR", -}; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/orders/contract.js.map b/packages/domain/orders/contract.js.map deleted file mode 100644 index d2ff01e6..00000000 --- a/packages/domain/orders/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":";;;AAkBa,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACN,CAAC;AAWE,QAAA,YAAY,GAAG;IAC1B,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACd,CAAC;AAWE,QAAA,eAAe,GAAG;IAC7B,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;CACd,CAAC;AAWE,QAAA,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,cAAc;CAChB,CAAC;AAYE,QAAA,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,wBAAwB;IAChD,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;CAChC,CAAC"} \ No newline at end of file diff --git a/packages/domain/orders/helpers.ts b/packages/domain/orders/helpers.ts index cf121c52..3a2b0d2e 100644 --- a/packages/domain/orders/helpers.ts +++ b/packages/domain/orders/helpers.ts @@ -1,4 +1,9 @@ -import { orderConfigurationsSchema, type OrderConfigurations } from "./schema"; +import { + orderConfigurationsSchema, + orderSelectionsSchema, + type OrderConfigurations, + type OrderSelections, +} from "./schema"; import type { SimConfigureFormData } from "../sim"; export interface BuildSimOrderConfigurationsOptions { @@ -69,3 +74,7 @@ export function buildSimOrderConfigurations( return orderConfigurationsSchema.parse(base); } + +export function normalizeOrderSelections(value: unknown): OrderSelections { + return orderSelectionsSchema.parse(value); +} diff --git a/packages/domain/orders/index.d.ts b/packages/domain/orders/index.d.ts deleted file mode 100644 index 5bc972e0..00000000 --- a/packages/domain/orders/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { type OrderCreationType, type OrderStatus, type OrderType, type UserMapping, ORDER_TYPE, ORDER_STATUS, ACTIVATION_TYPE, SIM_TYPE, ORDER_FULFILLMENT_ERROR_CODE, type OrderFulfillmentErrorCode, } from "./contract"; -export * from "./schema"; -export * from "./validation"; -export type { OrderItemSummary, OrderItemDetails, OrderSummary, OrderDetails, OrderQueryParams, OrderConfigurationsAddress, OrderConfigurations, CreateOrderRequest, OrderBusinessValidation, SfOrderIdParam, } from './schema'; -export * as Providers from "./providers/index"; -export * from "./providers/whmcs/raw.types"; -export * from "./providers/salesforce/raw.types"; diff --git a/packages/domain/orders/index.js b/packages/domain/orders/index.js deleted file mode 100644 index 19d8a707..00000000 --- a/packages/domain/orders/index.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Providers = exports.ORDER_FULFILLMENT_ERROR_CODE = exports.SIM_TYPE = exports.ACTIVATION_TYPE = exports.ORDER_STATUS = exports.ORDER_TYPE = void 0; -var contract_1 = require("./contract"); -Object.defineProperty(exports, "ORDER_TYPE", { enumerable: true, get: function () { return contract_1.ORDER_TYPE; } }); -Object.defineProperty(exports, "ORDER_STATUS", { enumerable: true, get: function () { return contract_1.ORDER_STATUS; } }); -Object.defineProperty(exports, "ACTIVATION_TYPE", { enumerable: true, get: function () { return contract_1.ACTIVATION_TYPE; } }); -Object.defineProperty(exports, "SIM_TYPE", { enumerable: true, get: function () { return contract_1.SIM_TYPE; } }); -Object.defineProperty(exports, "ORDER_FULFILLMENT_ERROR_CODE", { enumerable: true, get: function () { return contract_1.ORDER_FULFILLMENT_ERROR_CODE; } }); -__exportStar(require("./schema"), exports); -__exportStar(require("./validation"), exports); -exports.Providers = __importStar(require("./providers/index")); -__exportStar(require("./providers/whmcs/raw.types"), exports); -__exportStar(require("./providers/salesforce/raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/orders/index.js.map b/packages/domain/orders/index.js.map deleted file mode 100644 index facfc20d..00000000 --- a/packages/domain/orders/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,uCAYoB;AANlB,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,oGAAA,QAAQ,OAAA;AACR,wHAAA,4BAA4B,OAAA;AAK9B,2CAAyB;AAGzB,+CAA6B;AAoB7B,+DAA+C;AAG/C,8DAA4C;AAC5C,mEAAiD"} \ No newline at end of file diff --git a/packages/domain/orders/index.ts b/packages/domain/orders/index.ts index ae972805..e89f631c 100644 --- a/packages/domain/orders/index.ts +++ b/packages/domain/orders/index.ts @@ -38,6 +38,7 @@ export * from "./validation"; export * from "./utils"; export { buildSimOrderConfigurations, + normalizeOrderSelections, type BuildSimOrderConfigurationsOptions, } from "./helpers"; diff --git a/packages/domain/orders/providers/index.d.ts b/packages/domain/orders/providers/index.d.ts deleted file mode 100644 index 99388a25..00000000 --- a/packages/domain/orders/providers/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as WhmcsMapper from "./whmcs/mapper"; -import * as WhmcsRaw from "./whmcs/raw.types"; -import * as SalesforceMapper from "./salesforce/mapper"; -import * as SalesforceRaw from "./salesforce/raw.types"; -export declare const Whmcs: { - mapper: typeof WhmcsMapper; - raw: typeof WhmcsRaw; - mapOrderItemToWhmcs(item: import("..").OrderItemDetails, index?: number): WhmcsRaw.WhmcsOrderItem; - mapOrderToWhmcsItems(orderDetails: import("..").OrderDetails): WhmcsMapper.OrderItemMappingResult; - buildWhmcsAddOrderPayload(params: WhmcsRaw.WhmcsAddOrderParams): WhmcsRaw.WhmcsAddOrderPayload; - createOrderNotes(sfOrderId: string, additionalNotes?: string): string; -}; -export declare const Salesforce: { - mapper: typeof SalesforceMapper; - raw: typeof SalesforceRaw; - transformSalesforceOrderItem(record: SalesforceRaw.SalesforceOrderItemRecord): { - details: import("..").OrderItemDetails; - summary: import("..").OrderItemSummary; - }; - transformSalesforceOrderDetails(order: SalesforceRaw.SalesforceOrderRecord, itemRecords: SalesforceRaw.SalesforceOrderItemRecord[]): import("..").OrderDetails; - transformSalesforceOrderSummary(order: SalesforceRaw.SalesforceOrderRecord, itemRecords: SalesforceRaw.SalesforceOrderItemRecord[]): import("..").OrderSummary; -}; -export { WhmcsMapper, WhmcsRaw, SalesforceMapper, SalesforceRaw, }; -export * from "./whmcs/mapper"; -export * from "./whmcs/raw.types"; -export * from "./salesforce/mapper"; -export * from "./salesforce/raw.types"; diff --git a/packages/domain/orders/providers/index.js b/packages/domain/orders/providers/index.js deleted file mode 100644 index ed08e354..00000000 --- a/packages/domain/orders/providers/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SalesforceRaw = exports.SalesforceMapper = exports.WhmcsRaw = exports.WhmcsMapper = exports.Salesforce = exports.Whmcs = void 0; -const WhmcsMapper = __importStar(require("./whmcs/mapper")); -exports.WhmcsMapper = WhmcsMapper; -const WhmcsRaw = __importStar(require("./whmcs/raw.types")); -exports.WhmcsRaw = WhmcsRaw; -const SalesforceMapper = __importStar(require("./salesforce/mapper")); -exports.SalesforceMapper = SalesforceMapper; -const SalesforceRaw = __importStar(require("./salesforce/raw.types")); -exports.SalesforceRaw = SalesforceRaw; -exports.Whmcs = { - ...WhmcsMapper, - mapper: WhmcsMapper, - raw: WhmcsRaw, -}; -exports.Salesforce = { - ...SalesforceMapper, - mapper: SalesforceMapper, - raw: SalesforceRaw, -}; -__exportStar(require("./whmcs/mapper"), exports); -__exportStar(require("./whmcs/raw.types"), exports); -__exportStar(require("./salesforce/mapper"), exports); -__exportStar(require("./salesforce/raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/orders/providers/index.js.map b/packages/domain/orders/providers/index.js.map deleted file mode 100644 index b98e3951..00000000 --- a/packages/domain/orders/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4DAA8C;AAkB5C,kCAAW;AAjBb,4DAA8C;AAkB5C,4BAAQ;AAjBV,sEAAwD;AAkBtD,4CAAgB;AAjBlB,sEAAwD;AAkBtD,sCAAa;AAhBF,QAAA,KAAK,GAAG;IACnB,GAAG,WAAW;IACd,MAAM,EAAE,WAAW;IACnB,GAAG,EAAE,QAAQ;CACd,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,GAAG,gBAAgB;IACnB,MAAM,EAAE,gBAAgB;IACxB,GAAG,EAAE,aAAa;CACnB,CAAC;AAQF,iDAA+B;AAC/B,oDAAkC;AAClC,sDAAoC;AACpC,yDAAuC"} \ No newline at end of file diff --git a/packages/domain/orders/providers/salesforce/mapper.d.ts b/packages/domain/orders/providers/salesforce/mapper.d.ts deleted file mode 100644 index d22e30ad..00000000 --- a/packages/domain/orders/providers/salesforce/mapper.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { OrderDetails, OrderItemDetails, OrderItemSummary, OrderSummary } from "../../contract"; -import type { SalesforceOrderItemRecord, SalesforceOrderRecord } from "./raw.types"; -export declare function transformSalesforceOrderItem(record: SalesforceOrderItemRecord): { - details: OrderItemDetails; - summary: OrderItemSummary; -}; -export declare function transformSalesforceOrderDetails(order: SalesforceOrderRecord, itemRecords: SalesforceOrderItemRecord[]): OrderDetails; -export declare function transformSalesforceOrderSummary(order: SalesforceOrderRecord, itemRecords: SalesforceOrderItemRecord[]): OrderSummary; diff --git a/packages/domain/orders/providers/salesforce/mapper.js b/packages/domain/orders/providers/salesforce/mapper.js deleted file mode 100644 index a96995a4..00000000 --- a/packages/domain/orders/providers/salesforce/mapper.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.transformSalesforceOrderItem = transformSalesforceOrderItem; -exports.transformSalesforceOrderDetails = transformSalesforceOrderDetails; -exports.transformSalesforceOrderSummary = transformSalesforceOrderSummary; -const schema_1 = require("../../schema"); -function transformSalesforceOrderItem(record) { - const pricebookEntry = record.PricebookEntry; - const product = pricebookEntry?.Product2; - const details = schema_1.orderItemDetailsSchema.parse({ - id: record.Id, - orderId: record.OrderId ?? "", - quantity: normalizeQuantity(record.Quantity), - unitPrice: coerceNumber(record.UnitPrice), - totalPrice: coerceNumber(record.TotalPrice), - billingCycle: record.Billing_Cycle__c ?? undefined, - product: product - ? { - id: product.Id ?? undefined, - name: product.Name ?? undefined, - sku: product.StockKeepingUnit ?? undefined, - itemClass: product.Item_Class__c ?? undefined, - whmcsProductId: product.WH_Product_ID__c ? String(product.WH_Product_ID__c) : undefined, - internetOfferingType: product.Internet_Offering_Type__c ?? undefined, - internetPlanTier: product.Internet_Plan_Tier__c ?? undefined, - vpnRegion: product.VPN_Region__c ?? undefined, - } - : undefined, - }); - return { - details, - summary: { - productName: details.product?.name, - name: details.product?.name, - sku: details.product?.sku, - status: undefined, - billingCycle: details.billingCycle, - itemClass: details.product?.itemClass, - quantity: details.quantity, - unitPrice: details.unitPrice, - totalPrice: details.totalPrice, - }, - }; -} -function transformSalesforceOrderDetails(order, itemRecords) { - const transformedItems = itemRecords.map(record => transformSalesforceOrderItem(record)); - const items = transformedItems.map(item => item.details); - const itemsSummary = transformedItems.map(item => item.summary); - const summary = buildOrderSummary(order, itemsSummary); - return schema_1.orderDetailsSchema.parse({ - ...summary, - accountId: order.AccountId ?? undefined, - accountName: typeof order.Account?.Name === "string" ? order.Account.Name : undefined, - pricebook2Id: order.Pricebook2Id ?? undefined, - activationType: order.Activation_Type__c ?? undefined, - activationStatus: summary.activationStatus, - activationScheduledAt: order.Activation_Scheduled_At__c ?? undefined, - activationErrorCode: order.Activation_Error_Code__c ?? undefined, - activationErrorMessage: order.Activation_Error_Message__c ?? undefined, - activatedDate: typeof order.ActivatedDate === "string" ? order.ActivatedDate : undefined, - items, - }); -} -function transformSalesforceOrderSummary(order, itemRecords) { - const itemsSummary = itemRecords.map(record => transformSalesforceOrderItem(record).summary); - return buildOrderSummary(order, itemsSummary); -} -function buildOrderSummary(order, itemsSummary) { - const effectiveDate = ensureString(order.EffectiveDate) ?? - ensureString(order.CreatedDate) ?? - new Date().toISOString(); - const createdDate = ensureString(order.CreatedDate) ?? effectiveDate; - const lastModifiedDate = ensureString(order.LastModifiedDate) ?? createdDate; - const totalAmount = coerceNumber(order.TotalAmount); - return schema_1.orderSummarySchema.parse({ - id: order.Id, - orderNumber: ensureString(order.OrderNumber) ?? order.Id, - status: ensureString(order.Status) ?? "Unknown", - orderType: order.Type ?? undefined, - effectiveDate, - totalAmount: typeof totalAmount === "number" ? totalAmount : undefined, - createdDate, - lastModifiedDate, - whmcsOrderId: order.WHMCS_Order_ID__c ?? undefined, - activationStatus: order.Activation_Status__c ?? undefined, - itemsSummary, - }); -} -function ensureString(value) { - return typeof value === "string" ? value : undefined; -} -function coerceNumber(value) { - if (typeof value === "number") - return Number.isFinite(value) ? value : undefined; - if (typeof value === "string") { - const parsed = Number.parseFloat(value); - return Number.isFinite(parsed) ? parsed : undefined; - } - return undefined; -} -function normalizeQuantity(value) { - if (typeof value === "number" && Number.isFinite(value) && value > 0) { - return Math.trunc(value); - } - return 1; -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/orders/providers/salesforce/mapper.js.map b/packages/domain/orders/providers/salesforce/mapper.js.map deleted file mode 100644 index ec1cd666..00000000 --- a/packages/domain/orders/providers/salesforce/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;AAqBA,oEA0CC;AAKD,0EA0BC;AAKD,0EAQC;AA/FD,yCAA8F;AAS9F,SAAgB,4BAA4B,CAC1C,MAAiC;IAGjC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAwD,CAAC;IACvF,MAAM,OAAO,GAAG,cAAc,EAAE,QAA2C,CAAC;IAE5E,MAAM,OAAO,GAAG,+BAAsB,CAAC,KAAK,CAAC;QAC3C,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;QAC7B,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC5C,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC;QACzC,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;QAC3C,YAAY,EAAE,MAAM,CAAC,gBAAgB,IAAI,SAAS;QAClD,OAAO,EAAE,OAAO;YACd,CAAC,CAAC;gBACE,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,SAAS;gBAC3B,IAAI,EAAE,O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QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACrE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/packages/domain/orders/providers/salesforce/raw.types.d.ts b/packages/domain/orders/providers/salesforce/raw.types.d.ts deleted file mode 100644 index 63fd1b2c..00000000 --- a/packages/domain/orders/providers/salesforce/raw.types.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { z } from "zod"; -export declare const salesforceOrderItemRecordSchema: z.ZodObject<{ - Id: z.ZodString; - OrderId: z.ZodOptional>; - Quantity: z.ZodOptional>; - UnitPrice: z.ZodOptional>; - TotalPrice: z.ZodOptional>; - PricebookEntryId: z.ZodOptional>; - PricebookEntry: z.ZodOptional>; - Billing_Cycle__c: z.ZodOptional>; - WHMCS_Service_ID__c: z.ZodOptional>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; -}, z.core.$strip>; -export type SalesforceOrderItemRecord = z.infer; -export declare const salesforceOrderRecordSchema: z.ZodObject<{ - Id: z.ZodString; - OrderNumber: z.ZodOptional; - Status: z.ZodOptional; - Type: z.ZodOptional; - EffectiveDate: z.ZodOptional>; - TotalAmount: z.ZodOptional>; - AccountId: z.ZodOptional>; - Account: z.ZodOptional>; - }, z.core.$strip>>>; - Pricebook2Id: z.ZodOptional>; - Activation_Type__c: z.ZodOptional>; - Activation_Status__c: z.ZodOptional>; - Activation_Scheduled_At__c: z.ZodOptional>; - Activation_Error_Code__c: z.ZodOptional>; - Activation_Error_Message__c: z.ZodOptional>; - ActivatedDate: z.ZodOptional>; - Internet_Plan_Tier__c: z.ZodOptional>; - Installment_Plan__c: z.ZodOptional>; - Access_Mode__c: z.ZodOptional>; - Weekend_Install__c: z.ZodOptional>; - Hikari_Denwa__c: z.ZodOptional>; - VPN_Region__c: z.ZodOptional>; - SIM_Type__c: z.ZodOptional>; - SIM_Voice_Mail__c: z.ZodOptional>; - SIM_Call_Waiting__c: z.ZodOptional>; - EID__c: z.ZodOptional>; - MNP_Application__c: z.ZodOptional>; - MNP_Reservation_Number__c: z.ZodOptional>; - MNP_Expiry_Date__c: z.ZodOptional>; - MNP_Phone_Number__c: z.ZodOptional>; - MVNO_Account_Number__c: z.ZodOptional>; - Porting_Date_Of_Birth__c: z.ZodOptional>; - Porting_First_Name__c: z.ZodOptional>; - Porting_Last_Name__c: z.ZodOptional>; - Porting_First_Name_Katakana__c: z.ZodOptional>; - Porting_Last_Name_Katakana__c: z.ZodOptional>; - Porting_Gender__c: z.ZodOptional>; - Billing_Street__c: z.ZodOptional>; - Billing_City__c: z.ZodOptional>; - Billing_State__c: z.ZodOptional>; - Billing_Postal_Code__c: z.ZodOptional>; - Billing_Country__c: z.ZodOptional>; - Address_Changed__c: z.ZodOptional>; - WHMCS_Order_ID__c: z.ZodOptional>; - CreatedDate: z.ZodOptional; - LastModifiedDate: z.ZodOptional; -}, z.core.$strip>; -export type SalesforceOrderRecord = z.infer; -export declare const salesforceOrderProvisionEventPayloadSchema: z.ZodObject<{ - OrderId__c: z.ZodOptional; - OrderId: z.ZodOptional; -}, z.core.$loose>; -export type SalesforceOrderProvisionEventPayload = z.infer; -export declare const salesforceOrderProvisionEventSchema: z.ZodObject<{ - payload: z.ZodObject<{ - OrderId__c: z.ZodOptional; - OrderId: z.ZodOptional; - }, z.core.$loose>; - replayId: z.ZodOptional; -}, z.core.$loose>; -export type SalesforceOrderProvisionEvent = z.infer; -export declare const salesforcePubSubSubscriptionSchema: z.ZodObject<{ - topicName: z.ZodString; -}, z.core.$strip>; -export type SalesforcePubSubSubscription = z.infer; -export declare const salesforcePubSubErrorMetadataSchema: z.ZodObject<{ - "error-code": z.ZodOptional>; -}, z.core.$loose>; -export type SalesforcePubSubErrorMetadata = z.infer; -export declare const salesforcePubSubErrorSchema: z.ZodObject<{ - details: z.ZodOptional; - metadata: z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$loose>; -export type SalesforcePubSubError = z.infer; -export declare const salesforcePubSubCallbackTypeSchema: z.ZodEnum<{ - error: "error"; - data: "data"; - event: "event"; - grpcstatus: "grpcstatus"; - end: "end"; -}>; -export type SalesforcePubSubCallbackType = z.infer; -export type SalesforcePubSubUnknownData = Record | null | undefined; -export type SalesforcePubSubEventData = SalesforceOrderProvisionEvent | SalesforcePubSubError | SalesforcePubSubUnknownData; -export declare const salesforcePubSubCallbackSchema: z.ZodObject<{ - subscription: z.ZodObject<{ - topicName: z.ZodString; - }, z.core.$strip>; - callbackType: z.ZodEnum<{ - error: "error"; - data: "data"; - event: "event"; - grpcstatus: "grpcstatus"; - end: "end"; - }>; - data: z.ZodUnion; - OrderId: z.ZodOptional; - }, z.core.$loose>; - replayId: z.ZodOptional; - }, z.core.$loose>, z.ZodObject<{ - details: z.ZodOptional; - metadata: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>, z.ZodRecord, z.ZodNull]>; -}, z.core.$strip>; -export type SalesforcePubSubCallback = z.infer; diff --git a/packages/domain/orders/providers/salesforce/raw.types.js b/packages/domain/orders/providers/salesforce/raw.types.js deleted file mode 100644 index 3eedf065..00000000 --- a/packages/domain/orders/providers/salesforce/raw.types.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.salesforcePubSubCallbackSchema = exports.salesforcePubSubCallbackTypeSchema = exports.salesforcePubSubErrorSchema = exports.salesforcePubSubErrorMetadataSchema = exports.salesforcePubSubSubscriptionSchema = exports.salesforceOrderProvisionEventSchema = exports.salesforceOrderProvisionEventPayloadSchema = exports.salesforceOrderRecordSchema = exports.salesforceOrderItemRecordSchema = void 0; -const zod_1 = require("zod"); -exports.salesforceOrderItemRecordSchema = zod_1.z.object({ - Id: zod_1.z.string(), - OrderId: zod_1.z.string().nullable().optional(), - Quantity: zod_1.z.number().nullable().optional(), - UnitPrice: zod_1.z.number().nullable().optional(), - TotalPrice: zod_1.z.number().nullable().optional(), - PricebookEntryId: zod_1.z.string().nullable().optional(), - PricebookEntry: zod_1.z.unknown().nullable().optional(), - Billing_Cycle__c: zod_1.z.string().nullable().optional(), - WHMCS_Service_ID__c: zod_1.z.string().nullable().optional(), - CreatedDate: zod_1.z.string().optional(), - LastModifiedDate: zod_1.z.string().optional(), -}); -exports.salesforceOrderRecordSchema = zod_1.z.object({ - Id: zod_1.z.string(), - OrderNumber: zod_1.z.string().optional(), - Status: zod_1.z.string().optional(), - Type: zod_1.z.string().optional(), - EffectiveDate: zod_1.z.string().nullable().optional(), - TotalAmount: zod_1.z.number().nullable().optional(), - AccountId: zod_1.z.string().nullable().optional(), - Account: zod_1.z.object({ Name: zod_1.z.string().nullable().optional() }).nullable().optional(), - Pricebook2Id: zod_1.z.string().nullable().optional(), - Activation_Type__c: zod_1.z.string().nullable().optional(), - Activation_Status__c: zod_1.z.string().nullable().optional(), - Activation_Scheduled_At__c: zod_1.z.string().nullable().optional(), - Activation_Error_Code__c: zod_1.z.string().nullable().optional(), - Activation_Error_Message__c: zod_1.z.string().nullable().optional(), - ActivatedDate: zod_1.z.string().nullable().optional(), - Internet_Plan_Tier__c: zod_1.z.string().nullable().optional(), - Installment_Plan__c: zod_1.z.string().nullable().optional(), - Access_Mode__c: zod_1.z.string().nullable().optional(), - Weekend_Install__c: zod_1.z.boolean().nullable().optional(), - Hikari_Denwa__c: zod_1.z.boolean().nullable().optional(), - VPN_Region__c: zod_1.z.string().nullable().optional(), - SIM_Type__c: zod_1.z.string().nullable().optional(), - SIM_Voice_Mail__c: zod_1.z.boolean().nullable().optional(), - SIM_Call_Waiting__c: zod_1.z.boolean().nullable().optional(), - EID__c: zod_1.z.string().nullable().optional(), - MNP_Application__c: zod_1.z.string().nullable().optional(), - MNP_Reservation_Number__c: zod_1.z.string().nullable().optional(), - MNP_Expiry_Date__c: zod_1.z.string().nullable().optional(), - MNP_Phone_Number__c: zod_1.z.string().nullable().optional(), - MVNO_Account_Number__c: zod_1.z.string().nullable().optional(), - Porting_Date_Of_Birth__c: zod_1.z.string().nullable().optional(), - Porting_First_Name__c: zod_1.z.string().nullable().optional(), - Porting_Last_Name__c: zod_1.z.string().nullable().optional(), - Porting_First_Name_Katakana__c: zod_1.z.string().nullable().optional(), - Porting_Last_Name_Katakana__c: zod_1.z.string().nullable().optional(), - Porting_Gender__c: zod_1.z.string().nullable().optional(), - Billing_Street__c: zod_1.z.string().nullable().optional(), - Billing_City__c: zod_1.z.string().nullable().optional(), - Billing_State__c: zod_1.z.string().nullable().optional(), - Billing_Postal_Code__c: zod_1.z.string().nullable().optional(), - Billing_Country__c: zod_1.z.string().nullable().optional(), - Address_Changed__c: zod_1.z.boolean().nullable().optional(), - WHMCS_Order_ID__c: zod_1.z.string().nullable().optional(), - CreatedDate: zod_1.z.string().optional(), - LastModifiedDate: zod_1.z.string().optional(), -}); -exports.salesforceOrderProvisionEventPayloadSchema = zod_1.z.object({ - OrderId__c: zod_1.z.string().optional(), - OrderId: zod_1.z.string().optional(), -}).passthrough(); -exports.salesforceOrderProvisionEventSchema = zod_1.z.object({ - payload: exports.salesforceOrderProvisionEventPayloadSchema, - replayId: zod_1.z.number().optional(), -}).passthrough(); -exports.salesforcePubSubSubscriptionSchema = zod_1.z.object({ - topicName: zod_1.z.string(), -}); -exports.salesforcePubSubErrorMetadataSchema = zod_1.z.object({ - "error-code": zod_1.z.array(zod_1.z.string()).optional(), -}).passthrough(); -exports.salesforcePubSubErrorSchema = zod_1.z.object({ - details: zod_1.z.string().optional(), - metadata: exports.salesforcePubSubErrorMetadataSchema.optional(), -}).passthrough(); -exports.salesforcePubSubCallbackTypeSchema = zod_1.z.enum([ - "data", - "event", - "grpcstatus", - "end", - "error", -]); -exports.salesforcePubSubCallbackSchema = zod_1.z.object({ - subscription: exports.salesforcePubSubSubscriptionSchema, - callbackType: exports.salesforcePubSubCallbackTypeSchema, - data: zod_1.z.union([ - exports.salesforceOrderProvisionEventSchema, - exports.salesforcePubSubErrorSchema, - zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()), - zod_1.z.null(), - ]), -}); -//# sourceMappingURL=raw.types.js.map diff --git a/packages/domain/orders/providers/salesforce/raw.types.js.map b/packages/domain/orders/providers/salesforce/raw.types.js.map deleted file mode 100644 index eb81f39c..00000000 --- a/packages/domain/orders/providers/salesforce/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAOA,6BAAwB;AAMX,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC3C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAElD,cAAc,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACjD,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAClD,mBAAmB,EAAE,OAAC,CA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AG,OAAC,CAAC,IAAI,CAAC;IACvD,MAAM;IACN,OAAO;IACP,YAAY;IACZ,KAAK;IACL,OAAO;CACR,CAAC,CAAC;AAoBU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,YAAY,EAAE,0CAAkC;IAChD,YAAY,EAAE,0CAAkC;IAChD,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC;QACZ,2CAAmC;QACnC,mCAA2B;QAC3B,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;QACjC,OAAC,CAAC,IAAI,EAAE;KACT,CAAC;CACH,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/orders/providers/whmcs/mapper.d.ts b/packages/domain/orders/providers/whmcs/mapper.d.ts deleted file mode 100644 index 24cf8154..00000000 --- a/packages/domain/orders/providers/whmcs/mapper.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { OrderDetails, OrderItemDetails } from "../../contract"; -import { type WhmcsOrderItem, type WhmcsAddOrderParams, type WhmcsAddOrderPayload } from "./raw.types"; -export interface OrderItemMappingResult { - whmcsItems: WhmcsOrderItem[]; - summary: { - totalItems: number; - serviceItems: number; - activationItems: number; - }; -} -export declare function mapOrderItemToWhmcs(item: OrderItemDetails, index?: number): WhmcsOrderItem; -export declare function mapOrderToWhmcsItems(orderDetails: OrderDetails): OrderItemMappingResult; -export declare function buildWhmcsAddOrderPayload(params: WhmcsAddOrderParams): WhmcsAddOrderPayload; -export declare function createOrderNotes(sfOrderId: string, additionalNotes?: string): string; diff --git a/packages/domain/orders/providers/whmcs/mapper.js b/packages/domain/orders/providers/whmcs/mapper.js deleted file mode 100644 index d2b207a0..00000000 --- a/packages/domain/orders/providers/whmcs/mapper.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapOrderItemToWhmcs = mapOrderItemToWhmcs; -exports.mapOrderToWhmcsItems = mapOrderToWhmcsItems; -exports.buildWhmcsAddOrderPayload = buildWhmcsAddOrderPayload; -exports.createOrderNotes = createOrderNotes; -function normalizeBillingCycle(cycle) { - if (!cycle) - return "monthly"; - const normalized = cycle.trim().toLowerCase(); - if (normalized.includes("monthly")) - return "monthly"; - if (normalized.includes("one")) - return "onetime"; - if (normalized.includes("annual")) - return "annually"; - if (normalized.includes("quarter")) - return "quarterly"; - return "monthly"; -} -function mapOrderItemToWhmcs(item, index = 0) { - if (!item.product?.whmcsProductId) { - throw new Error(`Order item ${index} missing WHMCS product ID`); - } - const whmcsItem = { - productId: item.product.whmcsProductId, - billingCycle: normalizeBillingCycle(item.billingCycle), - quantity: item.quantity, - }; - return whmcsItem; -} -function mapOrderToWhmcsItems(orderDetails) { - if (!orderDetails.items || orderDetails.items.length === 0) { - throw new Error("No order items provided for WHMCS mapping"); - } - const whmcsItems = []; - let serviceItems = 0; - let activationItems = 0; - orderDetails.items.forEach((item, index) => { - const mapped = mapOrderItemToWhmcs(item, index); - whmcsItems.push(mapped); - if (mapped.billingCycle === "monthly") { - serviceItems++; - } - else if (mapped.billingCycle === "onetime") { - activationItems++; - } - }); - return { - whmcsItems, - summary: { - totalItems: whmcsItems.length, - serviceItems, - activationItems, - }, - }; -} -function buildWhmcsAddOrderPayload(params) { - const pids = []; - const billingCycles = []; - const quantities = []; - const configOptions = []; - const customFields = []; - params.items.forEach(item => { - pids.push(item.productId); - billingCycles.push(item.billingCycle); - quantities.push(item.quantity); - if (item.configOptions && Object.keys(item.configOptions).length > 0) { - const serialized = serializeForWhmcs(item.configOptions); - configOptions.push(serialized); - } - else { - configOptions.push(""); - } - if (item.customFields && Object.keys(item.customFields).length > 0) { - const serialized = serializeForWhmcs(item.customFields); - customFields.push(serialized); - } - else { - customFields.push(""); - } - }); - const payload = { - clientid: params.clientId, - paymentmethod: params.paymentMethod, - pid: pids, - billingcycle: billingCycles, - qty: quantities, - }; - if (params.promoCode) { - payload.promocode = params.promoCode; - } - if (params.noinvoice !== undefined) { - payload.noinvoice = params.noinvoice; - } - if (params.noinvoiceemail !== undefined) { - payload.noinvoiceemail = params.noinvoiceemail; - } - if (params.noemail !== undefined) { - payload.noemail = params.noemail; - } - if (configOptions.some(opt => opt !== "")) { - payload.configoptions = configOptions; - } - if (customFields.some(field => field !== "")) { - payload.customfields = customFields; - } - return payload; -} -function serializeForWhmcs(data) { - const jsonStr = JSON.stringify(data); - return Buffer.from(jsonStr).toString("base64"); -} -function createOrderNotes(sfOrderId, additionalNotes) { - const notes = []; - notes.push(`sfOrderId=${sfOrderId}`); - notes.push(`provisionedAt=${new Date().toISOString()}`); - if (additionalNotes) { - notes.push(additionalNotes); - } - return notes.join("; "); -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/orders/providers/whmcs/mapper.js.map b/packages/domain/orders/providers/whmcs/mapper.js.map deleted file mode 100644 index fa89cfee..00000000 --- a/packages/domain/orders/providers/whmcs/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;AAqCA,kDAeC;AAMD,oDA8BC;AAMD,8DA0DC;AAcD,4CAeC;AA/JD,SAAS,qBAAqB,CAAC,KAAyB;IACtD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACrD,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACjD,IAAI,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,UAAU,CAAC;IACrD,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,WAAW,CAAC;IAEvD,OAAO,SAAS,CAAC;AACnB,CAAC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C;IAGrC,KAAK,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAGxD,IAAI,eAAe,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/packages/domain/orders/providers/whmcs/raw.types.d.ts b/packages/domain/orders/providers/whmcs/raw.types.d.ts deleted file mode 100644 index 689ae1fb..00000000 --- a/packages/domain/orders/providers/whmcs/raw.types.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { z } from "zod"; -export declare const whmcsOrderItemSchema: z.ZodObject<{ - productId: z.ZodString; - billingCycle: z.ZodEnum<{ - monthly: "monthly"; - annually: "annually"; - quarterly: "quarterly"; - semiannually: "semiannually"; - biennially: "biennially"; - triennially: "triennially"; - onetime: "onetime"; - free: "free"; - }>; - quantity: z.ZodDefault; - configOptions: z.ZodOptional>; - customFields: z.ZodOptional>; -}, z.core.$strip>; -export type WhmcsOrderItem = z.infer; -export declare const whmcsAddOrderParamsSchema: z.ZodObject<{ - clientId: z.ZodNumber; - items: z.ZodArray; - quantity: z.ZodDefault; - configOptions: z.ZodOptional>; - customFields: z.ZodOptional>; - }, z.core.$strip>>; - paymentMethod: z.ZodString; - promoCode: z.ZodOptional; - notes: z.ZodOptional; - sfOrderId: z.ZodOptional; - noinvoice: z.ZodOptional; - noinvoiceemail: z.ZodOptional; - noemail: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsAddOrderParams = z.infer; -export declare const whmcsAddOrderPayloadSchema: z.ZodObject<{ - clientid: z.ZodNumber; - paymentmethod: z.ZodString; - promocode: z.ZodOptional; - noinvoice: z.ZodOptional; - noinvoiceemail: z.ZodOptional; - noemail: z.ZodOptional; - pid: z.ZodArray; - billingcycle: z.ZodArray; - qty: z.ZodArray; - configoptions: z.ZodOptional>; - customfields: z.ZodOptional>; -}, z.core.$strip>; -export type WhmcsAddOrderPayload = z.infer; -export declare const whmcsOrderResultSchema: z.ZodObject<{ - orderId: z.ZodNumber; - invoiceId: z.ZodOptional; - serviceIds: z.ZodDefault>; -}, z.core.$strip>; -export type WhmcsOrderResult = z.infer; -export declare const whmcsAcceptOrderResponseSchema: z.ZodObject<{ - result: z.ZodString; - orderid: z.ZodNumber; - invoiceid: z.ZodOptional; - productids: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsAcceptOrderResponse = z.infer; diff --git a/packages/domain/orders/providers/whmcs/raw.types.js b/packages/domain/orders/providers/whmcs/raw.types.js deleted file mode 100644 index 3725e2c3..00000000 --- a/packages/domain/orders/providers/whmcs/raw.types.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.whmcsAcceptOrderResponseSchema = exports.whmcsOrderResultSchema = exports.whmcsAddOrderPayloadSchema = exports.whmcsAddOrderParamsSchema = exports.whmcsOrderItemSchema = void 0; -const zod_1 = require("zod"); -exports.whmcsOrderItemSchema = zod_1.z.object({ - productId: zod_1.z.string().min(1, "Product ID is required"), - billingCycle: zod_1.z.enum([ - "monthly", - "quarterly", - "semiannually", - "annually", - "biennially", - "triennially", - "onetime", - "free" - ]), - quantity: zod_1.z.number().int().positive("Quantity must be positive").default(1), - configOptions: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(), - customFields: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(), -}); -exports.whmcsAddOrderParamsSchema = zod_1.z.object({ - clientId: zod_1.z.number().int().positive("Client ID must be positive"), - items: zod_1.z.array(exports.whmcsOrderItemSchema).min(1, "At least one item is required"), - paymentMethod: zod_1.z.string().min(1, "Payment method is required"), - promoCode: zod_1.z.string().optional(), - notes: zod_1.z.string().optional(), - sfOrderId: zod_1.z.string().optional(), - noinvoice: zod_1.z.boolean().optional(), - noinvoiceemail: zod_1.z.boolean().optional(), - noemail: zod_1.z.boolean().optional(), -}); -exports.whmcsAddOrderPayloadSchema = zod_1.z.object({ - clientid: zod_1.z.number().int().positive(), - paymentmethod: zod_1.z.string().min(1), - promocode: zod_1.z.string().optional(), - noinvoice: zod_1.z.boolean().optional(), - noinvoiceemail: zod_1.z.boolean().optional(), - noemail: zod_1.z.boolean().optional(), - pid: zod_1.z.array(zod_1.z.string()).min(1), - billingcycle: zod_1.z.array(zod_1.z.string()).min(1), - qty: zod_1.z.array(zod_1.z.number().int().positive()).min(1), - configoptions: zod_1.z.array(zod_1.z.string()).optional(), - customfields: zod_1.z.array(zod_1.z.string()).optional(), -}); -exports.whmcsOrderResultSchema = zod_1.z.object({ - orderId: zod_1.z.number().int().positive(), - invoiceId: zod_1.z.number().int().positive().optional(), - serviceIds: zod_1.z.array(zod_1.z.number().int().positive()).default([]), -}); -exports.whmcsAcceptOrderResponseSchema = zod_1.z.object({ - result: zod_1.z.string(), - orderid: zod_1.z.number().int().positive(), - invoiceid: zod_1.z.number().int().positive().optional(), - productids: zod_1.z.string().optional(), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/orders/providers/whmcs/raw.types.js.map b/packages/domain/orders/providers/whmcs/raw.types.js.map deleted file mode 100644 index a25b46a2..00000000 --- a/packages/domain/orders/providers/whmcs/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAOA,6BAAwB;AAMX,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC;IACtD,YAAY,EAAE,OAAC,CAAC,IAAI,CAAC;QACnB,SAAS;QACT,WAAW;QACX,cAAc;QACd,UAAU;QACV,YAAY;QACZ,aAAa;QACb,SAAS;QACT,MAAM;KACP,CAAC;IACF,QAAQ,EAAE,OAAC,C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AC,CAAC;AAQU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACjD,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/orders/schema.d.ts b/packages/domain/orders/schema.d.ts deleted file mode 100644 index fee64cdd..00000000 --- a/packages/domain/orders/schema.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -import { z } from "zod"; -export declare const orderItemSummarySchema: z.ZodObject<{ - productName: z.ZodOptional; - name: z.ZodOptional; - sku: z.ZodOptional; - status: z.ZodOptional; - billingCycle: z.ZodOptional; - itemClass: z.ZodOptional; - quantity: z.ZodOptional; - unitPrice: z.ZodOptional; - totalPrice: z.ZodOptional; -}, z.core.$strip>; -export declare const orderItemDetailsSchema: z.ZodObject<{ - id: z.ZodString; - orderId: z.ZodString; - quantity: z.ZodNumber; - unitPrice: z.ZodOptional; - totalPrice: z.ZodOptional; - billingCycle: z.ZodOptional; - product: z.ZodOptional; - name: z.ZodOptional; - sku: z.ZodOptional; - itemClass: z.ZodOptional; - whmcsProductId: z.ZodOptional; - internetOfferingType: z.ZodOptional; - internetPlanTier: z.ZodOptional; - vpnRegion: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const orderSummarySchema: z.ZodObject<{ - id: z.ZodString; - orderNumber: z.ZodString; - status: z.ZodString; - orderType: z.ZodOptional; - effectiveDate: z.ZodString; - totalAmount: z.ZodOptional; - createdDate: z.ZodString; - lastModifiedDate: z.ZodString; - whmcsOrderId: z.ZodOptional; - activationStatus: z.ZodOptional; - itemsSummary: z.ZodArray; - name: z.ZodOptional; - sku: z.ZodOptional; - status: z.ZodOptional; - billingCycle: z.ZodOptional; - itemClass: z.ZodOptional; - quantity: z.ZodOptional; - unitPrice: z.ZodOptional; - totalPrice: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const orderDetailsSchema: z.ZodObject<{ - id: z.ZodString; - orderNumber: z.ZodString; - status: z.ZodString; - orderType: z.ZodOptional; - effectiveDate: z.ZodString; - totalAmount: z.ZodOptional; - createdDate: z.ZodString; - lastModifiedDate: z.ZodString; - whmcsOrderId: z.ZodOptional; - itemsSummary: z.ZodArray; - name: z.ZodOptional; - sku: z.ZodOptional; - status: z.ZodOptional; - billingCycle: z.ZodOptional; - itemClass: z.ZodOptional; - quantity: z.ZodOptional; - unitPrice: z.ZodOptional; - totalPrice: z.ZodOptional; - }, z.core.$strip>>; - accountId: z.ZodOptional; - accountName: z.ZodOptional; - pricebook2Id: z.ZodOptional; - activationType: z.ZodOptional; - activationStatus: z.ZodOptional; - activationScheduledAt: z.ZodOptional; - activationErrorCode: z.ZodOptional; - activationErrorMessage: z.ZodOptional; - activatedDate: z.ZodOptional; - items: z.ZodArray; - totalPrice: z.ZodOptional; - billingCycle: z.ZodOptional; - product: z.ZodOptional; - name: z.ZodOptional; - sku: z.ZodOptional; - itemClass: z.ZodOptional; - whmcsProductId: z.ZodOptional; - internetOfferingType: z.ZodOptional; - internetPlanTier: z.ZodOptional; - vpnRegion: z.ZodOptional; - }, z.core.$strip>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const orderQueryParamsSchema: z.ZodObject<{ - page: z.ZodOptional>; - limit: z.ZodOptional>; - status: z.ZodOptional; - orderType: z.ZodOptional; -}, z.core.$strip>; -declare const orderConfigurationsAddressSchema: z.ZodObject<{ - street: z.ZodOptional>; - streetLine2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postalCode: z.ZodOptional>; - country: z.ZodOptional>; -}, z.core.$strip>; -export declare const orderConfigurationsSchema: z.ZodObject<{ - activationType: z.ZodOptional>; - scheduledAt: z.ZodOptional; - accessMode: z.ZodOptional>; - simType: z.ZodOptional>; - eid: z.ZodOptional; - isMnp: z.ZodOptional; - mnpNumber: z.ZodOptional; - mnpExpiry: z.ZodOptional; - mnpPhone: z.ZodOptional; - mvnoAccountNumber: z.ZodOptional; - portingLastName: z.ZodOptional; - portingFirstName: z.ZodOptional; - portingLastNameKatakana: z.ZodOptional; - portingFirstNameKatakana: z.ZodOptional; - portingGender: z.ZodOptional>; - portingDateOfBirth: z.ZodOptional; - address: z.ZodOptional>; - streetLine2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postalCode: z.ZodOptional>; - country: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const createOrderRequestSchema: z.ZodObject<{ - orderType: z.ZodEnum<{ - Internet: "Internet"; - SIM: "SIM"; - VPN: "VPN"; - Other: "Other"; - }>; - skus: z.ZodArray; - configurations: z.ZodOptional>; - scheduledAt: z.ZodOptional; - accessMode: z.ZodOptional>; - simType: z.ZodOptional>; - eid: z.ZodOptional; - isMnp: z.ZodOptional; - mnpNumber: z.ZodOptional; - mnpExpiry: z.ZodOptional; - mnpPhone: z.ZodOptional; - mvnoAccountNumber: z.ZodOptional; - portingLastName: z.ZodOptional; - portingFirstName: z.ZodOptional; - portingLastNameKatakana: z.ZodOptional; - portingFirstNameKatakana: z.ZodOptional; - portingGender: z.ZodOptional>; - portingDateOfBirth: z.ZodOptional; - address: z.ZodOptional>; - streetLine2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postalCode: z.ZodOptional>; - country: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const orderBusinessValidationSchema: z.ZodObject<{ - orderType: z.ZodEnum<{ - Internet: "Internet"; - SIM: "SIM"; - VPN: "VPN"; - Other: "Other"; - }>; - skus: z.ZodArray; - configurations: z.ZodOptional>; - scheduledAt: z.ZodOptional; - accessMode: z.ZodOptional>; - simType: z.ZodOptional>; - eid: z.ZodOptional; - isMnp: z.ZodOptional; - mnpNumber: z.ZodOptional; - mnpExpiry: z.ZodOptional; - mnpPhone: z.ZodOptional; - mvnoAccountNumber: z.ZodOptional; - portingLastName: z.ZodOptional; - portingFirstName: z.ZodOptional; - portingLastNameKatakana: z.ZodOptional; - portingFirstNameKatakana: z.ZodOptional; - portingGender: z.ZodOptional>; - portingDateOfBirth: z.ZodOptional; - address: z.ZodOptional>; - streetLine2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postalCode: z.ZodOptional>; - country: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>>; - userId: z.ZodString; - opportunityId: z.ZodOptional; -}, z.core.$strip>; -export declare const sfOrderIdParamSchema: z.ZodObject<{ - sfOrderId: z.ZodString; -}, z.core.$strip>; -export type SfOrderIdParam = z.infer; -export type OrderItemSummary = z.infer; -export type OrderItemDetails = z.infer; -export type OrderSummary = z.infer; -export type OrderDetails = z.infer; -export type OrderQueryParams = z.infer; -export type OrderConfigurationsAddress = z.infer; -export type OrderConfigurations = z.infer; -export type CreateOrderRequest = z.infer; -export type OrderBusinessValidation = z.infer; -export {}; diff --git a/packages/domain/orders/schema.js b/packages/domain/orders/schema.js deleted file mode 100644 index eccd5931..00000000 --- a/packages/domain/orders/schema.js +++ /dev/null @@ -1,157 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sfOrderIdParamSchema = exports.orderBusinessValidationSchema = exports.createOrderRequestSchema = exports.orderConfigurationsSchema = exports.orderQueryParamsSchema = exports.orderDetailsSchema = exports.orderSummarySchema = exports.orderItemDetailsSchema = exports.orderItemSummarySchema = void 0; -const zod_1 = require("zod"); -exports.orderItemSummarySchema = zod_1.z.object({ - productName: zod_1.z.string().optional(), - name: zod_1.z.string().optional(), - sku: zod_1.z.string().optional(), - status: zod_1.z.string().optional(), - billingCycle: zod_1.z.string().optional(), - itemClass: zod_1.z.string().optional(), - quantity: zod_1.z.number().int().min(0).optional(), - unitPrice: zod_1.z.number().optional(), - totalPrice: zod_1.z.number().optional(), -}); -exports.orderItemDetailsSchema = zod_1.z.object({ - id: zod_1.z.string(), - orderId: zod_1.z.string(), - quantity: zod_1.z.number().int().min(1), - unitPrice: zod_1.z.number().optional(), - totalPrice: zod_1.z.number().optional(), - billingCycle: zod_1.z.string().optional(), - product: zod_1.z.object({ - id: zod_1.z.string().optional(), - name: zod_1.z.string().optional(), - sku: zod_1.z.string().optional(), - itemClass: zod_1.z.string().optional(), - whmcsProductId: zod_1.z.string().optional(), - internetOfferingType: zod_1.z.string().optional(), - internetPlanTier: zod_1.z.string().optional(), - vpnRegion: zod_1.z.string().optional(), - }).optional(), -}); -exports.orderSummarySchema = zod_1.z.object({ - id: zod_1.z.string(), - orderNumber: zod_1.z.string(), - status: zod_1.z.string(), - orderType: zod_1.z.string().optional(), - effectiveDate: zod_1.z.string(), - totalAmount: zod_1.z.number().optional(), - createdDate: zod_1.z.string(), - lastModifiedDate: zod_1.z.string(), - whmcsOrderId: zod_1.z.string().optional(), - activationStatus: zod_1.z.string().optional(), - itemsSummary: zod_1.z.array(exports.orderItemSummarySchema), -}); -exports.orderDetailsSchema = exports.orderSummarySchema.extend({ - accountId: zod_1.z.string().optional(), - accountName: zod_1.z.string().optional(), - pricebook2Id: zod_1.z.string().optional(), - activationType: zod_1.z.string().optional(), - activationStatus: zod_1.z.string().optional(), - activationScheduledAt: zod_1.z.string().optional(), - activationErrorCode: zod_1.z.string().optional(), - activationErrorMessage: zod_1.z.string().optional(), - activatedDate: zod_1.z.string().optional(), - items: zod_1.z.array(exports.orderItemDetailsSchema), -}); -exports.orderQueryParamsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().optional(), - limit: zod_1.z.coerce.number().int().positive().max(100).optional(), - status: zod_1.z.string().optional(), - orderType: zod_1.z.string().optional(), -}); -const orderConfigurationsAddressSchema = zod_1.z.object({ - street: zod_1.z.string().nullable().optional(), - streetLine2: zod_1.z.string().nullable().optional(), - city: zod_1.z.string().nullable().optional(), - state: zod_1.z.string().nullable().optional(), - postalCode: zod_1.z.string().nullable().optional(), - country: zod_1.z.string().nullable().optional(), -}); -exports.orderConfigurationsSchema = zod_1.z.object({ - activationType: zod_1.z.enum(["Immediate", "Scheduled"]).optional(), - scheduledAt: zod_1.z.string().optional(), - accessMode: zod_1.z.enum(["IPoE-BYOR", "IPoE-HGW", "PPPoE"]).optional(), - simType: zod_1.z.enum(["eSIM", "Physical SIM"]).optional(), - eid: zod_1.z.string().optional(), - isMnp: zod_1.z.string().optional(), - mnpNumber: zod_1.z.string().optional(), - mnpExpiry: zod_1.z.string().optional(), - mnpPhone: zod_1.z.string().optional(), - mvnoAccountNumber: zod_1.z.string().optional(), - portingLastName: zod_1.z.string().optional(), - portingFirstName: zod_1.z.string().optional(), - portingLastNameKatakana: zod_1.z.string().optional(), - portingFirstNameKatakana: zod_1.z.string().optional(), - portingGender: zod_1.z.enum(["Male", "Female", "Corporate/Other"]).optional(), - portingDateOfBirth: zod_1.z.string().optional(), - address: orderConfigurationsAddressSchema.optional(), -}); -const baseCreateOrderSchema = zod_1.z.object({ - orderType: zod_1.z.enum(["Internet", "SIM", "VPN", "Other"]), - skus: zod_1.z.array(zod_1.z.string()), - configurations: exports.orderConfigurationsSchema.optional(), -}); -exports.createOrderRequestSchema = baseCreateOrderSchema; -exports.orderBusinessValidationSchema = baseCreateOrderSchema - .extend({ - userId: zod_1.z.string().uuid(), - opportunityId: zod_1.z.string().optional(), -}) - .refine((data) => { - if (data.orderType === "Internet") { - const mainServiceSkus = data.skus.filter(sku => { - const upperSku = sku.toUpperCase(); - return (!upperSku.includes("INSTALL") && - !upperSku.includes("ADDON") && - !upperSku.includes("ACTIVATION") && - !upperSku.includes("FEE")); - }); - return mainServiceSkus.length >= 1; - } - return true; -}, { - message: "Internet orders must have at least one main service SKU (non-installation, non-addon)", - path: ["skus"], -}) - .refine((data) => { - if (data.orderType === "SIM" && data.configurations) { - return data.configurations.simType !== undefined; - } - return true; -}, { - message: "SIM orders must specify SIM type", - path: ["configurations", "simType"], -}) - .refine((data) => { - if (data.configurations?.simType === "eSIM") { - return data.configurations.eid !== undefined && data.configurations.eid.length > 0; - } - return true; -}, { - message: "eSIM orders must provide EID", - path: ["configurations", "eid"], -}) - .refine((data) => { - if (data.configurations?.isMnp === "true") { - const required = [ - "mnpNumber", - "portingLastName", - "portingFirstName", - ]; - return required.every(field => data.configurations?.[field] !== undefined); - } - return true; -}, { - message: "MNP orders must provide porting information", - path: ["configurations"], -}); -exports.sfOrderIdParamSchema = zod_1.z.object({ - sfOrderId: zod_1.z - .string() - .length(18, "Salesforce order ID must be 18 characters") - .regex(/^[A-Za-z0-9]+$/, "Salesforce order ID must be alphanumeric"), -}); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/orders/schema.js.map b/packages/domain/orders/schema.js.map deleted file mode 100644 index 90c97460..00000000 --- a/packages/domain/orders/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAMX,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,G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AO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EAAE,kCAAkC;IAC3C,IAAI,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC;CACpC,CACF;KACA,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,IAAI,IAAI,CAAC,cAAc,EAAE,OAAO,KAAK,MAAM,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EAAE,8BAA8B;IACvC,IAAI,EAAE,CAAC,gBAAgB,EAAE,KAAK,CAAC;CAChC,CACF;KACA,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,IAAI,IAAI,CAAC,cAAc,EAAE,KAAK,KAAK,MAAM,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG;YACf,WAAW;YACX,iBAAiB;YACjB,kBAAkB;SACV,CAAC;QACX,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EAAE,6CAA6C;IACtD,IAAI,EAAE,CAAC,gBAAgB,CAAC;CACzB,CACF,CAAC;AAEO,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,OAAC;SACT,MAAM,EAAE;SACR,MAAM,CAAC,EAAE,EAAE,2CAA2C,CAAC;SACvD,KAAK,CAAC,gBAAgB,EAAE,0CAA0C,CAAC;CACvE,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/orders/schema.ts b/packages/domain/orders/schema.ts index c98c9471..4685bff2 100644 --- a/packages/domain/orders/schema.ts +++ b/packages/domain/orders/schema.ts @@ -5,6 +5,7 @@ */ import { z } from "zod"; +import { apiSuccessResponseSchema } from "../common"; // ============================================================================ // Order Item Summary Schema @@ -130,6 +131,51 @@ export const orderConfigurationsSchema = z.object({ address: orderConfigurationsAddressSchema.optional(), }); +/** + * Schema for raw checkout selections (typically derived from UI/query params) + */ +export const orderSelectionsSchema = z + .object({ + plan: z.string().optional(), + planId: z.string().optional(), + planSku: z.string().optional(), + planIdSku: z.string().optional(), + installationSku: z.string().optional(), + activationFeeSku: z.string().optional(), + activationSku: z.string().optional(), + addonSku: z.string().optional(), + addons: z.string().optional(), + accessMode: z.enum(["IPoE-BYOR", "IPoE-HGW", "PPPoE"]).optional(), + activationType: z.enum(["Immediate", "Scheduled"]).optional(), + scheduledAt: z.string().optional(), + simType: z.enum(["eSIM", "Physical SIM"]).optional(), + eid: z.string().optional(), + isMnp: z.string().optional(), + mnpNumber: z.string().optional(), + mnpExpiry: z.string().optional(), + mnpPhone: z.string().optional(), + mvnoAccountNumber: z.string().optional(), + portingLastName: z.string().optional(), + portingFirstName: z.string().optional(), + portingLastNameKatakana: z.string().optional(), + portingFirstNameKatakana: z.string().optional(), + portingGender: z.enum(["Male", "Female", "Corporate/Other"]).optional(), + portingDateOfBirth: z.string().optional(), + address: z + .object({ + street: z.string().optional(), + streetLine2: z.string().optional(), + city: z.string().optional(), + state: z.string().optional(), + postalCode: z.string().optional(), + country: z.string().optional(), + }) + .optional(), + }) + .passthrough(); + +export type OrderSelections = z.infer; + const baseCreateOrderSchema = z.object({ orderType: z.enum(["Internet", "SIM", "VPN", "Other"]), skus: z.array(z.string()), @@ -252,6 +298,14 @@ export const checkoutCartSchema = z.object({ configuration: orderConfigurationsSchema, }); +export const checkoutBuildCartRequestSchema = z.object({ + orderType: z.enum(["Internet", "SIM", "VPN", "Other"]), + selections: orderSelectionsSchema, + configuration: orderConfigurationsSchema.optional(), +}); + +export const checkoutBuildCartResponseSchema = apiSuccessResponseSchema(checkoutCartSchema); + /** * Schema for order creation response */ @@ -279,3 +333,5 @@ export type OrderConfigurationsAddress = z.infer; export type CreateOrderRequest = z.infer; export type OrderBusinessValidation = z.infer; +export type CheckoutBuildCartRequest = z.infer; +export type CheckoutBuildCartResponse = z.infer; diff --git a/packages/domain/orders/utils.ts b/packages/domain/orders/utils.ts index 9eea9d91..271f2d19 100644 --- a/packages/domain/orders/utils.ts +++ b/packages/domain/orders/utils.ts @@ -1,54 +1,25 @@ -import { z } from "zod"; - import { orderConfigurationsSchema, + orderSelectionsSchema, type OrderConfigurations, type CreateOrderRequest, + type OrderSelections, } from "./schema"; import { ORDER_TYPE } from "./contract"; -const orderSelectionsSchema = z.object({ - accessMode: z.enum(["IPoE-BYOR", "IPoE-HGW", "PPPoE"]).optional(), - activationType: z.enum(["Immediate", "Scheduled"]).optional(), - scheduledAt: z.string().optional(), - simType: z.enum(["eSIM", "Physical SIM"]).optional(), - eid: z.string().optional(), - isMnp: z.string().optional(), - mnpNumber: z.string().optional(), - mnpExpiry: z.string().optional(), - mnpPhone: z.string().optional(), - mvnoAccountNumber: z.string().optional(), - portingLastName: z.string().optional(), - portingFirstName: z.string().optional(), - portingLastNameKatakana: z.string().optional(), - portingFirstNameKatakana: z.string().optional(), - portingGender: z.enum(["Male", "Female", "Corporate/Other"]).optional(), - portingDateOfBirth: z.string().optional(), - address: z - .object({ - street: z.string().optional(), - streetLine2: z.string().optional(), - city: z.string().optional(), - state: z.string().optional(), - postalCode: z.string().optional(), - country: z.string().optional(), - }) - .optional(), -}); - -export type OrderSelections = z.infer; - export function buildOrderConfigurations(selections: OrderSelections): OrderConfigurations { + const normalizedSelections = orderSelectionsSchema.parse(selections); + return orderConfigurationsSchema.parse({ - ...selections, - address: selections.address + ...normalizedSelections, + address: normalizedSelections.address ? { - street: selections.address.street ?? null, - streetLine2: selections.address.streetLine2 ?? null, - city: selections.address.city ?? null, - state: selections.address.state ?? null, - postalCode: selections.address.postalCode ?? null, - country: selections.address.country ?? null, + street: normalizedSelections.address.street ?? null, + streetLine2: normalizedSelections.address.streetLine2 ?? null, + city: normalizedSelections.address.city ?? null, + state: normalizedSelections.address.state ?? null, + postalCode: normalizedSelections.address.postalCode ?? null, + country: normalizedSelections.address.country ?? null, } : undefined, }); @@ -70,4 +41,3 @@ export function createOrderRequest(payload: { }; } - diff --git a/packages/domain/orders/validation.d.ts b/packages/domain/orders/validation.d.ts deleted file mode 100644 index 083add77..00000000 --- a/packages/domain/orders/validation.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { z } from "zod"; -export declare function hasSimServicePlan(skus: string[]): boolean; -export declare function hasSimActivationFee(skus: string[]): boolean; -export declare function hasVpnActivationFee(skus: string[]): boolean; -export declare function hasInternetServicePlan(skus: string[]): boolean; -export declare function getMainServiceSkus(skus: string[]): string[]; -export declare const orderWithSkuValidationSchema: z.ZodObject<{ - orderType: z.ZodEnum<{ - Internet: "Internet"; - SIM: "SIM"; - VPN: "VPN"; - Other: "Other"; - }>; - skus: z.ZodArray; - configurations: z.ZodOptional>; - scheduledAt: z.ZodOptional; - accessMode: z.ZodOptional>; - simType: z.ZodOptional>; - eid: z.ZodOptional; - isMnp: z.ZodOptional; - mnpNumber: z.ZodOptional; - mnpExpiry: z.ZodOptional; - mnpPhone: z.ZodOptional; - mvnoAccountNumber: z.ZodOptional; - portingLastName: z.ZodOptional; - portingFirstName: z.ZodOptional; - portingLastNameKatakana: z.ZodOptional; - portingFirstNameKatakana: z.ZodOptional; - portingGender: z.ZodOptional>; - portingDateOfBirth: z.ZodOptional; - address: z.ZodOptional>; - streetLine2: z.ZodOptional>; - city: z.ZodOptional>; - state: z.ZodOptional>; - postalCode: z.ZodOptional>; - country: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>>; - userId: z.ZodString; - opportunityId: z.ZodOptional; -}, z.core.$strip>; -export type OrderWithSkuValidation = z.infer; -export declare function getOrderTypeValidationError(orderType: string, skus: string[]): string | null; diff --git a/packages/domain/orders/validation.js b/packages/domain/orders/validation.js deleted file mode 100644 index a15e4443..00000000 --- a/packages/domain/orders/validation.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.orderWithSkuValidationSchema = void 0; -exports.hasSimServicePlan = hasSimServicePlan; -exports.hasSimActivationFee = hasSimActivationFee; -exports.hasVpnActivationFee = hasVpnActivationFee; -exports.hasInternetServicePlan = hasInternetServicePlan; -exports.getMainServiceSkus = getMainServiceSkus; -exports.getOrderTypeValidationError = getOrderTypeValidationError; -const schema_1 = require("./schema"); -function hasSimServicePlan(skus) { - return skus.some((sku) => sku.toUpperCase().includes("SIM") && - !sku.toUpperCase().includes("ACTIVATION") && - !sku.toUpperCase().includes("ADDON")); -} -function hasSimActivationFee(skus) { - return skus.some((sku) => sku.toUpperCase().includes("ACTIVATION") || - sku.toUpperCase().includes("SIM-ACTIVATION")); -} -function hasVpnActivationFee(skus) { - return skus.some((sku) => sku.toUpperCase().includes("VPN") && - sku.toUpperCase().includes("ACTIVATION")); -} -function hasInternetServicePlan(skus) { - return skus.some((sku) => sku.toUpperCase().includes("INTERNET") && - !sku.toUpperCase().includes("INSTALL") && - !sku.toUpperCase().includes("ADDON")); -} -function getMainServiceSkus(skus) { - return skus.filter((sku) => { - const upperSku = sku.toUpperCase(); - return (!upperSku.includes("INSTALL") && - !upperSku.includes("ADDON") && - !upperSku.includes("ACTIVATION") && - !upperSku.includes("FEE")); - }); -} -exports.orderWithSkuValidationSchema = schema_1.orderBusinessValidationSchema - .refine((data) => data.orderType !== "SIM" || hasSimServicePlan(data.skus), { - message: "SIM orders must include a SIM service plan", - path: ["skus"], -}) - .refine((data) => data.orderType !== "SIM" || hasSimActivationFee(data.skus), { - message: "SIM orders require an activation fee", - path: ["skus"], -}) - .refine((data) => data.orderType !== "VPN" || hasVpnActivationFee(data.skus), { - message: "VPN orders require an activation fee", - path: ["skus"], -}) - .refine((data) => data.orderType !== "Internet" || hasInternetServicePlan(data.skus), { - message: "Internet orders require a service plan", - path: ["skus"], -}); -function getOrderTypeValidationError(orderType, skus) { - switch (orderType) { - case "SIM": - if (!hasSimServicePlan(skus)) { - return "A SIM plan must be selected"; - } - if (!hasSimActivationFee(skus)) { - return "SIM orders require an activation fee"; - } - break; - case "VPN": - if (!hasVpnActivationFee(skus)) { - return "VPN orders require an activation fee"; - } - break; - case "Internet": - if (!hasInternetServicePlan(skus)) { - return "Internet orders require a service plan"; - } - break; - } - return null; -} -//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/packages/domain/orders/validation.js.map b/packages/domain/orders/validation.js.map deleted file mode 100644 index b5db43d4..00000000 --- a/packages/domain/orders/validation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;;AAkBA,8CAOC;AAKD,kDAMC;AAKD,kDAMC;AAMD,wDAOC;AAMD,gDAUC;AAyDD,kEAyBC;AAtJD,qCAAyD;AAUzD,SAAgB,iBAAiB,CAAC,IAAc;IAC9C,OAAO,IAAI,CAAC,IAAI,CACd,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;QACjC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;QACzC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CACvC,CAAC;AACJ,CAAC;AAKD,SAAgB,mBAAmB,CAAC,IAAc;IAChD,OAAO,IAAI,CAAC,IAAI,CACd,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;QACxC,GAAG,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAC/C,CAAC;AACJ,CAAC;AAKD,SAAgB,mBAAmB,CAAC,IAAc;IAChD,OAAO,IAAI,CAAC,IAAI,CACd,CAAC,GAAG,EAAE,EAAE,CACN,G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OAAO,EAAE,sCAAsC;IAC/C,IAAI,EAAE,CAAC,MAAM,CAAC;CACf,CACF;KACA,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,KAAK,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EACpE;IACE,OAAO,EAAE,sCAAsC;IAC/C,IAAI,EAAE,CAAC,MAAM,CAAC;CACf,CACF;KACA,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,UAAU,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC5E;IACE,OAAO,EAAE,wCAAwC;IACjD,IAAI,EAAE,CAAC,MAAM,CAAC;CACf,CACF,CAAC;AAWJ,SAAgB,2BAA2B,CAAC,SAAiB,EAAE,IAAc;IAC3E,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,KAAK;YACR,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7B,OAAO,6BAA6B,CAAC;YACvC,CAAC;YACD,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/B,OAAO,sCAAsC,CAAC;YAChD,CAAC;YACD,MAAM;QAER,KAAK,KAAK;YACR,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/B,OAAO,sCAAsC,CAAC;YAChD,CAAC;YACD,MAAM;QAER,KAAK,UAAU;YACb,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClC,OAAO,wCAAwC,CAAC;YAClD,CAAC;YACD,MAAM;IACV,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/packages/domain/payments/contract.d.ts b/packages/domain/payments/contract.d.ts deleted file mode 100644 index f2925207..00000000 --- a/packages/domain/payments/contract.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export declare const PAYMENT_METHOD_TYPE: { - readonly CREDIT_CARD: "CreditCard"; - readonly BANK_ACCOUNT: "BankAccount"; - readonly REMOTE_CREDIT_CARD: "RemoteCreditCard"; - readonly REMOTE_BANK_ACCOUNT: "RemoteBankAccount"; - readonly MANUAL: "Manual"; -}; -export declare const PAYMENT_GATEWAY_TYPE: { - readonly MERCHANT: "merchant"; - readonly THIRDPARTY: "thirdparty"; - readonly TOKENIZATION: "tokenization"; - readonly MANUAL: "manual"; -}; -export interface InvoicePaymentLink { - url: string; - expiresAt: string; - gatewayName?: string; -} -export type { PaymentMethodType, PaymentMethod, PaymentMethodList, PaymentGatewayType, PaymentGateway, PaymentGatewayList, } from './schema'; diff --git a/packages/domain/payments/contract.js b/packages/domain/payments/contract.js deleted file mode 100644 index 86a38460..00000000 --- a/packages/domain/payments/contract.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PAYMENT_GATEWAY_TYPE = exports.PAYMENT_METHOD_TYPE = void 0; -exports.PAYMENT_METHOD_TYPE = { - CREDIT_CARD: "CreditCard", - BANK_ACCOUNT: "BankAccount", - REMOTE_CREDIT_CARD: "RemoteCreditCard", - REMOTE_BANK_ACCOUNT: "RemoteBankAccount", - MANUAL: "Manual", -}; -exports.PAYMENT_GATEWAY_TYPE = { - MERCHANT: "merchant", - THIRDPARTY: "thirdparty", - TOKENIZATION: "tokenization", - MANUAL: "manual", -}; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/payments/contract.js.map b/packages/domain/payments/contract.js.map deleted file mode 100644 index aa2c3ad8..00000000 --- a/packages/domain/payments/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":";;;AAWa,QAAA,mBAAmB,GAAG;IACjC,WAAW,EAAE,YAAY;IACzB,YAAY,EAAE,aAAa;IAC3B,kBAAkB,EAAE,kBAAkB;IACtC,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE,QAAQ;CACR,CAAC;AAME,QAAA,oBAAoB,GAAG;IAClC,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,QAAQ;CACR,CAAC"} \ No newline at end of file diff --git a/packages/domain/payments/index.d.ts b/packages/domain/payments/index.d.ts deleted file mode 100644 index 124c9cd0..00000000 --- a/packages/domain/payments/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { PAYMENT_METHOD_TYPE, PAYMENT_GATEWAY_TYPE, type InvoicePaymentLink } from "./contract"; -export * from "./schema"; -export type { PaymentMethodType, PaymentMethod, PaymentMethodList, PaymentGatewayType, PaymentGateway, PaymentGatewayList, } from './schema'; -export * as Providers from "./providers/index"; -export type { WhmcsGetPayMethodsParams, WhmcsPaymentMethod, WhmcsPaymentMethodListResponse, WhmcsPaymentGateway, WhmcsPaymentGatewayListResponse, } from "./providers/whmcs/raw.types"; diff --git a/packages/domain/payments/index.js b/packages/domain/payments/index.js deleted file mode 100644 index 3b4feff0..00000000 --- a/packages/domain/payments/index.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Providers = exports.PAYMENT_GATEWAY_TYPE = exports.PAYMENT_METHOD_TYPE = void 0; -var contract_1 = require("./contract"); -Object.defineProperty(exports, "PAYMENT_METHOD_TYPE", { enumerable: true, get: function () { return contract_1.PAYMENT_METHOD_TYPE; } }); -Object.defineProperty(exports, "PAYMENT_GATEWAY_TYPE", { enumerable: true, get: function () { return contract_1.PAYMENT_GATEWAY_TYPE; } }); -__exportStar(require("./schema"), exports); -exports.Providers = __importStar(require("./providers/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/payments/index.js.map b/packages/domain/payments/index.js.map deleted file mode 100644 index caa70ef5..00000000 --- a/packages/domain/payments/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,uCAAgG;AAAvF,+GAAA,mBAAmB,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAGlD,2CAAyB;AAazB,+DAA+C"} \ No newline at end of file diff --git a/packages/domain/payments/providers/index.d.ts b/packages/domain/payments/providers/index.d.ts deleted file mode 100644 index 8c40106b..00000000 --- a/packages/domain/payments/providers/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as WhmcsMapper from "./whmcs/mapper"; -import * as WhmcsRaw from "./whmcs/raw.types"; -export declare const Whmcs: { - mapper: typeof WhmcsMapper; - raw: typeof WhmcsRaw; - transformWhmcsPaymentMethod(raw: unknown): import("..").PaymentMethod; - transformWhmcsPaymentGateway(raw: unknown): import("..").PaymentGateway; -}; -export { WhmcsMapper, WhmcsRaw }; -export * from "./whmcs/mapper"; -export * from "./whmcs/raw.types"; diff --git a/packages/domain/payments/providers/index.js b/packages/domain/payments/providers/index.js deleted file mode 100644 index 34a15b7b..00000000 --- a/packages/domain/payments/providers/index.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WhmcsRaw = exports.WhmcsMapper = exports.Whmcs = void 0; -const WhmcsMapper = __importStar(require("./whmcs/mapper")); -exports.WhmcsMapper = WhmcsMapper; -const WhmcsRaw = __importStar(require("./whmcs/raw.types")); -exports.WhmcsRaw = WhmcsRaw; -exports.Whmcs = { - ...WhmcsMapper, - mapper: WhmcsMapper, - raw: WhmcsRaw, -}; -__exportStar(require("./whmcs/mapper"), exports); -__exportStar(require("./whmcs/raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/payments/providers/index.js.map b/packages/domain/payments/providers/index.js.map deleted file mode 100644 index 47259257..00000000 --- a/packages/domain/payments/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4DAA8C;AASrC,kCAAW;AARpB,4DAA8C;AAQxB,4BAAQ;AANjB,QAAA,KAAK,GAAG;IACnB,GAAG,WAAW;IACd,MAAM,EAAE,WAAW;IACnB,GAAG,EAAE,QAAQ;CACd,CAAC;AAGF,iDAA+B;AAC/B,oDAAkC"} \ No newline at end of file diff --git a/packages/domain/payments/providers/whmcs/mapper.d.ts b/packages/domain/payments/providers/whmcs/mapper.d.ts deleted file mode 100644 index 67b59b90..00000000 --- a/packages/domain/payments/providers/whmcs/mapper.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PaymentMethod, PaymentGateway } from "../../contract"; -export declare function transformWhmcsPaymentMethod(raw: unknown): PaymentMethod; -export declare function transformWhmcsPaymentGateway(raw: unknown): PaymentGateway; diff --git a/packages/domain/payments/providers/whmcs/mapper.js b/packages/domain/payments/providers/whmcs/mapper.js deleted file mode 100644 index a1be787b..00000000 --- a/packages/domain/payments/providers/whmcs/mapper.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.transformWhmcsPaymentMethod = transformWhmcsPaymentMethod; -exports.transformWhmcsPaymentGateway = transformWhmcsPaymentGateway; -const schema_1 = require("../../schema"); -const raw_types_1 = require("./raw.types"); -const PAYMENT_TYPE_MAP = { - creditcard: "CreditCard", - bankaccount: "BankAccount", - remotecard: "RemoteCreditCard", - remotebankaccount: "RemoteBankAccount", - manual: "Manual", - remoteccreditcard: "RemoteCreditCard", -}; -function mapPaymentMethodType(type) { - const normalized = type.trim().toLowerCase(); - return PAYMENT_TYPE_MAP[normalized] ?? "Manual"; -} -const GATEWAY_TYPE_MAP = { - merchant: "merchant", - thirdparty: "thirdparty", - tokenization: "tokenization", - manual: "manual", -}; -function mapGatewayType(type) { - const normalized = type.trim().toLowerCase(); - return GATEWAY_TYPE_MAP[normalized] ?? "manual"; -} -function coerceBoolean(value) { - if (typeof value === "boolean") - return value; - if (typeof value === "number") - return value === 1; - if (typeof value === "string") - return value === "1" || value.toLowerCase() === "true"; - return false; -} -function transformWhmcsPaymentMethod(raw) { - const whmcs = raw_types_1.whmcsPaymentMethodRawSchema.parse(raw); - const paymentMethod = { - id: whmcs.id, - type: mapPaymentMethodType(whmcs.payment_type || whmcs.type || "manual"), - description: whmcs.description, - gatewayName: whmcs.gateway_name || whmcs.gateway, - cardLastFour: whmcs.card_last_four, - expiryDate: whmcs.expiry_date, - cardType: whmcs.card_type, - bankName: whmcs.bank_name, - remoteToken: whmcs.remote_token, - lastUpdated: whmcs.last_updated, - isDefault: coerceBoolean(whmcs.is_default), - }; - return schema_1.paymentMethodSchema.parse(paymentMethod); -} -function transformWhmcsPaymentGateway(raw) { - const whmcs = raw_types_1.whmcsPaymentGatewayRawSchema.parse(raw); - const gateway = { - name: whmcs.name, - displayName: whmcs.display_name || whmcs.name, - type: mapGatewayType(whmcs.type), - isActive: coerceBoolean(whmcs.visible), - configuration: whmcs.configuration, - }; - return schema_1.paymentGatewaySchema.parse(gateway); -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/payments/providers/whmcs/mapper.js.map b/packages/domain/payments/providers/whmcs/mapper.js.map deleted file mode 100644 index 340220dd..00000000 --- a/packages/domain/payments/providers/whmcs/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","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,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,IAAI,IAAI,QAAQ,CAAC;QACxE,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,WAAW,EAAE,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,OAAO;QAChD,YAAY,EAAE,KAAK,CAAC,cAAc;QAClC,UAAU,EAAE,KAAK,CAAC,WAAW;QAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS;QACzB,QAAQ,EAAE,KAAK,CAAC,SAAS;QACzB,WAAW,EAAE,KAAK,CAAC,YAAY;QAC/B,WAAW,EAAE,KAAK,CAAC,YAAY;QAC/B,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC;KAC3C,CAAC;IAEF,OAAO,4BAAmB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;AAClD,CAAC;AAED,SAAgB,4BAA4B,CAAC,GAAY;IACvD,MAAM,KAAK,GAAG,wCAA4B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtD,MAAM,OAAO,GAAmB;QAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,IAAI;QAC7C,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC;QAChC,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC;QACtC,aAAa,EAAE,KAAK,CAAC,aAAa;KACnC,CAAC;IAEF,OAAO,6BAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC"} \ No newline at end of file diff --git a/packages/domain/payments/providers/whmcs/raw.types.d.ts b/packages/domain/payments/providers/whmcs/raw.types.d.ts deleted file mode 100644 index 1a50600d..00000000 --- a/packages/domain/payments/providers/whmcs/raw.types.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { z } from "zod"; -export interface WhmcsGetPayMethodsParams extends Record { - clientid: number; - paymethodid?: number; - type?: "BankAccount" | "CreditCard"; -} -export declare const whmcsPaymentMethodRawSchema: z.ZodObject<{ - id: z.ZodNumber; - payment_type: z.ZodOptional; - type: z.ZodOptional; - description: z.ZodString; - gateway_name: z.ZodOptional; - gateway: z.ZodOptional; - card_last_four: z.ZodOptional; - card_type: z.ZodOptional; - expiry_date: z.ZodOptional; - bank_name: z.ZodOptional; - remote_token: z.ZodOptional; - last_updated: z.ZodOptional; - is_default: z.ZodOptional>; -}, z.core.$strip>; -export type WhmcsPaymentMethodRaw = z.infer; -export declare const whmcsPaymentGatewayRawSchema: z.ZodObject<{ - name: z.ZodString; - display_name: z.ZodOptional; - type: z.ZodString; - visible: z.ZodOptional>; - configuration: z.ZodOptional>; -}, z.core.$strip>; -export type WhmcsPaymentGatewayRaw = z.infer; -export declare const whmcsPaymentMethodSchema: z.ZodObject<{ - id: z.ZodNumber; - type: z.ZodEnum<{ - CreditCard: "CreditCard"; - BankAccount: "BankAccount"; - RemoteCreditCard: "RemoteCreditCard"; - RemoteBankAccount: "RemoteBankAccount"; - }>; - description: z.ZodString; - gateway_name: z.ZodOptional; - contact_type: z.ZodOptional; - contact_id: z.ZodOptional; - card_last_four: z.ZodOptional; - expiry_date: z.ZodOptional; - start_date: z.ZodOptional; - issue_number: z.ZodOptional; - card_type: z.ZodOptional; - remote_token: z.ZodOptional; - last_updated: z.ZodOptional; - bank_name: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsPaymentMethod = z.infer; -export declare const whmcsPaymentMethodListResponseSchema: z.ZodObject<{ - clientid: z.ZodUnion; - paymethods: z.ZodOptional; - description: z.ZodString; - gateway_name: z.ZodOptional; - contact_type: z.ZodOptional; - contact_id: z.ZodOptional; - card_last_four: z.ZodOptional; - expiry_date: z.ZodOptional; - start_date: z.ZodOptional; - issue_number: z.ZodOptional; - card_type: z.ZodOptional; - remote_token: z.ZodOptional; - last_updated: z.ZodOptional; - bank_name: z.ZodOptional; - }, z.core.$strip>>>; - message: z.ZodOptional; -}, z.core.$strip>; -export type WhmcsPaymentMethodListResponse = z.infer; -export declare const whmcsPaymentGatewaySchema: z.ZodObject<{ - name: z.ZodString; - display_name: z.ZodString; - type: z.ZodEnum<{ - merchant: "merchant"; - thirdparty: "thirdparty"; - tokenization: "tokenization"; - manual: "manual"; - }>; - active: z.ZodBoolean; -}, z.core.$strip>; -export type WhmcsPaymentGateway = z.infer; -export declare const whmcsPaymentGatewayListResponseSchema: z.ZodObject<{ - gateways: z.ZodObject<{ - gateway: z.ZodArray; - active: z.ZodBoolean; - }, z.core.$strip>>; - }, z.core.$strip>; - totalresults: z.ZodNumber; -}, z.core.$strip>; -export type WhmcsPaymentGatewayListResponse = z.infer; diff --git a/packages/domain/payments/providers/whmcs/raw.types.js b/packages/domain/payments/providers/whmcs/raw.types.js deleted file mode 100644 index 2aff7f80..00000000 --- a/packages/domain/payments/providers/whmcs/raw.types.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.whmcsPaymentGatewayListResponseSchema = exports.whmcsPaymentGatewaySchema = exports.whmcsPaymentMethodListResponseSchema = exports.whmcsPaymentMethodSchema = exports.whmcsPaymentGatewayRawSchema = exports.whmcsPaymentMethodRawSchema = void 0; -const zod_1 = require("zod"); -exports.whmcsPaymentMethodRawSchema = zod_1.z.object({ - id: zod_1.z.number(), - payment_type: zod_1.z.string().optional(), - type: zod_1.z.string().optional(), - description: zod_1.z.string(), - gateway_name: zod_1.z.string().optional(), - gateway: zod_1.z.string().optional(), - card_last_four: zod_1.z.string().optional(), - card_type: zod_1.z.string().optional(), - expiry_date: zod_1.z.string().optional(), - bank_name: zod_1.z.string().optional(), - remote_token: zod_1.z.string().optional(), - last_updated: zod_1.z.string().optional(), - is_default: zod_1.z.union([zod_1.z.boolean(), zod_1.z.number(), zod_1.z.string()]).optional(), -}); -exports.whmcsPaymentGatewayRawSchema = zod_1.z.object({ - name: zod_1.z.string(), - display_name: zod_1.z.string().optional(), - type: zod_1.z.string(), - visible: zod_1.z.union([zod_1.z.boolean(), zod_1.z.number(), zod_1.z.string()]).optional(), - configuration: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(), -}); -exports.whmcsPaymentMethodSchema = zod_1.z.object({ - id: zod_1.z.number(), - type: zod_1.z.enum(["CreditCard", "BankAccount", "RemoteCreditCard", "RemoteBankAccount"]), - description: zod_1.z.string(), - gateway_name: zod_1.z.string().optional(), - contact_type: zod_1.z.string().optional(), - contact_id: zod_1.z.number().optional(), - card_last_four: zod_1.z.string().optional(), - expiry_date: zod_1.z.string().optional(), - start_date: zod_1.z.string().optional(), - issue_number: zod_1.z.string().optional(), - card_type: zod_1.z.string().optional(), - remote_token: zod_1.z.string().optional(), - last_updated: zod_1.z.string().optional(), - bank_name: zod_1.z.string().optional(), -}); -exports.whmcsPaymentMethodListResponseSchema = zod_1.z.object({ - clientid: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]), - paymethods: zod_1.z.array(exports.whmcsPaymentMethodSchema).optional(), - message: zod_1.z.string().optional(), -}); -exports.whmcsPaymentGatewaySchema = zod_1.z.object({ - name: zod_1.z.string(), - display_name: zod_1.z.string(), - type: zod_1.z.enum(["merchant", "thirdparty", "tokenization", "manual"]), - active: zod_1.z.boolean(), -}); -exports.whmcsPaymentGatewayListResponseSchema = zod_1.z.object({ - gateways: zod_1.z.object({ - gateway: zod_1.z.array(exports.whmcsPaymentGatewaySchema), - }), - totalresults: zod_1.z.number(), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/payments/providers/whmcs/raw.types.js.map b/packages/domain/payments/providers/whmcs/raw.types.js.map deleted file mode 100644 index cdb23561..00000000 --- a/packages/domain/payments/providers/whmcs/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAQA,6BAAwB;AAmBX,QAAA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AAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3C,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,gCAAwB,CAAC,CAAC,QAAQ,EAAE;IACxD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAWU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;IAClE,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAOU,QAAA,qCAAqC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5D,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,iCAAyB,CAAC;KAC5C,CAAC;IACF,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/payments/schema.d.ts b/packages/domain/payments/schema.d.ts deleted file mode 100644 index f8b1d7c9..00000000 --- a/packages/domain/payments/schema.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { z } from "zod"; -export declare const paymentMethodTypeSchema: z.ZodEnum<{ - CreditCard: "CreditCard"; - BankAccount: "BankAccount"; - RemoteCreditCard: "RemoteCreditCard"; - RemoteBankAccount: "RemoteBankAccount"; - Manual: "Manual"; -}>; -export declare const paymentMethodSchema: z.ZodObject<{ - id: z.ZodNumber; - type: z.ZodEnum<{ - CreditCard: "CreditCard"; - BankAccount: "BankAccount"; - RemoteCreditCard: "RemoteCreditCard"; - RemoteBankAccount: "RemoteBankAccount"; - Manual: "Manual"; - }>; - description: z.ZodString; - gatewayName: z.ZodOptional; - contactType: z.ZodOptional; - contactId: z.ZodOptional; - cardLastFour: z.ZodOptional; - expiryDate: z.ZodOptional; - startDate: z.ZodOptional; - issueNumber: z.ZodOptional; - cardType: z.ZodOptional; - remoteToken: z.ZodOptional; - lastUpdated: z.ZodOptional; - bankName: z.ZodOptional; - isDefault: z.ZodOptional; -}, z.core.$strip>; -export declare const paymentMethodListSchema: z.ZodObject<{ - paymentMethods: z.ZodArray; - description: z.ZodString; - gatewayName: z.ZodOptional; - contactType: z.ZodOptional; - contactId: z.ZodOptional; - cardLastFour: z.ZodOptional; - expiryDate: z.ZodOptional; - startDate: z.ZodOptional; - issueNumber: z.ZodOptional; - cardType: z.ZodOptional; - remoteToken: z.ZodOptional; - lastUpdated: z.ZodOptional; - bankName: z.ZodOptional; - isDefault: z.ZodOptional; - }, z.core.$strip>>; - totalCount: z.ZodNumber; -}, z.core.$strip>; -export declare const paymentGatewayTypeSchema: z.ZodEnum<{ - merchant: "merchant"; - thirdparty: "thirdparty"; - tokenization: "tokenization"; - manual: "manual"; -}>; -export declare const paymentGatewaySchema: z.ZodObject<{ - name: z.ZodString; - displayName: z.ZodString; - type: z.ZodEnum<{ - merchant: "merchant"; - thirdparty: "thirdparty"; - tokenization: "tokenization"; - manual: "manual"; - }>; - isActive: z.ZodBoolean; - configuration: z.ZodOptional>; -}, z.core.$strip>; -export declare const paymentGatewayListSchema: z.ZodObject<{ - gateways: z.ZodArray; - isActive: z.ZodBoolean; - configuration: z.ZodOptional>; - }, z.core.$strip>>; - totalCount: z.ZodNumber; -}, z.core.$strip>; -export type PaymentMethodType = z.infer; -export type PaymentMethod = z.infer; -export type PaymentMethodList = z.infer; -export type PaymentGatewayType = z.infer; -export type PaymentGateway = z.infer; -export type PaymentGatewayList = z.infer; diff --git a/packages/domain/payments/schema.js b/packages/domain/payments/schema.js deleted file mode 100644 index 31bf9c88..00000000 --- a/packages/domain/payments/schema.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.paymentGatewayListSchema = exports.paymentGatewaySchema = exports.paymentGatewayTypeSchema = exports.paymentMethodListSchema = exports.paymentMethodSchema = exports.paymentMethodTypeSchema = void 0; -const zod_1 = require("zod"); -exports.paymentMethodTypeSchema = zod_1.z.enum([ - "CreditCard", - "BankAccount", - "RemoteCreditCard", - "RemoteBankAccount", - "Manual", -]); -exports.paymentMethodSchema = zod_1.z.object({ - id: zod_1.z.number().int(), - type: exports.paymentMethodTypeSchema, - description: zod_1.z.string(), - gatewayName: zod_1.z.string().optional(), - contactType: zod_1.z.string().optional(), - contactId: zod_1.z.number().int().optional(), - cardLastFour: zod_1.z.string().optional(), - expiryDate: zod_1.z.string().optional(), - startDate: zod_1.z.string().optional(), - issueNumber: zod_1.z.string().optional(), - cardType: zod_1.z.string().optional(), - remoteToken: zod_1.z.string().optional(), - lastUpdated: zod_1.z.string().optional(), - bankName: zod_1.z.string().optional(), - isDefault: zod_1.z.boolean().optional(), -}); -exports.paymentMethodListSchema = zod_1.z.object({ - paymentMethods: zod_1.z.array(exports.paymentMethodSchema), - totalCount: zod_1.z.number().int().min(0), -}); -exports.paymentGatewayTypeSchema = zod_1.z.enum([ - "merchant", - "thirdparty", - "tokenization", - "manual", -]); -exports.paymentGatewaySchema = zod_1.z.object({ - name: zod_1.z.string(), - displayName: zod_1.z.string(), - type: exports.paymentGatewayTypeSchema, - isActive: zod_1.z.boolean(), - configuration: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(), -}); -exports.paymentGatewayListSchema = zod_1.z.object({ - gateways: zod_1.z.array(exports.paymentGatewaySchema), - totalCount: zod_1.z.number().int().min(0), -}); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/payments/schema.js.map b/packages/domain/payments/schema.js.map deleted file mode 100644 index 316dfc91..00000000 --- a/packages/domain/payments/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"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C5C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpC,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC7C,UAAU;IACV,YAAY;IACZ,cAAc;IACd,QAAQ;CACT,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,IAAI,EAAE,gCAAwB;IAC9B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,aAAa,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC;IACvC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpC,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/contract.d.ts b/packages/domain/sim/contract.d.ts deleted file mode 100644 index c8856c95..00000000 --- a/packages/domain/sim/contract.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare const SIM_STATUS: { - readonly ACTIVE: "active"; - readonly SUSPENDED: "suspended"; - readonly CANCELLED: "cancelled"; - readonly PENDING: "pending"; -}; -export declare const SIM_TYPE: { - readonly STANDARD: "standard"; - readonly NANO: "nano"; - readonly MICRO: "micro"; - readonly ESIM: "esim"; -}; -export type { SimStatus, SimType, SimDetails, RecentDayUsage, SimUsage, SimTopUpHistoryEntry, SimTopUpHistory, SimTopUpRequest, SimPlanChangeRequest, SimCancelRequest, SimTopUpHistoryRequest, SimFeaturesUpdateRequest, SimOrderActivationRequest, SimOrderActivationMnp, SimOrderActivationAddons, } from './schema'; diff --git a/packages/domain/sim/contract.js b/packages/domain/sim/contract.js deleted file mode 100644 index 09a0969f..00000000 --- a/packages/domain/sim/contract.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SIM_TYPE = exports.SIM_STATUS = void 0; -exports.SIM_STATUS = { - ACTIVE: "active", - SUSPENDED: "suspended", - CANCELLED: "cancelled", - PENDING: "pending", -}; -exports.SIM_TYPE = { - STANDARD: "standard", - NANO: "nano", - MICRO: "micro", - ESIM: "esim", -}; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/sim/contract.js.map b/packages/domain/sim/contract.js.map deleted file mode 100644 index fe19ca99..00000000 --- a/packages/domain/sim/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":";;;AAWa,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;CACV,CAAC;AAME,QAAA,QAAQ,GAAG;IACtB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/index.d.ts b/packages/domain/sim/index.d.ts deleted file mode 100644 index c2a4d05d..00000000 --- a/packages/domain/sim/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { SIM_STATUS, SIM_TYPE } from "./contract"; -export * from "./schema"; -export * from "./validation"; -export type { SimStatus, SimType, SimDetails, RecentDayUsage, SimUsage, SimTopUpHistoryEntry, SimTopUpHistory, SimTopUpRequest, SimPlanChangeRequest, SimCancelRequest, SimTopUpHistoryRequest, SimFeaturesUpdateRequest, SimOrderActivationRequest, SimOrderActivationMnp, SimOrderActivationAddons, } from './schema'; -export * as Providers from "./providers/index"; diff --git a/packages/domain/sim/index.js b/packages/domain/sim/index.js deleted file mode 100644 index d69c6353..00000000 --- a/packages/domain/sim/index.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Providers = exports.SIM_TYPE = exports.SIM_STATUS = void 0; -var contract_1 = require("./contract"); -Object.defineProperty(exports, "SIM_STATUS", { enumerable: true, get: function () { return contract_1.SIM_STATUS; } }); -Object.defineProperty(exports, "SIM_TYPE", { enumerable: true, get: function () { return contract_1.SIM_TYPE; } }); -__exportStar(require("./schema"), exports); -__exportStar(require("./validation"), exports); -exports.Providers = __importStar(require("./providers/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/sim/index.js.map b/packages/domain/sim/index.js.map deleted file mode 100644 index 0625c9f0..00000000 --- a/packages/domain/sim/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,uCAAkD;AAAzC,sGAAA,UAAU,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAG7B,2CAAyB;AAGzB,+CAA6B;AAwB7B,+DAA+C"} \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/index.d.ts b/packages/domain/sim/providers/freebit/index.d.ts deleted file mode 100644 index 3f3e281e..00000000 --- a/packages/domain/sim/providers/freebit/index.d.ts +++ /dev/null @@ -1,496 +0,0 @@ -import * as Mapper from "./mapper"; -import * as RawTypes from "./raw.types"; -import * as Requests from "./requests"; -import * as Utils from "./utils"; -export declare const schemas: { - accountDetails: import("node_modules/zod/index.cjs").ZodObject<{ - version: import("node_modules/zod/index.cjs").ZodOptional; - requestDatas: import("node_modules/zod/index.cjs").ZodArray; - account: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - trafficInfo: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - topUp: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - quotaMb: import("node_modules/zod/index.cjs").ZodNumber; - options: import("node_modules/zod/index.cjs").ZodOptional; - expiryDate: import("node_modules/zod/index.cjs").ZodOptional; - scheduledAt: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - topUpApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - quota: import("node_modules/zod/index.cjs").ZodNumber; - quotaCode: import("node_modules/zod/index.cjs").ZodOptional; - expire: import("node_modules/zod/index.cjs").ZodOptional; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - planChange: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - newPlanCode: import("node_modules/zod/index.cjs").ZodString; - assignGlobalIp: import("node_modules/zod/index.cjs").ZodOptional; - scheduledAt: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - planChangeApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - plancode: import("node_modules/zod/index.cjs").ZodString; - globalip: import("node_modules/zod/index.cjs").ZodOptional>; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - addSpec: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - specCode: import("node_modules/zod/index.cjs").ZodString; - enabled: import("node_modules/zod/index.cjs").ZodOptional; - networkType: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelPlan: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runDate: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelPlanApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - quotaHistory: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - fromDate: import("node_modules/zod/index.cjs").ZodString; - toDate: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimReissue: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - newEid: import("node_modules/zod/index.cjs").ZodString; - oldEid: import("node_modules/zod/index.cjs").ZodOptional; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - oldProductNumber: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - simFeatures: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - voiceMailEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callWaitingEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callForwardingEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callerIdEnabled: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - globalIp: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - assign: import("node_modules/zod/index.cjs").ZodBoolean; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimActivationParams: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - identity: import("node_modules/zod/index.cjs").ZodOptional; - lastnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - firstnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - lastnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - gender: import("node_modules/zod/index.cjs").ZodOptional>; - birthday: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimActivationRequest: import("node_modules/zod/index.cjs").ZodObject<{ - authKey: import("node_modules/zod/index.cjs").ZodString; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - createType: import("node_modules/zod/index.cjs").ZodDefault>; - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - simkind: import("node_modules/zod/index.cjs").ZodDefault>; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - firstnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - lastnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - firstnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - lastnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - gender: import("node_modules/zod/index.cjs").ZodOptional>; - birthday: import("node_modules/zod/index.cjs").ZodOptional; - masterAccount: import("node_modules/zod/index.cjs").ZodOptional; - masterPassword: import("node_modules/zod/index.cjs").ZodOptional; - repAccount: import("node_modules/zod/index.cjs").ZodOptional; - size: import("node_modules/zod/index.cjs").ZodOptional; - addKind: import("node_modules/zod/index.cjs").ZodOptional; - oldEid: import("node_modules/zod/index.cjs").ZodOptional; - oldProductNumber: import("node_modules/zod/index.cjs").ZodOptional; - deliveryCode: import("node_modules/zod/index.cjs").ZodOptional; - globalIp: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimAddAccount: import("node_modules/zod/index.cjs").ZodObject<{ - authKey: import("node_modules/zod/index.cjs").ZodOptional; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - addKind: import("node_modules/zod/index.cjs").ZodDefault>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - auth: import("node_modules/zod/index.cjs").ZodObject<{ - oemId: import("node_modules/zod/index.cjs").ZodString; - oemKey: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelAccount: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runDate: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; -}; -export declare const raw: typeof RawTypes; -export declare const mapper: typeof Mapper; -export declare const requests: typeof Requests; -export type EsimAccountActivationRequest = Requests.FreebitEsimActivationRequest; -export type TopUpRequest = Requests.FreebitTopUpRequest; -export type TopUpApiRequest = Requests.FreebitTopUpApiRequest; -export type PlanChangeRequest = Requests.FreebitPlanChangeRequest; -export type PlanChangeApiRequest = Requests.FreebitPlanChangeApiRequest; -export type SimFeaturesRequest = Requests.FreebitSimFeaturesRequest; -export type QuotaHistoryRequest = Requests.FreebitQuotaHistoryRequest; -export type EsimAddAccountRequest = Requests.FreebitEsimAddAccountRequest; -export type TrafficInfoRequest = Requests.FreebitTrafficInfoRequest; -export type CancelPlanRequest = Requests.FreebitCancelPlanRequest; -export type CancelPlanApiRequest = Requests.FreebitCancelPlanApiRequest; -export type CancelAccountRequest = Requests.FreebitCancelAccountRequest; -export type AuthRequest = Requests.FreebitAuthRequest; -export type TopUpResponse = ReturnType; -export type AddSpecResponse = ReturnType; -export type PlanChangeResponse = ReturnType; -export type CancelPlanResponse = ReturnType; -export type CancelAccountResponse = ReturnType; -export type EsimReissueResponse = ReturnType; -export type EsimAddAccountResponse = ReturnType; -export type EsimActivationResponse = ReturnType; -export type AuthResponse = ReturnType; -export * from "./mapper"; -export * from "./raw.types"; -export * from "./requests"; -export * from "./utils"; -export declare const Freebit: { - mapper: typeof Mapper; - raw: typeof RawTypes; - schemas: { - accountDetails: import("node_modules/zod/index.cjs").ZodObject<{ - version: import("node_modules/zod/index.cjs").ZodOptional; - requestDatas: import("node_modules/zod/index.cjs").ZodArray; - account: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - trafficInfo: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - topUp: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - quotaMb: import("node_modules/zod/index.cjs").ZodNumber; - options: import("node_modules/zod/index.cjs").ZodOptional; - expiryDate: import("node_modules/zod/index.cjs").ZodOptional; - scheduledAt: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - topUpApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - quota: import("node_modules/zod/index.cjs").ZodNumber; - quotaCode: import("node_modules/zod/index.cjs").ZodOptional; - expire: import("node_modules/zod/index.cjs").ZodOptional; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - planChange: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - newPlanCode: import("node_modules/zod/index.cjs").ZodString; - assignGlobalIp: import("node_modules/zod/index.cjs").ZodOptional; - scheduledAt: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - planChangeApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - plancode: import("node_modules/zod/index.cjs").ZodString; - globalip: import("node_modules/zod/index.cjs").ZodOptional>; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - addSpec: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - specCode: import("node_modules/zod/index.cjs").ZodString; - enabled: import("node_modules/zod/index.cjs").ZodOptional; - networkType: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelPlan: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runDate: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelPlanApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - quotaHistory: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - fromDate: import("node_modules/zod/index.cjs").ZodString; - toDate: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimReissue: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - newEid: import("node_modules/zod/index.cjs").ZodString; - oldEid: import("node_modules/zod/index.cjs").ZodOptional; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - oldProductNumber: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - simFeatures: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - voiceMailEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callWaitingEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callForwardingEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callerIdEnabled: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - globalIp: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - assign: import("node_modules/zod/index.cjs").ZodBoolean; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimActivationParams: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - identity: import("node_modules/zod/index.cjs").ZodOptional; - lastnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - firstnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - lastnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - gender: import("node_modules/zod/index.cjs").ZodOptional>; - birthday: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimActivationRequest: import("node_modules/zod/index.cjs").ZodObject<{ - authKey: import("node_modules/zod/index.cjs").ZodString; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - createType: import("node_modules/zod/index.cjs").ZodDefault>; - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - simkind: import("node_modules/zod/index.cjs").ZodDefault>; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - firstnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - lastnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - firstnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - lastnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - gender: import("node_modules/zod/index.cjs").ZodOptional>; - birthday: import("node_modules/zod/index.cjs").ZodOptional; - masterAccount: import("node_modules/zod/index.cjs").ZodOptional; - masterPassword: import("node_modules/zod/index.cjs").ZodOptional; - repAccount: import("node_modules/zod/index.cjs").ZodOptional; - size: import("node_modules/zod/index.cjs").ZodOptional; - addKind: import("node_modules/zod/index.cjs").ZodOptional; - oldEid: import("node_modules/zod/index.cjs").ZodOptional; - oldProductNumber: import("node_modules/zod/index.cjs").ZodOptional; - deliveryCode: import("node_modules/zod/index.cjs").ZodOptional; - globalIp: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimAddAccount: import("node_modules/zod/index.cjs").ZodObject<{ - authKey: import("node_modules/zod/index.cjs").ZodOptional; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - addKind: import("node_modules/zod/index.cjs").ZodDefault>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - auth: import("node_modules/zod/index.cjs").ZodObject<{ - oemId: import("node_modules/zod/index.cjs").ZodString; - oemKey: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelAccount: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runDate: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - }; - requests: typeof Requests; - utils: typeof Utils; - normalizeAccount(account: string): string; - validateAccount(account: string): boolean; - formatDateForApi(date: Date): string; - parseDateFromApi(dateString: string): Date | null; - transformFreebitAccountDetails(raw: unknown): import("../..").SimDetails; - transformFreebitTrafficInfo(raw: unknown): import("../..").SimUsage; - transformFreebitQuotaHistory(raw: unknown, accountOverride?: string): import("../..").SimTopUpHistory; - transformFreebitTopUpResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitAddSpecResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitPlanChangeResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - ipv4?: string | undefined; - ipv6?: string | undefined; - }; - transformFreebitCancelPlanResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitCancelAccountResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitEsimReissueResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitEsimAddAccountResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitEsimActivationResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitAuthResponse(raw: unknown): RawTypes.FreebitAuthResponseRaw; -}; -export declare const normalizeAccount: typeof Utils.normalizeAccount; diff --git a/packages/domain/sim/providers/freebit/index.js b/packages/domain/sim/providers/freebit/index.js deleted file mode 100644 index 94ac02ea..00000000 --- a/packages/domain/sim/providers/freebit/index.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizeAccount = exports.Freebit = exports.requests = exports.mapper = exports.raw = exports.schemas = void 0; -const Mapper = __importStar(require("./mapper")); -const RawTypes = __importStar(require("./raw.types")); -const Requests = __importStar(require("./requests")); -const Utils = __importStar(require("./utils")); -exports.schemas = { - accountDetails: Requests.freebitAccountDetailsRequestSchema, - trafficInfo: Requests.freebitTrafficInfoRequestSchema, - topUp: Requests.freebitTopUpRequestPayloadSchema, - topUpApi: Requests.freebitTopUpApiRequestSchema, - planChange: Requests.freebitPlanChangeRequestSchema, - planChangeApi: Requests.freebitPlanChangeApiRequestSchema, - addSpec: Requests.freebitAddSpecRequestSchema, - cancelPlan: Requests.freebitCancelPlanRequestSchema, - cancelPlanApi: Requests.freebitCancelPlanApiRequestSchema, - quotaHistory: Requests.freebitQuotaHistoryRequestSchema, - esimReissue: Requests.freebitEsimReissueRequestSchema, - simFeatures: Requests.freebitSimFeaturesRequestSchema, - globalIp: Requests.freebitGlobalIpRequestSchema, - esimActivationParams: Requests.freebitEsimActivationParamsSchema, - esimActivationRequest: Requests.freebitEsimActivationRequestSchema, - esimAddAccount: Requests.freebitEsimAddAccountRequestSchema, - auth: Requests.freebitAuthRequestSchema, - cancelAccount: Requests.freebitCancelAccountRequestSchema, -}; -exports.raw = RawTypes; -exports.mapper = Mapper; -exports.requests = Requests; -__exportStar(require("./mapper"), exports); -__exportStar(require("./raw.types"), exports); -__exportStar(require("./requests"), exports); -__exportStar(require("./utils"), exports); -exports.Freebit = { - ...Mapper, - ...Utils, - mapper: Mapper, - raw: RawTypes, - schemas: exports.schemas, - requests: Requests, - utils: Utils, -}; -exports.normalizeAccount = Utils.normalizeAccount; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/index.js.map b/packages/domain/sim/providers/freebit/index.js.map deleted file mode 100644 index ac00c6dd..00000000 --- a/packages/domain/sim/providers/freebit/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,sDAAwC;AACxC,qDAAuC;AACvC,+CAAiC;AAEpB,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE,QAAQ,CAAC,kCAAkC;IAC3D,WAAW,EAAE,QAAQ,CAAC,+BAA+B;IACrD,KAAK,EAAE,QAAQ,CAAC,gCAAgC;IAChD,QAAQ,EAAE,QAAQ,CAAC,4BAA4B;IAC/C,UAAU,EAAE,QAAQ,CAAC,8BAA8B;IACnD,aAAa,EAAE,QAAQ,CAAC,iCAAiC;IACzD,OAAO,EAAE,QAAQ,CAAC,2BAA2B;IAC7C,UAAU,EAAE,QAAQ,CAAC,8BAA8B;IACnD,aAAa,EAAE,QAAQ,CAAC,iCAAiC;IACzD,YAAY,EAAE,QAAQ,CAAC,gCAAgC;IACvD,WAAW,EAAE,QAAQ,CAAC,+BAA+B;IACrD,WAAW,EAAE,QAAQ,CAAC,+BAA+B;IACrD,QAAQ,EAAE,QAAQ,CAAC,4BAA4B;IAC/C,oBAAoB,EAAE,QAAQ,CAAC,iCAAiC;IAChE,qBAAqB,EAAE,QAAQ,CAAC,kCAAkC;IAClE,cAAc,EAAE,QAAQ,CAAC,kCAAkC;IAC3D,IAAI,EAAE,QAAQ,CAAC,wBAAwB;IACvC,aAAa,EAAE,QAAQ,CAAC,iCAAiC;CAC1D,CAAC;AAEW,QAAA,GAAG,GAAG,QAAQ,CAAC;AACf,QAAA,MAAM,GAAG,MAAM,CAAC;AAChB,QAAA,QAAQ,GAAG,QAAQ,CAAC;AAyBjC,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AAEX,QAAA,OAAO,GAAG;IACrB,GAAG,MAAM;IACT,GAAG,KAAK;IACR,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,QAAQ;IACb,OAAO,EAAP,eAAO;IACP,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;CACb,CAAC;AAGW,QAAA,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/mapper.d.ts b/packages/domain/sim/providers/freebit/mapper.d.ts deleted file mode 100644 index 223c22c2..00000000 --- a/packages/domain/sim/providers/freebit/mapper.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { SimDetails, SimUsage, SimTopUpHistory } from "../../contract"; -import { type FreebitAuthResponseRaw } from "./raw.types"; -export declare function transformFreebitAccountDetails(raw: unknown): SimDetails; -export declare function transformFreebitTrafficInfo(raw: unknown): SimUsage; -export declare function transformFreebitQuotaHistory(raw: unknown, accountOverride?: string): SimTopUpHistory; -export declare function transformFreebitTopUpResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; -}; -export type FreebitTopUpResponse = ReturnType; -export declare function transformFreebitAddSpecResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; -}; -export type FreebitAddSpecResponse = ReturnType; -export declare function transformFreebitPlanChangeResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - ipv4?: string | undefined; - ipv6?: string | undefined; -}; -export type FreebitPlanChangeResponse = ReturnType; -export declare function transformFreebitCancelPlanResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; -}; -export type FreebitCancelPlanResponse = ReturnType; -export declare function transformFreebitCancelAccountResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; -}; -export type FreebitCancelAccountResponse = ReturnType; -export declare function transformFreebitEsimReissueResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; -}; -export type FreebitEsimReissueResponse = ReturnType; -export declare function transformFreebitEsimAddAccountResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; -}; -export type FreebitEsimAddAccountResponse = ReturnType; -export declare function transformFreebitEsimActivationResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; -}; -export declare function transformFreebitAuthResponse(raw: unknown): FreebitAuthResponseRaw; diff --git a/packages/domain/sim/providers/freebit/mapper.js b/packages/domain/sim/providers/freebit/mapper.js deleted file mode 100644 index 991a6f50..00000000 --- a/packages/domain/sim/providers/freebit/mapper.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.transformFreebitAccountDetails = transformFreebitAccountDetails; -exports.transformFreebitTrafficInfo = transformFreebitTrafficInfo; -exports.transformFreebitQuotaHistory = transformFreebitQuotaHistory; -exports.transformFreebitTopUpResponse = transformFreebitTopUpResponse; -exports.transformFreebitAddSpecResponse = transformFreebitAddSpecResponse; -exports.transformFreebitPlanChangeResponse = transformFreebitPlanChangeResponse; -exports.transformFreebitCancelPlanResponse = transformFreebitCancelPlanResponse; -exports.transformFreebitCancelAccountResponse = transformFreebitCancelAccountResponse; -exports.transformFreebitEsimReissueResponse = transformFreebitEsimReissueResponse; -exports.transformFreebitEsimAddAccountResponse = transformFreebitEsimAddAccountResponse; -exports.transformFreebitEsimActivationResponse = transformFreebitEsimActivationResponse; -exports.transformFreebitAuthResponse = transformFreebitAuthResponse; -const schema_1 = require("../../schema"); -const raw_types_1 = require("./raw.types"); -function asString(value) { - if (typeof value === "string") - return value; - if (typeof value === "number") - return String(value); - return ""; -} -function asNumber(value) { - if (typeof value === "number") - return value; - if (typeof value === "string") { - const parsed = parseFloat(value); - return isNaN(parsed) ? 0 : parsed; - } - return 0; -} -function parseBooleanFlag(value) { - if (typeof value === "boolean") - return value; - if (typeof value === "number") - return value === 10; - if (typeof value === "string") - return value === "10" || value.toLowerCase() === "true"; - return false; -} -function mapSimStatus(status) { - if (!status) - return "pending"; - const normalized = status.toLowerCase(); - if (normalized.includes("active") || normalized === "10") - return "active"; - if (normalized.includes("suspend")) - return "suspended"; - if (normalized.includes("cancel") || normalized.includes("terminate")) - return "cancelled"; - return "pending"; -} -function deriveSimType(sizeValue, eid) { - const simSizeStr = typeof sizeValue === "number" ? String(sizeValue) : sizeValue; - const raw = typeof simSizeStr === "string" ? simSizeStr.toLowerCase() : undefined; - const eidStr = typeof eid === "number" ? String(eid) : eid; - if (eidStr && eidStr.length > 0) { - return "esim"; - } - switch (raw) { - case "nano": - return "nano"; - case "micro": - return "micro"; - case "esim": - return "esim"; - default: - return "standard"; - } -} -function transformFreebitAccountDetails(raw) { - const response = raw_types_1.freebitAccountDetailsRawSchema.parse(raw); - const account = response.responseDatas.at(0); - if (!account) { - throw new Error("Freebit account details missing response data"); - } - const sanitizedAccount = asString(account.account); - const simSizeValue = account.simSize ?? account.size; - const eidValue = account.eid; - const simType = deriveSimType(typeof simSizeValue === 'number' ? String(simSizeValue) : simSizeValue, typeof eidValue === 'number' ? String(eidValue) : eidValue); - const voiceMailEnabled = parseBooleanFlag(account.voicemail ?? account.voiceMail); - const callWaitingEnabled = parseBooleanFlag(account.callwaiting ?? account.callWaiting); - const internationalRoamingEnabled = parseBooleanFlag(account.worldwing ?? account.worldWing); - const simDetails = { - account: sanitizedAccount, - status: mapSimStatus(account.status), - planCode: asString(account.planCode), - planName: asString(account.planName), - simType, - iccid: asString(account.iccid), - eid: asString(eidValue), - msisdn: asString(account.msisdn), - imsi: asString(account.imsi), - remainingQuotaMb: asNumber(account.quota), - remainingQuotaKb: asNumber(account.quotaKb), - voiceMailEnabled, - callWaitingEnabled, - internationalRoamingEnabled, - networkType: asString(account.contractLine), - activatedAt: asString(account.startDate) || undefined, - expiresAt: asString(account.expireDate) || undefined, - }; - return schema_1.simDetailsSchema.parse(simDetails); -} -function transformFreebitTrafficInfo(raw) { - const response = raw_types_1.freebitTrafficInfoRawSchema.parse(raw); - const simUsage = { - account: asString(response.account), - todayUsageMb: response.traffic?.today ? asNumber(response.traffic.today) / 1024 : 0, - todayUsageKb: response.traffic?.today ? asNumber(response.traffic.today) : 0, - monthlyUsageMb: undefined, - monthlyUsageKb: undefined, - recentDaysUsage: [], - isBlacklisted: parseBooleanFlag(response.traffic?.blackList), - lastUpdated: new Date().toISOString(), - }; - return schema_1.simUsageSchema.parse(simUsage); -} -function transformFreebitQuotaHistory(raw, accountOverride) { - const response = raw_types_1.freebitQuotaHistoryRawSchema.parse(raw); - const history = { - account: accountOverride ?? asString(response.account), - totalAdditions: asNumber(response.total), - additionCount: asNumber(response.count), - history: (response.quotaHistory || []).map(detail => ({ - quotaKb: asNumber(detail.addQuotaKb), - quotaMb: asNumber(detail.addQuotaKb) / 1024, - addedDate: detail.addDate || "", - expiryDate: detail.expireDate || "", - campaignCode: detail.campaignCode || "", - })), - }; - return schema_1.simTopUpHistorySchema.parse(history); -} -function transformFreebitTopUpResponse(raw) { - return raw_types_1.freebitTopUpRawSchema.parse(raw); -} -function transformFreebitAddSpecResponse(raw) { - return raw_types_1.freebitAddSpecRawSchema.parse(raw); -} -function transformFreebitPlanChangeResponse(raw) { - return raw_types_1.freebitPlanChangeRawSchema.parse(raw); -} -function transformFreebitCancelPlanResponse(raw) { - return raw_types_1.freebitCancelPlanRawSchema.parse(raw); -} -function transformFreebitCancelAccountResponse(raw) { - return raw_types_1.freebitCancelAccountRawSchema.parse(raw); -} -function transformFreebitEsimReissueResponse(raw) { - return raw_types_1.freebitEsimReissueRawSchema.parse(raw); -} -function transformFreebitEsimAddAccountResponse(raw) { - return raw_types_1.freebitEsimAddAccountRawSchema.parse(raw); -} -function transformFreebitEsimActivationResponse(raw) { - return raw_types_1.freebitEsimAddAccountRawSchema.parse(raw); -} -function transformFreebitAuthResponse(raw) { - return raw_types_1.freebitAuthResponseRawSchema.parse(raw); -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/mapper.js.map b/packages/domain/sim/providers/freebit/mapper.js.map deleted file mode 100644 index d1f5ff38..00000000 --- a/packages/domain/sim/providers/freebit/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;AAoFA,wEAuCC;AAED,kEAeC;AAED,oEAoBC;AAED,sEAEC;AAID,0EAEC;AAID,gFAEC;AAID,gFAEC;AAID,sFAEC;AAID,kFAEC;AAID,wFAEC;AAID,wFAEC;AAED,oEAEC;AA/MD,yCAAuF;AACvF,2CAuBqB;AAGrB,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAA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AAC;AACnD,CAAC;AAED,SAAgB,4BAA4B,CAAC,GAAY;IACvD,OAAO,wCAA4B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/raw.types.d.ts b/packages/domain/sim/providers/freebit/raw.types.d.ts deleted file mode 100644 index 86ce9268..00000000 --- a/packages/domain/sim/providers/freebit/raw.types.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { z } from "zod"; -export declare const freebitAccountDetailsRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - resultMessage: z.ZodOptional; - responseDatas: z.ZodArray; - account: z.ZodOptional>; - state: z.ZodOptional; - status: z.ZodOptional; - planCode: z.ZodOptional>; - planName: z.ZodOptional>; - simSize: z.ZodOptional; - iccid: z.ZodOptional; - eid: z.ZodOptional>; - msisdn: z.ZodOptional; - imsi: z.ZodOptional; - quota: z.ZodOptional>; - quotaKb: z.ZodOptional>; - voicemail: z.ZodOptional; - voiceMail: z.ZodOptional; - callwaiting: z.ZodOptional; - callWaiting: z.ZodOptional; - worldwing: z.ZodOptional; - worldWing: z.ZodOptional; - contractLine: z.ZodOptional; - startDate: z.ZodOptional; - expireDate: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitAccountDetailsRaw = z.infer; -export declare const freebitTrafficInfoRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; - account: z.ZodOptional>; - traffic: z.ZodOptional>; - inRecentDays: z.ZodOptional>; - blackList: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const freebitTopUpRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitTopUpRaw = z.infer; -export declare const freebitAddSpecRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitAddSpecRaw = z.infer; -export declare const freebitPlanChangeRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; - ipv4: z.ZodOptional; - ipv6: z.ZodOptional; -}, z.core.$strip>; -export type FreebitPlanChangeRaw = z.infer; -export declare const freebitCancelPlanRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitCancelPlanRaw = z.infer; -export declare const freebitCancelAccountRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitCancelAccountRaw = z.infer; -export declare const freebitEsimReissueRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitEsimReissueRaw = z.infer; -export declare const freebitEsimAddAccountRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitEsimAddAccountRaw = z.infer; -export type FreebitTrafficInfoRaw = z.infer; -export declare const freebitQuotaHistoryRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; - account: z.ZodOptional>; - total: z.ZodOptional>; - count: z.ZodOptional>; - quotaHistory: z.ZodOptional>; - addDate: z.ZodOptional; - expireDate: z.ZodOptional; - campaignCode: z.ZodOptional; - }, z.core.$strip>>>; -}, z.core.$strip>; -export type FreebitQuotaHistoryRaw = z.infer; -export declare const freebitAuthResponseRawSchema: z.ZodObject<{ - resultCode: z.ZodOptional; - status: z.ZodOptional; - statusCode: z.ZodOptional>; - }, z.core.$strip>>; - authKey: z.ZodOptional; -}, z.core.$strip>; -export type FreebitAuthResponseRaw = z.infer; diff --git a/packages/domain/sim/providers/freebit/raw.types.js b/packages/domain/sim/providers/freebit/raw.types.js deleted file mode 100644 index 5b2c8d25..00000000 --- a/packages/domain/sim/providers/freebit/raw.types.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.freebitAuthResponseRawSchema = exports.freebitQuotaHistoryRawSchema = exports.freebitEsimAddAccountRawSchema = exports.freebitEsimReissueRawSchema = exports.freebitCancelAccountRawSchema = exports.freebitCancelPlanRawSchema = exports.freebitPlanChangeRawSchema = exports.freebitAddSpecRawSchema = exports.freebitTopUpRawSchema = exports.freebitTrafficInfoRawSchema = exports.freebitAccountDetailsRawSchema = void 0; -const zod_1 = require("zod"); -exports.freebitAccountDetailsRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - resultMessage: zod_1.z.string().optional(), - responseDatas: zod_1.z.array(zod_1.z.object({ - kind: zod_1.z.string().optional(), - account: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.null()]).optional(), - state: zod_1.z.string().optional(), - status: zod_1.z.string().optional(), - planCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.null()]).optional(), - planName: zod_1.z.union([zod_1.z.string(), zod_1.z.null()]).optional(), - simSize: zod_1.z.string().optional(), - iccid: zod_1.z.string().optional(), - eid: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.null()]).optional(), - msisdn: zod_1.z.string().optional(), - imsi: zod_1.z.string().optional(), - quota: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - quotaKb: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - voicemail: zod_1.z.string().optional(), - voiceMail: zod_1.z.string().optional(), - callwaiting: zod_1.z.string().optional(), - callWaiting: zod_1.z.string().optional(), - worldwing: zod_1.z.string().optional(), - worldWing: zod_1.z.string().optional(), - contractLine: zod_1.z.string().optional(), - startDate: zod_1.z.string().optional(), - expireDate: zod_1.z.string().optional(), - })), -}); -exports.freebitTrafficInfoRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), - account: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - traffic: zod_1.z.object({ - today: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - inRecentDays: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - blackList: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }).optional(), -}); -exports.freebitTopUpRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), -}); -exports.freebitAddSpecRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), -}); -exports.freebitPlanChangeRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), - ipv4: zod_1.z.string().optional(), - ipv6: zod_1.z.string().optional(), -}); -exports.freebitCancelPlanRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), -}); -exports.freebitCancelAccountRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), -}); -exports.freebitEsimReissueRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), -}); -exports.freebitEsimAddAccountRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), -}); -exports.freebitQuotaHistoryRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), - account: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - total: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - count: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - quotaHistory: zod_1.z.array(zod_1.z.object({ - addQuotaKb: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - addDate: zod_1.z.string().optional(), - expireDate: zod_1.z.string().optional(), - campaignCode: zod_1.z.string().optional(), - })).optional(), -}); -exports.freebitAuthResponseRawSchema = zod_1.z.object({ - resultCode: zod_1.z.string().optional(), - status: zod_1.z - .object({ - message: zod_1.z.string().optional(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - }) - .optional(), - authKey: zod_1.z.string().optional(), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/raw.types.js.map b/packages/domain/sim/providers/freebit/raw.types.js.map deleted file mode 100644 index 56827499..00000000 --- a/packages/domain/sim/providers/freebit/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":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EAAE,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,OAAC;SACN,MAAM,CAAC;QACN,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;KACzD,CAAC;SACD,QAAQ,EAAE;IACb,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/requests.d.ts b/packages/domain/sim/providers/freebit/requests.d.ts deleted file mode 100644 index 7d5a60c0..00000000 --- a/packages/domain/sim/providers/freebit/requests.d.ts +++ /dev/null @@ -1,264 +0,0 @@ -import { z } from "zod"; -export declare const freebitAccountDetailsRequestSchema: z.ZodObject<{ - version: z.ZodOptional; - requestDatas: z.ZodArray; - account: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const freebitTrafficInfoRequestSchema: z.ZodObject<{ - account: z.ZodString; -}, z.core.$strip>; -export declare const freebitTopUpOptionsSchema: z.ZodObject<{ - campaignCode: z.ZodOptional; - expiryDate: z.ZodOptional; - scheduledAt: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitTopUpRequestPayloadSchema: z.ZodObject<{ - account: z.ZodString; - quotaMb: z.ZodNumber; - options: z.ZodOptional; - expiryDate: z.ZodOptional; - scheduledAt: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const freebitTopUpApiRequestSchema: z.ZodObject<{ - account: z.ZodString; - quota: z.ZodNumber; - quotaCode: z.ZodOptional; - expire: z.ZodOptional; - runTime: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitPlanChangeRequestSchema: z.ZodObject<{ - account: z.ZodString; - newPlanCode: z.ZodString; - assignGlobalIp: z.ZodOptional; - scheduledAt: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitPlanChangeApiRequestSchema: z.ZodObject<{ - account: z.ZodString; - plancode: z.ZodString; - globalip: z.ZodOptional>; - runTime: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitAddSpecRequestSchema: z.ZodObject<{ - account: z.ZodString; - specCode: z.ZodString; - enabled: z.ZodOptional; - networkType: z.ZodOptional>; -}, z.core.$strip>; -export declare const freebitRemoveSpecRequestSchema: z.ZodObject<{ - account: z.ZodString; - specCode: z.ZodString; -}, z.core.$strip>; -export declare const freebitCancelPlanRequestSchema: z.ZodObject<{ - account: z.ZodString; - runDate: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitCancelPlanApiRequestSchema: z.ZodObject<{ - account: z.ZodString; - runTime: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitQuotaHistoryRequestSchema: z.ZodObject<{ - account: z.ZodString; - fromDate: z.ZodString; - toDate: z.ZodString; -}, z.core.$strip>; -export declare const freebitQuotaHistoryResponseSchema: z.ZodObject<{ - resultCode: z.ZodString; - status: z.ZodOptional; - }, z.core.$strip>>; - total: z.ZodUnion; - count: z.ZodUnion; - quotaHistory: z.ZodArray; - addDate: z.ZodString; - expireDate: z.ZodString; - campaignCode: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const freebitEsimMnpSchema: z.ZodObject<{ - reserveNumber: z.ZodString; - reserveExpireDate: z.ZodString; -}, z.core.$strip>; -export declare const freebitEsimReissueRequestSchema: z.ZodObject<{ - account: z.ZodString; - newEid: z.ZodString; - oldEid: z.ZodOptional; - planCode: z.ZodOptional; - oldProductNumber: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitEsimAddAccountRequestSchema: z.ZodObject<{ - authKey: z.ZodOptional; - aladinOperated: z.ZodDefault>; - account: z.ZodString; - eid: z.ZodString; - addKind: z.ZodDefault>; - shipDate: z.ZodOptional; - planCode: z.ZodOptional; - contractLine: z.ZodOptional>; - mnp: z.ZodOptional>; -}, z.core.$strip>; -export declare const freebitSimFeaturesRequestSchema: z.ZodObject<{ - account: z.ZodString; - voiceMailEnabled: z.ZodOptional; - callWaitingEnabled: z.ZodOptional; - callForwardingEnabled: z.ZodOptional; - callerIdEnabled: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitGlobalIpRequestSchema: z.ZodObject<{ - account: z.ZodString; - assign: z.ZodBoolean; -}, z.core.$strip>; -export declare const freebitAuthRequestSchema: z.ZodObject<{ - oemId: z.ZodString; - oemKey: z.ZodString; -}, z.core.$strip>; -export declare const freebitCancelAccountRequestSchema: z.ZodObject<{ - account: z.ZodString; - runDate: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitEsimIdentitySchema: z.ZodObject<{ - firstnameKanji: z.ZodOptional; - lastnameKanji: z.ZodOptional; - firstnameZenKana: z.ZodOptional; - lastnameZenKana: z.ZodOptional; - gender: z.ZodOptional>; - birthday: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitEsimActivationRequestSchema: z.ZodObject<{ - authKey: z.ZodString; - aladinOperated: z.ZodDefault>; - createType: z.ZodDefault>; - account: z.ZodString; - eid: z.ZodString; - simkind: z.ZodDefault>; - planCode: z.ZodOptional; - contractLine: z.ZodOptional>; - shipDate: z.ZodOptional; - mnp: z.ZodOptional>; - firstnameKanji: z.ZodOptional; - lastnameKanji: z.ZodOptional; - firstnameZenKana: z.ZodOptional; - lastnameZenKana: z.ZodOptional; - gender: z.ZodOptional>; - birthday: z.ZodOptional; - masterAccount: z.ZodOptional; - masterPassword: z.ZodOptional; - repAccount: z.ZodOptional; - size: z.ZodOptional; - addKind: z.ZodOptional; - oldEid: z.ZodOptional; - oldProductNumber: z.ZodOptional; - deliveryCode: z.ZodOptional; - globalIp: z.ZodOptional>; -}, z.core.$strip>; -export declare const freebitEsimActivationResponseSchema: z.ZodObject<{ - resultCode: z.ZodString; - resultMessage: z.ZodOptional; - data: z.ZodOptional; - status: z.ZodOptional; - message: z.ZodString; - }, z.core.$strip>>; - message: z.ZodOptional; -}, z.core.$strip>; -export declare const freebitEsimActivationParamsSchema: z.ZodObject<{ - account: z.ZodString; - eid: z.ZodString; - planCode: z.ZodOptional; - contractLine: z.ZodOptional>; - aladinOperated: z.ZodDefault>; - shipDate: z.ZodOptional; - mnp: z.ZodOptional>; - identity: z.ZodOptional; - lastnameKanji: z.ZodOptional; - firstnameZenKana: z.ZodOptional; - lastnameZenKana: z.ZodOptional; - gender: z.ZodOptional>; - birthday: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export type FreebitAccountDetailsRequest = z.infer; -export type FreebitTrafficInfoRequest = z.infer; -export type FreebitTopUpRequest = z.infer; -export type FreebitTopUpApiRequest = z.infer; -export type FreebitPlanChangeRequest = z.infer; -export type FreebitPlanChangeApiRequest = z.infer; -export type FreebitAddSpecRequest = z.infer; -export type FreebitRemoveSpecRequest = z.infer; -export type FreebitCancelPlanRequest = z.infer; -export type FreebitCancelPlanApiRequest = z.infer; -export type FreebitSimFeaturesRequest = z.infer; -export type FreebitGlobalIpRequest = z.infer; -export type FreebitEsimActivationRequest = z.infer; -export type FreebitEsimActivationResponse = z.infer; -export type FreebitEsimActivationParams = z.infer; -export type FreebitEsimReissueRequest = z.infer; -export type FreebitQuotaHistoryRequest = z.infer; -export type FreebitQuotaHistoryResponse = z.infer; -export type FreebitEsimAddAccountRequest = z.infer; -export type FreebitAuthRequest = z.infer; -export type FreebitCancelAccountRequest = z.infer; diff --git a/packages/domain/sim/providers/freebit/requests.js b/packages/domain/sim/providers/freebit/requests.js deleted file mode 100644 index 0868669a..00000000 --- a/packages/domain/sim/providers/freebit/requests.js +++ /dev/null @@ -1,182 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.freebitEsimActivationParamsSchema = exports.freebitEsimActivationResponseSchema = exports.freebitEsimActivationRequestSchema = exports.freebitEsimIdentitySchema = exports.freebitCancelAccountRequestSchema = exports.freebitAuthRequestSchema = exports.freebitGlobalIpRequestSchema = exports.freebitSimFeaturesRequestSchema = exports.freebitEsimAddAccountRequestSchema = exports.freebitEsimReissueRequestSchema = exports.freebitEsimMnpSchema = exports.freebitQuotaHistoryResponseSchema = exports.freebitQuotaHistoryRequestSchema = exports.freebitCancelPlanApiRequestSchema = exports.freebitCancelPlanRequestSchema = exports.freebitRemoveSpecRequestSchema = exports.freebitAddSpecRequestSchema = exports.freebitPlanChangeApiRequestSchema = exports.freebitPlanChangeRequestSchema = exports.freebitTopUpApiRequestSchema = exports.freebitTopUpRequestPayloadSchema = exports.freebitTopUpOptionsSchema = exports.freebitTrafficInfoRequestSchema = exports.freebitAccountDetailsRequestSchema = void 0; -const zod_1 = require("zod"); -exports.freebitAccountDetailsRequestSchema = zod_1.z.object({ - version: zod_1.z.string().optional(), - requestDatas: zod_1.z - .array(zod_1.z.object({ - kind: zod_1.z.enum(["MASTER", "MVNO"]), - account: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - })) - .min(1, "At least one request data entry is required"), -}); -exports.freebitTrafficInfoRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), -}); -exports.freebitTopUpOptionsSchema = zod_1.z.object({ - campaignCode: zod_1.z.string().optional(), - expiryDate: zod_1.z.string().optional(), - scheduledAt: zod_1.z.string().optional(), -}); -exports.freebitTopUpRequestPayloadSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - quotaMb: zod_1.z.number().positive("Quota must be positive"), - options: exports.freebitTopUpOptionsSchema.optional(), -}); -exports.freebitTopUpApiRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - quota: zod_1.z.number().positive("Quota must be positive"), - quotaCode: zod_1.z.string().optional(), - expire: zod_1.z.string().optional(), - runTime: zod_1.z.string().optional(), -}); -exports.freebitPlanChangeRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - newPlanCode: zod_1.z.string().min(1, "New plan code is required"), - assignGlobalIp: zod_1.z.boolean().optional(), - scheduledAt: zod_1.z.string().optional(), -}); -exports.freebitPlanChangeApiRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - plancode: zod_1.z.string().min(1, "Plan code is required"), - globalip: zod_1.z.enum(["0", "1"]).optional(), - runTime: zod_1.z.string().optional(), -}); -exports.freebitAddSpecRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - specCode: zod_1.z.string().min(1, "Spec code is required"), - enabled: zod_1.z.boolean().optional(), - networkType: zod_1.z.enum(["4G", "5G"]).optional(), -}); -exports.freebitRemoveSpecRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - specCode: zod_1.z.string().min(1, "Spec code is required"), -}); -exports.freebitCancelPlanRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - runDate: zod_1.z.string().optional(), -}); -exports.freebitCancelPlanApiRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - runTime: zod_1.z.string().optional(), -}); -exports.freebitQuotaHistoryRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - fromDate: zod_1.z.string().regex(/^\d{8}$/, "From date must be in YYYYMMDD format"), - toDate: zod_1.z.string().regex(/^\d{8}$/, "To date must be in YYYYMMDD format"), -}); -exports.freebitQuotaHistoryResponseSchema = zod_1.z.object({ - resultCode: zod_1.z.string(), - status: zod_1.z - .object({ - message: zod_1.z.string(), - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]), - }) - .optional(), - total: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]), - count: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]), - quotaHistory: zod_1.z.array(zod_1.z.object({ - addQuotaKb: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]), - addDate: zod_1.z.string(), - expireDate: zod_1.z.string(), - campaignCode: zod_1.z.string().optional(), - })), -}); -exports.freebitEsimMnpSchema = zod_1.z.object({ - reserveNumber: zod_1.z.string().min(1, "Reserve number is required"), - reserveExpireDate: zod_1.z.string().regex(/^\d{8}$/, "Reserve expire date must be in YYYYMMDD format"), -}); -exports.freebitEsimReissueRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - newEid: zod_1.z.string().min(1, "New EID is required"), - oldEid: zod_1.z.string().optional(), - planCode: zod_1.z.string().optional(), - oldProductNumber: zod_1.z.string().optional(), -}); -exports.freebitEsimAddAccountRequestSchema = zod_1.z.object({ - authKey: zod_1.z.string().min(1).optional(), - aladinOperated: zod_1.z.enum(["10", "20"]).default("10"), - account: zod_1.z.string().min(1, "Account is required"), - eid: zod_1.z.string().min(1, "EID is required"), - addKind: zod_1.z.enum(["N", "R"]).default("N"), - shipDate: zod_1.z.string().regex(/^\d{8}$/, "Ship date must be in YYYYMMDD format").optional(), - planCode: zod_1.z.string().optional(), - contractLine: zod_1.z.enum(["4G", "5G"]).optional(), - mnp: exports.freebitEsimMnpSchema.optional(), -}); -exports.freebitSimFeaturesRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - voiceMailEnabled: zod_1.z.boolean().optional(), - callWaitingEnabled: zod_1.z.boolean().optional(), - callForwardingEnabled: zod_1.z.boolean().optional(), - callerIdEnabled: zod_1.z.boolean().optional(), -}); -exports.freebitGlobalIpRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - assign: zod_1.z.boolean(), -}); -exports.freebitAuthRequestSchema = zod_1.z.object({ - oemId: zod_1.z.string().min(1), - oemKey: zod_1.z.string().min(1), -}); -exports.freebitCancelAccountRequestSchema = zod_1.z.object({ - account: zod_1.z.string().min(1), - runDate: zod_1.z.string().optional(), -}); -exports.freebitEsimIdentitySchema = zod_1.z.object({ - firstnameKanji: zod_1.z.string().optional(), - lastnameKanji: zod_1.z.string().optional(), - firstnameZenKana: zod_1.z.string().optional(), - lastnameZenKana: zod_1.z.string().optional(), - gender: zod_1.z.enum(["M", "F"]).optional(), - birthday: zod_1.z.string().regex(/^\d{8}$/, "Birthday must be in YYYYMMDD format").optional(), -}); -exports.freebitEsimActivationRequestSchema = zod_1.z.object({ - authKey: zod_1.z.string().min(1, "Auth key is required"), - aladinOperated: zod_1.z.enum(["10", "20"]).default("10"), - createType: zod_1.z.enum(["new", "reissue", "exchange"]).default("new"), - account: zod_1.z.string().min(1, "Account (MSISDN) is required"), - eid: zod_1.z.string().min(1, "EID is required for eSIM"), - simkind: zod_1.z.enum(["esim", "psim"]).default("esim"), - planCode: zod_1.z.string().optional(), - contractLine: zod_1.z.enum(["4G", "5G"]).optional(), - shipDate: zod_1.z.string().regex(/^\d{8}$/, "Ship date must be in YYYYMMDD format").optional(), - mnp: exports.freebitEsimMnpSchema.optional(), - firstnameKanji: zod_1.z.string().optional(), - lastnameKanji: zod_1.z.string().optional(), - firstnameZenKana: zod_1.z.string().optional(), - lastnameZenKana: zod_1.z.string().optional(), - gender: zod_1.z.enum(["M", "F"]).optional(), - birthday: zod_1.z.string().regex(/^\d{8}$/, "Birthday must be in YYYYMMDD format").optional(), - masterAccount: zod_1.z.string().optional(), - masterPassword: zod_1.z.string().optional(), - repAccount: zod_1.z.string().optional(), - size: zod_1.z.string().optional(), - addKind: zod_1.z.string().optional(), - oldEid: zod_1.z.string().optional(), - oldProductNumber: zod_1.z.string().optional(), - deliveryCode: zod_1.z.string().optional(), - globalIp: zod_1.z.enum(["10", "20"]).optional(), -}); -exports.freebitEsimActivationResponseSchema = zod_1.z.object({ - resultCode: zod_1.z.string(), - resultMessage: zod_1.z.string().optional(), - data: zod_1.z.any().optional(), - status: zod_1.z.object({ - statusCode: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]), - message: zod_1.z.string(), - }).optional(), - message: zod_1.z.string().optional(), -}); -exports.freebitEsimActivationParamsSchema = zod_1.z.object({ - account: zod_1.z.string().min(1, "Account is required"), - eid: zod_1.z.string().min(1, "EID is required"), - planCode: zod_1.z.string().optional(), - contractLine: zod_1.z.enum(["4G", "5G"]).optional(), - aladinOperated: zod_1.z.enum(["10", "20"]).default("10"), - shipDate: zod_1.z.string().regex(/^\d{8}$/, "Ship date must be in YYYYMMDD format").optional(), - mnp: exports.freebitEsimMnpSchema.optional(), - identity: exports.freebitEsimIdentitySchema.optional(), -}); -//# sourceMappingURL=requests.js.map \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/requests.js.map b/packages/domain/sim/providers/freebit/requests.js.map deleted file mode 100644 index 1aa8c548..00000000 --- a/packages/domain/sim/providers/freebit/requests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"requests.js","sourceRoot":"","sources":["requests.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAMX,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,YAAY,EAAE,OAAC;SACZ,KAAK,CACJ,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAChC,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;KACtD,CAAC,CACH;SACA,GAAG,CAAC,CAAC,EAAE,6CAA6C,CAAC;CACzD,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC;CAClD,CAAC,CAAC;AAMU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;C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AE,OAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAClD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,sCAAsC,CAAC,CAAC,QAAQ,EAAE;IACxF,GAAG,EAAE,4BAAoB,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,iCAAyB,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/utils.d.ts b/packages/domain/sim/providers/freebit/utils.d.ts deleted file mode 100644 index 5a181d62..00000000 --- a/packages/domain/sim/providers/freebit/utils.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare function normalizeAccount(account: string): string; -export declare function validateAccount(account: string): boolean; -export declare function formatDateForApi(date: Date): string; -export declare function parseDateFromApi(dateString: string): Date | null; diff --git a/packages/domain/sim/providers/freebit/utils.js b/packages/domain/sim/providers/freebit/utils.js deleted file mode 100644 index 407b226a..00000000 --- a/packages/domain/sim/providers/freebit/utils.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizeAccount = normalizeAccount; -exports.validateAccount = validateAccount; -exports.formatDateForApi = formatDateForApi; -exports.parseDateFromApi = parseDateFromApi; -function normalizeAccount(account) { - return account.replace(/[^0-9]/g, ''); -} -function validateAccount(account) { - const normalized = normalizeAccount(account); - return /^\d{10,11}$/.test(normalized); -} -function formatDateForApi(date) { - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, '0'); - const day = String(date.getDate()).padStart(2, '0'); - return `${year}${month}${day}`; -} -function parseDateFromApi(dateString) { - if (!/^\d{8}$/.test(dateString)) - return null; - const year = parseInt(dateString.substring(0, 4), 10); - const month = parseInt(dateString.substring(4, 6), 10) - 1; - const day = parseInt(dateString.substring(6, 8), 10); - return new Date(year, month, day); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/packages/domain/sim/providers/freebit/utils.js.map b/packages/domain/sim/providers/freebit/utils.js.map deleted file mode 100644 index 8519655d..00000000 --- a/packages/domain/sim/providers/freebit/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":";;AAUA,4CAEC;AAKD,0CAGC;AAKD,4CAKC;AAMD,4CAQC;AAlCD,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAKD,SAAgB,eAAe,CAAC,OAAe;IAC7C,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC;AAKD,SAAgB,gBAAgB,CAAC,IAAU;IACzC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACpD,OAAO,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,EAAE,CAAC;AACjC,CAAC;AAMD,SAAgB,gBAAgB,CAAC,UAAkB;IACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAE7C,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAErD,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/providers/index.d.ts b/packages/domain/sim/providers/index.d.ts deleted file mode 100644 index 1ee96359..00000000 --- a/packages/domain/sim/providers/index.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -import * as FreebitModule from "./freebit/index"; -export declare const Freebit: { - mapper: typeof import("./freebit/mapper"); - raw: typeof import("./freebit/raw.types"); - schemas: { - accountDetails: import("node_modules/zod/index.cjs").ZodObject<{ - version: import("node_modules/zod/index.cjs").ZodOptional; - requestDatas: import("node_modules/zod/index.cjs").ZodArray; - account: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - trafficInfo: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - topUp: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - quotaMb: import("node_modules/zod/index.cjs").ZodNumber; - options: import("node_modules/zod/index.cjs").ZodOptional; - expiryDate: import("node_modules/zod/index.cjs").ZodOptional; - scheduledAt: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - topUpApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - quota: import("node_modules/zod/index.cjs").ZodNumber; - quotaCode: import("node_modules/zod/index.cjs").ZodOptional; - expire: import("node_modules/zod/index.cjs").ZodOptional; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - planChange: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - newPlanCode: import("node_modules/zod/index.cjs").ZodString; - assignGlobalIp: import("node_modules/zod/index.cjs").ZodOptional; - scheduledAt: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - planChangeApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - plancode: import("node_modules/zod/index.cjs").ZodString; - globalip: import("node_modules/zod/index.cjs").ZodOptional>; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - addSpec: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - specCode: import("node_modules/zod/index.cjs").ZodString; - enabled: import("node_modules/zod/index.cjs").ZodOptional; - networkType: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelPlan: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runDate: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelPlanApi: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runTime: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - quotaHistory: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - fromDate: import("node_modules/zod/index.cjs").ZodString; - toDate: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimReissue: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - newEid: import("node_modules/zod/index.cjs").ZodString; - oldEid: import("node_modules/zod/index.cjs").ZodOptional; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - oldProductNumber: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - simFeatures: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - voiceMailEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callWaitingEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callForwardingEnabled: import("node_modules/zod/index.cjs").ZodOptional; - callerIdEnabled: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - globalIp: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - assign: import("node_modules/zod/index.cjs").ZodBoolean; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimActivationParams: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - identity: import("node_modules/zod/index.cjs").ZodOptional; - lastnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - firstnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - lastnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - gender: import("node_modules/zod/index.cjs").ZodOptional>; - birthday: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimActivationRequest: import("node_modules/zod/index.cjs").ZodObject<{ - authKey: import("node_modules/zod/index.cjs").ZodString; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - createType: import("node_modules/zod/index.cjs").ZodDefault>; - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - simkind: import("node_modules/zod/index.cjs").ZodDefault>; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - firstnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - lastnameKanji: import("node_modules/zod/index.cjs").ZodOptional; - firstnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - lastnameZenKana: import("node_modules/zod/index.cjs").ZodOptional; - gender: import("node_modules/zod/index.cjs").ZodOptional>; - birthday: import("node_modules/zod/index.cjs").ZodOptional; - masterAccount: import("node_modules/zod/index.cjs").ZodOptional; - masterPassword: import("node_modules/zod/index.cjs").ZodOptional; - repAccount: import("node_modules/zod/index.cjs").ZodOptional; - size: import("node_modules/zod/index.cjs").ZodOptional; - addKind: import("node_modules/zod/index.cjs").ZodOptional; - oldEid: import("node_modules/zod/index.cjs").ZodOptional; - oldProductNumber: import("node_modules/zod/index.cjs").ZodOptional; - deliveryCode: import("node_modules/zod/index.cjs").ZodOptional; - globalIp: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - esimAddAccount: import("node_modules/zod/index.cjs").ZodObject<{ - authKey: import("node_modules/zod/index.cjs").ZodOptional; - aladinOperated: import("node_modules/zod/index.cjs").ZodDefault>; - account: import("node_modules/zod/index.cjs").ZodString; - eid: import("node_modules/zod/index.cjs").ZodString; - addKind: import("node_modules/zod/index.cjs").ZodDefault>; - shipDate: import("node_modules/zod/index.cjs").ZodOptional; - planCode: import("node_modules/zod/index.cjs").ZodOptional; - contractLine: import("node_modules/zod/index.cjs").ZodOptional>; - mnp: import("node_modules/zod/index.cjs").ZodOptional>; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - auth: import("node_modules/zod/index.cjs").ZodObject<{ - oemId: import("node_modules/zod/index.cjs").ZodString; - oemKey: import("node_modules/zod/index.cjs").ZodString; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - cancelAccount: import("node_modules/zod/index.cjs").ZodObject<{ - account: import("node_modules/zod/index.cjs").ZodString; - runDate: import("node_modules/zod/index.cjs").ZodOptional; - }, import("node_modules/zod/v4/core/schemas.cjs").$strip>; - }; - requests: typeof import("./freebit/requests"); - utils: typeof import("./freebit/utils"); - normalizeAccount(account: string): string; - validateAccount(account: string): boolean; - formatDateForApi(date: Date): string; - parseDateFromApi(dateString: string): Date | null; - transformFreebitAccountDetails(raw: unknown): import("..").SimDetails; - transformFreebitTrafficInfo(raw: unknown): import("..").SimUsage; - transformFreebitQuotaHistory(raw: unknown, accountOverride?: string): import("..").SimTopUpHistory; - transformFreebitTopUpResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitAddSpecResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitPlanChangeResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - ipv4?: string | undefined; - ipv6?: string | undefined; - }; - transformFreebitCancelPlanResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitCancelAccountResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitEsimReissueResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitEsimAddAccountResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitEsimActivationResponse(raw: unknown): { - resultCode?: string | undefined; - status?: { - message?: string | undefined; - statusCode?: string | number | undefined; - } | undefined; - }; - transformFreebitAuthResponse(raw: unknown): FreebitModule.FreebitAuthResponseRaw; -}; -export { FreebitModule }; -export * from "./freebit/index"; diff --git a/packages/domain/sim/providers/index.js b/packages/domain/sim/providers/index.js deleted file mode 100644 index ddcea224..00000000 --- a/packages/domain/sim/providers/index.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FreebitModule = exports.Freebit = void 0; -const index_1 = require("./freebit/index"); -const FreebitModule = __importStar(require("./freebit/index")); -exports.FreebitModule = FreebitModule; -exports.Freebit = index_1.Freebit; -__exportStar(require("./freebit/index"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/sim/providers/index.js.map b/packages/domain/sim/providers/index.js.map deleted file mode 100644 index a0073a29..00000000 --- a/packages/domain/sim/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2CAA+D;AAC/D,+DAAiD;AAGxC,sCAAa;AADT,QAAA,OAAO,GAAG,eAAiB,CAAC;AAEzC,kDAAgC"} \ No newline at end of file diff --git a/packages/domain/sim/schema.d.ts b/packages/domain/sim/schema.d.ts deleted file mode 100644 index d15ce3fe..00000000 --- a/packages/domain/sim/schema.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { z } from "zod"; -export declare const simStatusSchema: z.ZodEnum<{ - active: "active"; - pending: "pending"; - suspended: "suspended"; - cancelled: "cancelled"; -}>; -export declare const simTypeSchema: z.ZodEnum<{ - standard: "standard"; - nano: "nano"; - micro: "micro"; - esim: "esim"; -}>; -export declare const simDetailsSchema: z.ZodObject<{ - account: z.ZodString; - status: z.ZodEnum<{ - active: "active"; - pending: "pending"; - suspended: "suspended"; - cancelled: "cancelled"; - }>; - planCode: z.ZodString; - planName: z.ZodString; - simType: z.ZodEnum<{ - standard: "standard"; - nano: "nano"; - micro: "micro"; - esim: "esim"; - }>; - iccid: z.ZodString; - eid: z.ZodString; - msisdn: z.ZodString; - imsi: z.ZodString; - remainingQuotaMb: z.ZodNumber; - remainingQuotaKb: z.ZodNumber; - voiceMailEnabled: z.ZodBoolean; - callWaitingEnabled: z.ZodBoolean; - internationalRoamingEnabled: z.ZodBoolean; - networkType: z.ZodString; - activatedAt: z.ZodOptional; - expiresAt: z.ZodOptional; -}, z.core.$strip>; -export declare const recentDayUsageSchema: z.ZodObject<{ - date: z.ZodString; - usageKb: z.ZodNumber; - usageMb: z.ZodNumber; -}, z.core.$strip>; -export declare const simUsageSchema: z.ZodObject<{ - account: z.ZodString; - todayUsageMb: z.ZodNumber; - todayUsageKb: z.ZodNumber; - monthlyUsageMb: z.ZodOptional; - monthlyUsageKb: z.ZodOptional; - recentDaysUsage: z.ZodArray>; - isBlacklisted: z.ZodBoolean; - lastUpdated: z.ZodOptional; -}, z.core.$strip>; -export declare const simTopUpHistoryEntrySchema: z.ZodObject<{ - quotaKb: z.ZodNumber; - quotaMb: z.ZodNumber; - addedDate: z.ZodString; - expiryDate: z.ZodString; - campaignCode: z.ZodString; -}, z.core.$strip>; -export declare const simTopUpHistorySchema: z.ZodObject<{ - account: z.ZodString; - totalAdditions: z.ZodNumber; - additionCount: z.ZodNumber; - history: z.ZodArray>; -}, z.core.$strip>; -export declare const simTopUpRequestSchema: z.ZodObject<{ - quotaMb: z.ZodNumber; -}, z.core.$strip>; -export declare const simPlanChangeRequestSchema: z.ZodObject<{ - newPlanCode: z.ZodString; - assignGlobalIp: z.ZodOptional; - scheduledAt: z.ZodOptional; -}, z.core.$strip>; -export declare const simCancelRequestSchema: z.ZodObject<{ - scheduledAt: z.ZodOptional; -}, z.core.$strip>; -export declare const simTopUpHistoryRequestSchema: z.ZodObject<{ - fromDate: z.ZodString; - toDate: z.ZodString; -}, z.core.$strip>; -export declare const simFeaturesUpdateRequestSchema: z.ZodObject<{ - voiceMailEnabled: z.ZodOptional; - callWaitingEnabled: z.ZodOptional; - internationalRoamingEnabled: z.ZodOptional; - networkType: z.ZodOptional>; -}, z.core.$strip>; -export declare const simOrderActivationMnpSchema: z.ZodObject<{ - reserveNumber: z.ZodString; - reserveExpireDate: z.ZodString; - account: z.ZodOptional; - firstnameKanji: z.ZodOptional; - lastnameKanji: z.ZodOptional; - firstnameZenKana: z.ZodOptional; - lastnameZenKana: z.ZodOptional; - gender: z.ZodOptional; - birthday: z.ZodOptional; -}, z.core.$strip>; -export declare const simOrderActivationAddonsSchema: z.ZodObject<{ - voiceMail: z.ZodOptional; - callWaiting: z.ZodOptional; -}, z.core.$strip>; -export declare const simOrderActivationRequestSchema: z.ZodObject<{ - planSku: z.ZodString; - simType: z.ZodEnum<{ - eSIM: "eSIM"; - "Physical SIM": "Physical SIM"; - }>; - eid: z.ZodOptional; - activationType: z.ZodEnum<{ - Immediate: "Immediate"; - Scheduled: "Scheduled"; - }>; - scheduledAt: z.ZodOptional; - addons: z.ZodOptional; - callWaiting: z.ZodOptional; - }, z.core.$strip>>; - mnp: z.ZodOptional; - firstnameKanji: z.ZodOptional; - lastnameKanji: z.ZodOptional; - firstnameZenKana: z.ZodOptional; - lastnameZenKana: z.ZodOptional; - gender: z.ZodOptional; - birthday: z.ZodOptional; - }, z.core.$strip>>; - msisdn: z.ZodString; - oneTimeAmountJpy: z.ZodNumber; - monthlyAmountJpy: z.ZodNumber; -}, z.core.$strip>; -export type SimOrderActivationRequest = z.infer; -export type SimOrderActivationMnp = z.infer; -export type SimOrderActivationAddons = z.infer; -export declare const simTopupRequestSchema: z.ZodObject<{ - quotaMb: z.ZodNumber; -}, z.core.$strip>; -export type SimTopupRequest = SimTopUpRequest; -export declare const simChangePlanRequestSchema: z.ZodObject<{ - newPlanCode: z.ZodString; - assignGlobalIp: z.ZodOptional; - scheduledAt: z.ZodOptional; -}, z.core.$strip>; -export type SimChangePlanRequest = SimPlanChangeRequest; -export declare const simFeaturesRequestSchema: z.ZodObject<{ - voiceMailEnabled: z.ZodOptional; - callWaitingEnabled: z.ZodOptional; - internationalRoamingEnabled: z.ZodOptional; - networkType: z.ZodOptional>; -}, z.core.$strip>; -export type SimFeaturesRequest = SimFeaturesUpdateRequest; -export type SimStatus = z.infer; -export type SimType = z.infer; -export type SimDetails = z.infer; -export type RecentDayUsage = z.infer; -export type SimUsage = z.infer; -export type SimTopUpHistoryEntry = z.infer; -export type SimTopUpHistory = z.infer; -export type SimTopUpRequest = z.infer; -export type SimPlanChangeRequest = z.infer; -export type SimCancelRequest = z.infer; -export type SimTopUpHistoryRequest = z.infer; -export type SimFeaturesUpdateRequest = z.infer; diff --git a/packages/domain/sim/schema.js b/packages/domain/sim/schema.js deleted file mode 100644 index 326fca0a..00000000 --- a/packages/domain/sim/schema.js +++ /dev/null @@ -1,135 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.simFeaturesRequestSchema = exports.simChangePlanRequestSchema = exports.simTopupRequestSchema = exports.simOrderActivationRequestSchema = exports.simOrderActivationAddonsSchema = exports.simOrderActivationMnpSchema = exports.simFeaturesUpdateRequestSchema = exports.simTopUpHistoryRequestSchema = exports.simCancelRequestSchema = exports.simPlanChangeRequestSchema = exports.simTopUpRequestSchema = exports.simTopUpHistorySchema = exports.simTopUpHistoryEntrySchema = exports.simUsageSchema = exports.recentDayUsageSchema = exports.simDetailsSchema = exports.simTypeSchema = exports.simStatusSchema = void 0; -const zod_1 = require("zod"); -exports.simStatusSchema = zod_1.z.enum(["active", "suspended", "cancelled", "pending"]); -exports.simTypeSchema = zod_1.z.enum(["standard", "nano", "micro", "esim"]); -exports.simDetailsSchema = zod_1.z.object({ - account: zod_1.z.string(), - status: exports.simStatusSchema, - planCode: zod_1.z.string(), - planName: zod_1.z.string(), - simType: exports.simTypeSchema, - iccid: zod_1.z.string(), - eid: zod_1.z.string(), - msisdn: zod_1.z.string(), - imsi: zod_1.z.string(), - remainingQuotaMb: zod_1.z.number(), - remainingQuotaKb: zod_1.z.number(), - voiceMailEnabled: zod_1.z.boolean(), - callWaitingEnabled: zod_1.z.boolean(), - internationalRoamingEnabled: zod_1.z.boolean(), - networkType: zod_1.z.string(), - activatedAt: zod_1.z.string().optional(), - expiresAt: zod_1.z.string().optional(), -}); -exports.recentDayUsageSchema = zod_1.z.object({ - date: zod_1.z.string(), - usageKb: zod_1.z.number(), - usageMb: zod_1.z.number(), -}); -exports.simUsageSchema = zod_1.z.object({ - account: zod_1.z.string(), - todayUsageMb: zod_1.z.number(), - todayUsageKb: zod_1.z.number(), - monthlyUsageMb: zod_1.z.number().optional(), - monthlyUsageKb: zod_1.z.number().optional(), - recentDaysUsage: zod_1.z.array(exports.recentDayUsageSchema), - isBlacklisted: zod_1.z.boolean(), - lastUpdated: zod_1.z.string().optional(), -}); -exports.simTopUpHistoryEntrySchema = zod_1.z.object({ - quotaKb: zod_1.z.number(), - quotaMb: zod_1.z.number(), - addedDate: zod_1.z.string(), - expiryDate: zod_1.z.string(), - campaignCode: zod_1.z.string(), -}); -exports.simTopUpHistorySchema = zod_1.z.object({ - account: zod_1.z.string(), - totalAdditions: zod_1.z.number(), - additionCount: zod_1.z.number(), - history: zod_1.z.array(exports.simTopUpHistoryEntrySchema), -}); -exports.simTopUpRequestSchema = zod_1.z.object({ - quotaMb: zod_1.z - .number() - .int() - .min(100, "Quota must be at least 100MB") - .max(51200, "Quota must be 50GB or less"), -}); -exports.simPlanChangeRequestSchema = zod_1.z.object({ - newPlanCode: zod_1.z.string().min(1, "New plan code is required"), - assignGlobalIp: zod_1.z.boolean().optional(), - scheduledAt: zod_1.z - .string() - .regex(/^\d{8}$/, "Scheduled date must be in YYYYMMDD format") - .optional(), -}); -exports.simCancelRequestSchema = zod_1.z.object({ - scheduledAt: zod_1.z - .string() - .regex(/^\d{8}$/, "Scheduled date must be in YYYYMMDD format") - .optional(), -}); -exports.simTopUpHistoryRequestSchema = zod_1.z.object({ - fromDate: zod_1.z - .string() - .regex(/^\d{8}$/, "From date must be in YYYYMMDD format"), - toDate: zod_1.z - .string() - .regex(/^\d{8}$/, "To date must be in YYYYMMDD format"), -}); -exports.simFeaturesUpdateRequestSchema = zod_1.z.object({ - voiceMailEnabled: zod_1.z.boolean().optional(), - callWaitingEnabled: zod_1.z.boolean().optional(), - internationalRoamingEnabled: zod_1.z.boolean().optional(), - networkType: zod_1.z.enum(["4G", "5G"]).optional(), -}); -exports.simOrderActivationMnpSchema = zod_1.z.object({ - reserveNumber: zod_1.z.string().min(1, "Reserve number is required"), - reserveExpireDate: zod_1.z.string().regex(/^\d{8}$/, "Reserve expire date must be in YYYYMMDD format"), - account: zod_1.z.string().optional(), - firstnameKanji: zod_1.z.string().optional(), - lastnameKanji: zod_1.z.string().optional(), - firstnameZenKana: zod_1.z.string().optional(), - lastnameZenKana: zod_1.z.string().optional(), - gender: zod_1.z.string().optional(), - birthday: zod_1.z.string().regex(/^\d{8}$/, "Birthday must be in YYYYMMDD format").optional(), -}); -exports.simOrderActivationAddonsSchema = zod_1.z.object({ - voiceMail: zod_1.z.boolean().optional(), - callWaiting: zod_1.z.boolean().optional(), -}); -exports.simOrderActivationRequestSchema = zod_1.z.object({ - planSku: zod_1.z.string().min(1, "Plan SKU is required"), - simType: zod_1.z.enum(["eSIM", "Physical SIM"]), - eid: zod_1.z.string().min(15, "EID must be at least 15 characters").optional(), - activationType: zod_1.z.enum(["Immediate", "Scheduled"]), - scheduledAt: zod_1.z.string().regex(/^\d{8}$/, "Scheduled date must be in YYYYMMDD format").optional(), - addons: exports.simOrderActivationAddonsSchema.optional(), - mnp: exports.simOrderActivationMnpSchema.optional(), - msisdn: zod_1.z.string().min(1, "Phone number (msisdn) is required"), - oneTimeAmountJpy: zod_1.z.number().nonnegative("One-time amount must be non-negative"), - monthlyAmountJpy: zod_1.z.number().nonnegative("Monthly amount must be non-negative"), -}).refine((data) => { - if (data.simType === "eSIM" && (!data.eid || data.eid.length < 15)) { - return false; - } - return true; -}, { - message: "EID is required for eSIM and must be at least 15 characters", - path: ["eid"], -}).refine((data) => { - if (data.activationType === "Scheduled" && !data.scheduledAt) { - return false; - } - return true; -}, { - message: "Scheduled date is required for Scheduled activation", - path: ["scheduledAt"], -}); -exports.simTopupRequestSchema = exports.simTopUpRequestSchema; -exports.simChangePlanRequestSchema = exports.simPlanChangeRequestSchema; -exports.simFeaturesRequestSchema = exports.simFeaturesUpdateRequestSchema; -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/sim/schema.js.map b/packages/domain/sim/schema.js.map deleted file mode 100644 index 8b0a4451..00000000 --- a/packages/domain/sim/sch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,CAAC"} \ No newline at end of file diff --git a/packages/domain/sim/validation.d.ts b/packages/domain/sim/validation.d.ts deleted file mode 100644 index 0b2c25ae..00000000 --- a/packages/domain/sim/validation.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Subscription } from "../subscriptions/schema"; -export declare function isSimSubscription(subscription: Subscription): boolean; -export declare function extractSimAccountFromSubscription(subscription: Subscription): string | null; -export declare function cleanSimAccount(account: string): string; diff --git a/packages/domain/sim/validation.js b/packages/domain/sim/validation.js deleted file mode 100644 index 5b96228b..00000000 --- a/packages/domain/sim/validation.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isSimSubscription = isSimSubscription; -exports.extractSimAccountFromSubscription = extractSimAccountFromSubscription; -exports.cleanSimAccount = cleanSimAccount; -function isSimSubscription(subscription) { - const productName = subscription.productName?.toLowerCase() || ""; - const groupName = subscription.groupName?.toLowerCase() || ""; - return productName.includes("sim") || groupName.includes("sim"); -} -function extractSimAccountFromSubscription(subscription) { - if (subscription.domain && subscription.domain.trim()) { - return subscription.domain.trim(); - } - if (subscription.customFields) { - const account = extractFromCustomFields(subscription.customFields); - if (account) - return account; - } - if (subscription.orderNumber) { - const orderNum = subscription.orderNumber.toString(); - if (/^\d{10,11}$/.test(orderNum)) { - return orderNum; - } - } - return null; -} -function extractFromCustomFields(customFields) { - const phoneFields = [ - "phone", - "msisdn", - "phonenumber", - "phone_number", - "mobile", - "sim_phone", - "Phone Number", - "MSISDN", - "Phone", - "Mobile", - "SIM Phone", - "PhoneNumber", - "mobile_number", - "sim_number", - "account_number", - "Account Number", - "SIM Account", - "Phone Number (SIM)", - "Mobile Number", - "SIM Number", - "SIM_Number", - "SIM_Phone_Number", - "Phone_Number_SIM", - "Mobile_SIM_Number", - "SIM_Account_Number", - ]; - for (const fieldName of phoneFields) { - const value = customFields[fieldName]; - if (value !== undefined && value !== null && value !== "") { - return String(value); - } - } - return null; -} -function cleanSimAccount(account) { - return account.replace(/[-\s()]/g, ""); -} -//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/packages/domain/sim/validation.js.map b/packages/domain/sim/validation.js.map deleted file mode 100644 index 219d310d..00000000 --- a/packages/domain/sim/validation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;AAkBA,8CAKC;AAYD,8EAuBC;AAqED,0CAEC;AA/GD,SAAgB,iBAAiB,CAAC,YAA0B;IAC1D,MAAM,WAAW,GAAG,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAClE,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAE9D,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC;AAYD,SAAgB,iCAAiC,CAC/C,YAA0B;IAG1B,IAAI,YAAY,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACtD,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACpC,CAAC;IAGD,IAAI,YAAY,CAAC,YAAY,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,uBAAuB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACnE,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC;IAC9B,CAAC;IAGD,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;QACrD,IAAI,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAWD,SAAS,uBAAuB,CAC9B,YAAqC;IAGrC,MAAM,WAAW,GAAG;QAElB,OAAO;QACP,QAAQ;QACR,aAAa;QACb,cAAc;QACd,QAAQ;QACR,WAAW;QAGX,cAAc;QACd,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,WAAW;QACX,aAAa;QAGb,eAAe;QACf,YAAY;QACZ,gBAAgB;QAChB,gBAAgB;QAChB,aAAa;QACb,oBAAoB;QACpB,eAAe;QACf,YAAY;QAGZ,YAAY;QACZ,kBAAkB;QAClB,kBAAkB;QAClB,mBAAmB;QACnB,oBAAoB;KACrB,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;QACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YAC1D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAWD,SAAgB,eAAe,CAAC,OAAe;IAC7C,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC"} \ No newline at end of file diff --git a/packages/domain/subscriptions/contract.d.ts b/packages/domain/subscriptions/contract.d.ts deleted file mode 100644 index f9746b68..00000000 --- a/packages/domain/subscriptions/contract.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export declare const SUBSCRIPTION_STATUS: { - readonly ACTIVE: "Active"; - readonly INACTIVE: "Inactive"; - readonly PENDING: "Pending"; - readonly CANCELLED: "Cancelled"; - readonly SUSPENDED: "Suspended"; - readonly TERMINATED: "Terminated"; - readonly COMPLETED: "Completed"; -}; -export declare const SUBSCRIPTION_CYCLE: { - readonly MONTHLY: "Monthly"; - readonly QUARTERLY: "Quarterly"; - readonly SEMI_ANNUALLY: "Semi-Annually"; - readonly ANNUALLY: "Annually"; - readonly BIENNIALLY: "Biennially"; - readonly TRIENNIALLY: "Triennially"; - readonly ONE_TIME: "One-time"; - readonly FREE: "Free"; -}; -export type { SubscriptionStatus, SubscriptionCycle, Subscription, SubscriptionList, SubscriptionQueryParams, SubscriptionQuery, } from './schema'; diff --git a/packages/domain/subscriptions/contract.js b/packages/domain/subscriptions/contract.js deleted file mode 100644 index 6edbf9db..00000000 --- a/packages/domain/subscriptions/contract.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SUBSCRIPTION_CYCLE = exports.SUBSCRIPTION_STATUS = void 0; -exports.SUBSCRIPTION_STATUS = { - ACTIVE: "Active", - INACTIVE: "Inactive", - PENDING: "Pending", - CANCELLED: "Cancelled", - SUSPENDED: "Suspended", - TERMINATED: "Terminated", - COMPLETED: "Completed", -}; -exports.SUBSCRIPTION_CYCLE = { - MONTHLY: "Monthly", - QUARTERLY: "Quarterly", - SEMI_ANNUALLY: "Semi-Annually", - ANNUALLY: "Annually", - BIENNIALLY: "Biennially", - TRIENNIALLY: "Triennially", - ONE_TIME: "One-time", - FREE: "Free", -}; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/packages/domain/subscriptions/contract.js.map b/packages/domain/subscriptions/contract.js.map deleted file mode 100644 index ce8882ea..00000000 --- a/packages/domain/subscriptions/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["contract.ts"],"names":[],"mappings":";;;AAWa,QAAA,mBAAmB,GAAG;IACjC,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;CACd,CAAC;AAME,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACJ,CAAC"} \ No newline at end of file diff --git a/packages/domain/subscriptions/index.d.ts b/packages/domain/subscriptions/index.d.ts deleted file mode 100644 index fbe32381..00000000 --- a/packages/domain/subscriptions/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { SUBSCRIPTION_STATUS, SUBSCRIPTION_CYCLE } from "./contract"; -export * from "./schema"; -export type { SubscriptionStatus, SubscriptionCycle, Subscription, SubscriptionList, SubscriptionQueryParams, SubscriptionQuery, SubscriptionStats, SimActionResponse, SimPlanChangeResult, } from './schema'; -export * as Providers from "./providers/index"; -export type { WhmcsGetClientsProductsParams, WhmcsProductListResponse, } from "./providers/whmcs/raw.types"; diff --git a/packages/domain/subscriptions/index.js b/packages/domain/subscriptions/index.js deleted file mode 100644 index d4fd1473..00000000 --- a/packages/domain/subscriptions/index.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Providers = exports.SUBSCRIPTION_CYCLE = exports.SUBSCRIPTION_STATUS = void 0; -var contract_1 = require("./contract"); -Object.defineProperty(exports, "SUBSCRIPTION_STATUS", { enumerable: true, get: function () { return contract_1.SUBSCRIPTION_STATUS; } }); -Object.defineProperty(exports, "SUBSCRIPTION_CYCLE", { enumerable: true, get: function () { return contract_1.SUBSCRIPTION_CYCLE; } }); -__exportStar(require("./schema"), exports); -exports.Providers = __importStar(require("./providers/index")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/subscriptions/index.js.map b/packages/domain/subscriptions/index.js.map deleted file mode 100644 index 8a037c64..00000000 --- a/packages/domain/subscriptions/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,uCAAqE;AAA5D,+GAAA,mBAAmB,OAAA;AAAE,8GAAA,kBAAkB,OAAA;AAGhD,2CAAyB;AAgBzB,+DAA+C"} \ No newline at end of file diff --git a/packages/domain/subscriptions/providers/index.d.ts b/packages/domain/subscriptions/providers/index.d.ts deleted file mode 100644 index 90440543..00000000 --- a/packages/domain/subscriptions/providers/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as WhmcsMapper from "./whmcs/mapper"; -import * as WhmcsRaw from "./whmcs/raw.types"; -export declare const Whmcs: { - mapper: typeof WhmcsMapper; - raw: typeof WhmcsRaw; - transformWhmcsSubscription(rawProduct: unknown, options?: WhmcsMapper.TransformSubscriptionOptions): import("..").Subscription; - transformWhmcsSubscriptions(rawProducts: unknown[], options?: WhmcsMapper.TransformSubscriptionOptions): import("..").Subscription[]; -}; -export { WhmcsMapper, WhmcsRaw }; -export * from "./whmcs/mapper"; -export * from "./whmcs/raw.types"; diff --git a/packages/domain/subscriptions/providers/index.js b/packages/domain/subscriptions/providers/index.js deleted file mode 100644 index 34a15b7b..00000000 --- a/packages/domain/subscriptions/providers/index.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WhmcsRaw = exports.WhmcsMapper = exports.Whmcs = void 0; -const WhmcsMapper = __importStar(require("./whmcs/mapper")); -exports.WhmcsMapper = WhmcsMapper; -const WhmcsRaw = __importStar(require("./whmcs/raw.types")); -exports.WhmcsRaw = WhmcsRaw; -exports.Whmcs = { - ...WhmcsMapper, - mapper: WhmcsMapper, - raw: WhmcsRaw, -}; -__exportStar(require("./whmcs/mapper"), exports); -__exportStar(require("./whmcs/raw.types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domain/subscriptions/providers/index.js.map b/packages/domain/subscriptions/providers/index.js.map deleted file mode 100644 index 47259257..00000000 --- a/packages/domain/subscriptions/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4DAA8C;AASrC,kCAAW;AARpB,4DAA8C;AAQxB,4BAAQ;AANjB,QAAA,KAAK,GAAG;IACnB,GAAG,WAAW;IACd,MAAM,EAAE,WAAW;IACnB,GAAG,EAAE,QAAQ;CACd,CAAC;AAGF,iDAA+B;AAC/B,oDAAkC"} \ No newline at end of file diff --git a/packages/domain/subscriptions/providers/whmcs/mapper.d.ts b/packages/domain/subscriptions/providers/whmcs/mapper.d.ts deleted file mode 100644 index 34db9d12..00000000 --- a/packages/domain/subscriptions/providers/whmcs/mapper.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Subscription } from "../../contract"; -export interface TransformSubscriptionOptions { - defaultCurrencyCode?: string; - defaultCurrencySymbol?: string; -} -export declare function transformWhmcsSubscription(rawProduct: unknown, options?: TransformSubscriptionOptions): Subscription; -export declare function transformWhmcsSubscriptions(rawProducts: unknown[], options?: TransformSubscriptionOptions): Subscription[]; diff --git a/packages/domain/subscriptions/providers/whmcs/mapper.js b/packages/domain/subscriptions/providers/whmcs/mapper.js deleted file mode 100644 index 5f96a76c..00000000 --- a/packages/domain/subscriptions/providers/whmcs/mapper.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.transformWhmcsSubscription = transformWhmcsSubscription; -exports.transformWhmcsSubscriptions = transformWhmcsSubscriptions; -const schema_1 = require("../../schema"); -const raw_types_1 = require("./raw.types"); -const STATUS_MAP = { - active: "Active", - inactive: "Inactive", - pending: "Pending", - cancelled: "Cancelled", - canceled: "Cancelled", - terminated: "Terminated", - completed: "Completed", - suspended: "Suspended", - fraud: "Cancelled", -}; -const CYCLE_MAP = { - monthly: "Monthly", - annually: "Annually", - annual: "Annually", - yearly: "Annually", - quarterly: "Quarterly", - "semi annually": "Semi-Annually", - semiannually: "Semi-Annually", - "semi-annually": "Semi-Annually", - biennially: "Biennially", - triennially: "Triennially", - "one time": "One-time", - onetime: "One-time", - "one-time": "One-time", - "one time fee": "One-time", - free: "Free", -}; -function mapStatus(status) { - if (!status) - return "Cancelled"; - const mapped = STATUS_MAP[status.trim().toLowerCase()]; - return mapped ?? "Cancelled"; -} -function mapCycle(cycle) { - if (!cycle) - return "One-time"; - const normalized = cycle.trim().toLowerCase().replace(/[_\s-]+/g, " "); - return CYCLE_MAP[normalized] ?? "One-time"; -} -function parseAmount(amount) { - if (typeof amount === "number") { - return amount; - } - if (!amount) { - return 0; - } - const cleaned = String(amount).replace(/[^\d.-]/g, ""); - const parsed = Number.parseFloat(cleaned); - return Number.isNaN(parsed) ? 0 : parsed; -} -function formatDate(input) { - if (!input) { - return undefined; - } - const date = new Date(input); - if (Number.isNaN(date.getTime())) { - return undefined; - } - return date.toISOString(); -} -function extractCustomFields(raw) { - if (!raw) - return undefined; - const container = raw_types_1.whmcsCustomFieldsContainerSchema.safeParse(raw); - if (!container.success) - return undefined; - const customfield = container.data.customfield; - const fieldsArray = Array.isArray(customfield) ? customfield : [customfield]; - const entries = fieldsArray.reduce((acc, field) => { - if (field?.name && field.value) { - acc[field.name] = field.value; - } - return acc; - }, {}); - return Object.keys(entries).length > 0 ? entries : undefined; -} -function transformWhmcsSubscription(rawProduct, options = {}) { - const product = raw_types_1.whmcsProductRawSchema.parse(rawProduct); - const currency = product.pricing?.currency || options.defaultCurrencyCode || "JPY"; - const currencySymbol = product.pricing?.currencyprefix || - product.pricing?.currencysuffix || - options.defaultCurrencySymbol; - const amount = parseAmount(product.amount || - product.recurringamount || - product.pricing?.amount || - product.firstpaymentamount || - 0); - const subscription = { - id: product.id, - serviceId: product.serviceid || product.id, - productName: product.name || product.translated_name || "Unknown Product", - domain: product.domain || undefined, - cycle: mapCycle(product.billingcycle), - status: mapStatus(product.status), - nextDue: formatDate(product.nextduedate || product.nextinvoicedate), - amount, - currency, - currencySymbol, - registrationDate: formatDate(product.regdate) || new Date().toISOString(), - notes: product.notes || undefined, - customFields: extractCustomFields(product.customfields), - orderNumber: product.ordernumber || undefined, - groupName: product.groupname || product.translated_groupname || undefined, - paymentMethod: product.paymentmethodname || product.paymentmethod || undefined, - serverName: product.servername || product.serverhostname || undefined, - }; - return schema_1.subscriptionSchema.parse(subscription); -} -function transformWhmcsSubscriptions(rawProducts, options = {}) { - return rawProducts.map(raw => transformWhmcsSubscription(raw, options)); -} -//# sourceMappingURL=mapper.js.map \ No newline at end of file diff --git a/packages/domain/subscriptions/providers/whmcs/mapper.js.map b/packages/domain/subscriptions/providers/whmcs/mapper.js.map deleted file mode 100644 index 23515ce5..00000000 --- a/packages/domain/subscriptions/providers/whmcs/mapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapper.js","sourceRoot":"","sources":["mapper.ts"],"names":[],"mappings":";;AA+GA,gEA8CC;AAKD,kEAKC;AAhKD,yCAAkD;AAClD,2CAIqB;AAQrB,MAAM,UAAU,GAAuC;IACrD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,WAAW;CACnB,CAAC;AAGF,MAAM,SAAS,GAAsC;IACnD,OAAO,EAAE,SAAS;IAClB,QA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AS,EAAE,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,oBAAoB,IAAI,SAAS;QACzE,aAAa,EAAE,OAAO,CAAC,iBAAiB,IAAI,OAAO,CAAC,aAAa,IAAI,SAAS;QAC9E,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,cAAc,IAAI,SAAS;KACtE,CAAC;IAGF,OAAO,2BAAkB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAChD,CAAC;AAKD,SAAgB,2BAA2B,CACzC,WAAsB,EACtB,UAAwC,EAAE;IAE1C,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,0BAA0B,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/packages/domain/subscriptions/providers/whmcs/raw.types.d.ts b/packages/domain/subscriptions/providers/whmcs/raw.types.d.ts deleted file mode 100644 index a6cc6442..00000000 --- a/packages/domain/subscriptions/providers/whmcs/raw.types.d.ts +++ /dev/null @@ -1,214 +0,0 @@ -import { z } from "zod"; -export interface WhmcsGetClientsProductsParams { - clientid: number; - serviceid?: number; - pid?: number; - domain?: string; - limitstart?: number; - limitnum?: number; - orderby?: "id" | "productname" | "regdate" | "nextduedate"; - order?: "ASC" | "DESC"; - [key: string]: unknown; -} -export declare const whmcsCustomFieldSchema: z.ZodObject<{ - id: z.ZodOptional; - name: z.ZodOptional; - value: z.ZodOptional; -}, z.core.$strip>; -export declare const whmcsCustomFieldsContainerSchema: z.ZodObject<{ - customfield: z.ZodUnion; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>>]>; -}, z.core.$strip>; -export declare const whmcsProductRawSchema: z.ZodObject<{ - id: z.ZodNumber; - clientid: z.ZodNumber; - serviceid: z.ZodOptional; - pid: z.ZodOptional; - orderid: z.ZodOptional; - ordernumber: z.ZodOptional; - regdate: z.ZodString; - name: z.ZodString; - translated_name: z.ZodOptional; - groupname: z.ZodOptional; - translated_groupname: z.ZodOptional; - domain: z.ZodOptional; - dedicatedip: z.ZodOptional; - serverid: z.ZodOptional; - servername: z.ZodOptional; - serverip: z.ZodOptional; - serverhostname: z.ZodOptional; - suspensionreason: z.ZodOptional; - promoid: z.ZodOptional; - subscriptionid: z.ZodOptional; - firstpaymentamount: z.ZodOptional>; - amount: z.ZodOptional>; - recurringamount: z.ZodOptional>; - billingcycle: z.ZodOptional; - paymentmethod: z.ZodOptional; - paymentmethodname: z.ZodOptional; - nextduedate: z.ZodOptional; - nextinvoicedate: z.ZodOptional; - status: z.ZodString; - username: z.ZodOptional; - password: z.ZodOptional; - notes: z.ZodOptional; - diskusage: z.ZodOptional; - disklimit: z.ZodOptional; - bwusage: z.ZodOptional; - bwlimit: z.ZodOptional; - lastupdate: z.ZodOptional; - customfields: z.ZodOptional; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>>]>; - }, z.core.$strip>>; - pricing: z.ZodOptional>; - currency: z.ZodOptional; - currencyprefix: z.ZodOptional; - currencysuffix: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export type WhmcsProductRaw = z.infer; -export type WhmcsCustomField = z.infer; -export declare const whmcsProductListResponseSchema: z.ZodObject<{ - result: z.ZodEnum<{ - error: "error"; - success: "success"; - }>; - message: z.ZodOptional; - clientid: z.ZodOptional>; - serviceid: z.ZodOptional>; - pid: z.ZodOptional>; - domain: z.ZodOptional>; - totalresults: z.ZodOptional>; - startnumber: z.ZodOptional; - numreturned: z.ZodOptional; - products: z.ZodOptional; - pid: z.ZodOptional; - orderid: z.ZodOptional; - ordernumber: z.ZodOptional; - regdate: z.ZodString; - name: z.ZodString; - translated_name: z.ZodOptional; - groupname: z.ZodOptional; - translated_groupname: z.ZodOptional; - domain: z.ZodOptional; - dedicatedip: z.ZodOptional; - serverid: z.ZodOptional; - servername: z.ZodOptional; - serverip: z.ZodOptional; - serverhostname: z.ZodOptional; - suspensionreason: z.ZodOptional; - promoid: z.ZodOptional; - subscriptionid: z.ZodOptional; - firstpaymentamount: z.ZodOptional>; - amount: z.ZodOptional>; - recurringamount: z.ZodOptional>; - billingcycle: z.ZodOptional; - paymentmethod: z.ZodOptional; - paymentmethodname: z.ZodOptional; - nextduedate: z.ZodOptional; - nextinvoicedate: z.ZodOptional; - status: z.ZodString; - username: z.ZodOptional; - password: z.ZodOptional; - notes: z.ZodOptional; - diskusage: z.ZodOptional; - disklimit: z.ZodOptional; - bwusage: z.ZodOptional; - bwlimit: z.ZodOptional; - lastupdate: z.ZodOptional; - customfields: z.ZodOptional; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>>]>; - }, z.core.$strip>>; - pricing: z.ZodOptional>; - currency: z.ZodOptional; - currencyprefix: z.ZodOptional; - currencysuffix: z.ZodOptional; - }, z.core.$strip>>; - }, z.core.$strip>, z.ZodArray; - pid: z.ZodOptional; - orderid: z.ZodOptional; - ordernumber: z.ZodOptional; - regdate: z.ZodString; - name: z.ZodString; - translated_name: z.ZodOptional; - groupname: z.ZodOptional; - translated_groupname: z.ZodOptional; - domain: z.ZodOptional; - dedicatedip: z.ZodOptional; - serverid: z.ZodOptional; - servername: z.ZodOptional; - serverip: z.ZodOptional; - serverhostname: z.ZodOptional; - suspensionreason: z.ZodOptional; - promoid: z.ZodOptional; - subscriptionid: z.ZodOptional; - firstpaymentamount: z.ZodOptional>; - amount: z.ZodOptional>; - recurringamount: z.ZodOptional>; - billingcycle: z.ZodOptional; - paymentmethod: z.ZodOptional; - paymentmethodname: z.ZodOptional; - nextduedate: z.ZodOptional; - nextinvoicedate: z.ZodOptional; - status: z.ZodString; - username: z.ZodOptional; - password: z.ZodOptional; - notes: z.ZodOptional; - diskusage: z.ZodOptional; - disklimit: z.ZodOptional; - bwusage: z.ZodOptional; - bwlimit: z.ZodOptional; - lastupdate: z.ZodOptional; - customfields: z.ZodOptional; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>, z.ZodArray; - name: z.ZodOptional; - value: z.ZodOptional; - }, z.core.$strip>>]>; - }, z.core.$strip>>; - pricing: z.ZodOptional>; - currency: z.ZodOptional; - currencyprefix: z.ZodOptional; - currencysuffix: z.ZodOptional; - }, z.core.$strip>>; - }, z.core.$strip>>]>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export type WhmcsProductListResponse = z.infer; diff --git a/packages/domain/subscriptions/providers/whmcs/raw.types.js b/packages/domain/subscriptions/providers/whmcs/raw.types.js deleted file mode 100644 index bb9995f9..00000000 --- a/packages/domain/subscriptions/providers/whmcs/raw.types.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.whmcsProductListResponseSchema = exports.whmcsProductRawSchema = exports.whmcsCustomFieldsContainerSchema = exports.whmcsCustomFieldSchema = void 0; -const zod_1 = require("zod"); -exports.whmcsCustomFieldSchema = zod_1.z.object({ - id: zod_1.z.number().optional(), - name: zod_1.z.string().optional(), - value: zod_1.z.string().optional(), -}); -exports.whmcsCustomFieldsContainerSchema = zod_1.z.object({ - customfield: zod_1.z.union([exports.whmcsCustomFieldSchema, zod_1.z.array(exports.whmcsCustomFieldSchema)]), -}); -exports.whmcsProductRawSchema = zod_1.z.object({ - id: zod_1.z.number(), - clientid: zod_1.z.number(), - serviceid: zod_1.z.number().optional(), - pid: zod_1.z.number().optional(), - orderid: zod_1.z.number().optional(), - ordernumber: zod_1.z.string().optional(), - regdate: zod_1.z.string(), - name: zod_1.z.string(), - translated_name: zod_1.z.string().optional(), - groupname: zod_1.z.string().optional(), - translated_groupname: zod_1.z.string().optional(), - domain: zod_1.z.string().optional(), - dedicatedip: zod_1.z.string().optional(), - serverid: zod_1.z.number().optional(), - servername: zod_1.z.string().optional(), - serverip: zod_1.z.string().optional(), - serverhostname: zod_1.z.string().optional(), - suspensionreason: zod_1.z.string().optional(), - promoid: zod_1.z.number().optional(), - subscriptionid: zod_1.z.string().optional(), - firstpaymentamount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - amount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - recurringamount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - billingcycle: zod_1.z.string().optional(), - paymentmethod: zod_1.z.string().optional(), - paymentmethodname: zod_1.z.string().optional(), - nextduedate: zod_1.z.string().optional(), - nextinvoicedate: zod_1.z.string().optional(), - status: zod_1.z.string(), - username: zod_1.z.string().optional(), - password: zod_1.z.string().optional(), - notes: zod_1.z.string().optional(), - diskusage: zod_1.z.number().optional(), - disklimit: zod_1.z.number().optional(), - bwusage: zod_1.z.number().optional(), - bwlimit: zod_1.z.number().optional(), - lastupdate: zod_1.z.string().optional(), - customfields: exports.whmcsCustomFieldsContainerSchema.optional(), - pricing: zod_1.z.object({ - amount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(), - currency: zod_1.z.string().optional(), - currencyprefix: zod_1.z.string().optional(), - currencysuffix: zod_1.z.string().optional(), - }).optional(), -}); -exports.whmcsProductListResponseSchema = zod_1.z.object({ - result: zod_1.z.enum(["success", "error"]), - message: zod_1.z.string().optional(), - clientid: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(), - serviceid: zod_1.z.union([zod_1.z.number(), zod_1.z.string(), zod_1.z.null()]).optional(), - pid: zod_1.z.union([zod_1.z.number(), zod_1.z.string(), zod_1.z.null()]).optional(), - domain: zod_1.z.string().nullable().optional(), - totalresults: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(), - startnumber: zod_1.z.number().optional(), - numreturned: zod_1.z.number().optional(), - products: zod_1.z.object({ - product: zod_1.z.union([exports.whmcsProductRawSchema, zod_1.z.array(exports.whmcsProductRawSchema)]).optional(), - }).optional(), -}); -//# sourceMappingURL=raw.types.js.map \ No newline at end of file diff --git a/packages/domain/subscriptions/providers/whmcs/raw.types.js.map b/packages/domain/subscriptions/providers/whmcs/raw.types.js.map deleted file mode 100644 index 65e17ffb..00000000 --- a/packages/domain/subscriptions/providers/whmcs/raw.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw.types.js","sourceRoot":"","sources":["raw.types.ts"],"names":[],"mappings":";;;AAQA,6BAAwB;AA0BX,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEU,QAAA,gCAAgC,GAAG,OAAC,CAAC,MAAM,CAAC;IACvD,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,8BAAsB,EAAE,OAAC,CAAC,KAAK,CAAC,8BAAsB,CAAC,CAAC,CAAC;CAChF,CAAC,CAAC;AAGU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE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ode 100644 index 1a315367..00000000 --- a/packages/domain/subscriptions/schema.d.ts +++ /dev/null @@ -1,149 +0,0 @@ -import { z } from "zod"; -export declare const subscriptionStatusSchema: z.ZodEnum<{ - Active: "Active"; - Inactive: "Inactive"; - Pending: "Pending"; - Cancelled: "Cancelled"; - Suspended: "Suspended"; - Terminated: "Terminated"; - Completed: "Completed"; -}>; -export declare const subscriptionCycleSchema: z.ZodEnum<{ - Monthly: "Monthly"; - Quarterly: "Quarterly"; - Annually: "Annually"; - Free: "Free"; - "Semi-Annually": "Semi-Annually"; - Biennially: "Biennially"; - Triennially: "Triennially"; - "One-time": "One-time"; -}>; -export declare const subscriptionSchema: z.ZodObject<{ - id: z.ZodNumber; - serviceId: z.ZodNumber; - productName: z.ZodString; - domain: z.ZodOptional; - cycle: z.ZodEnum<{ - Monthly: "Monthly"; - Quarterly: "Quarterly"; - Annually: "Annually"; - Free: "Free"; - "Semi-Annually": "Semi-Annually"; - Biennially: "Biennially"; - Triennially: "Triennially"; - "One-time": "One-time"; - }>; - status: z.ZodEnum<{ - Active: "Active"; - Inactive: "Inactive"; - Pending: "Pending"; - Cancelled: "Cancelled"; - Suspended: "Suspended"; - Terminated: "Terminated"; - Completed: "Completed"; - }>; - nextDue: z.ZodOptional; - amount: z.ZodNumber; - currency: z.ZodString; - currencySymbol: z.ZodOptional; - registrationDate: z.ZodString; - notes: z.ZodOptional; - customFields: z.ZodOptional>; - orderNumber: z.ZodOptional; - groupName: z.ZodOptional; - paymentMethod: z.ZodOptional; - serverName: z.ZodOptional; -}, z.core.$strip>; -export declare const subscriptionListSchema: z.ZodObject<{ - subscriptions: z.ZodArray; - cycle: z.ZodEnum<{ - Monthly: "Monthly"; - Quarterly: "Quarterly"; - Annually: "Annually"; - Free: "Free"; - "Semi-Annually": "Semi-Annually"; - Biennially: "Biennially"; - Triennially: "Triennially"; - "One-time": "One-time"; - }>; - status: z.ZodEnum<{ - Active: "Active"; - Inactive: "Inactive"; - Pending: "Pending"; - Cancelled: "Cancelled"; - Suspended: "Suspended"; - Terminated: "Terminated"; - Completed: "Completed"; - }>; - nextDue: z.ZodOptional; - amount: z.ZodNumber; - currency: z.ZodString; - currencySymbol: z.ZodOptional; - registrationDate: z.ZodString; - notes: z.ZodOptional; - customFields: z.ZodOptional>; - orderNumber: z.ZodOptional; - groupName: z.ZodOptional; - paymentMethod: z.ZodOptional; - serverName: z.ZodOptional; - }, z.core.$strip>>; - totalCount: z.ZodNumber; -}, z.core.$strip>; -export declare const subscriptionQueryParamsSchema: z.ZodObject<{ - page: z.ZodOptional>; - limit: z.ZodOptional>; - status: z.ZodOptional>; - type: z.ZodOptional; -}, z.core.$strip>; -export type SubscriptionQueryParams = z.infer; -export declare const subscriptionQuerySchema: z.ZodObject<{ - page: z.ZodOptional>; - limit: z.ZodOptional>; - status: z.ZodOptional>; - type: z.ZodOptional; -}, z.core.$strip>; -export type SubscriptionQuery = SubscriptionQueryParams; -export declare const subscriptionStatsSchema: z.ZodObject<{ - total: z.ZodNumber; - active: z.ZodNumber; - completed: z.ZodNumber; - cancelled: z.ZodNumber; -}, z.core.$strip>; -export declare const simActionResponseSchema: z.ZodObject<{ - success: z.ZodBoolean; - message: z.ZodString; - data: z.ZodOptional; -}, z.core.$strip>; -export declare const simPlanChangeResultSchema: z.ZodObject<{ - success: z.ZodBoolean; - message: z.ZodString; - ipv4: z.ZodOptional; - ipv6: z.ZodOptional; -}, z.core.$strip>; -export type SubscriptionStatus = z.infer; -export type SubscriptionCycle = z.infer; -export type Subscription = z.infer; -export type SubscriptionList = z.infer; -export type SubscriptionStats = z.infer; -export type SimActionResponse = z.infer; -export type SimPlanChangeResult = z.infer; diff --git a/packages/domain/subscriptions/schema.js b/packages/domain/subscriptions/schema.js deleted file mode 100644 index 4bcb97aa..00000000 --- a/packages/domain/subscriptions/schema.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.simPlanChangeResultSchema = exports.simActionResponseSchema = exports.subscriptionStatsSchema = exports.subscriptionQuerySchema = exports.subscriptionQueryParamsSchema = exports.subscriptionListSchema = exports.subscriptionSchema = exports.subscriptionCycleSchema = exports.subscriptionStatusSchema = void 0; -const zod_1 = require("zod"); -exports.subscriptionStatusSchema = zod_1.z.enum([ - "Active", - "Inactive", - "Pending", - "Cancelled", - "Suspended", - "Terminated", - "Completed", -]); -exports.subscriptionCycleSchema = zod_1.z.enum([ - "Monthly", - "Quarterly", - "Semi-Annually", - "Annually", - "Biennially", - "Triennially", - "One-time", - "Free", -]); -exports.subscriptionSchema = zod_1.z.object({ - id: zod_1.z.number().int().positive("Subscription id must be positive"), - serviceId: zod_1.z.number().int().positive("Service id must be positive"), - productName: zod_1.z.string().min(1, "Product name is required"), - domain: zod_1.z.string().optional(), - cycle: exports.subscriptionCycleSchema, - status: exports.subscriptionStatusSchema, - nextDue: zod_1.z.string().optional(), - amount: zod_1.z.number(), - currency: zod_1.z.string().min(1, "Currency is required"), - currencySymbol: zod_1.z.string().optional(), - registrationDate: zod_1.z.string().min(1, "Registration date is required"), - notes: zod_1.z.string().optional(), - customFields: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(), - orderNumber: zod_1.z.string().optional(), - groupName: zod_1.z.string().optional(), - paymentMethod: zod_1.z.string().optional(), - serverName: zod_1.z.string().optional(), -}); -exports.subscriptionListSchema = zod_1.z.object({ - subscriptions: zod_1.z.array(exports.subscriptionSchema), - totalCount: zod_1.z.number().int().nonnegative(), -}); -exports.subscriptionQueryParamsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().optional(), - limit: zod_1.z.coerce.number().int().positive().max(100).optional(), - status: exports.subscriptionStatusSchema.optional(), - type: zod_1.z.string().optional(), -}); -exports.subscriptionQuerySchema = exports.subscriptionQueryParamsSchema; -exports.subscriptionStatsSchema = zod_1.z.object({ - total: zod_1.z.number().int().nonnegative(), - active: zod_1.z.number().int().nonnegative(), - completed: zod_1.z.number().int().nonnegative(), - cancelled: zod_1.z.number().int().nonnegative(), -}); -exports.simActionResponseSchema = zod_1.z.object({ - success: zod_1.z.boolean(), - message: zod_1.z.string(), - data: zod_1.z.unknown().optional(), -}); -exports.simPlanChangeResultSchema = zod_1.z.object({ - success: zod_1.z.boolean(), - message: zod_1.z.string(), - ipv4: zod_1.z.string().optional(), - ipv6: zod_1.z.string().optional(), -}); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/packages/domain/subscriptions/schema.js.map b/packages/domain/subscriptions/schema.js.map deleted file mode 100644 index cec7c3d6..00000000 --- a/packages/domain/subscriptions/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAGX,QAAA,wBAAwB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC7C,QAAQ;IACR,UAAU;IACV,SAAS;IACT,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;CACZ,CAAC,CAAC;AAGU,QAAA,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5C,SAAS;IACT,WAAW;IACX,eAAe;IACf,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;IACV,MAAM;CACP,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACjE,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACnE,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;IAC1D,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,+BAAuB;IAC9B,MAAM,EAAE,gCAAwB;IAChC,OAAO,EAAE,OAAC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