Storage layout
Firebase Storage is used for user-uploaded files (e.g. job photos, attachments).
Path structure
- /{orgId}/jobs/{jobId}/{filename} : Photos and attachments for a job. Access controlled by rules that check auth and org membership.
- /{orgId}/customers/{customerId}/{filename} : Optional customer-level uploads (e.g. documents). Same org-scoping.
Rules
- Only authenticated users can upload or read.
- Path segments (orgId, jobId, customerId) are validated so users can only access their organisation’s data.
- File types and size limits can be enforced in rules or in Cloud Functions (e.g. resizing images on upload).
Metadata
Object metadata (content type, custom attributes) can be set on upload. Avoid storing sensitive data in metadata; use Firestore for structured data.