349 Commits

Author SHA1 Message Date
Temuulen Ankhbayar
5c67fc34ea fix: resolve Order Activation Flow issues
- Fix SF Order locking by deferring Status change to final step
  - executeSfActivatedUpdate now only sets Activation_Status__c
  - executeSfRegistrationComplete sets Status: Processed atomically with WHMCS info

- Add WHMCS custom fields update step (whmcs_custom_fields)
  - AddOrder API expects field IDs, UpdateClientProduct accepts field names
  - New step updates SIM Number, Serial Number, EID after order acceptance

- Add Opportunity WH_Registeration__c field update
  - Sets productselect={serviceId} for WHMCS linking

- Add SIM Inventory assignment fields
  - Assigned_Account__c, Assigned_Order__c, SIM_Type__c now populated

- Remove PA05-18 Semi-Black SIM registration (only Black SIMs used)
  - Changed to direct PA02-01 call with createType=new

- Fix me-status to check for Status: Processed instead of Activated

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 15:38:59 +09:00
Temuuleenn
df742e50bc fix: resolve BFF TypeScript errors and improve mobile UX
BFF fixes:
- Fix pino-http type import by using Params from nestjs-pino
- Use Prisma-generated AuditAction enum instead of local duplicate
- Add null check for sfAccountId in mapping mapper

Portal mobile UX improvements:
- DataTable: Add responsive card view for mobile with stacked layout
- Header: Increase touch targets to 44px minimum, better spacing
- PageLayout: Optimize padding and make breadcrumbs scrollable
- PublicShell: Add iOS safe area support, slide animation, language
  switcher and sign-in button visible in mobile header

Also removes "Trusted by Leading Companies" section from AboutUsView.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:29:55 +09:00
barsa
4c724da7ae feat: implement trusted device functionality for enhanced login experience 2026-02-03 19:21:48 +09:00
barsa
70f65cedaa chore: remove IDE artifacts and update gitignore
- Remove .cursor/ folder from tracking (plans, worktrees, rules)
- Remove sim-api-test-log.csv from tracking
- Add .cursor/ and *.csv to gitignore
2026-02-03 18:35:15 +09:00
barsa
b957877c6f chore: ignore all csv files 2026-02-03 18:32:16 +09:00
barsa
7abd433d95 Refactor conditional rendering and improve code readability across multiple components
- Simplified conditional rendering in OrderSummary, ProductCard, InstallationOptions, InternetOfferingCard, DeviceCompatibility, SimPlansContent, and other components by removing unnecessary parentheses.
- Enhanced clarity in the use of ternary operators for better maintainability.
- Updated documentation to reflect changes in development setup for skipping OTP verification during login.
- Removed outdated orchestrator refactoring plan document.
- Added new environment variable for skipping OTP verification in development.
- Minor adjustments in domain contracts and mappers for consistency in conditional checks.
2026-02-03 18:28:38 +09:00
barsa
2dec0af63b fix: resolve nested ternary lint errors across codebase 2026-02-03 18:11:51 +09:00
barsa
4cb393bdb8 refactor: simplify order fulfillment and remove unused public pages
- Extract fulfillment step executors and factory from orchestrator
- Remove unused signup, migrate, and internet configure pages
- Simplify PublicShell and landing page components
- Standardize conditional expressions across codebase
2026-02-03 17:35:47 +09:00
barsa
ff9ee10860 Merge main into alt-design
Resolved merge conflicts between main and alt-design branches.

Key decisions:
- BFF: Adopted SIM-first workflow from main (PA05-18 → PA02-01 → PA05-05 → WHMCS)
- BFF: Kept FreebitFacade pattern, added new services (AccountRegistration, VoiceOptions, SemiBlack)
- BFF: Fixed freebit-usage.service.ts bug (quotaKb → quotaMb)
- BFF: Merged rate limiting + HTTP status parsing in WHMCS error handler
- Portal: Took main's UI implementations
- Deleted: TV page, SignupForm, ServicesGrid (as per main)
- Added whmcsRegistrationUrl to field-maps.ts (was missing after file consolidation)

TODO post-merge:
- Refactor order-fulfillment-orchestrator.service.ts to use buildTransactionSteps abstraction
- Fix ESLint errors from main's code (skipped pre-commit for merge)
2026-02-03 16:12:05 +09:00
Temuuleenn
35619f24d1 Simplify physical SIM activation and enhance order fulfillment
- Remove PA05-18 semi-black step from physical SIM flow, use PA02-01 directly
- Add WHMCS client ID fallback from Salesforce WH_Account__c field
- Return service IDs from WHMCS AcceptOrder for proper linking
- Add phone number to WHMCS domain field and WHMCS admin URL to Salesforce
- Change SIM Inventory status from "In Use" to "Assigned"
- Fix SIM services query case sensitivity ("SIM" → "Sim")
- Add bash 3.2 compatibility to dev-watch.sh
- Add "Most Popular Services" section to landing page
- Add "Trusted By" company carousel to About page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:41:32 +09:00
barsa
61d2236b68 refactor: standardize conditional expressions for improved readability 2026-02-03 15:21:45 +09:00
barsa
f257ffe35a Refactor SupportCaseDetailView for improved state management and component structure
- Extracted case detail logic into a custom hook `useCaseDetailState` for better separation of concerns.
- Created sub-components: `CaseNotFoundView`, `CaseHeaderCard`, `CaseMetaInfoRow`, `CaseConversationSection`, `ReplyForm`, and `ClosedCaseNotice` to enhance readability and maintainability.
- Updated message bubble rendering to use `MessageBubbleHeader` and `MessageBubbleStatus` for clearer status indication.
- Improved loading and error handling in `ResidenceCardVerificationSettingsView` by creating dedicated content components for different states.
- Refactored `transformWhmcsSubscriptionListResponse` to enhance readability and maintainability.
- Minor code style adjustments for consistency and clarity across various files.
2026-02-03 13:12:08 +09:00
barsa
d5e22f14f5 feat: add address reconciliation queue service for Salesforce integration
- Implement AddressReconcileQueueService to handle address reconciliation jobs between WHMCS and Salesforce.
- Define job data structure and queue configuration for retries and error handling.
- Add methods for enqueueing reconciliation jobs and retrieving queue health metrics.

feat: create loading components for various services in the portal

- Add loading skeletons for Internet, SIM, VPN, and public services configuration.
- Implement loading states for account-related views including account details, services, and verification settings.
- Introduce loading states for support case details and subscription actions.

feat: implement OTP input component for user verification

- Create OtpInput component to handle 6-digit OTP input with auto-focus and navigation.
- Add LoginOtpStep component for OTP verification during login, including countdown timer and error handling.

feat: define address domain constants for validation

- Establish constants for address field length limits to ensure compliance with WHMCS API constraints.
- Include maximum lengths for address fields and user input fields to maintain data integrity.
2026-02-03 11:48:49 +09:00
Temuulen Ankhbayar
9fbb6ed61e Add PA05-18 semi-black registration before PA02-01 for physical SIM activation
Physical SIM activation was failing with error 210 "アカウント不在エラー"
(Account not found) because PA02-01 requires the SIM to be pre-registered
in Freebit's system. This adds PA05-18 (Semi-Black Account Registration)
as the first step before PA02-01.

New flow: PA05-18 → PA02-01 → PA05-05

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:02:15 +09:00
tema
b400b982f3 Improve section transitions with gradient bleed effect
- Replace animated blob hero background with dot grid pattern
- Add gradient bleed transitions between all landing page sections
- Apply same gradient bleed technique to About page sections
- Remove unused blob-float animations from globals.css
- Make Trust and Values sections full-width for visual consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:05:54 +09:00
tema
1283880f7d Revamp Physical SIM activation to use PA02-01 + PA05-05
Replace PA05-33 OTA API with the proper two-step activation flow:
- PA02-01: Account Registration (/master/addAcnt/)
- PA05-05: Voice Options Registration (/mvno/talkoption/addOrder/)

Changes:
- Add FreebitAccountRegistrationService for PA02-01 account registration
- Add FreebitVoiceOptionsService for PA05-05 voice options
- Update SimFulfillmentService to use new APIs instead of PA05-33 OTA
- Add SalesforceSIMInventoryService for fetching SIM inventory data
- Remove deprecated FreebitOtaService (PA05-33 no longer used)
- Remove debug console.log statements

The new flow:
1. Fetch SIM inventory from Salesforce (phone number, PT number)
2. Call PA02-01 to register MVNO account with plan code
3. Call PA05-05 to configure voice options with customer identity
4. Update SIM inventory status to "In Use"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 18:22:00 +09:00
tema
c9d568d22f Enhance Homepage UX with Mobile Navigation and Form Improvements
- Add mobile hamburger menu with full navigation
- Fix touch support for Services dropdown
- Add form validation and accessibility labels to contact form
- Add carousel position indicators and swipe support
- Add scroll-triggered animations with useInView hook
- Add sticky mobile CTA bar
- Improve Remote Support section mobile layout
- Add animated background blobs
- Add language selector (EN indicator)
- Optimize hero image with priority flag

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 17:42:19 +09:00
barsa
464f98284a feat(eligibility): add address key field for Salesforce Flow duplicate detection
Add Eligibility_Address_Key__c field (postcode:streetAddress format) to Case records
for eligibility check requests. Salesforce Flow will use this field to detect duplicate
requests for the same address within a time period.

Changes:
- Add eligibilityAddressKey to CreateCaseParams and CASE_FIELDS mapping
- Add streetAddress param to EligibilityCheckCaseParams for passing from callers
- Add createAddressKey() helper in WorkflowCaseManager to generate the key
- Update raw.types.ts schema with new field
- Note in internet-eligibility.service.ts that basic flow skips duplicate detection
2026-01-20 19:00:09 +09:00
tema
7139e0489d Enhance Service Pages with New FAQ Sections and Content Updates
- Added new FAQ sections to the TV Services and Public Internet Plans pages, improving user assistance and engagement.
- Updated the Onsite Support page to utilize a dedicated content component for better organization and maintainability.
- Included device compatibility information in the SIM Plans content, enhancing user clarity on service offerings.
- Improved the structure and functionality of FAQ items across various service pages for a more interactive user experience.
2026-01-20 11:43:51 +09:00
barsa
2a40d84691 feat: implement ServicesOverviewContent component for consistent service listings
refactor: update AccountServicesOverview and PublicServicesOverview to use ServicesOverviewContent
fix: enhance case comment transformation with email-based customer identification
refactor: improve SupportCaseDetailView with message grouping and localStorage tracking
2026-01-19 16:29:26 +09:00
barsa
0a0e2c6508 feat: add SIM call history management service with import and retrieval functionalities
feat: implement unified SIM notification service for internal and customer notifications

feat: create SIM schedule service for date validation and resolution

feat: develop subscriptions orchestrator service for managing subscription operations and statistics
2026-01-19 14:20:14 +09:00
barsa
6a7ea6e057 feat: add services for SIM billing, details, top-up pricing, and usage management 2026-01-19 14:15:43 +09:00
barsa
be164cf287 feat: Implement Me Status Aggregator to consolidate user status data
feat: Add Fulfillment Side Effects Service for order processing notifications and cache management

feat: Create base validation interfaces and implement various order validators

feat: Develop Internet Order Validator to check eligibility and prevent duplicate services

feat: Implement SIM Order Validator to ensure residence card verification and activation fee presence

feat: Create SKU Validator to validate product SKUs against the Salesforce pricebook

feat: Implement User Mapping Validator to ensure necessary account mappings exist before ordering

feat: Enhance Users Service with methods for user profile management and summary retrieval
2026-01-19 11:25:30 +09:00
barsa
d3b94b1ed3 feat(auth): implement permission-based access control and centralized error handling
- Introduced PermissionsGuard to enforce permission checks on routes.
- Added RequirePermissions decorator for specifying required permissions on handlers.
- Created AUTH_ERRORS constants for consistent error messages across the auth module.
- Updated CsrfService to reduce CSRF token expiry time for enhanced security.
- Refactored auth cookie handling into utility functions for better maintainability.
- Enhanced TokenBlacklistService to default to fail-closed in production environments.
- Updated various DTOs and schemas for consistency and clarity.
- Removed legacy code and types related to SIM requests.
- Improved logging and error handling in GlobalAuthGuard.
- Added middleware for public path checks and optimistic authentication.
2026-01-19 10:40:50 +09:00
barsa
b52b2874d6 feat: add public VPN configuration page and view for unauthenticated users 2026-01-19 10:13:55 +09:00
tema
94b341dd93 Enhance Freebit Integration and Update UI Components
- Added FreebitTestTrackerService to FreebitClientService for improved API call tracking.
- Updated Freebit module to include the new test tracker service.
- Refactored HowItWorksSection and PublicInternetPlans to enhance user guidance with clearer steps and improved styling.
- Introduced a new VpnHowItWorksSection to provide users with a simplified setup process for VPN services.
- Enhanced PublicOfferingCard and VpnPlanCard components with updated styles and additional feature highlights for better user engagement.
2026-01-17 18:47:13 +09:00
barsa
f4099ac81f feat(eslint): enforce BFF architecture rules for controllers and aggregators 2026-01-16 17:11:49 +09:00
barsa
a23a5593f7 refactor(bff): restructure service architecture with clearer naming conventions
- Rename integration orchestrators to facades:
  - WhmcsConnectionOrchestratorService → WhmcsConnectionFacade
  - FreebitOperationsService → FreebitFacade
  - SalesforceService → SalesforceFacade

- Rename module orchestrator:
  - SimOrchestratorService → SimOrchestrator

- Rename aggregators for clarity:
  - MeStatusService → MeStatusAggregator
  - UserProfileService → UserProfileAggregator

- Move integration facades to dedicated facades/ folders:
  - whmcs/facades/whmcs.facade.ts
  - salesforce/facades/salesforce.facade.ts
  - freebit/facades/freebit.facade.ts

This establishes clearer architectural boundaries between:
- Facades: unified entry points for integration subsystems
- Orchestrators: coordinate workflows across multiple services
- Aggregators: read-only data composition from multiple sources

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 18:50:52 +09:00
barsa
18360416a3 feat(workflow): introduce Workflow Module and Case Manager for internal case handling
- Added WorkflowModule to manage internal workflow operations.
- Implemented WorkflowCaseManager for creating various types of internal cases (e.g., order placements, cancellations, ID verifications).
- Integrated WorkflowCaseManager into existing services for handling internet and SIM cancellations, eligibility checks, and ID verification submissions.
- Enhanced error handling and logging for case creation processes.
- Introduced CacheCoordinatorService for coordinating multiple cache invalidation operations with error aggregation.
- Updated relevant modules to include WorkflowModule and refactored services to utilize the new WorkflowCaseManager.
- Improved UI components in the eligibility check process for better user experience.
2026-01-15 18:15:51 +09:00
barsa
1294375205 feat: implement InlineGetStartedSection for email-first registration flow on service pages 2026-01-15 17:33:23 +09:00
barsa
7bcd7fa10d refactor: remove unused DTOs and guards from auth and billing controllers 2026-01-15 16:41:58 +09:00
barsa
37ef51cc82 chore: update repository structure documentation for clarity and organization 2026-01-15 16:31:15 +09:00
barsa
aa77f23d85 Refactor conditional rendering and improve code readability across multiple components
- Updated conditional rendering syntax in CheckoutStatusBanners, IdentityVerificationSection, and other components for consistency.
- Removed unused quick eligibility and maybe later API functions from get-started API.
- Enhanced error handling messages in various subscription views.
- Updated documentation to reflect changes in eligibility check flow.
- Cleaned up unused fields in Salesforce mapping and raw types.
2026-01-15 16:11:11 +09:00
barsa
a01361bb89 Enhance JapanAddressForm with 2026-01-15 14:38:25 +09:00
barsa
c4abd41ec6 2026-01-15 12:38:16 +09:00
barsa
0f6bae840f feat: add eligibility check flow with form, OTP, and success steps
- Implemented FormStep component for user input (name, email, address).
- Created OtpStep component for OTP verification.
- Developed SuccessStep component to display success messages based on account creation.
- Introduced eligibility-check.store for managing state throughout the eligibility check process.
- Added commitlint configuration for standardized commit messages.
- Configured knip for workspace management and project structure.
2026-01-15 11:28:25 +09:00
barsa
1d1602f5e7 feat: Implement unified eligibility check flow with inline OTP verification
- Refactor PublicLandingView to enhance service section animations.
- Update SimPlansContent and PublicEligibilityCheck to streamline service highlights.
- Revise PublicEligibilityCheck to support new flow: "Send Request Only" and "Continue to Create Account".
- Introduce guest eligibility check API with handoff token for account creation.
- Modify success step to provide clear options for account creation and navigation.
- Enhance form handling and error management in PublicEligibilityCheckView.
- Update domain schemas to accommodate guest eligibility requests and responses.
- Document new eligibility check flows and testing procedures.
2026-01-14 17:14:07 +09:00
barsa
bb4be98444 feat: Enhance About Us page with animations and updated styles
- Updated typography for headings and paragraphs in AboutUsView.
- Added animation effects for header and sections to improve user experience.
- Refactored section headers to use new display styles.

feat: Implement bilingual address handling in AddressConfirmation

- Integrated JapanAddressForm for ZIP code lookup and bilingual address input.
- Updated state management to handle bilingual addresses and validation.
- Enhanced save functionality to support dual-write to WHMCS and Salesforce.

fix: Adjust Japan Post address mapping to handle nullish values

- Updated address mapping to use nullish coalescing for optional fields.
- Ensured compatibility with API responses that may return null for certain fields.

feat: Add ServiceCard component for displaying services

- Created a flexible ServiceCard component with multiple variants (default, featured, minimal, bento).
- Implemented accent color options and responsive design for better UI.
- Added detailed props documentation and usage examples.

chore: Clean up development scripts

- Removed unnecessary build steps for validation package in manage.sh.
2026-01-14 16:25:06 +09:00
barsa
7624684e6b feat: enhance development experience by improving watch options for domain package and refining error logging in Japan Post Address Service 2026-01-14 14:00:37 +09:00
barsa
971cde9d05 feat(auth): add Password Reset Token Service and update token infrastructure 2026-01-14 13:58:24 +09:00
barsa
fd15324ef0 feat(address): integrate AddressModule and optimize Japan address form handling 2026-01-14 13:54:01 +09:00
barsa
78689da8fb feat(address): implement Japan address form with ZIP code lookup
- Add JapanAddressForm component for complete Japanese address input.
- Integrate ZipCodeInput for automatic address population via Japan Post API.
- Create hooks for ZIP code lookup and address service status.
- Define address-related types and constants in the domain package.
- Document the feature, including environment variables and API endpoints.
- Implement mapping functions for WHMCS and Salesforce address formats.
2026-01-13 18:41:17 +09:00
barsa
dc32e7aa07 feat: Enhance Public VPN Plans view with marketing content and new components
- Added detailed service highlights, how it works steps, and FAQs to the Public VPN Plans view.
- Introduced new components: CtaButton, FeaturedServiceCard, ProcessStep, ServiceCard, ServiceShowcaseCard, TrustBadge, TrustIndicators, HowItWorks, ServiceCTA, and ServiceFAQ for improved layout and functionality.
- Implemented a new design for the landing page with enhanced visuals and user engagement elements.
- Updated the VPN plans section to include a more informative and visually appealing layout.
2026-01-13 18:19:58 +09:00
barsa
bde9f706ce feat: add VPN services and call history management features
- Implemented VpnServicesService for managing VPN plans and activation fees.
- Created SimCallHistoryFormatterService for formatting call history data.
- Developed SimCallHistoryParserService to parse call history CSV files.
- Added AnimatedContainer and AnimatedBackground components for UI animations.
- Introduced BentoServiceCard, FloatingGlassCard, GlowButton, and ValuePropCard components for landing page.
- Implemented useCountUp hook for animated number counting.
- Added cancellation months utility functions for subscription management.
2026-01-13 16:19:39 +09:00
barsa
b49c94994d Decompose large services and components for improved maintainability
Phase 5: BFF Service Decomposition
- Split SalesforceOpportunityService (1055 lines) into focused services:
  - OpportunityQueryService: find/get operations
  - OpportunityCancellationService: cancellation workflows
  - OpportunityMutationService: create/update/link operations
  - SalesforceOpportunityService: thin facade (227 lines)

Phase 6: Portal Component Decomposition
- Refactor AccountCheckoutContainer (798 → 357 lines, 55% reduction)
- Extract reusable checkout section components:
  - ResidenceCardUploadInput: eliminates 3x duplicated upload UI
  - PaymentMethodSection: payment method handling
  - IdentityVerificationSection: identity verification states
  - OrderSubmitSection: order summary and submission

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:38:27 +09:00
barsa
f447ba1800 Refactor codebase: eliminate duplication, standardize patterns, resolve circular deps
Phase 1: Portal Duplication Cleanup
- Delete apps/portal/src/lib/ directory (12 duplicate files)
- Update imports to use canonical locations (core/, shared/)

Phase 2: Domain Package Standardization
- Add contract.ts to notifications and checkout modules
- Update billing schema to derive enums from contract

Phase 3: BFF Error Handling
- Remove hardcoded test SIM number from SimValidationService
- Use ConfigService for TEST_SIM_ACCOUNT env variable

Phase 4: Circular Dependency Resolution
- Create VoiceOptionsModule to break FreebitModule <-> SimManagementModule cycle
- Remove forwardRef usage between these modules
- Move SimVoiceOptionsService to new voice-options module

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:25:14 +09:00
barsa
90958d5e1d Update SalesforceAccountService to Handle Person Accounts and Update Contacts
- Modified SalesforceAccountService to support Person Accounts by adding required fields for account creation and updating associated contacts.
- Enhanced the createContact method to retrieve and update the PersonContactId instead of creating a new contact, ensuring compliance with Salesforce's Person Account structure.
- Improved logging for better traceability during account and contact updates, enhancing overall integration reliability.
2026-01-07 17:13:27 +09:00
barsa
3fb1de27d5 Add RecordTypeId for Person Accounts in Salesforce Account Service
- Updated SalesforceAccountService to include RecordTypeId for Person Accounts, ensuring proper handling of account types during creation.
- This addition enhances the integration with Salesforce by specifying the required record type for accounts, improving data accuracy and compliance with Salesforce requirements.
2026-01-06 17:03:27 +09:00
barsa
a8580b0d61 Enhance Salesforce Account and Contact Creation in Signup Workflow
- Updated SalesforceAccountService to map gender values to Salesforce picklist values and added date of birth handling for contact creation.
- Modified SignupWorkflowService to require gender and date of birth during account creation, ensuring complete data submission.
- Adjusted SignupAccountResolverService to include gender and date of birth in account creation logic, improving data integrity.
- Introduced SalesforceContactRecord interface in domain to standardize contact data structure, enhancing type safety and validation.
2026-01-06 16:52:02 +09:00
barsa
1a3032bbd3 Refactor Address Handling in Signup and Profile Components
- Updated address handling in Salesforce account and contact services to remove unnecessary address fields during signup, improving data management.
- Refactored address input fields in the SignupForm and AddressForm components to ensure proper labeling and validation for Japanese address formats.
- Enhanced address display logic in ProfileContainer and AddressConfirmation components for better user experience.
- Standardized address field names and improved placeholder texts for clarity and consistency across the application.
2026-01-06 16:13:59 +09:00