Skip to content

Customer fields

Customers store account details, CRM contacts, activity, and projects. Customers are soft-deleted, while sales orders keep customer snapshots for history.

customercontactsactivities and projects

FieldTypeDefaultMeaning
namevarchar(255)requiredCustomer or account name.
customerCategoryIduuidnullCategory used for pricing scope and grouping.
accountStateconstrained varcharactiveactive, growth, at_risk, or former.
accountPriorityconstrained varcharstandardstrategic, high, standard, or low.
emailvarcharnullMain account email.
phonevarcharnullMain account phone.
billing* fieldsvarcharnullBilling address: line 1, line 2, city, region, postcode, country.
ship* fieldsvarcharnullShipping address: line 1, line 2, city, region, postcode, country.
versioninteger1Optimistic concurrency version.
deletedAttimestamptznullSet when the customer is soft-deleted.

Contacts belong to the customer and are reconciled by id when the customer document saves.

FieldTypeDefaultMeaning
namevarchar(255)requiredContact name.
titlevarcharnullRole or title at the account.
emailvarcharnullContact email.
phonevarcharnullContact phone.
addressEntryIduuidnullOptional shared address-book entry.
roleslogical role list[]primary, shipping, invoicing, billing, field.

Role flags map to isPrimary, receivesShipping, receivesInvoices, receivesBillingCc, and isOnSite in storage.

FieldTypeDefaultMeaning
typeconstrained varcharrequirednote, call, email, meeting, or task.
occurredAttimestamptznowWhen the activity happened.
titlevarchar(255)nullRequired for tasks.
bodytextnullRequired for non-task activities.
dueDatedatenullTasks only.
statusconstrained varcharnullTasks only: open or done.
completedAttimestamptznullSet when a task is done.
customerProjectIduuidnullOptional project link.
attendeesrows[]Optional contact attendees.

Non-task activities cannot have task due dates or task status. Tasks require a title and carry status.

FieldTypeDefaultMeaning
namevarchar(255)requiredProject name.
statusconstrained varcharplanningplanning, active, hold, or done.
startDatedatenullOptional start date.
targetEndDatedatenullOptional target date.
summarytextnullOptional project description.

Projects can be linked to sales orders and activities, then read back with order count and order value.