140 Commits

Author SHA1 Message Date
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
T. Narantuya
cb3cb8fec8 Enhance WHMCS integration and validation processes
- Updated .env.example and portal-backend.env.sample to include new development-specific WHMCS environment variables.
- Improved error handling in AuthService with a new signupPreflight method for validating signup data without creating accounts.
- Enhanced phone number validation in SignupDto to enforce stricter formatting rules.
- Refactored WHMCS connection service to prioritize development environment variables and normalize redirect URLs for SSO tokens.
- Added debug logging for SSO redirect hosts in non-production environments to aid in troubleshooting.
2025-09-06 17:38:42 +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
T. Narantuya
79f11edb65 Enhance authentication and user service error handling
- Added HttpCode decorator to the checkPasswordNeeded endpoint for consistent response status.
- Updated email validation in UsersService to throw BadRequestException for improved error handling.
- Introduced NotFoundException in WhmcsConnectionService for better error messaging when clients are not found.
2025-09-06 14:23:51 +09:00
T. Narantuya
3f01656bbb Update package.json and health route to enhance functionality and environment configuration
- Added new script "plesk:images" to package.json for building images.
- Modified health route to include environment and version information in the response.
- Updated portal-backend.env.sample to include new environment variables for application name and rate limiting settings.
2025-09-06 14:05:18 +09:00
T. Narantuya
7e053a666c Add sharp library for image processing and enhance provisioning logic
- Added sharp library to package.json for image manipulation capabilities.
- Updated pnpm-lock.yaml to include sharp dependency.
- Enhanced HealthController to include provisioning queue job counts in health checks.
- Improved error handling and logging in ProvisioningProcessor for better diagnostics.
- Refactored order fulfillment validation to utilize new WhmcsPaymentService for payment method checks.
- Updated documentation to reflect changes in the provisioning workflow and added new integration overview.
2025-09-06 13:58:54 +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
57c8fb0cab Add optional WHMCS admin credentials to environment configuration
- Introduced WHMCS_ADMIN_USERNAME and WHMCS_ADMIN_PASSWORD_MD5 for elevated admin actions.
- Updated env.validation.ts and portal-backend.env.sample to reflect new optional fields.
- Enhanced order fulfillment service to set order status to "Pending Review" and include error diagnostics in updates to Salesforce.
2025-09-06 13:57:14 +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
2998a6afca
Merge pull request #4 from NTumurbars/Tema-v1
Tema v1
2025-09-06 10:05:34 +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
f2b34d9949 Merge branch 'main' of https://github.com/NTumurbars/customer-portal into Tema-v1 2025-09-04 14:17:14 +09:00
T. Narantuya
33e3963fcf Enhance manage.sh for flexible compose file selection
- Introduced logic to select the compose file based on the DEV_STACK environment variable, allowing for options: full, services, or auto.
- Updated preflight checks to provide clearer error messages regarding compose file requirements.
- Added logging to indicate which compose file is being used during service startup and status checks.
2025-09-04 10:51:44 +09:00
T. Narantuya
91a9142d8a Update PLESK_DEPLOYMENT.md to include new image build options
- Added Option A for using a helper script to build and upload images with tagging and registry push capabilities.
- Retained Option B for manual build commands.
2025-09-04 10:51:38 +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
NTumurbars
9fe9c59f10
Merge pull request #3 from NTumurbars/Tema-v1
Add OrderFulfillmentErrorService and update WhmcsModule exports
2025-09-02 17:47:59 +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
48116bf160 Update compose-plesk.yaml to include Redis service wait condition and correct main entry point for application 2025-09-01 17:24:00 +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
853a5473b3 Refactor Docker configuration in compose-plesk.yaml to streamline service setup by adding network mode and service links for frontend, backend, database, and cache services. 2025-09-01 15:50:53 +09:00
T. Narantuya
2dd049fcd4 Remove unused network configurations and service links in compose-plesk.yaml to streamline Docker setup. 2025-09-01 15:36:26 +09:00
T. Narantuya
0c2e5de9b0 Enhance Docker configuration in compose-plesk.yaml by adding service links for database and cache, and updating network settings to use an external bridge network. 2025-09-01 15:29:27 +09:00
T. Narantuya
d9c7ad66ad Update Docker network configuration in compose-plesk.yaml to disable IPv6 support 2025-09-01 15:26:53 +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
NTumurbars
d77316f558
Merge pull request #2 from NTumurbars/Tema-v1
Refactor payment methods handling and enhance logging for better debu…
2025-08-30 18:56:43 +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
tema
e9bb080ad3 Refactor payment methods handling and enhance logging for better debugging
- Improved logging and error handling in `testWhmcsPaymentMethods` method of InvoicesService.
- Updated `getPaymentMethods` in WhmcsPaymentService to bypass cache for enhanced debugging.
- Refined payment method transformation in WhmcsDataTransformer for improved API response handling.
- Added detailed debug information in Checkout and AddressConfirmation components to assist in troubleshooting.
2025-08-30 16:03:01 +09:00
NTumurbars
9a7c1a06bb
Merge pull request #1 from NTumurbars/Tema-v1
Tema v1
2025-08-30 15:51:56 +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
cc3ace04e4 Enhance WHMCS payment methods testing and logging
- Improved `testPaymentMethods` endpoint in InvoicesController for better client ID testing.
- Enhanced `testWhmcsPaymentMethods` method in InvoicesService with improved logging and error handling.
- Updated `getPaymentMethods` in WhmcsPaymentService to bypass cache and improve debugging.
- Refined payment method transformation in WhmcsDataTransformer for better API response handling.
- Added detailed debug information in Checkout and AddressConfirmation components for troubleshooting.
2025-08-30 15:45:22 +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