Files
vmall/openspec/changes/add-merchant-onboarding/proposal.md
T

2.5 KiB

Why

A shop can currently exist only when a platform admin creates it directly and assigns an owner by hand. There is no merchant-facing entry: prospective sellers cannot apply, nothing records their entity and qualification data, and admins have no review queue. As the 2B entry of the B2B2C mall, joining as a merchant must become an application-and-review flow instead of a manual admin back-office step.

What Changes

  • Add a public merchant onboarding application ("商家入驻") with two form kinds — personal (个人) and enterprise (企业) — covering entity information, operating categories, contact details, and qualification materials submitted as URL fields only.
  • Require registration or sign-in before submission: the form can be filled anonymously, but only an authenticated user can submit, and a user holding a pending or approved application is deduplicated and rejected.
  • Add a review state machine pending -> approved | rejected: platform admins review applications in a queue, rejection requires a reason, and approval creates the shop and a dedicated shop_owner account in the same transaction, issuing initial credentials displayed exactly once.
  • Add a mall application status page so an applicant can track their own review state and rejection reason, with re-apply after rejection.
  • Land the mall top-bar "商家入驻" entry on the onboarding page instead of the stores directory.

Capabilities

New Capabilities

  • merchant-onboarding: Application submission with per-user deduplication, the review state machine, transactional approval provisioning with one-time credentials, and applicant/admin visibility.

Modified Capabilities

  • frontend-mall: Multi-step merchant onboarding form and application status page behind the top-bar "商家入驻" entry.
  • frontend-admin: Merchant application list and review console with approve/reject actions.

Non-goals

File upload storage, qualification OCR and real-name identity verification, onboarding fees, public notice (公示期) periods, supplier (non-shop) onboarding, and multiple active applications per user are excluded.

Impact

Adds one Postgres migration (merchant_applications), a Rust merchant-onboarding module with customer and admin routes, shared types and API methods, a merchant-onboarding live-domain pick with fixed-adapter parity, Mall onboarding and status pages, and an admin review console. Approval reuses the existing identity and shop provisioning paths inside one transaction.