Contacts¶
Backend domains:
- app/graphql/clients/ — customers
- app/graphql/suppliers/ — vendors
- app/graphql/factories.py — manufacturer / brand records (used in distribution use cases)
- app/graphql/salespersons/ — sales reps
- app/graphql/addresses/ — shared polymorphic addresses
RBAC Paths: CLIENTS, SUPPLIERS, SALESPERSONS.
Clients¶
A Client is a billable customer. The model carries:
- Legal identity —
name,ruc,dv,tax_payer_type(Natural, Jurídico, Gobierno, Consumidor Final), country, default currency. - Default invoicing settings — payment terms, default tax rate, default sales account, retention behaviour. These are managed via
ClientInvoiceDefault. - Contacts — many
ClientContactrows with email / phone / role. - Addresses — many
Addressrows via the polymorphicaddresses/domain.
Key mutations:
- Client:
createClient,updateClient,deleteClient,deleteClients,getOrCreateClient(idempotent upsert by RUC, used by tabular import). - Invoice defaults:
createClientInvoiceDefault,updateClientInvoiceDefault,deleteClientInvoiceDefault.
Bulk import via app/graphql/clients/tabular/.
Suppliers¶
A Supplier mirrors Client for the AP side. Same legal identity fields, contacts, and addresses; plus supplier_category_* for buyer-side categorisation.
Key mutations:
- Supplier:
createSupplier,updateSupplier,deleteSupplier,deleteSuppliers. - Contacts:
createSupplierContact,updateSupplierContact,deleteSupplierContact. - Categories:
createSupplierCategory,updateSupplierCategory,deleteSupplierCategory. - Supplier quotes: see Purchasing Cycle.
The supplier RUC is validated against DGI via the RUC-verification flow — see PAC → RUC Verification.
Factories¶
Factory is a manufacturer record used by the medics / distribution flow (an invoice line can point at an item's factory for traceability and royalty reporting). Defined inline in app/graphql/factories.py.
Salespersons¶
A Salesperson is a sales rep, optionally linked to a system User. Used for commission reporting (getCommissionPerSalespersonReport under orders/).
Key mutations: createSalesperson, updateSalesperson, deleteSalesperson.
Key queries: salespersonSettings, getSalespersonByUserId, salespersonSearch.
Addresses¶
Address is a polymorphic shared table — a client, supplier, factory, or shipping destination can own many addresses, each with a label (PRIMARY, SHIPPING, BILLING, …). Tax addresses for electronic invoicing are normalised here.
Key mutations: createAddress, updateAddress, deleteAddress.
Key queries: findAddressesBySourceId, getAddressById.