DODIL BLOG
DocsLog inSign up

Modules / Business partner

Customers & suppliers (shared)

One record per company or person you do business with, shared by every other module — so sales, invoicing and purchasing all mean the same customer.

People ask for it as: “one customer list”, “our customers and suppliers”, “the same client in sales and accounting”

Who uses it

RoleDoesSees
Whoever keeps the customer list cleanmerges duplicates, fixes names, links subsidiaries to parentsevery partner
Other modules (sales, invoicing, purchasing)create-or-reuse a partner, read partners and familiesevery partner
The people module (hr), through its service identitythe SINGLE writer of person partners (name, work contact, roles employee / worker / supplier, the works_for edge), and anonymises them on erasureperson partners, and organisation partners as any module does
Roles that deal with people as parties (contracts, finance)reads person partners, for a contract counterparty or a supplier paymentperson partners and organisation partners
The systemderives ids and enforces the sole-writer rule on every writeevery partner, through its own service account

What it has to do

Reference user stories. Each has a test written into it — the given / when / then — which becomes an automated check once it is built. Expect to keep some, change some and drop some.

Things people do

  • BP-01As the person who keeps the customer list, I want one record per real company however many modules use it, so that reports agree.

    Given sales and invoicing both refer to Acme · when I open Acme · then I see one partner with two roles (customer, and supplier if we also buy from them)

    Whoever keeps the customer list clean · reference: implemented

  • BP-03As the data steward, I want to link subsidiaries to their parent, so that group-level reporting is possible.

    Given Acme UK and Acme DE · when I link both to Acme Group as subsidiary_of · then the family walk returns both; a framework-agreement link does not leak into the ownership tree

    Whoever keeps the customer list clean · reference: implemented (typed edges)

  • BP-06As anyone signed in without bp:person:read, I should not see people in the partner list, so that a starter's name is not visible to the whole company before they start.

    Given an organisation partner Acme and a person partner for a starter hired today · when I list partners or open the person partner by id · then I see Acme; the person partner is not in the list and opening it is not found (404, not 403); a caller with bp:person:read sees both

    Other modules (sales, invoicing, purchasing) · screen: Partners · reference: not built

Things that happen on their own

  • BP-02whenever any module creates a partnerThe system derives the partner id from a stable business key, so that importing the same company twice creates it once.

    Given a partner with key acme.com · when it is created twice, by two modules · then one row, the same id both times

    · reference: implemented (bp_id = blake2b(bp_key), 56-bit)

Things that cross into other modules

  • BP-04when sales converts a new companySales promotes a company into the shared list instead of keeping its own.

    Given a CRM organization row · when promote is called · then a partner exists (created or reused) with the customer role

    · owned by business-partner · reference: implemented (POST /partners/promote)

  • BP-05when hr hires a person, changes their name or work contact, or a role-bearing event takes effecthr keeps the person's partner right, as its only writer, so that every module addresses a person with one key.

    Given a person in hr with person_id 812…, and no partner for them · when hr calls bp:person:sync with bp_key 'person:<person_id>', the legal and preferred name, the work email and phone, the roles and, for a company freelancer, works_for → the company's partner · then one partner of kind person exists (bp_id derived from the bp_key, so hr knows it without asking), with exactly those fields; a second identical call changes nothing; a payload carrying a personal email, phone, home address, tax or bank field is refused ("a person partner carries a name and a work contact only"); bp:partner:write cannot edit a person partner ("people are written by hr")

    · owned by business-partner · reference: not built

  • BP-07when hr applies an erasure or a retention rule to a personhr anonymises the person's partner, so that erasure reaches the shared record too.

    Given a person partner whose person is erased in hr · when hr calls bp:person:sync with anonymise=true · then the name and work contact are replaced with a fixed placeholder, the bp_id and roles history stay (other modules' records still join), and a second call changes nothing

    · owned by business-partner · reference: not built

What it keeps

ThingMeaningIdentified byShared?
business partnera company or person you do business withbp_id derived from bp_key (a domain, a legacy customer number, a VAT id; for a person, 'person:<person_id>')SHARED — this module is the sole writer
bp rolewhat the partner is to us — customer, supplier, carrier; and for a person, employee or workerbp_idroleSHARED — sole writer
bp edgea typed relationship between partners (subsidiary_of, framework_governs, works_for — a person to the company they freelance through)srcdstrelSHARED — sole writer

DataK3 accepts foreign keys but does not enforce them. "Only this module writes partners" IS the integrity mechanism — other modules call its routes, never its tables.

Questions that shape your version

Read these out and let the customer correct one — people rarely recall a policy on demand and can always react to one. Standard is a named authority you can look up and hold us to. Commonly seen is exactly that: arrangements we have met, with no survey behind them. A customer doing none of them is not doing it wrong.

  1. What identifies a customer for you — a website, a customer number, a tax id?
    b2b services
    a customer number they already use in their old system
    vat registered trade
    the tax id, because it is what the invoice must carry anyway
    warning
    a web domain looks stable and is not — it moves on a rename or acquisition
  2. Do you buy from any of the companies you sell to?
  3. Do you deal with groups of companies?

What you can change yourself

These are settings, not code: someone in your team changes them on a screen, without a developer and without a release.

For builders

Code

Public repositories, anonymous clone, one release tag each. Read README.md and AGENTS.md first.

Known gaps in the reference

© 2026 DODILHomeDocsConsole