363 Commits

Author SHA1 Message Date
barsa
451d58d436 refactor: simplify auth signup flow by merging duplicate workflows
Merge SfCompletionWorkflow and NewCustomerSignupWorkflow into a single
AccountCreationWorkflowService, remove legacy /auth/migrate endpoint
and WhmcsLinkWorkflow, extract shared OTP email pattern into
OtpEmailService, and improve PORTAL_EXISTS redirect UX with email
pre-fill.

- Consolidate signup/ directory services into steps/ (PortalUserCreationService,
  WhmcsCleanupService) and new AccountCreationWorkflowService
- Rename WhmcsMigrationWorkflowService to AccountMigrationWorkflowService
- Remove dead code: WhmcsLinkWorkflowService, auth.controller /migrate endpoint
- Extract OtpEmailService from duplicated login/verification OTP email logic
- Pass email query param on PORTAL_EXISTS redirect for login pre-fill
- Delete 1977 lines of legacy code, add ~350 lines of consolidated logic
2026-03-03 17:58:06 +09:00
barsa
9b7cbcf78f refactor: improve error handling and caching in BFF services
- Enhanced UnifiedExceptionFilter to handle ZodValidationException, extracting field errors for better user feedback.
- Updated WhmcsRequestQueueService and WhmcsHttpClientService to use logger.warn for non-critical errors, improving log clarity.
- Introduced Redis-backed caching in JapanPostFacade for postal code lookups, reducing redundant API calls.
- Refactored address handling in AddressWriterService to deduplicate concurrent Japan Post lookups, optimizing API usage.
- Improved error parsing in various forms and hooks to provide clearer error messages and field-specific feedback.
2026-03-03 17:27:50 +09:00
barsa
6299fbabdc refactor: enhance address handling in BFF workflows
- Integrated AddressWriterService into GuestEligibilityWorkflowService and NewCustomerSignupWorkflowService for improved address writing to Salesforce.
- Updated AddressModule to include SalesforceModule and export AddressWriterService.
- Refactored address handling in various workflows to utilize the new address structure, ensuring consistency and reliability in address processing.
- Removed deprecated address building logic from eligibility check store, streamlining address management across components.
2026-03-03 16:33:40 +09:00
barsa
26a1419189 refactor: integrate PasswordInput component across forms
- Replaced standard input fields with the new PasswordInput component in various forms including PasswordChangeCard, LoginForm, PasswordResetForm, SetPasswordForm, and MigrateAccountStep.
- Updated imports to include PasswordInput in relevant components for consistent password handling and improved user experience.
2026-03-03 15:37:51 +09:00
barsa
73ef1d9825 refactor: enhance phone number validation in account forms
- Updated phone number validation logic in useCompleteAccountForm and CompleteAccountStep components to include schema validation using phoneSchema.
- Improved error messaging for invalid phone numbers and ensured required field checks are clearly defined.
2026-03-03 14:50:58 +09:00
58ed32c431 fix: correct company name typo in PublicShell header
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:38:29 +09:00
barsa
0ac4e80ba7 refactor: update Content Security Policy in proxy configuration
- Adjusted CSP to allow same-origin scripts and inline scripts generated by Next.js.
- Removed 'strict-dynamic' to prevent blocking of parser-inserted script tags, ensuring proper loading of Next.js chunks.
2026-03-03 14:30:39 +09:00
barsa
0bf367ffec refactor: update rate limiting configuration and enhance account event handling
- Increased default login rate limit from 5 to 20 and adjusted TTL from 15 to 5 minutes for improved security.
- Updated login captcha threshold from 3 to 5 attempts to enhance user experience.
- Modified AccountEventsListener to invalidate additional queries for account updates and support case changes, improving responsiveness to real-time events.
2026-03-03 14:13:24 +09:00
barsa
99761b21dd refactor: enhance password reset form validation and auth store integration
- Introduced a new reset form schema that extends the domain passwordResetSchema to include a confirmPassword field with matching logic.
- Updated the PasswordResetForm component to utilize the new schema for improved validation.
- Added applyAuthResponse method to the auth store for syncing authentication responses.
- Refactored GetStartedForm to redirect users to the dashboard upon successful account setup, integrating with the auth store for session management.
- Removed unnecessary redirection logic from CompleteAccountStep and MigrateAccountStep components to streamline the flow.
2026-03-02 19:02:48 +09:00
barsa
29b511e44c refactor: update password validation requirements and messaging
- Removed special character requirement from password validation across various components and schemas.
- Updated user-facing messages to reflect the new password criteria.
- Adjusted related validation logic in the domain and portal to ensure consistency.
2026-03-02 17:40:47 +09:00
barsa
49d6d21974 fix: restore lost error classifications and address code review findings
- Salesforce: add validation/duplicate/access/storage error classes and
  restore classification in error handler (400/409/403/503 vs generic 502)
- Freebit: add auth/rate-limit/validation/network error classes and
  restore result-code-based classification (215, 381, 382)
- Portal: replace unsafe string→enum casts with typed state variables
- BaseRepository: narrow orderBy from unknown to Record<string, "asc"|"desc">
- WHMCS: narrow WhmcsNotFoundError.providerCode from string to union type
- Remove unused UnitOfWork service from PrismaModule
2026-03-02 13:11:11 +09:00
barsa
7da032fd95 refactor: tighten support schema to use defined enum validators
Replace loose z.string() fields in supportCaseSchema and supportCaseFilterSchema
with the already-defined enum schemas (status, priority, category). Add JSDoc
to intentional escape hatches in customer contract interfaces. Fix portal
type assertions for the stricter filter types.
2026-03-02 13:11:10 +09:00
barsa
9941250cb5 refactor: streamline authentication workflows and remove legacy services
- Replace SignupWorkflowService and GetStartedWorkflowService with new coordinator services for improved modularity and clarity.
- Update auth controller to utilize the new GetStartedCoordinator.
- Refactor account status handling in the GetStartedForm component to leverage XState for state management.
- Introduce new hooks for managing the get-started flow, enhancing the overall user experience.
- Remove deprecated services and clean up related imports to maintain code hygiene.
2026-02-24 14:37:23 +09:00
barsa
6e51012d21 UAT docs and bug fixes 2026-02-24 11:09:35 +09:00
Temuulen Ankhbayar
5e5bff12da fix: comprehensive SIM audit fixes and MNP debug logging
Address critical, high, and medium issues found during SIM management audit:

Critical: fix eSIM plan code mapping (SKU→PASI), PA05-41 endpoint typo,
PA05-05 gender mapping (F→W) and katakana field names.

High: fix double authKey injection, add MNP/porting fields to SF getOrder
SOQL, add reissue params to eSIM addAcnt, remove console.error debug stmt.

Medium: fix KB/MB conversion (1000→1024), birthday UTC timezone bug, plan
code regex matching "5G" as 5GB, case-insensitive isMnp flag, domain schema
enums (addKind +M, simkind E0/E2/E3), move identity into mnp Level 2.

Frontend: fix SVG donut radius mismatch (r=88→96), fix FreebitError typo.

Add comprehensive MNP debug logging across the entire data flow pipeline:
SF order extraction, config mapping, MNP field parsing, API payload assembly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 18:48:50 +09:00
Temuulen Ankhbayar
df017d520f fix: resolve SIM management modal, plan change, and voice feature issues
- Fix Tailwind v4 modal stacking bug by adding relative z-10 to modal
  content divs (CancellationFlow, ChangePlanModal, TopUpModal, SimActions)
- Add test mode for immediate plan changes (SIM_BILLING_TEST_MODE) instead
  of scheduling for 1st of next month
- Bypass rate limiter spacing/cancellation checks in test mode
- Hide voice feature toggles for data-only SIMs using hasVoice flag
- Guard BFF voice feature updates to reject early for data-only SIMs
- Fix Freebit retry logic to not retry business errors (e.g. resultCode 260)
- Add user-friendly error message for resultCode 260 (voice not active)
- Update plan change page text to reflect test mode behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 14:53:07 +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
60849b59a8 chore: update dependencies and fix lint errors
- Update pnpm 10.25.0 → 10.28.2
- Update all packages to latest versions (Next.js, React, NestJS, Prisma, etc.)
- Fix 36 nested ternary lint errors (unicorn/no-nested-ternary)
- Add security overrides for lodash and hono transitive deps
- Change pinned versions to use caret (^) for auto-updates
- Update catalog versions (@types/node, typescript, zod)
- Resolve all 12 security vulnerabilities
2026-02-03 18:46:51 +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
44aa90061e refactor: remove unused metadata and sitemap configurations for cleaner code 2026-02-03 17:59:44 +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
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
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
b5a1091d41 feat(sim-plans): update layout for SimPlansContent component with responsive design 2026-01-20 19:44:12 +09:00
barsa
7dff7dc728 refactor(auth): remove SignupForm and related steps, migrate to new account creation flow
- Deleted SignupForm component and its associated steps (AccountStep, AddressStep, PasswordStep, ReviewStep).
- Removed references to SignupForm in index files and views.
- Updated MigrateAccountView to redirect to the new get-started flow.
- Adjusted PublicInternetConfigureView to use InlineGetStartedSection instead of InlineAuthSection.
- Cleaned up unused hooks and store methods related to WHMCS linking.
2026-01-20 19:40:55 +09:00
barsa
0ee1f00bf8 feat(migrate-account): implement MigrateAccountStep for passwordless WHMCS account migration 2026-01-20 19:00:20 +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
ff870c9f4f Update Service Pages Metadata and Content for Enhanced User Engagement
- Revised metadata titles and descriptions across various service pages to better reflect offerings and improve SEO.
- Updated content in the About Us, Contact, and Support pages to emphasize English support and services for expats in Japan.
- Removed TV Services references from the portal, streamlining service offerings and focusing on core services.
- Enhanced service descriptions to clarify benefits and features, ensuring users understand the value of each service.
2026-01-20 17:19:00 +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
Temuuleenn
1f57ca4906 Remove Deprecated FAQ Sections and Update Blog Content
- Deleted the .env.example file as it is no longer needed.
- Updated blog page content with new sample posts and adjusted category counts for better accuracy.
- Removed FAQ sections from various service pages to streamline content and improve user experience.
- Simplified author information in blog posts for consistency and clarity.
2026-01-20 11:33:10 +09:00
barsa
04fd0ea233 feat: Implement safe redirect handling in CompleteAccountStep and SuccessStep components 2026-01-20 11:28:03 +09:00
barsa
5c6bd00346 feat(auth): update migration and password set flows with improved redirect handling
feat(billing): enhance invoice list with filtering and summary stats

feat(components): add ClearFiltersButton, FilterDropdown, and DetailStatsGrid components for better UI consistency

fix(get-started): refactor button links to use new Button component for consistency

style(services): update ServicesOverviewContent to conditionally render hero section

refactor(orders): simplify OrderDetail and OrdersList views with new stat grid and filtering components

chore: add useInvoicesFilter hook for managing invoice filtering logic
2026-01-20 11:26:40 +09:00
barsa
8d9c954230 refactor: Remove AccountRouteGuard and adjust loading state handling in AppShell and views 2026-01-19 18:32:31 +09:00
barsa
69e07ecef2 feat: Set hasCheckedAuth to true upon successful login/signup 2026-01-19 17:29:07 +09:00
barsa
f3b41ca6f4 refactor: Simplify getStepIndex and getStatusCategory logic for clarity 2026-01-19 17:11:55 +09:00
barsa
dd8259e06f feat: Add SummaryStats component for displaying statistics in cards and inline formats
- Introduced SummaryStats component to standardize the display of statistics across the application.
- Updated SubscriptionsList and SupportCasesView to utilize the new SummaryStats component for better UI consistency.
- Refactored existing statistics display code into the new component, improving maintainability.

feat: Implement OrderDetailSkeleton and OrderProgressTimeline components

- Created OrderDetailSkeleton for loading states in order details view.
- Developed OrderProgressTimeline to visually represent the order status progression.
- Added skeleton loading states for both components to enhance user experience during data fetching.

feat: Enhance orders filtering with useOrdersFilter hook

- Implemented useOrdersFilter hook to manage order filtering logic, including search and status filters.
- Improved filtering capabilities for orders based on various criteria, enhancing user interaction.

feat: Add VpnPlansContent component for VPN service plans display

- Developed VpnPlansContent component to showcase available VPN plans and features.
- Integrated loading and error handling states for better user feedback.
- Included FAQ and How It Works sections to provide users with essential information about the VPN service.

chore: Update index files for new components

- Added exports for new components in their respective index files for easier imports.
2026-01-19 17:08:28 +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
789e2d95a5 refactor: extract hooks and components from high-complexity views
Reduce complexity in ProfileContainer, AccountCheckoutContainer, and JapanAddressForm
by extracting reusable hooks, components, and utilities.

ProfileContainer (705 → 132 lines):
- Extract useProfileDataLoading hook for consolidated data loading
- Extract useVerificationFileUpload hook for file upload state
- Create VerificationCard component for verification UI
- Create ProfileLoadingSkeleton for loading state
- Update PersonalInfoCard with phone field and additional fields
- Update AddressCard to use Button component

AccountCheckoutContainer (382 → 303 lines):
- Extract useCheckoutEligibility hook for eligibility state
- Extract useCheckoutFormState and useCanSubmit hooks
- Extract useCheckoutToast hook for toast timing
- Create checkout-navigation utilities
- Create CheckoutErrorFallback component

JapanAddressForm (727 → 437 lines):
- Extract AnimatedSection, ProgressIndicator, BilingualValue components
- Extract useAddressCompletion hook for completion state
- Extract useJapanAddressForm hook for form state/handlers
- Create japan-address.constants and street-address.validation utilities
2026-01-19 15:48:47 +09:00
barsa
0a5a33da98 Refactor conditional statements for improved readability and consistency
- Updated various components to use parentheses in conditional statements for clarity.
- Refactored `renderSubCardHeader` to use an options object for better parameter handling.
- Enhanced error handling messages across multiple components to provide clearer feedback.
- Adjusted query string handling in routing to improve readability.
- Made minor adjustments to ensure consistent formatting and style across the codebase.
2026-01-19 15:14:39 +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
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