65 Commits

Author SHA1 Message Date
tema
927d1c7dcf Refactor SIM cancellation logic and Freebit service integration for improved scheduling and error handling
- Updated SimManagementService to determine the run date for SIM cancellations, defaulting to the 1st of the next month if no date is provided.
- Modified FreebititService to align with the new cancellation request structure, utilizing the PA02-04 API for account cancellations.
- Enhanced logging to provide clearer information regarding cancellation requests and their statuses.
2025-09-09 17:22:53 +09:00
tema
74e27e3ca2 Enhance SIM management and Freebit service with improved scheduling and error handling
- Updated SimManagementService to schedule contract line changes 30 minutes after applying voice options, improving user experience.
- Refactored FreebititService to include a new method for authenticated JSON POST requests, enhancing error handling and logging for API responses.
- Introduced new interfaces for voice option and contract line change requests and responses, improving type safety and clarity in API interactions.
- Enhanced error handling in FreebititService to provide more specific error messages based on API response status codes.
2025-09-09 17:13:10 +09:00
tema
340ff94d07 Refactor SIM management and usage services for improved scheduling and error handling
- Updated SimManagementService to automatically schedule plan changes for the 1st of the next month instead of immediate execution.
- Enhanced SimUsageStoreService by introducing a private store getter for safer access to the SIM usage data.
- Improved error handling in upsert and find methods to ensure proper logging and handling of unconfigured stores.
- Refined port management logic in manage.sh to ensure desired ports are free and provide clearer error messages for port conflicts.
2025-09-09 16:54:36 +09:00
tema
6e27d8a21e Refactor SIM management and usage services for improved functionality and type safety
- Updated SimManagementService to schedule plan changes for immediate execution during testing.
- Enhanced type safety in SimUsageStoreService by removing unsafe type assertions and improving method calls.
- Improved error handling in FreebititService by ensuring proper type handling for plan codes and sizes.
- Added functionality in manage.sh to automatically find and assign free ports for development services.
2025-09-09 16:30:36 +09:00
tema
f21db44611 Lint fixes 2025-09-09 16:13:17 +09:00
tema
5f7fb483d7 Refactor error handling and type safety across services
- Simplified error handling in TokenBlacklistService by removing unnecessary error variable.
- Enhanced type safety in SimUsageStoreService with improved type assertions and error handling.
- Updated FreebititService to provide clearer error messages and consistent error handling across multiple methods.
- Standardized import statements in WhmcsInvoiceService for better organization and clarity.
- Added missing imports in dev-prep script to ensure proper functionality.
2025-09-09 16:07:48 +09:00
tema
de35397cf9 Refactor order and subscription services for improved type safety and error handling
- Updated billing cycle assignment in OrderOrchestrator to ensure proper type handling.
- Enhanced error handling in SimManagementService and related components to use more specific types for exceptions.
- Standardized error handling across various components to improve consistency and clarity.
- Adjusted function signatures in multiple services and controllers to return more precise types, enhancing type safety.
2025-09-09 15:59:30 +09:00
tema
05817e8c67 Refactor code for improved readability and consistency across components
- Standardized import statements and formatting in various files for better code clarity.
- Enhanced error messages and logging for improved debugging and user experience.
- Adjusted whitespace and line breaks in multiple components to follow best practices.
- Updated environment variable handling and configuration for consistency across services.
2025-09-09 15:45:03 +09:00
tema
425ef83dba Update SIM management service and UI components for Freebit API compliance
- Adjusted quota validation in SimManagementService to enforce limits of 100MB to 51200MB for Freebit API compatibility.
- Updated cost calculation to round up GB usage for billing, ensuring accurate invoice generation.
- Modified top-up modal and related UI components to reflect new limits of 1-50 GB, aligning with Freebit API constraints.
- Enhanced documentation to clarify pricing structure and API data flow adjustments.
2025-09-09 15:40:13 +09:00
tema
5c6057bf2e Implement eSIM profile reissue via PA05-41 API with enhanced error handling
- Updated reissueEsimProfile method to utilize the PA05-41 eSIM Account Activation API for reissuing profiles.
- Added validation checks for eSIM type and EID presence, throwing appropriate exceptions for errors.
- Improved logging for both successful operations and error responses from the API.
- Introduced new interfaces for eSIM account activation requests and responses to support the API integration.
2025-09-08 18:57:26 +09:00
tema
2325cf2753 Refactor Freebit plan change request and improve error handling
- Updated FreebititPlanChangeRequest interface to use 'planCode' instead of 'plancode' for consistency.
- Enhanced error handling in WhmcsInvoiceService to provide a default message for payment errors.
- Removed unused state variables for global IP assignment and scheduling in SIM change plan components to streamline the user interface.
2025-09-08 18:45:00 +09:00
tema
c9356cad65 Enhance SIM management service with improved error handling and scheduling
- Added specific checks for SIM data in SimManagementService, including expected SIM number and EID.
- Updated the change plan functionality to automatically schedule changes for the 1st of the next month.
- Enhanced error handling for Freebit API responses with user-friendly messages.
- Implemented invoice update functionality in WHMCS service for better payment processing management.
- Improved logging for debugging and tracking SIM account issues.
2025-09-08 18:31:26 +09:00
tema
5a0c5272e0 Update SIM management calculations and configurations
- Changed the base URL for Freebit API in environment validation to the new test URL.
- Updated data usage calculations in SimManagementService and related components to use 1000 instead of 1024 for MB to GB conversions.
- Adjusted the top-up modal and related components to reflect the new GB input method and validation rules.
- Enhanced documentation to align with the updated API and usage metrics.
2025-09-06 17:02:20 +09:00
tema
ac259ce902 Enhance SIM management service with payment processing and API integration
- Implemented WHMCS invoice creation and payment capture in SimManagementService for top-ups.
- Updated top-up logic to calculate costs based on GB input, with pricing set at 500 JPY per GB.
- Simplified the Top Up Modal interface, removing unnecessary fields and improving user experience.
- Added new methods in WhmcsService for invoice and payment operations.
- Enhanced error handling for payment failures and added transaction logging for audit purposes.
- Updated documentation to reflect changes in the SIM management flow and API interactions.
2025-09-06 13:57:18 +09:00
T. Narantuya
ae56477714 Refactor SIM cancel page layout and improve readability
- Updated the formatting of the SIM cancel page for better readability, including consistent use of quotes and improved line breaks in text.
- Enhanced the layout of buttons and links for a more user-friendly interface.
- Added a "Back" link to improve navigation options for users.
2025-09-06 10:11:39 +09:00
NTumurbars
781e4c9b6a
Merge branch 'main' into Tema-v1 2025-09-06 10:05:23 +09:00
tema
e115a3ab15 Add daily SIM usage tracking and persistence functionality
- Introduced SimUsageDaily model to store daily usage snapshots for SIM accounts.
- Updated SimManagementService to persist daily usage data and clean up previous months' records.
- Enhanced error handling for usage persistence failures.
- Updated SubscriptionsModule to include SimUsageStoreService for managing usage data.
- Improved user interface text for clarity in SIM management pages.
2025-09-06 10:01:52 +09:00
T. Narantuya
f305ee6e1a Implement Salesforce Platform Events for Order Provisioning
- Added support for Salesforce Platform Events, specifically subscribing to `OrderProvisionRequested__e` to trigger provisioning jobs.
- Introduced new environment variables for Salesforce event configuration, including SF_EVENTS_ENABLED, SF_PROVISION_EVENT_CHANNEL, and SF_PUBSUB_ENDPOINT.
- Refactored order fulfillment process to utilize event-driven architecture, enhancing reliability and scalability.
- Updated documentation to reflect changes in the provisioning workflow and environment variable requirements.
- Removed deprecated webhook handling code to streamline the integration.
2025-09-06 10:01:44 +09:00
T. Narantuya
df4149063f Add Salesforce event configuration and provisioning diagnostics
- Introduced new environment variables for Salesforce platform events, including SF_EVENTS_ENABLED, SF_PROVISION_EVENT_CHANNEL, SF_EVENTS_REPLAY, SF_PUBSUB_ENDPOINT, SF_PUBSUB_NUM_REQUESTED, and SF_PUBSUB_QUEUE_MAX.
- Updated SalesforceFieldMap to include optional fields for provisioning diagnostics: lastErrorCode, lastErrorMessage, and lastAttemptAt.
- Adjusted installationType field mapping to reflect the correct field name in Salesforce.
- Enhanced order query fields to include new diagnostic fields for better tracking and error handling.
2025-09-06 10:01:25 +09:00
tema
9d4505d6be Refactor SIM management components and enhance user experience
- Updated CatalogPage and SimPlansPage to improve descriptions and layout for better clarity.
- Removed unused SignalIcon from CatalogPage.
- Enhanced ChangePlanModal to allow selection of new plans with improved validation and user feedback.
- Updated SimActions to handle navigation and contextual information for actions.
- Improved SimDetailsCard to format current plan codes for better readability.
- Enhanced SimFeatureToggles to support embedded rendering and streamlined service options management.
- Refactored SimManagementSection layout for better organization of SIM details and actions.
2025-09-05 18:22:55 +09:00
tema
735828cf32 Implement SIM features update functionality and enhance UI components
- Added new SimFeaturesUpdateRequest interface to handle optional SIM feature updates.
- Implemented updateSimFeatures method in SimManagementService to process feature updates including voicemail, call waiting, international roaming, and network type.
- Expanded SubscriptionsController with a new endpoint for updating SIM features.
- Introduced SimFeatureToggles component for managing service options in the UI.
- Enhanced DataUsageChart and SimDetailsCard components to support embedded rendering and improved styling.
- Updated layout and design for better user experience in the SIM management section.
2025-09-05 15:39:43 +09:00
tema
d9f7c5c8b2 Enhance Freebit SIM management features and UI components
- Added optional service features to SimDetails interface: voiceMailEnabled, callWaitingEnabled, internationalRoamingEnabled, and networkType.
- Updated FreebitService to include new service feature flags based on SIM data.
- Enhanced SimDetailsCard component to display service features for eSIMs, including voice mail, call waiting, international roaming, and network type.
- Improved conditional rendering for optional fields in SimDetailsCard.
- Updated SimActions component with an ID for better accessibility.
2025-09-05 12:30:57 +09:00
tema
9e552d6a21 Enhance SIM management features and order details
- Added new environment variables for Freebit API configuration in env.validation.ts.
- Updated OrderOrchestrator to include unit price, total price, and billing cycle in order item details.
- Expanded SubscriptionsController with new SIM management endpoints for debugging, retrieving details, usage, top-ups, plan changes, cancellations, and eSIM reissues.
- Integrated SimManagementService into SubscriptionsModule and SubscriptionsController.
- Updated OrdersPage and SubscriptionDetailPage to display additional order item information and conditionally render SIM management sections.
2025-09-04 18:34:28 +09:00
T. Narantuya
ece6821766 Enhance Salesforce order fulfillment process and security measures
- Updated PLESK_DEPLOYMENT.md to include new Salesforce credentials and webhook security configurations.
- Refactored order fulfillment controller to streamline the process and improve readability.
- Introduced EnhancedWebhookSignatureGuard for improved HMAC signature validation and nonce management.
- Updated various documentation files to reflect changes in endpoint naming from `/provision` to `/fulfill` for clarity and consistency.
- Enhanced Redis integration for nonce storage to prevent replay attacks.
- Removed deprecated WebhookSignatureGuard in favor of the new enhanced guard.
2025-09-04 14:17:54 +09:00
tema
75e205b1e3 Update field mapping for billing address and enhance order page components
- Updated default field mappings for billing address in SalesforceFieldMap to maintain backward compatibility.
- Added new icons for service types in OrdersPage and OrderStatusPage for improved visual representation.
- Revised next action and timeline messages for clarity and consistency across order status components.
- Enhanced layout and styling for better user experience in order details and service overview sections.
2025-09-02 18:55:17 +09:00
tema
22baa0af06 Add OrderFulfillmentErrorService and update WhmcsModule exports 2025-09-02 17:43:30 +09:00
T. Narantuya
bb6593c9a3 Refactor OrderFulfillmentController for improved readability and consistency
- Consolidated import statements for better clarity.
- Streamlined API operation and parameter definitions for enhanced readability.
- Cleaned up response schemas and error handling for consistency across API responses.
- Improved logging messages for better context during order fulfillment requests.
2025-09-02 16:09:54 +09:00
T. Narantuya
98f998db51 Refactor code for improved readability and maintainability
- Simplified import statements in auth.controller.ts and consolidated DTO imports.
- Streamlined accountStatus method in AuthController for better clarity.
- Refactored error handling in AuthService for existing mapping checks and password validation.
- Cleaned up whitespace and formatting across various files for consistency.
- Enhanced logging configuration in logging.module.ts to reduce noise and improve clarity.
- Updated frontend components for better formatting and readability in ProfilePage and SignupPage.
2025-09-02 16:09:17 +09:00
T. Narantuya
26eb8a7341 Enhance user service and Salesforce connection handling
- Added 'salesforceHealthy' property to EnhancedUser interface for tracking Salesforce account health.
- Updated toEnhancedUser method to accept 'salesforceHealthy' parameter for improved user data handling.
- Modified user retrieval logic to correctly reflect Salesforce account status.
- Refactored Salesforce connection service to handle session expiration with automatic re-authentication for SObject operations.
2025-09-02 14:15:24 +09:00
T. Narantuya
cc2a6a3046 Enhance authentication and password management features
- Added new endpoint for retrieving account status by email in AuthController.
- Implemented change password functionality with validation in AuthService.
- Updated password strength validation to require special characters across relevant DTOs.
- Introduced optional API Access Key in environment configuration for WHMCS.
- Refactored user address update logic in UsersController to improve clarity and maintainability.
- Enhanced error handling in various services to provide more user-friendly messages.
- Updated frontend components to support new password change and account status features.
2025-09-02 13:52:13 +09:00
T. Narantuya
0f7d680782 Update throttler configuration and enhance logging setup
- Adjusted authentication rate limit TTL from 15 minutes to 10 minutes for stricter control.
- Improved logging configuration to reduce noise by ignoring specific HTTP requests and customizing serializers.
- Refactored logging in checkout components to utilize useCallback for better performance and removed unnecessary console logs.
2025-09-01 18:47:30 +09:00
T. Narantuya
911b16b67a Update Dockerfile and package configurations for BFF module
- Refactor Dockerfile to improve clarity in production dependency installation and Prisma client generation.
- Update package.json to include express and adjust dependencies for better compatibility.
- Modify pnpm-lock.yaml to reflect changes in dependencies and ensure consistency across the project.
2025-09-01 16:45:12 +09:00
T. Narantuya
4d0baed4b2 Update Plesk environment configuration and enhance Docker setup
- Added detailed instructions for Plesk deployment in `.env.plesk` and `compose-plesk.yaml`.
- Updated `.gitignore` to exclude Docker-related files.
- Enhanced Dockerfiles for both frontend and backend to optimize for Plesk deployment.
- Refined TypeScript configurations across various files for improved module resolution and compatibility.
- Removed obsolete logger fixes summary file to streamline documentation.
2025-09-01 15:11:42 +09:00
T. Narantuya
b0c8103ee2 Refactor TypeScript configurations and enhance logging setup
- Updated nest-cli.json to enable output directory deletion and refined TypeScript compiler options.
- Modified package.json to improve development command for BFF with preserved watch output.
- Adjusted tsconfig.json to extend from a higher-level configuration and removed unnecessary options.
- Enhanced logging.module.ts to simplify logger configuration and improve log message formatting.
- Updated next.config.mjs to manage server-only libraries and optimize Webpack configuration.
- Refined error logging in various components for better clarity and consistency.
2025-08-30 18:22:31 +09:00
T. Narantuya
807d37a729 Enhance TypeScript configuration and logging setup
- Added "rootDir" to tsconfig.build.json for improved build structure.
- Implemented dynamic import for fs/promises in nest-logger.config.ts to ensure compatibility in different environments and handle directory creation more robustly.
2025-08-30 17:23:50 +09:00
T. Narantuya
67c763016d Update TypeScript configurations and build process for BFF module
- Set entry file in nest-cli.json and disabled output directory deletion.
- Updated tsconfig.build.json to extend from tsconfig.base.json and refined compiler options.
- Modified tsconfig.json to extend from tsconfig.base.json and removed unnecessary overrides.
- Adjusted manage.sh script to build BFF using TypeScript compiler directly.
2025-08-30 17:11:10 +09:00
T. Narantuya
cde7cb3e3c Update package configurations and enhance BFF module structure
- Modified build command in package.json for improved reporting.
- Updated pnpm-lock.yaml to remove obsolete dependencies and add new ones.
- Enhanced TypeScript configuration in BFF for better compatibility with ES2024.
- Refactored app.module.ts for clearer module organization and added comments for better understanding.
- Adjusted next.config.mjs to conditionally enable standalone output based on environment.
- Improved InternetPlansPage to fetch and display installation options alongside internet plans.
- Cleaned up unnecessary comments and code in VPN plans page for better readability.
- Updated manage.sh script to build shared packages and BFF before starting development applications.
2025-08-30 16:45:22 +09:00
NTumurbars
b99f256da3
Merge branch 'main' into Tema-v1 2025-08-30 15:51:31 +09:00
T. Narantuya
d055ba34d8 Remove obsolete deployment guides and ESLint report files to streamline project documentation and improve clarity. Updated package configurations and scripts for better development experience and logging integration. 2025-08-30 15:47:48 +09:00
tema
a8f02ebc2b Add temporary debug endpoints and methods for WHMCS payment methods testing
- Introduced `testPaymentMethods` endpoint in InvoicesController to directly test WHMCS payment methods for a specific client ID.
- Added `testWhmcsPaymentMethods` method in InvoicesService for detailed logging and error handling during WHMCS API calls.
- Implemented cache bypassing and enhanced logging in `getPaymentMethods` method of WhmcsPaymentService for debugging purposes.
- Updated payment method transformation logic in WhmcsDataTransformer to handle variations in WHMCS API responses.
- Added debug information in Checkout and AddressConfirmation components to assist in troubleshooting address confirmation flow.
2025-08-30 15:41:08 +09:00
tema
1640fae457 Add new payment methods and health check endpoints in Auth and Invoices services
- Introduced `validateSignup` endpoint in AuthController for customer number validation during signup.
- Added `healthCheck` method in AuthService to verify service integrations and database connectivity.
- Implemented `getPaymentMethods`, `getPaymentGateways`, and `refreshPaymentMethods` endpoints in InvoicesController for managing user payment options.
- Enhanced InvoicesService with methods to invalidate payment methods cache and improved error handling.
- Updated currency handling across various services and components to reflect JPY as the default currency.
- Added new dependencies in package.json for ESLint configuration.
2025-08-30 15:10:24 +09:00
T. Narantuya
e13f63cf0c Update Dockerfile to install all dependencies for build and optimize production setup
- Changed the installation command to include all dependencies necessary for the build process.
- Updated comments for clarity regarding the installation of production dependencies and rebuilding critical native modules.
2025-08-30 10:58:31 +09:00
T. Narantuya
c025993384 Refactor Dockerfile to optimize production dependency installation
- Updated the Dockerfile to install only production dependencies, skipping unnecessary scripts to streamline the build process.
- Removed the copying of node_modules from the builder stage to reduce image size and improve efficiency.
- Ensured necessary postinstall scripts are executed for essential packages like Prisma and bcrypt.
2025-08-29 18:52:31 +09:00
T. Narantuya
e9c8d193b7 Update Dockerfile to streamline production dependencies and build process
- Simplified the installation of production dependencies by copying node_modules from the builder stage.
- Enhanced the Dockerfile by removing unnecessary environment variable settings and comments for clarity.
- Ensured all necessary built applications and dependencies are included in the final image.
2025-08-29 18:46:20 +09:00
T. Narantuya
81c0efb0b8 Remove example environment configuration files and update Dockerfile for production dependency installation
- Deleted .env.dev.example and .env.production.example files to streamline configuration management.
- Updated Dockerfile to install production dependencies recursively, ensuring all necessary packages are included during the build process.
2025-08-29 16:25:59 +09:00
T. Narantuya
ca68cabe76 Add public directory creation in Dockerfile to ensure it exists during build process 2025-08-29 14:17:15 +09:00
T. Narantuya
01c01d516a Add world-countries dependency to package.json and pnpm-lock.yaml for enhanced geographical data support 2025-08-29 14:12:12 +09:00
T. Narantuya
4f087d5c4c Enhance order processing and address management across components
- Updated pnpm-lock.yaml to include new dependencies and ensure consistent package versions.
- Refactored order handling in OrderOrchestrator to utilize centralized field mapping for Salesforce queries.
- Modified SalesforceOrder interface to replace Order_Type__c with Type for clarity.
- Improved error handling in UsersService during WHMCS updates to provide user-friendly messages.
- Enhanced BillingPage and ProfilePage components to streamline address management and improve user experience.
- Updated documentation to reflect changes in address handling and system architecture.
2025-08-29 14:05:33 +09:00
T. Narantuya
6c7b1b531c Refine address confirmation message in AddressConfirmation component for clarity 2025-08-29 13:27:06 +09:00
T. Narantuya
0a387275ff Refactor address handling in AuthService and SignupDto, and enhance order processing with address verification
- Updated AuthService to directly access address fields and added support for address line 2.
- Introduced AddressDto in SignupDto for structured address validation.
- Modified OrdersController to utilize CreateOrderDto for improved type safety.
- Enhanced OrderBuilder to include address snapshot functionality during order creation.
- Updated UsersService to handle address updates and added new methods in WHMCS service for client updates.
- Improved address confirmation logic in AddressConfirmation component for internet orders.
2025-08-29 13:26:57 +09:00