Skip to main content
Version: MNSR

Document Management

Author(s)

  • Ramit Ray

Last Updated Date

2025-03-20


SRS References


Version History

VersionDateChangesAuthor
1.02025-03-20Initial draftRamit 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

  1. Allow document upload during employee onboarding.
  2. Allow additional document upload post-onboarding.
  3. Provide a listing table of employee documents with search and filter options.
  4. Allow viewing, saving, and printing of employee and company documents.
  5. Separate interface for company-related documents.
  6. Support for filtering documents across all employees (e.g., Aadhar card).
  7. Implement soft delete and versioning for documents.
  8. Role-based access control (RBAC) to restrict access to sensitive documents.
  9. Track all document-related actions through an audit trail.

Non-Functional Requirements

  1. Ensure data encryption during upload and retrieval.
  2. Ensure secure blob storage for documents.
  3. 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

EndpointMethodParametersResponseStatus Codes
/api/v1/documentsGETempCode (optional), type (optional)List of Document200, 204, 500
/api/v1/documents/{id}GETid (required)Document200, 204, 500
/api/v1/documentsPOSTdocument (required)Success Message201, 400, 500
/api/v1/documents/{id}PUTid (required), documentSuccess Message200, 400, 500
/api/v1/documents/{id}DELETEid (required)Success Message200, 400, 500
/api/v1/documents/type/{type}GETtype (required)List of Document200, 400, 500

Third-Party Integrations

  • Blob storage for document saving and retrieval.

Workflow

  1. Employee onboarding → Upload documents → Save to blob → Create record in DB.
  2. User opens employee document screen → Loads documents from DB → Allows view, save, and print.
  3. User uploads additional documents → Save to blob → Create record in DB.
  4. User accesses company documents → Loads from DB → Filter and search.
  5. Audit trail logs all actions.

Development Tasks & Estimates

NoTask NameEstimate (Hours)DependenciesNotes
1Set up DocumentType lookup table3 hoursBlob setup
2Create Document table and schema4 hoursBlob setup
3Create Audit Trail table3 hoursDatabase setup
4Implement UI/UX for employee document screen6 hoursBackend ready
5Implement UI/UX for company document screen6 hoursBackend ready
6API development for CRUD operations8 hoursDatabase setup
7Implement role-based access control4 hoursAuthentication
8Implement soft delete and versioning4 hoursDatabase setup
9Implement filtering by document type3 hoursDatabase setup
Total41 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

RiskImpactLikelihoodMitigation Strategy
Incorrect RBAC configurationHighMediumReview permissions setup carefully
Blob storage connection failureHighLowSet up monitoring and alerts
High volume of documents slowing down retrievalMediumHighImplement 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!