A business operations project connecting dispatch, technician work, time, parts, and invoicing. Its security story starts with a simple rule: one organization’s work must stay inside that organization.
A simplified view to support a technical conversation.
USER EXPERIENCE
Office workspace
Dispatch, work orders, and business records
Field workflow
Assignments, time, parts, and closeout
↓↓
TRUST BOUNDARY
Business API
Role permissions · organization context · validated inputs
↓↓
Tenant-scoped data
Prisma / PostgreSQL records
Background work
Worker and queued jobs
Conceptual architecture based on the project summary. Organization context must remain attached to work that crosses into background processing.
02 / ENGINEERING DECISIONS
The reasoning matters.
Implementation choices paired with the tradeoffs they introduce.
01
Scope access at more than one layer
The repository’s isolation tests exercise both API requests and the tenant database client. This checks the boundary below individual screens.
REVIEW CONSIDERATION
A scoped client helps reduce repetition, but every new query path and relation still needs review.
02
Validate relationships, too
A work order must not link to another organization’s site, technician, or customer simply because the submitted ID is valid.
REVIEW CONSIDERATION
Checking the primary record alone leaves related records as a separate authorization surface.
03
Keep investigation data scoped
The selected test file also checks that audit entries stay inside their organization.
REVIEW CONSIDERATION
Operational visibility is useful only when logs and history respect the same privacy boundary as business data.
03 / REVIEW SCENARIOS
Look at the unexpected path.
Illustrative explanations of selected test definitions. These controls do not call the application or execute its tests.
SCENARIO 01
Cross-tenant read
A member of Organization A requests a record owned by Organization B.
EXPECTED IN THE SELECTED TEST
404 expected
The selected API tests expect an unavailable response for cross-organization record IDs, including document downloads.
NEXT REVIEW QUESTION
Review the response body and storage lookup as well as the status code; an error response must not contain the protected record.
SCENARIO 02
Cross-tenant write
Organization A attempts to change or remove Organization B’s customer.
EXPECTED IN THE SELECTED TEST
Record unchanged
The tests expect the request to fail and then retrieve the customer from its owning organization to check that its name is unchanged.
NEXT REVIEW QUESTION
Extend the review to bulk updates, exports, and newly added endpoints.
SCENARIO 03
Foreign relationship
A work order in Organization A refers to a site or technician in Organization B.
EXPECTED IN THE SELECTED TEST
Relationship rejected
The selected cases expect invalid cross-organization assignments and linked records to be rejected.
NEXT REVIEW QUESTION
Check every referenced object, even when the caller is authorized to create the parent record.
04 / TRACEABLE EVIDENCE
From a claim to a test.
Selected source reviewed on November 6, 2026.
Source reviewed · tests not rerun
SELECTED TEST FILEapps/api/test/tenant-isolation.test.ts
Snapshot66c5f1ab5754
Cross-organization list, read, change, and delete cases
Foreign site, contact, assignment, and upload references
Tenant database client behavior and organization-scoped audit history
These statements summarize the test definitions at this repository snapshot. They do not report a passing run, complete coverage, or an independent security audit. Application source stays private.
WHAT I WOULD EXAMINE NEXT
Continue the review.
A fuller production review would trace organization context through queued jobs, inspect permissions for each role, and run the integration suite against an isolated test database.