Skip to content

Work in Progress

Feature details in this document may change during investigation, discussion, design, and implementation phases.

Organization / Tổ chức

Business entity and company-level management.

Overview

AttributeValue
Module IDCORE-03
PhasePhase 2
PriorityHIGH
DependenciesUser Management

The Organization module manages the top-level business entity (Hộ kinh doanh / Doanh nghiệp). This is the parent container for all stores, users, and operations. Organizations can be created through self-registration by owners or sales-assisted registration, both requiring internal operator verification before activation.

┌─────────────────────────────────────────────────────────────────┐
│                   ORGANIZATION HIERARCHY                        │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│    ┌─────────────────────────────────────────────┐              │
│    │            ORGANIZATION                     │              │
│    │   (Hộ kinh doanh / Doanh nghiệp)           │              │
│    │                                             │              │
│    │   - Business Registration                   │              │
│    │   - Tax ID (MST)                            │              │
│    │   - Onboarding Status                       │              │
│    │   - Company Settings                        │              │
│    └─────────────────┬───────────────────────────┘              │
│                      │                                          │
│          ┌───────────┴───────────┐                              │
│          ▼                       ▼                              │
│    ┌───────────┐           ┌───────────┐                        │
│    │ Merchant 1│           │ Merchant 2│   → See Merchant Module│
│    │ (Store)   │           │ (Store)   │                        │
│    │ (MO #1)   │           │ (MO #2)   │   → Each can have MO   │
│    └───────────┘           └───────────┘                        │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Registration Methods

MethodDescriptionInitiator
Self-RegistrationOwner registers directly in PMBH app/webOwner
Sales-AssistedSales person registers on behalf of ownerSales Person

Both methods follow the same onboarding process after registration.

Onboarding Status

Organizations go through a manual onboarding process before becoming fully operational:

StatusDescriptionCan OperateFeatures Available
PENDINGRegistered in PMBH, awaiting VNPAY MO submissionNoView status only
MO_SUBMITTEDSubmitted to VNPAY MO, awaiting approvalNoView status only
MO_APPROVEDVNPAY approved, awaiting operator activationNoView status only
ACTIVATEDFully activated, ready to useYesAll features
SUSPENDEDTemporarily disabledNoView only

Note: Each Merchant under an Organization can have its own MO registration. If the owner wants payment capabilities for multiple stores, they need to register separate MO accounts for each Merchant in VNPAY.


User Stories

Self-Registration (Owner)

IDAs a...I want to...So that...
US-REG-01Business ownerRegister myself and my organizationI can start the onboarding process
US-REG-02Business ownerEnter my business information (MST, address)My organization is properly set up
US-REG-03Business ownerSee my registration statusI know where I am in the process
US-REG-04Business ownerReceive notifications on status changesI know when I can start using the system
US-REG-05Business ownerAccess full features after activationI can operate my business

Sales-Assisted Registration

IDAs a...I want to...So that...
US-SALES-01Sales personRegister organization on behalf of ownerOwner doesn't need to do it themselves
US-SALES-02Sales personSubmit organization to VNPAY MOApproval process can begin
US-SALES-03Sales personTrack organizations I registeredI know their onboarding status

Onboarding (Internal Users)

IDAs a...I want to...So that...
US-INT-01OperatorSee pending organizations awaiting processingI know which need attention
US-INT-02OperatorSubmit organization to VNPAY MOApproval process can begin
US-INT-03OperatorSync MO approval dataOrganization info is updated
US-INT-04OperatorComplete organization detailsAll required info is filled
US-INT-05OperatorActivate organizationOwner can start using full features
US-INT-06AdminView onboarding dashboardI can monitor the pipeline
US-INT-07AdminSuspend/reactivate organizationsI can manage compliance issues

Organization Management (After Activation)

IDAs a...I want to...So that...
US-OWN-01Business ownerConfigure company-wide settingsAll stores follow consistent rules
US-OWN-02Business ownerManage business licensesCompliance requirements are met
US-OWN-03Business ownerSet default tax ratesInvoices use correct VAT rates
US-OWN-04Business ownerConfigure invoice templatesInvoices match brand identity
US-OWN-05Business ownerView organization dashboardI see overall business performance
US-OWN-06Business ownerRequest additional MO for merchantsEach store can process payments

Feature Matrix

Registration & Onboarding

FeatureP1P2P3Description
Owner self-registrationOwner registers directly in app/web
Sales-assisted registrationSales registers on behalf of owner
Onboarding status trackingTrack PENDING → MO_SUBMITTED → MO_APPROVED → ACTIVATED
Status notificationsNotify owner on status changes
MO submission (Operator)Operator submits to VNPAY MO
MO sync (Operator)Operator syncs MO approval data
Organization activationOperator activates for full access
Onboarding dashboard (Admin)View all pending onboardings

Organization Management (After Activation)

FeatureP1P2P3Description
Full organization profileComplete business entity setup
Company-wide settingsDefault settings for all stores
Invoice template configCustomize invoice appearance
Multiple MO per merchantRegister separate MO for each store
License managementTrack business licenses
Multi-brand supportMultiple brands under one org

Key Flows

Owner Self-Registration Flow

Sales-Assisted Registration Flow

Onboarding State Diagram

What Owner Can Do at Each Status

┌─────────────────────────────────────────────────────────────────────────────┐
│                    FEATURE ACCESS BY STATUS                                  │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  PENDING / MO_SUBMITTED / MO_APPROVED:                                       │
│  ├── ✓ View onboarding status                                                │
│  ├── ✓ View/edit basic profile                                               │
│  ├── ✗ Create merchants/stores                                               │
│  ├── ✗ Create products                                                       │
│  ├── ✗ Process orders                                                        │
│  └── ✗ Access reports                                                        │
│                                                                              │
│  ACTIVATED:                                                                  │
│  ├── ✓ Full organization management                                          │
│  ├── ✓ Create merchants/stores                                               │
│  ├── ✓ Manage products & inventory                                           │
│  ├── ✓ Process orders & payments                                             │
│  ├── ✓ Issue invoices                                                        │
│  ├── ✓ Access all reports                                                    │
│  └── ✓ Manage users & permissions                                            │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Multiple MO Registration Flow

Organization Setup Flow (After Onboarding)


Business Rules

Registration Rules

Rule IDRuleDescription
BR-REG-01Self-registration allowedOwner can register themselves directly
BR-REG-02Sales-assisted allowedSales can register on behalf of owner
BR-REG-03MST required at registrationTax ID (MST) must be provided during registration
BR-REG-04MST uniqueMST must be unique system-wide
BR-REG-05Phone verificationOwner phone must be verified during registration
BR-REG-06Initial status PENDINGNew registrations start with PENDING status

Onboarding Rules

Rule IDRuleDescription
BR-ONB-01Operator submits to MOOnly Operator can submit organization to VNPAY MO
BR-ONB-02Cannot operate until ACTIVATEDFull features only available after ACTIVATED status
BR-ONB-03Operator activatesOnly internal Operator can activate organization
BR-ONB-04Status notificationsOwner notified on each status change
BR-ONB-05Sequential statusStatus must follow: PENDING → MO_SUBMITTED → MO_APPROVED → ACTIVATED
BR-ONB-06Limited access before activationOwner can only view status and edit basic profile before ACTIVATED

Organization Rules

Rule IDRuleDescription
BR-ORG-01Single organizationEach owner has exactly one organization
BR-ORG-02Cascading settingsOrg settings cascade to merchants
BR-ORG-03VAT rate validationVAT rates must be valid Vietnam rates
BR-ORG-04Address requiredBusiness address is mandatory
BR-ORG-05Owner immutableOrganization owner cannot be changed
BR-ORG-06Soft delete onlyOrganizations can only be suspended, not deleted
BR-ORG-07Audit trailAll changes are logged for compliance

MO Registration Rules

Rule IDRuleDescription
BR-MO-01MO per merchantEach Merchant can have its own MO registration
BR-MO-02Multiple MO allowedOwner can register multiple MO for multiple merchants
BR-MO-03MO required for paymentMerchant needs MO to process payments
BR-MO-04MO linked by OperatorOperator links MO approval to specific Merchant

Acceptance Criteria

Self-Registration

AC-REG-01: Owner Self-Registration

GIVEN   a business owner wants to use PMBH
WHEN    they register themselves on app/web
THEN    - Owner account is created
        - Organization is created with status PENDING
        - Owner receives registration confirmation
        - Owner can view their onboarding status
        - Owner cannot access operational features

AC-REG-02: Registration Data Validation

GIVEN   a user registering organization
WHEN    they submit registration form
THEN    - MST format is validated
        - MST uniqueness is checked
        - Phone number is verified
        - Required fields are enforced
        - Clear error messages on validation failure

Sales-Assisted Registration

AC-REG-03: Sales Registers Organization

GIVEN   a sales person with business owner info
WHEN    they register organization in PMBH
THEN    - Organization is created with status PENDING
        - Owner account is created with temporary credentials
        - Owner receives account creation notification
        - Sales can track registration status

Onboarding (Internal Processing)

AC-ONB-01: Operator Submits to MO

GIVEN   an organization with status PENDING
WHEN    operator submits to VNPAY MO
THEN    - Organization status changes to MO_SUBMITTED
        - Submission timestamp is recorded
        - Owner is notified of status change
        - Organization still cannot operate

AC-ONB-02: Operator Syncs MO Approval

GIVEN   VNPAY has approved MO and notified sales by email
WHEN    operator syncs MO approval in Admin Portal
THEN    - Organization status changes to MO_APPROVED
        - MO reference ID is linked
        - Approval data is recorded
        - Owner is notified of status change
        - Organization still cannot operate

AC-ONB-03: Operator Activates Organization

GIVEN   an organization with status MO_APPROVED
WHEN    operator fills details and activates
THEN    - All required fields are complete
        - Organization status changes to ACTIVATED
        - Activation timestamp is recorded
        - Owner is notified of activation
        - Organization can now operate fully

AC-ONB-04: Status Notifications

GIVEN   an organization undergoing onboarding
WHEN    status changes (any transition)
THEN    - Owner receives push notification
        - Owner receives email notification (if configured)
        - Status change is logged with timestamp
        - Previous status is preserved in history

MO Registration

AC-MO-01: Multiple MO Registration

GIVEN   an owner wanting payment for additional merchant
WHEN    sales registers new MO in VNPAY
THEN    - New MO can be linked to specific merchant
        - Operator links MO to merchant
        - Merchant can process payments
        - MO details are recorded per merchant

Organization Management (After Activation)

AC-ORG-01: Organization Profile Setup

GIVEN   an owner with ACTIVATED organization
WHEN    they access organization settings
THEN    - Existing data is displayed
        - Required fields are clearly marked
        - MST format is validated
        - Profile can be updated
        - Changes are logged

AC-ORG-02: Company-wide Settings

GIVEN   an owner configuring organization settings
WHEN    they set default values (tax rate, currency, etc.)
THEN    - Settings apply to all merchants by default
        - Merchants can override if permitted
        - Changes are logged

AC-ORG-03: Invoice Template Configuration

GIVEN   an owner setting up invoice template
WHEN    they configure logo, footer, terms
THEN    - Template preview shows changes
        - All merchants use this template
        - Changes apply to new invoices only

Suspension & Reactivation

AC-SUS-01: Organization Suspension

GIVEN   an ACTIVATED organization with compliance issue
WHEN    admin suspends the organization
THEN    - Organization status changes to SUSPENDED
        - Owner is notified immediately
        - All operational features are disabled
        - Historical data remains accessible
        - Reason is recorded in audit log

AC-SUS-02: Organization Reactivation

GIVEN   a SUSPENDED organization
WHEN    admin reactivates the organization
THEN    - Organization status changes to ACTIVATED
        - Owner is notified immediately
        - All operational features are restored
        - Reactivation is logged

Dependencies

Organization
├── Requires: User Management (Owner)
├── Required by: Merchant, Permissions, Reports
└── Integrates: VNPAY MO, CA Provider
ModuleRelationship
User ManagementOwner belongs to Org
PermissionsRoles scoped to Org
MerchantStores belong to Org
Tax & InvoiceTax settings from Org

Integration Points

VNPAY Management Office (MO)

┌─────────────────────────────────────────────────────────────────┐
│                    VNPAY MO INTEGRATION                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  CURRENT PROCESS: Manual (No automatic sync)                     │
│                                                                  │
│  Self-Registration Flow:                                         │
│  1. Owner registers in PMBH (status: PENDING)                 │
│  2. Operator reviews and submits to VNPAY MO                     │
│  3. VNPAY reviews and approves                                   │
│  4. VNPAY notifies Operator via EMAIL                            │
│  5. Operator syncs approval in Admin Portal (status: MO_APPROVED)│
│  6. Operator activates organization (status: ACTIVATED)          │
│                                                                  │
│  Sales-Assisted Flow:                                            │
│  1. Sales registers org in PMBH (status: PENDING)             │
│  2. Operator submits to VNPAY MO (status: MO_SUBMITTED)          │
│  3. VNPAY reviews and approves                                   │
│  4. VNPAY notifies Operator via EMAIL                            │
│  5. Operator syncs approval (status: MO_APPROVED)                │
│  6. Operator activates organization (status: ACTIVATED)          │
│                                                                  │
│  MO Data (manually synced):                                      │
│  ├── MO Reference ID                                             │
│  ├── Business registration details                               │
│  ├── Tax ID (MST)                                                │
│  ├── Approved payment methods                                    │
│  └── Merchant/outlet information                                 │
│                                                                  │
│  MO Registration:                                                │
│  ├── One MO per Merchant (for payment capability)                │
│  ├── Owner can have multiple MO (one per store)                  │
│  └── Each MO linked to specific Merchant by Operator             │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Admin Portal (Internal Users)

┌─────────────────────────────────────────────────────────────────┐
│                 ADMIN PORTAL - ONBOARDING                        │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  Operator Functions:                                             │
│  ├── View pending organizations (PENDING status)                 │
│  ├── Submit organization to VNPAY MO                             │
│  ├── Sync MO approval data                                       │
│  ├── Fill organization details                                   │
│  ├── Link MO to Merchants                                        │
│  └── Activate organization (status: ACTIVATED)                   │
│                                                                  │
│  Admin Functions:                                                │
│  ├── Onboarding dashboard (all statuses)                         │
│  ├── Suspend/reactivate organizations                            │
│  └── Override/correct organization data                          │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

CA Provider (Certificate Authority)

┌─────────────────────────────────────────────────────────┐
│                 CA PROVIDER INTEGRATION                 │
├─────────────────────────────────────────────────────────┤
│                                                         │
│  Purpose: E-Invoice certificate management              │
│                                                         │
│  Data Exchange:                                         │
│  ├── Organization MST                                   │
│  ├── Business registration                              │
│  ├── Digital certificate request                        │
│  └── Certificate status                                 │
│                                                         │
│  Status: Managed through Tax & Invoice module           │
│                                                         │
└─────────────────────────────────────────────────────────┘

Screenshots

Screenshots

Screenshots will be added after UI implementation.


Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.