413 Commits

Author SHA1 Message Date
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
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
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
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
2db3d9ec5d feat: for improved UI consistency 2026-01-15 11:30:29 +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
barsa
cc0200bd5e Update pnpm-lock.yaml and Dockerfile for Dependency Management
- Standardized quotes in pnpm-lock.yaml for improved consistency across dependencies.
- Added new dependencies including '@types/node' and 'zod' with specified versions to enhance type safety and validation.
- Updated Dockerfile to disable workspace package injection, ensuring symlinks are used for the domain package during installation, which improves build reliability.
2026-01-06 14:09:32 +09:00
barsa
0f1c134bc9 Update Next.js Configuration to Support Monorepo Package Bundling
- Added `transpilePackages` configuration in `next.config.mjs` to ensure proper bundling of the `@customer-portal/domain` package in the monorepo setup, enhancing build efficiency and compatibility.
2026-01-05 19:03:18 +09:00
barsa
c37bdd2b9c Refactor Support Views to Improve Loading State Handling
- Updated SupportCaseDetailView, SupportCasesView, and SupportHomeView to remove direct loading state checks and replace them with a unified `showLoading` variable, enhancing code clarity.
- Adjusted loading prop in PageLayout components to reflect the new loading state logic, ensuring a smoother user experience during data fetching.
2026-01-05 18:39:55 +09:00
barsa
655d26da4f Refactor Subscription Module and Enhance Subscription Detail View
- Updated the subscriptions module to register CancellationController alongside SimController, ensuring more specific route matching for cancellation actions.
- Enhanced SubscriptionDetail component by adding a header action button for canceling Internet services, improving user experience and navigation.
- Removed deprecated Internet service actions from the SubscriptionDetail view, streamlining the component and promoting cleaner code.
2026-01-05 18:35:05 +09:00
barsa
b19c213931 Implement Unified Cancellation Features for SIM and Internet Services
- Added new methods in SalesforceOpportunityService to retrieve cancellation statuses for both Internet and SIM services by Opportunity ID, enhancing cancellation handling.
- Updated BFF module to include a new CancellationModule, improving service organization and modularity.
- Refactored portal routes and components to unify cancellation navigation, streamlining user experience.
- Introduced new domain schemas for unified cancellation previews, ensuring consistent data structure and validation across services.
- Removed deprecated cancellation components from the portal, promoting cleaner code and improved maintainability.
2026-01-05 17:09:10 +09:00
barsa
922fd3dab0 Refactor Salesforce Opportunity Integration for Enhanced Cancellation Handling
- Updated opportunity field mappings to align with new requirements for SIM and Internet cancellations, improving data accuracy.
- Introduced distinct data structures for SIM and Internet cancellations, enhancing type safety and validation processes.
- Refactored SalesforceOpportunityService to manage updates for both cancellation types, ensuring precise data handling.
- Enhanced cancellation query fields to accommodate new SIM cancellation specifications, streamlining the cancellation workflow.
- Cleaned up portal integration to reflect updated opportunity source fields, promoting better data integrity and tracking.
2026-01-05 17:08:33 +09:00
barsa
6096c15659 Refactor Salesforce Opportunity Integration for SIM and Internet Cancellations
- Updated opportunity field mappings to replace deprecated fields with new ones for SIM and Internet cancellations, enhancing clarity and consistency.
- Introduced separate data structures for Internet and SIM cancellation data, improving type safety and validation.
- Refactored SalesforceOpportunityService to handle updates for both Internet and SIM cancellations, ensuring accurate data handling.
- Enhanced cancellation query fields to support new SIM cancellation requirements, improving the overall cancellation process.
- Cleaned up the portal integration to reflect changes in opportunity source fields, promoting better data integrity and tracking.
2026-01-05 17:08:33 +09:00
tema
2b001809c3 Merge branch 'main' of https://github.com/NTumurbars/customer-portal 2026-01-05 15:59:09 +09:00