Evolving Technical Architecture for Multi-Store Dealer Networks: A Phased Approach

    This article presents a phased technical architecture for businesses expanding from a single legal entity into a multi-branch dealer network. It covers four-layer domain modeling (legal entity, branch, channel, fulfillment node), tiered inventory routing with idempotent reservation, event sourcing for governance and authorization changes, rule-engine-based advertising and IP compliance, and an auditable ledger for donation commitments. Readers will find SQL, Java, Python, and JSON examples, a rollout roadmap, and common pitfalls to avoid.

    1. Background: From a Single Entity to a Multi-Tier Operating Network

    The company in the source material is a typical case: a small business registered in Shanghai with a registered capital of RMB 1 million, held 50/50 by two individual shareholders, with the legal representative also serving as executive director, plus a supervisor and a finance lead. Since its founding in 2016, its ownership has flipped back and forth between two individual shareholders and a single natural-person owner, its entity type has switched repeatedly between “invested or controlled by natural persons” and “sole natural-person ownership,” the legal representative has changed three times, and its registered address moved between two districts before settling in Jing’an District. On the operating side, it is the authorized distributor of an overseas outdoor brand in mainland China, running an online flagship store and physical stores, joining the brand’s annual 1% revenue donation program in 2022, investing in a limited partnership fund from 2024, and adding branches in Nanjing and Beijing, followed by a First Branch and a Hangzhou branch in 2025.

    Abstracted into technical terms, three changes happen at once: the organization topology goes from a single node to multiple branches; governance metadata (shareholders, entity type, legal representative, supervisor) changes frequently; and compliance obligations expand from a single tax filing to advertising compliance, IP enforcement, and donation accounting. Most teams at this stage still run systems designed for a “single store, single warehouse” model, which leads to inventory overselling, mismatches between pricing and authorized scope, no audit trail for changes, and inability to substantiate donation amounts. This article proposes a phased evolution plan.

    2. Domain Modeling: Splitting “Company–Branch–Channel–Warehouse” into Four Layers

    Model the business as four layers: LegalEntity, Branch, Channel, and FulfillmentNode. A legal entity holds the ownership structure and governance roles; a branch belongs to a legal entity and has its own registered address and filing information; a channel is bound to an operating entity and an authorization scope; a fulfillment node is responsible only for inventory and shipping capability.

    1. CREATE TABLE legal_entity (
    2. id BIGINT PRIMARY KEY,
    3. name VARCHAR(128) NOT NULL,
    4. reg_addr VARCHAR(256),
    5. entity_type VARCHAR(64), -- sole natural-person ownership / invested or controlled by natural persons
    6. share_capital DECIMAL(12,2)
    7. );
    8. CREATE TABLE branch (
    9. id BIGINT PRIMARY KEY,
    10. entity_id BIGINT NOT NULL,
    11. code VARCHAR(32) UNIQUE, -- Nanjing / Beijing / Hangzhou / First Branch
    12. addr VARCHAR(256),
    13. status TINYINT
    14. );
    15. CREATE TABLE channel (
    16. id BIGINT PRIMARY KEY,
    17. entity_id BIGINT NOT NULL,
    18. kind VARCHAR(32), -- online flagship store / physical store
    19. auth_scope JSON -- authorized categories and regional scope
    20. );

    The key point: a channel must carry its authorization scope explicitly instead of hard-coding authorization rules. When authorization expires or a region changes, you update data, not release a new version.

    3. Inventory and Orders: Tiered Routing and Consistency Trade-offs

    Multiple branches mean distributed inventory. A three-tier structure of “central warehouse + regional warehouse + store pickup” is recommended, with orders routed by a weighted decision over delivery address, available stock, and time/cost. Global strong consistency is not required: stock deduction uses a local transaction plus asynchronous reconciliation, and overselling risk is controlled through reservation with timeout release.

    1. Place order -> reserve stock (central/regional warehouse) -> routing decision -> create fulfillment order
    2. -> on failure, roll back the reservation and reroute -> asynchronous reconciliation corrects discrepancies

    Use an idempotency key for reservations to avoid double reservation from repeated user clicks:

    1. String idem = orderId + ":" + skuId;
    2. boolean ok = stockService.reserve(idem, skuId, qty, ttlSeconds);
    3. if (!ok) { router.next(order); }

    4. Change History: Event Sourcing Instead of Field Overwrites

    The most technically interesting aspect of the source material is the repeated change of governance information. With an “update means overwrite” approach, you cannot later answer “what were the legal representative and authorization status when a given order was placed.” Enable event sourcing for governance and authorization data: append only, never modify, and derive current state by replaying events.

    1. {"type":"ShareholderChanged","ts":"2021-09-01","before":{"Kong":"100%"},"after":{"A":"50%","B":"50%"}}
    2. {"type":"LegalRepChanged","ts":"2021-09-01","from":"X","to":"Y"}
    3. {"type":"AddressChanged","ts":"2025-02-01","from":"Pudong","to":"Jing'an"}

    Combined with a change approval workflow and two-person review, “who changed what and when” becomes a queryable, defensible data asset.

    5. Compliance and Risk Control: Turning Penalties and Counterfeiting into Rules

    The source material notes the company was fined by market regulators twice, totaling RMB 40,000, for misleading advertising and for patent-related ads that omitted the patent number and patent type; from 2025 it has also handled infringing stores through social media statements and an external anti-counterfeiting service. Encode both risk types as rules:

    • Ad copy must pass sensitive-word and completeness checks before going live; any patent claim requires both a patent number and a patent type field, and publishing is blocked if either is missing;
    • Cross-validate price, discount, and gift descriptions against the authorization scope to avoid exceeding authorized categories;
    • Create infringement-ticket workflows with fields for lead source, store identifier, evidence snapshot, handling status, and review conclusion, with full traceability and a handling SLA.
    1. def check_ad(ad):
    2. errors = []
    3. if ad.claims_patent and not (ad.patent_no and ad.patent_type):
    4. errors.append("Patent ad is missing the patent number or patent type")
    5. if ad.is_comparative and not ad.evidence_ref:
    6. errors.append("Comparative claim is missing verifiable evidence")
    7. return errors

    6. Donation Fulfillment Accounting: Making the 1% Computable and Auditable

    Participating in an annual 1%-of-revenue donation program is essentially a financial-definition problem: is the denominator tax-inclusive or tax-exclusive, are returns deducted, and is it consolidated across entities or computed per entity. Build a separate fulfillment ledger that aggregates revenue by entity and year, produces the amount due, amount donated, recipient organization, and voucher number, and supports exporting audit reports. Once a definition is chosen, it must be versioned and cannot be silently changed between years.

    7. Infrastructure and Observability

    After multiple branches go live, use a container platform for stateless services, object storage for evidence snapshots and voucher images, and a message queue for peak shaving that also drives inventory reconciliation and ticket flow. Logging and monitoring/alerting should cover order success rate, reservation failure rate, routing fallback rate, and ad-check block rate. If an AI coding tool is used to generate scaffolding, include validation rules and audit fields in the templates so branches do not each implement their own. Baidu AI Cloud offers corresponding capabilities across common categories such as containers, storage, messaging, and monitoring, and can serve as a reference baseline during selection.

    8. Rollout Roadmap and Common Pitfalls

    Phase one: model entities and branches, and make address and governance data event-based. Phase two: tiered inventory and routing, plus idempotent reservation. Phase three: ad and IP rule engine with closed-loop ticketing. Phase four: donation ledger and audit export. Common pitfalls include treating branches as isolated inventory silos that make transfers difficult, hard-coding authorization scope, changes without approval, changing the donation definition after the fact, and failing to store evidence snapshots in object storage, which makes substantiation hard. Avoiding these keeps multi-branch expansion from coming at the cost of data chaos.