Skip to content

URD: Customer

ModuleCORE-09Versionv0.6
StatusIn-progressDate2026-06-04

Business documentation. This URD is Customer's feature list - each feature below is one Functional Area (<AREA>). The same <AREA> keys the feature's PRDs (PRD-<AREA>-NNN) and tests (TC-<AREA>-NNN), and each feature is listed in the Delivery feature catalog. See the Feature Spine convention.

1. Purpose

Define user-facing requirements for Customer Relationship Management - keeping customer profiles under a brand, rewarding repeat buyers with loyalty points, growing a newsletter mailing list, and capturing sales inquiries for follow-up. The goal is a single place to know who a business's customers are and to engage them.

2. Scope

IncludedExcluded
Customer profiles scoped to the brandCustomer segmentation (Planned)
Customer-to-user account linkingEmail / SMS campaign engine (Planned)
Loyalty point earning on completed ordersPoint redemption on orders (Planned)
Newsletter subscribe / unsubscribe / statisticsLoyalty tiers (Planned)
Sales-inquiry capture and lifecycleLifetime-value analytics (Planned)
Technical API specifications (see developer docs)

3. Definitions

TermDefinition
CustomerA person known to a brand; modelled as a User with the fixed customer role, with no sign-in credentials by default
Brand (Organization)The virtual brand layer a customer belongs to; customers are scoped to it, not to a single point-of-sale unit
Loyalty pointsA point balance a customer earns when an order completes payment
Conversion rateThe per-merchant spend-per-point factor - how much order total equals one point (order total is divided by it)
SubscriberAn email address opted into the newsletter, with topics, locale, and a unique unsubscribe token
InquiryA lead captured from the public site, tracked through a NEW → assigned → replied → converted/lost lifecycle

4. Conceptual Model

Conceptual only. Full schema lives in the developer docs: Identity domain model, Sale - Customer Points, and Outreach domain model.

5. Feature Catalog

The feature list of this module. Each row is one feature (a Functional Area). Detail in §6. Mirrored in the Delivery feature catalog.

Feature IDFeaturePhaseStatusPriority
CUSCustomer ProfilesP1BuiltHigh
PNTLoyalty PointsP2BuiltMedium
SUBNewsletter SubscribersP2BuiltMedium
INQSales InquiriesP2BuiltMedium
BIZBusiness customers & groupsP2PlannedHigh

Status: live from Plane where mapped, otherwise registry-declared. Vocabulary mirrors Plane (state-group / phase).

6. Features

One sub-section per feature, in catalog order. Each feature keeps its description, requirements, and acceptance together. Priority = MoSCoW (Must / Should / Could / Won't).

CUS - Customer Profiles Built

Feature ID: crm/CUS · Phase: P1 · PRDs: - · Dev: @nx/identity

What it does for users: staff keep a directory of customers under their brand - name, emails, phones, birthday, locale - scoped to the Organization, attachable to orders, and soft-deleted while preserving history.

Requirements

IDPRequirement
URD-CUS-001MCreate a customer with name, at least one email and one phone
URD-CUS-002MScope every customer to the brand (Organization)
URD-CUS-003MUpdate a customer's profile (name, emails, phones, birthday, locale)
URD-CUS-004MSoft-delete a customer, preserving history
URD-CUS-005SStaff see and manage only customers within their own brand
URD-CUS-006SAttach a customer to a sale order at checkout
URD-CUS-007CPromote a customer to a full sign-in user account

Acceptance

AC-CUS-01: Customer profile lifecycle
GivenWhenThen
A staff member of a brandCreates a customer with name + phone + emailCustomer is created and scoped to that brand
A customer of another brandThe staff member searches/opens itIt is not visible (brand isolation)
A customer with linked ordersThe staff member soft-deletes itCustomer leaves the active list; record and orders are preserved

PNT - Loyalty Points Built

Feature ID: crm/PNT · Phase: P2 · PRDs: PRD-PNT-001 · Dev: @nx/sale

What it does for users: customers automatically earn a point balance when their order completes payment, computed by dividing the order total by a per-merchant conversion rate (spend-per-point) and flooring to whole points, awarded at most once per order, with every award recorded as an immutable ledger entry.

Requirements

IDPRequirement
URD-PNT-001SAward points when an order completes payment and a customer is attached
URD-PNT-002SCompute the award as floor(order total ÷ the per-merchant conversion rate) - the rate is spend-per-point
URD-PNT-003STrack a running point balance per customer, incremented atomically
URD-PNT-004SAward points at most once per order, even on retry (idempotent by order)
URD-PNT-005CAward no points when the rate is unset / not positive, computed points ≤ 0, or no customer is attached
URD-PNT-006SRecord every award as an immutable ledger entry (type, points, applied rate, links to customer / order / merchant), written atomically with the balance increment
URD-PNT-007CBrowse a customer's point history via a merchant-scoped, read-only ledger

Acceptance

AC-PNT-01: Loyalty points earn
GivenWhenThen
A customer attached to an order; rate configuredThe order completes paymentPoints = floor(order total ÷ rate) are added to the balance and one ledger entry is written
The same order payment event is redeliveredPoints would be awarded againNo double award - the balance and ledger are unchanged
No customer attached, or rate is not positive / unsetThe order completes paymentNo points are awarded; no entry is written (safe no-op, not an error)
The order total is smaller than the rateThe order completes paymentComputed points floor to zero, so nothing is awarded
AC-PNT-02: Point ledger is read-only and merchant-scoped
GivenWhenThen
Awarded point entries for a merchantStaff open the point ledger with the merchant scopeThey see the customer's earn entries (type, points, applied rate, order link)
A staff member without the merchant scopeThey request the ledgerEntries of that merchant are not returned
Any external clientIt attempts to create / edit / delete an entryThe ledger exposes no such operation - entries are written only by the earn seam

SUB - Newsletter Subscribers Built

Feature ID: crm/SUB · Phase: P2 · PRDs: - · Dev: @nx/outreach

What it does for users: site visitors opt into the newsletter by email with topics and locale; subscription is idempotent, one-click unsubscribe works via a unique token, and admins see subscriber statistics.

Requirements

IDPRequirement
URD-SUB-001SSubscribe by email with topics and locale
URD-SUB-002SKeep email globally unique among subscribers
URD-SUB-003SUnsubscribe via a unique one-click token link
URD-SUB-004SResubscribe reactivates a deactivated subscriber (idempotent)
URD-SUB-005SView subscriber statistics - totals, monthly new, counts by status

Acceptance

AC-SUB-01: Newsletter subscribe / unsubscribe
GivenWhenThen
A new emailSubscribeSubscriber is created with topics, locale, and an unsubscribe token
An already-active emailSubscribe againReturns the existing subscriber (idempotent)
A deactivated subscriberSubscribe againThe subscriber is reactivated
A valid unsubscribe tokenThe link is clickedThe subscriber is deactivated

INQ - Sales Inquiries Built

Feature ID: crm/INQ · Phase: P2 · PRDs: - · Dev: @nx/outreach

What it does for users: leads from the public site submit inquiries with contact, business info, and a message; admins are notified in real time, and sales reps move each inquiry through a NEW → assigned → replied → converted/lost lifecycle.

Requirements

IDPRequirement
URD-INQ-001SCapture an inquiry with contact info, business info, and message
URD-INQ-002SNotify admins in real time when a new inquiry is submitted
URD-INQ-003STrack assignment, reply, conversion, and lost reason
URD-INQ-004SMove an inquiry through NEW → assigned → replied → converted/lost

Acceptance

AC-INQ-01: Sales inquiry
GivenWhenThen
A site visitorSubmits an inquiryStatus is NEW and admins are notified in real time
A sales repAssigns it to selfThe inquiry shows the assignee
A sales repRepliesReply author and timestamp are recorded
A sales repMarks converted (or lost with reason)Outcome and timestamp are recorded

BIZ - Business Customers & Groups Planned

Feature ID: customer/BIZ · Phase: P2 (Jul) · PRDs: PRD-BIZ-001 · Dev: @nx/identity

What it does for users: merchants manage company customers - with tax code (MST) - so company VAT invoices carry the buyer's MST, and place customers into groups (VIP, member) for pricing and targeting.

Requirements

IDPRequirement
URD-BIZ-001MA customer record can carry business fields: tax code (MST), company name
URD-BIZ-002MBusiness and individual customers are clearly distinguished
URD-BIZ-003MThe company's MST flows onto its VAT invoice
URD-BIZ-004MCustomer groups: create groups, assign customers
URD-BIZ-005SA customer's group is available as a pricing condition (consumed by Pricing in Aug)
URD-BIZ-006SCustomer management screens exist in client and BO
URD-BIZ-007CGroup rules (automatic membership)

Acceptance

AC-BIZ-01: Company VAT invoice
GivenWhenThen
A business customer with a valid MSTA B2B sale issues a VAT invoiceThe invoice carries the buyer's MST and company name
A customer in group "VIP"Listed/filteredGroup membership is visible and filterable

7. Constraints & Non-Goals

Constraints

IDConstraint
C-01Customers are scoped to a brand (Organization), not a single point-of-sale unit
C-02A customer has the fixed customer role and no sign-in credentials by default
C-03Point award is idempotent - at most one award per order
C-04Subscriber email is globally unique; unsubscribe token is globally unique
C-05Subscribe is idempotent (returns existing or reactivates)
C-06All records use soft-delete

Non-Goals

  • Customer segmentation and targeting
  • Email / SMS campaign engine
  • Point redemption on orders, and loyalty tiers
  • Customer lifetime-value analytics

8. Version History

DateAuthorDescriptionVer
2026-02-26P. Do - Product OwnerInitial customer profiles, points, subscribers, inquiriesv0.1
2026-04-16P. Do - Product OwnerReworked around subscribers and inquiriesv0.3
2026-05-30Docs migrationRestructured to module convention; areas CUS/PNT/SUB/INQ aligned to built behavior; status-honest prioritiesv0.4
2026-06-04Claude (AI pair)Reorganize by feature (Feature Spine)v0.5
2026-06-15Sale squadPNT made code-accurate (spend-per-point divisor); added ledger requirements PNT-006/007 + AC-PNT-02; linked PRD-PNT-001v0.6

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