Actors & Identity Model
Partially validated (2026-09-06). Rows marked ๐ need a code/DB confirmation pass.
Koovira separates who you are (a person / login) from what capacity you are acting in (customer, a specific merchant type, staff, admin). One login can be both a customer and a merchant, and can hold sub-profiles.
The identity tables (validated names; confirm columns per feature)
customer_masterโ one row per profile, not per person. A person can have a parent profile
(parent_user_id = 0) plus sub-profiles (professional, dating). Counting people โ counting rows (a known trap: filter parent_user_id = 0 or overstate ~3ร). This is the buyer/buyer_id, user_id referenced everywhere.
company_masterโ one row per business (55 columns, corrected 2026-09-06 โ was cited as 57;
live SHOW COLUMNS count is 55; incl. primary_module, company_type, verified_badge). A merchant "acts as" a company. House rule: one account owns one company.
kv_module_registryโ the enrollment type a company signs up under (see
../00-architecture/module-registry.md).
- Staff / sub-users, roles & permissions โ managed via
classs/AdminUserManagerModule.phpand the
merchant staff screens. ๐ exact permission tables to be documented in the auth pass.
Identity matrix (skeleton โ fill/verify per capability)
| Identity | View | Create listing | Buy | Sell | Book | Manage business | Financial access | KYC required |
|---|---|---|---|---|---|---|---|---|
| Guest / anonymous | public only | โ | โ | โ | โ | โ | โ | โ |
| Registered customer | โ | โ | โ (wallet-first) | โ | โ | โ | own wallet | at purchase-risk gates |
| Merchant / business owner | โ | โ | โ | โ | โ | โ | company wallet/settlement | โ (module-dependent) |
| Merchant staff / sub-user | โ | scoped | โ | scoped | scoped | scoped by permission | scoped | inherits company |
| Service provider / freelancer | โ | โ (services/bids) | โ | โ (service) | โ | โ | escrow/wallet | โ |
| Property agent / builder | โ | โ (listings/projects) | โ | โ | โ | โ | membership/leads | โ (๐ role-gate issues on record) |
| Delivery / courier / driver partner | assigned jobs | โ | โ | โ | โ | partner panel | payouts | โ |
| Admin / super-admin (padmin) | all | all | โ | โ | โ | all | all (commission, refunds, settlement) | n/a |
โ/โ above are the intended model; each cell becomes authoritative only when tied to the actual permission check in code. Do not quote a cell as fact until the auth pass cites it.
To document next (auth & identity pass)
- Signup/login/OTP/social-login flows (each its own page, per the spec's ยง5).
- The permission/authorization matrix (ยง24) โ page access, CRUD, publish, approve, financial.
- Identity switching (customer โ merchant), sub-profile activation
(TOGGLE_SUB_PROFILE), multi-module within one company.