Document Repository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Data access layer for all power of attorney and encrypted document records, providing CRUD operations with RLS enforcement. Handles document metadata persistence, versioning records, signing status updates, and audit log entries. Interfaces directly with the Supabase database and enforces organization-level and user-level data isolation.
document-repository
Responsibilities
- Persist and retrieve document metadata records
- Store and query document versioning history
- Update signing status and session references
- Write and read audit log entries per document
- Enforce row-level security on all queries
Interfaces
createDocument(data)
getDocumentById(id, userId)
listDocumentsByUser(userId, orgId, filters)
updateDocument(id, updates)
deleteDocument(id)
createDocumentVersion(documentId, versionData)
getDocumentVersions(documentId)
appendAuditEntry(documentId, entry)
getAuditLog(documentId)
updateSigningStatus(documentId, status)
Related Data Entities (2)
Data entities managed by this component