Document Management
Author(s)
- Ramit Ray
Last Updated Date
2025-03-20
SRS References
Version History
| Version | Date | Changes | Author |
|---|---|---|---|
| 1.0 | 2025-03-20 | Initial draft | Ramit Ray |
Feature Overview
Objective:
The Document Management feature will enable users to manage both employee and company-related documents efficiently. It will provide a unified system to store, access, and manage documents, ensuring secure storage and easy retrieval.
Scope:
- Employee onboarding documents upload during the onboarding process.
- Post-onboarding document uploads through a separate screen.
- Employee document listing with viewing, saving, and printing options.
- Separate interface for company-related documents.
- Filtering options to view specific document types (e.g., Aadhar card) for all employees at once.
Dependencies:
- Blob setup for document storage.
Requirements
Functional Requirements
- Allow document upload during employee onboarding.
- Allow additional document upload post-onboarding.
- Provide a listing table of employee documents with search and filter options.
- Allow viewing, saving, and printing of employee and company documents.
- Separate interface for company-related documents.
- Support for filtering documents across all employees (e.g., Aadhar card).
- Implement soft delete and versioning for documents.
- Role-based access control (RBAC) to restrict access to sensitive documents.
- Track all document-related actions through an audit trail.
Non-Functional Requirements
- Ensure data encryption during upload and retrieval.
- Ensure secure blob storage for documents.
- Maintain system performance under high document load.
Design Specifications
UI/UX Design
-
Employee Document Screen
- Table with employee code, employee details, and document overview.
- Action button to view documents (opens a modal).
- Search and filter options.
-
Company Document Screen
- Similar table design for company-related documents.
- Filter and search functionality.
Data Models
- DocumentType Lookup Table
Stores different document types (e.g., Aadhar, PAN, Contract)
CREATE TABLE DocumentType (
DocumentTypeId INT PRIMARY KEY,
TypeName VARCHAR(100) NOT NULL
);
- Document Table
Stores employee and company documents
CREATE TABLE Document (
DocumentId INT PRIMARY KEY,
EmpCode VARCHAR(20) NULL,
DocumentTypeId INT NOT NULL,
FilePath NVARCHAR(MAX) NOT NULL,
CreatedAt DATETIME NOT NULL,
UpdatedAt DATETIME NOT NULL,
IsDeleted BIT DEFAULT 0,
Version INT DEFAULT 1,
FOREIGN KEY (EmpCode) REFERENCES Employee(EmpCode),
FOREIGN KEY (DocumentTypeId) REFERENCES DocumentType(DocumentTypeId)
);
- Audit Trail Table
Tracks uploads, downloads, and updates for traceability
CREATE TABLE DocumentAuditTrail (
AuditId INT PRIMARY KEY,
DocumentId INT NOT NULL,
Action VARCHAR(50) NOT NULL,
PerformedBy INT NOT NULL,
PerformedAt DATETIME NOT NULL,
FOREIGN KEY (DocumentId) REFERENCES Document(DocumentId)
);
API Interfaces
| Endpoint | Method | Parameters | Response | Status Codes |
|---|---|---|---|---|
/api/v1/documents | GET | empCode (optional), type (optional) | List of Document | 200, 204, 500 |
/api/v1/documents/{id} | GET | id (required) | Document | 200, 204, 500 |
/api/v1/documents | POST | document (required) | Success Message | 201, 400, 500 |
/api/v1/documents/{id} | PUT | id (required), document | Success Message | 200, 400, 500 |
/api/v1/documents/{id} | DELETE | id (required) | Success Message | 200, 400, 500 |
/api/v1/documents/type/{type} | GET | type (required) | List of Document | 200, 400, 500 |
Third-Party Integrations
- Blob storage for document saving and retrieval.
Workflow
- Employee onboarding → Upload documents → Save to blob → Create record in DB.
- User opens employee document screen → Loads documents from DB → Allows view, save, and print.
- User uploads additional documents → Save to blob → Create record in DB.
- User accesses company documents → Loads from DB → Filter and search.
- Audit trail logs all actions.
Development Tasks & Estimates
| No | Task Name | Estimate (Hours) | Dependencies | Notes |
|---|---|---|---|---|
| 1 | Set up DocumentType lookup table | 3 hours | Blob setup | |
| 2 | Create Document table and schema | 4 hours | Blob setup | |
| 3 | Create Audit Trail table | 3 hours | Database setup | |
| 4 | Implement UI/UX for employee document screen | 6 hours | Backend ready | |
| 5 | Implement UI/UX for company document screen | 6 hours | Backend ready | |
| 6 | API development for CRUD operations | 8 hours | Database setup | |
| 7 | Implement role-based access control | 4 hours | Authentication | |
| 8 | Implement soft delete and versioning | 4 hours | Database setup | |
| 9 | Implement filtering by document type | 3 hours | Database setup | |
| Total | 41 hours |
Testing & Quality Assurance
- Unit Tests: CRUD operations, filtering, RBAC
- Integration Tests: Blob storage, database integration
- Acceptance Criteria:
- Document upload and retrieval working
- RBAC working as expected
- Filtering works correctly
- Testing Tools: Postman, Jest, Cypress
Deployment Considerations
-
Configuration Changes:
- Blob storage configuration
- RBAC setup
-
Rollout Plan:
- Phase 1: Backend setup and blob integration
- Phase 2: UI/UX implementation
- Phase 3: Testing and deployment
Risks & Mitigations
| Risk | Impact | Likelihood | Mitigation Strategy |
|---|---|---|---|
| Incorrect RBAC configuration | High | Medium | Review permissions setup carefully |
| Blob storage connection failure | High | Low | Set up monitoring and alerts |
| High volume of documents slowing down retrieval | Medium | High | Implement caching and lazy loading |
Review & Approval
- Reviewer: [Reviewer Name]
- Approval Date: [YYYY-MM-DD]
Notes
- Ensure blob storage path follows a consistent structure.
- Keep document versioning enabled to prevent data loss.
Let me know if you’d like to adjust anything!