## Bookkeeping practices: Form collection using Next.js

### Summary
A form collection blueprint for bookkeeping practices built with Next.js on Ample. Domain schema: client_entities (legal_name, entity_type, accounting_software, period_cadence): clients and their bookkeeping cadence; engagements (client_entity_id, period_start, period_end, close_status): monthly or quarterly close engagements; document_requests (engagement_id, category, due_at, status, uploaded_object_key): receipts, statements and payroll summaries requested; close_checklists (engagement_id, item, done_at): close tasks per period; uploads (id, owner_reference, object_key, content_type, size, uploaded_at): validated uploads linked to their owner. Public information: service packages and cadence, onboarding checklist, contact details.

**Note**: Kept out of scope until handling is reviewed: bank statements and receipts, payroll data, login credentials for accounting software. Never store client accounting-software credentials in these flows; financial records are sensitive and no compliance is claimed. Technical basis verified on Next.js: content-type and size validation that rejects disallowed files, an object written to a private bucket and a row linking the record to the object key (reject=ok upload=ok linked=ok).

### Framework
Next.js

### Workload
Form collection

### Industry
Bookkeeping practices

### Resource Requirements
- primitive:compute
- primitive:postgres
- primitive:s3-compatible-object-storage

### Workflow Steps
1. **Model the bookkeeping practices domain**: Create the tables client_entities, engagements, document_requests, close_checklists, uploads. 
2. **Workflow step 1**: Model document requests per engagement with due dates and status.
3. **Workflow step 2**: Validate uploaded files (type, size) before storing them in the private bucket and linking them to the request.
4. **Workflow step 3**: Authorize uploads by client entity.
5. **Workflow step 4**: Deploy and verify rejection of disallowed files and a linked upload.
6. **Deploy**: Run the synchronous deploy once and read the result. Re-running with no change is a no-op.
7. **Verify**: Run the pattern self-test(s) from the example (/p/browser-file-uploads) and your own acceptance checks for the bookkeeping practices workflow.

### Success Checks
- App responds on its public URL
- Browser-file-uploads self-test from the example

### Limitations
- The technical basis (browser file uploads on Next.js) was verified with the pattern fixture; the bookkeeping practices schema and workflow are an original design for this blueprint and were not executed as a separate application.
- No health, financial, privacy or other compliance claim is made.

### Cost Estimate
- **Currency**: USD
- **Monthly Amount**: 10.0
- **Basis**: Size prices from pricing.toml (loaded by the API)

### Evidence Summary
- Next.js pattern fixture deployed on Ample; the browser file uploads checks passed.

### Next Actions
1. **Browse the catalog index**: [GET /v1/catalog](https://api.ample.computer/v1/catalog)
2. **Search published recipes by intent, stack and constraints**: [POST /v1/catalog/search](https://api.ample.computer/v1/catalog/search)
3. **Prepare a side-effect-free deployment plan for an authorized project**: [POST /v1/catalog/plan](https://api.ample.computer/v1/catalog/plan) 
4. **Read the existing agent authentication setup**: [GET /mcp/setup](https://api.ample.computer/mcp/setup)
5. **Browse Bookkeeping practices**: [GET /v1/catalog/nodes/industry:bookkeeping-practices](https://api.ample.computer/v1/catalog/nodes/industry:bookkeeping-practices)
6. **Browse Form collection**: [GET /v1/catalog/nodes/workload:form-collection](https://api.ample.computer/v1/catalog/nodes/workload:form-collection)
7. **Browse Next.js**: [GET /v1/catalog/nodes/stack:framework-next-js](https://api.ample.computer/v1/catalog/nodes/stack:framework-next-js) 
8. **Browse Deploy web app**: [GET /v1/catalog/nodes/intent:deploy-web-app](https://api.ample.computer/v1/catalog/nodes/intent:deploy-web-app)
