Description
Implement a Document Workflow system that allows admins and moderators to upload, manage, and track important user-related documents such as signed contracts and appraisals. The system should categorize documents by year and user, and provide a comprehensive view of each user's document status.
Features to Implement
- Document upload functionality for admins and moderators.
- Year-based categorization for uploaded documents.
- User-specific document management page.
- Document type classification (e.g., contract, appraisal).
- Document status tracking and reporting.
- Missing document identification system.
Technical Tasks
- Update Prisma schema to include new models for document management.
- Create new API routes for document upload, retrieval, and management.
- Develop user interface for document upload and management.
- Implement document categorization by year and type.
- Create a user-specific document overview page.
- Develop a system to identify and report missing documents.
- Implement access control for document viewing and management.
Database Schema Updates
Add the following model to the Prisma schema:
model UserDocument {
id String @id @default(cuid())
userId String
user User @relation(fields: [userId], references: [id])
documentType String // e.g., "contract", "appraisal"
year Int
fileName String
fileUrl String
uploadedAt DateTime @default(now())
uploadedBy String
}
model User {
// ... existing fields
documents UserDocument[]
}
File Updates
- Create
app/(dashboard)/dashboard/documents/page.tsx for the main document management page.
- Create
app/(dashboard)/dashboard/documents/[userId]/page.tsx for user-specific document pages.
- Create
app/actions/documentActions.ts for document-related server actions.
- Update navigation components to include the new document management pages.
Additional Considerations
- Implement secure file storage and retrieval system.
- Ensure proper file type validation for uploads (e.g., only allow PDFs).
- Consider implementing document versioning for tracking changes over time.
- Add a notification system for upcoming or overdue document requirements.
Acceptance Criteria
Related Files
- app/(dashboard)/dashboard/users/page.tsx
- app/(dashboard)/dashboard/users/UsersTable.tsx
- prisma/schema.prisma
Please update these files and any others necessary to fully integrate the new Document Workflow System.
Document Requirements
Implement a system to check for the following document requirements:
- Each user should have a signed contract for the current year.
- Users should have two appraisals per year.
The system should flag any missing documents based on these requirements.
Description
Implement a Document Workflow system that allows admins and moderators to upload, manage, and track important user-related documents such as signed contracts and appraisals. The system should categorize documents by year and user, and provide a comprehensive view of each user's document status.
Features to Implement
Technical Tasks
Database Schema Updates
Add the following model to the Prisma schema:
File Updates
app/(dashboard)/dashboard/documents/page.tsxfor the main document management page.app/(dashboard)/dashboard/documents/[userId]/page.tsxfor user-specific document pages.app/actions/documentActions.tsfor document-related server actions.Additional Considerations
Acceptance Criteria
Related Files
Please update these files and any others necessary to fully integrate the new Document Workflow System.
Document Requirements
Implement a system to check for the following document requirements:
The system should flag any missing documents based on these requirements.