Multi-tenant B2B SaaS
Administrator, manager, field, and auditor are separate logins. This base defines them as accounts, not as states of one customer.
These are example architectures. They are not affiliated with any company or trademark.
Try the flow here. It is a local sketch of the base, not a live account.
Work orders
200 · work orders for this organization.
Try as
Functions
Shows the jobs in this organization. The field account only acts on its own job.
Apps
A full pack is not available to clone.
backend
Core API
Work orders, approval, and the audit log. Every query stays in one organization.
Default node-backend
Can swap node-backend, go-backend, python-backend, rust-backend
web
Tenant portal
The administrator, manager, and auditor read jobs in the browser.
Default nextjs
Can swap nextjs, react
mobile
Field mobile
The field account marks the assigned job on site.
Default react-native
Can swap react-native
Who signs in
Administrator
admin
Owns the organization. Sees every job and the audit log.
Manager
manager
Approves work orders for this organization.
Field
field
Updates only the jobs assigned to them.
Auditor
auditor
Reads the audit log. Does not approve or edit a job.
Policies
One organization per query
A job, a membership, and an audit line all carry the organization id.
Field touches only its job
The field account cannot approve and cannot read another assignee.
The audit log only grows
A line is added when someone approves. It is not edited.
API
List work orders
Shows the jobs in this organization. The field account only acts on its own job.
GET /api/v1/work-orders
requireAuth · Hosted by Core API
Administrator · Manager · Field · Auditor
Approve an order
Marks a pending job approved and writes a line the audit log can show.
POST /api/v1/work-orders/:id/approve
requireUserType · Hosted by Core API
Administrator · Manager
Mark on site
The field account records that they are at the assigned job.
PATCH /api/v1/work-orders/:id/status
requireUserType · Hosted by Core API
Field
Read the audit log
Shows what changed. The auditor and the administrator can read it. Approving writes the newest line.
GET /api/v1/audit-logs
requireUserType · Hosted by Core API
Administrator · Auditor
What you see
Work orders
- The job name
- Pending, assigned, or done
- Approve, only for manager and administrator
GET /api/v1/work-orders
Approval
- The pending job
- Approve
- A refusal for field and auditor
POST /api/v1/work-orders/:id/approve
On site
- The assigned job
- Mark on site
- A refusal for every other account
PATCH /api/v1/work-orders/:id/status
Audit log
- The newest approval
- An older field update
- An empty line until someone approves
GET /api/v1/audit-logs