PRD: Business Customers & Groups
| Module | Customer (CORE-09) | PRD ID | PRD-BIZ-001 |
| Status | Planned | Owner | Hải Cao · Khoa Nguyễn · Phát Nguyễn |
| Date | 2026-06-11 | Version | v0.1 (draft) |
| Packages | @nx/identity · apps/client · apps/bo | URD | BIZ |
| Epic | BANA-1322 | Window | July 2026 |
TL;DR
Merchants sell to companies: a customer record carries the buyer's tax code (MST) and company name, so company VAT invoices are correct - and customers can be placed into groups (VIP, member) that pricing and marketing can target. One of the three core reasons Phase 2 exists.
1. Context & Problem
The customer record today holds name/phone/email/points - no tax code, no company name, and no group entity exists. That blocks B2B: a company VAT invoice can't carry the buyer's MST. It also blocks segment pricing (E10), which needs groups to exist first. Client screens (list/detail/create/edit) exist to extend; BO has none.
2. Goals & Non-Goals
Goals - business fields MST + company (URD-BIZ-001) · business/individual distinction (002) · MST onto the VAT invoice (003) · groups + assignment (004) · group exposed to pricing (005) · screens client + BO (006).
Non-Goals - loyalty changes · auto-membership rules (007, Could) · receivables (Finance PRD-LDG-001).
3. Success Metrics
| Metric | Target |
|---|---|
| B2B invoice | A company VAT invoice carries MST + company name, end-to-end |
| Groups | Used by Pricing in August without rework |
4. Personas & Use Cases
Owner selling to companies (needs compliant invoices) · Cashier picking the right buyer fast · Marketing/pricing targeting groups.
5. User Stories
- As an owner, I add "Cty TNHH ABC" with its MST once; every later invoice to them is correct.
- As an owner, I put my regulars in "VIP" and give that group a price in August.
6. Functional Requirements
Delivers URD BIZ URD-BIZ-001…006 (Musts 001-004).
7. Non-Functional Requirements
- MST validated on entry (format + lookup where available); group filters fast on large customer lists.
8. UX & Flows
- Customer form: type toggle (individual/business) → business shows MST + company; MST validation inline.
- Groups: manage groups, assign from list/detail (multi-select).
- Checkout/invoice: picking a business customer carries MST onto the invoice.
9. Data & Domain
- Extend the customer schema with business fields; new CustomerGroup entity + membership.
- Invoice path consumes customer MST (ties to the existing merchant taxInfo flow on the seller side).
10. Dependencies & Assumptions
| Dependency | Why |
|---|---|
| Invoice issuance paths (shipped) | Where MST lands |
| Pricing (Aug) | Consumer of groups - schema must be stable by end of July |
11. Risks & Open Questions
- MST validation source (checksum only vs registry lookup) - decide in design.
- Migrating existing customers: all default to individual.
12. Release Plan & Launch Criteria
Build July (WK27-31). Launch: AC-BIZ-01 passes - a real B2B sale produces a compliant company VAT invoice; groups assignable.
13. FAQ
- Do groups affect prices now? Not in July - Pricing consumes them in August (E10).
References
URD BIZ · Phase 2 - By Month · Epic BANA-1322