Files
Goa-gel-fullstack/frontend/swagger.json
Mahi 80566bf0a2 feat: Goa GEL Blockchain e-Licensing Platform - Full Stack Implementation
Complete implementation of the Goa Government e-Licensing platform with:

Backend:
- NestJS API with JWT authentication
- PostgreSQL database with Knex ORM
- Redis caching and session management
- MinIO document storage
- Hyperledger Besu blockchain integration
- Multi-department workflow system
- Comprehensive API tests (266/282 passing)

Frontend:
- Angular 21 with standalone components
- Angular Material + TailwindCSS UI
- Visual workflow builder
- Document upload with progress tracking
- Blockchain explorer integration
- Role-based dashboards (Admin, Department, Citizen)
- E2E tests with Playwright (37 tests)

Infrastructure:
- Docker Compose orchestration
- Blockscout blockchain explorer
- Development and production configurations
2026-02-07 10:23:29 -04:00

1 line
59 KiB
JSON

{"openapi":"3.0.0","paths":{"/api/v1/auth/department/login":{"post":{"operationId":"AuthController_departmentLogin","summary":"Department login with API key","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}}},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}},"401":{"description":"Invalid credentials"}},"tags":["Auth"]}},"/api/v1/auth/digilocker/login":{"post":{"operationId":"AuthController_digiLockerLogin","summary":"Applicant login via DigiLocker (Mock)","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigiLockerLoginDto"}}}},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigiLockerLoginResponseDto"}}}},"401":{"description":"Authentication failed"}},"tags":["Auth"]}},"/api/v1/departments":{"post":{"operationId":"DepartmentsController_create","summary":"Create a new department","description":"Register a new department in the system (admin only)","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDepartmentDto"}}}},"responses":{"201":{"description":"Department created successfully with API credentials","content":{"application/json":{"schema":{"properties":{"apiKey":{"type":"string"},"apiSecret":{"type":"string"},"department":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}}}},"400":{"description":"Invalid input data"},"401":{"description":"Unauthorized"},"409":{"description":"Department with this code already exists"}},"tags":["Departments"],"security":[{"bearer":[]}]},"get":{"operationId":"DepartmentsController_findAll","summary":"List all departments","description":"Retrieve a paginated list of all departments","parameters":[{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","example":1,"schema":{"minimum":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Items per page (default: 10)","example":10,"schema":{"minimum":1,"maximum":100,"type":"number"}}],"responses":{"200":{"description":"List of departments retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse"}}}}},"tags":["Departments"]}},"/api/v1/departments/{code}":{"get":{"operationId":"DepartmentsController_findByCode","summary":"Get department by code","description":"Retrieve detailed information about a specific department","parameters":[{"name":"code","required":true,"in":"path","description":"Department code","example":"DEPT_001","schema":{"type":"string"}}],"responses":{"200":{"description":"Department retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"404":{"description":"Department not found"}},"tags":["Departments"]},"patch":{"operationId":"DepartmentsController_update","summary":"Update department","description":"Update department information (admin only)","parameters":[{"name":"code","required":true,"in":"path","description":"Department code","example":"DEPT_001","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDepartmentDto"}}}},"responses":{"200":{"description":"Department updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"400":{"description":"Invalid input data"},"401":{"description":"Unauthorized"},"404":{"description":"Department not found"}},"tags":["Departments"],"security":[{"bearer":[]}]}},"/api/v1/departments/{code}/regenerate-api-key":{"post":{"operationId":"DepartmentsController_regenerateApiKey","summary":"Regenerate API key","description":"Generate a new API key pair for the department (admin only). Old key will be invalidated.","parameters":[{"name":"code","required":true,"in":"path","description":"Department code","example":"DEPT_001","schema":{"type":"string"}}],"responses":{"200":{"description":"New API key pair generated successfully","content":{"application/json":{"schema":{"properties":{"apiKey":{"type":"string","description":"New API key"},"apiSecret":{"type":"string","description":"New API secret"}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Department not found"}},"tags":["Departments"],"security":[{"bearer":[]}]}},"/api/v1/departments/{code}/stats":{"get":{"operationId":"DepartmentsController_getStats","summary":"Get department statistics","description":"Retrieve statistics for a specific department","parameters":[{"name":"code","required":true,"in":"path","description":"Department code","example":"DEPT_001","schema":{"type":"string"}},{"name":"startDate","required":false,"in":"query","description":"Start date for statistics (ISO format)","schema":{"type":"string"}},{"name":"endDate","required":false,"in":"query","description":"End date for statistics (ISO format)","schema":{"type":"string"}}],"responses":{"200":{"description":"Department statistics retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentStatsDto"}}}},"404":{"description":"Department not found"}},"tags":["Departments"]}},"/api/v1/departments/{code}/activate":{"post":{"operationId":"DepartmentsController_activate","summary":"Activate department","description":"Activate a deactivated department (admin only)","parameters":[{"name":"code","required":true,"in":"path","description":"Department code","example":"DEPT_001","schema":{"type":"string"}}],"responses":{"200":{"description":"Department activated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Department not found"}},"tags":["Departments"],"security":[{"bearer":[]}]}},"/api/v1/departments/{code}/deactivate":{"post":{"operationId":"DepartmentsController_deactivate","summary":"Deactivate department","description":"Deactivate a department (admin only)","parameters":[{"name":"code","required":true,"in":"path","description":"Department code","example":"DEPT_001","schema":{"type":"string"}}],"responses":{"200":{"description":"Department deactivated successfully"},"401":{"description":"Unauthorized"},"404":{"description":"Department not found"}},"tags":["Departments"],"security":[{"bearer":[]}]}},"/api/v1/applicants":{"get":{"operationId":"ApplicantsController_findAll","summary":"List all applicants (Admin only)","parameters":[{"name":"page","required":false,"in":"query","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"List of applicants"}},"tags":["Applicants"],"security":[{"BearerAuth":[]}]},"post":{"operationId":"ApplicantsController_create","summary":"Create new applicant (Admin only)","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApplicantDto"}}}},"responses":{"201":{"description":"Applicant created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicantResponseDto"}}}},"409":{"description":"Applicant already exists"}},"tags":["Applicants"],"security":[{"BearerAuth":[]}]}},"/api/v1/applicants/{id}":{"get":{"operationId":"ApplicantsController_findOne","summary":"Get applicant by ID","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Applicant details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicantResponseDto"}}}},"404":{"description":"Applicant not found"}},"tags":["Applicants"],"security":[{"BearerAuth":[]}]},"put":{"operationId":"ApplicantsController_update","summary":"Update applicant","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApplicantDto"}}}},"responses":{"200":{"description":"Applicant updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicantResponseDto"}}}},"404":{"description":"Applicant not found"}},"tags":["Applicants"],"security":[{"BearerAuth":[]}]}},"/api/v1/requests":{"post":{"operationId":"RequestsController_create","summary":"Create new license request","description":"Create a new license request in DRAFT status","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequestDto"}}}},"responses":{"201":{"description":"License request created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResponseDto"}}}},"400":{"description":"Invalid request data"},"401":{"description":"Unauthorized"}},"tags":["Requests"],"security":[{"bearer":[]}]},"get":{"operationId":"RequestsController_findAll","summary":"List license requests","description":"Get paginated list of license requests with optional filters","parameters":[{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"enum":["DRAFT","SUBMITTED","IN_REVIEW","PENDING_RESUBMISSION","APPROVED","REJECTED","REVOKED","CANCELLED"],"type":"string"}},{"name":"requestType","required":false,"in":"query","description":"Filter by request type","schema":{"enum":["NEW_LICENSE","RENEWAL","AMENDMENT","MODIFICATION","CANCELLATION"],"type":"string"}},{"name":"applicantId","required":false,"in":"query","description":"Filter by applicant ID","schema":{"type":"string"}},{"name":"requestNumber","required":false,"in":"query","description":"Filter by request number","schema":{"type":"string"}},{"name":"startDate","required":false,"in":"query","description":"Start date for date range filter (ISO 8601)","example":"2024-01-01T00:00:00Z","schema":{"type":"string"}},{"name":"endDate","required":false,"in":"query","description":"End date for date range filter (ISO 8601)","example":"2024-12-31T23:59:59Z","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Items per page (default: 20)","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort field","schema":{"default":"createdAt","enum":["createdAt","updatedAt","requestNumber","status"],"type":"string"}},{"name":"sortOrder","required":false,"in":"query","description":"Sort order","schema":{"default":"DESC","enum":["ASC","DESC"],"type":"string"}}],"responses":{"200":{"description":"List of license requests","content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RequestResponseDto"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"}}}}}}},"tags":["Requests"],"security":[{"bearer":[]}]}},"/api/v1/requests/pending":{"get":{"operationId":"RequestsController_findPending","summary":"Get pending requests for department","description":"Get paginated list of pending requests for the current department","parameters":[{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Items per page (default: 20)","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}}],"responses":{"200":{"description":"Pending requests"}},"tags":["Requests"],"security":[{"bearer":[]}]}},"/api/v1/requests/{id}":{"get":{"operationId":"RequestsController_findById","summary":"Get request details","description":"Get full details of a license request including documents and approvals","parameters":[{"name":"id","required":true,"in":"path","description":"Request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Request details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestDetailResponseDto"}}}},"404":{"description":"Request not found"}},"tags":["Requests"],"security":[{"bearer":[]}]},"patch":{"operationId":"RequestsController_update","summary":"Update request metadata","description":"Update additional metadata for a request","parameters":[{"name":"id","required":true,"in":"path","description":"Request ID (UUID)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestDto"}}}},"responses":{"200":{"description":"Request updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResponseDto"}}}},"404":{"description":"Request not found"}},"tags":["Requests"],"security":[{"bearer":[]}]}},"/api/v1/requests/{id}/submit":{"post":{"operationId":"RequestsController_submit","summary":"Submit request for approval","description":"Submit a draft request for review","parameters":[{"name":"id","required":true,"in":"path","description":"Request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Request submitted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResponseDto"}}}},"400":{"description":"Cannot submit request (invalid status or missing documents)"},"404":{"description":"Request not found"}},"tags":["Requests"],"security":[{"bearer":[]}]}},"/api/v1/requests/{id}/cancel":{"post":{"operationId":"RequestsController_cancel","summary":"Cancel request","description":"Cancel a license request","parameters":[{"name":"id","required":true,"in":"path","description":"Request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Request cancelled successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResponseDto"}}}},"400":{"description":"Cannot cancel request (invalid status)"},"404":{"description":"Request not found"}},"tags":["Requests"],"security":[{"bearer":[]}]}},"/api/v1/requests/{id}/timeline":{"get":{"operationId":"RequestsController_getTimeline","summary":"Get request timeline","description":"Get timeline of events for a license request","parameters":[{"name":"id","required":true,"in":"path","description":"Request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Request timeline","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TimelineEventDto"}}}}},"404":{"description":"Request not found"}},"tags":["Requests"],"security":[{"bearer":[]}]}},"/api/v1/requests/{requestId}/documents":{"post":{"operationId":"DocumentsController_uploadDocument","summary":"Upload document","description":"Upload a new document for a license request","parameters":[{"name":"requestId","required":true,"in":"path","description":"License request ID (UUID)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadDocumentDto"}}}},"responses":{"201":{"description":"Document uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponseDto"}}}},"400":{"description":"Invalid file or request data"},"404":{"description":"Request not found"}},"tags":["Documents"],"security":[{"bearer":[]}]},"get":{"operationId":"DocumentsController_getRequestDocuments","summary":"List request documents","description":"Get all documents for a license request","parameters":[{"name":"requestId","required":true,"in":"path","description":"License request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Request documents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentResponseDto"}}}}}},"tags":["Documents"],"security":[{"bearer":[]}]}},"/api/v1/documents/{documentId}":{"get":{"operationId":"DocumentsController_getDocument","summary":"Get document metadata","description":"Retrieve metadata for a document","parameters":[{"name":"documentId","required":true,"in":"path","description":"Document ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Document metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponseDto"}}}},"404":{"description":"Document not found"}},"tags":["Documents"],"security":[{"bearer":[]}]},"delete":{"operationId":"DocumentsController_deleteDocument","summary":"Soft delete document","description":"Soft delete a document (marks as inactive)","parameters":[{"name":"documentId","required":true,"in":"path","description":"Document ID (UUID)","schema":{"type":"string"}}],"responses":{"204":{"description":"Document deleted successfully"},"404":{"description":"Document not found"}},"tags":["Documents"],"security":[{"bearer":[]}]}},"/api/v1/documents/{documentId}/download":{"get":{"operationId":"DocumentsController_getDownloadUrl","summary":"Get download URL","description":"Generate a signed URL for downloading a document","parameters":[{"name":"documentId","required":true,"in":"path","description":"Document ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Download URL generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadUrlResponseDto"}}}},"404":{"description":"Document not found"}},"tags":["Documents"],"security":[{"bearer":[]}]}},"/api/v1/documents/{documentId}/versions":{"get":{"operationId":"DocumentsController_getVersions","summary":"List document versions","description":"Get all versions of a document","parameters":[{"name":"documentId","required":true,"in":"path","description":"Document ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Document versions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentVersionResponseDto"}}}}},"404":{"description":"Document not found"}},"tags":["Documents"],"security":[{"bearer":[]}]}},"/api/v1/requests/{requestId}/documents/{documentId}":{"put":{"operationId":"DocumentsController_uploadVersion","summary":"Upload new document version","description":"Upload a new version of an existing document","parameters":[{"name":"requestId","required":true,"in":"path","description":"License request ID (UUID)","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"New version uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponseDto"}}}},"400":{"description":"Invalid file or request data"},"404":{"description":"Request or document not found"}},"tags":["Documents"],"security":[{"bearer":[]}]}},"/api/v1/approvals/requests/{requestId}/approve":{"post":{"operationId":"ApprovalsController_approve","summary":"Approve request","description":"Approve a license request for a specific department","parameters":[{"name":"requestId","required":true,"in":"path","description":"License request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Request approved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponseDto"}}}},"400":{"description":"Invalid request or no pending approval found"},"404":{"description":"Request not found"}},"tags":["Approvals"],"security":[{"bearer":[]}]}},"/api/v1/approvals/requests/{requestId}/reject":{"post":{"operationId":"ApprovalsController_reject","summary":"Reject request","description":"Reject a license request for a specific department","parameters":[{"name":"requestId","required":true,"in":"path","description":"License request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Request rejected successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponseDto"}}}},"400":{"description":"Invalid request or no pending approval found"},"404":{"description":"Request not found"}},"tags":["Approvals"],"security":[{"bearer":[]}]}},"/api/v1/approvals/requests/{requestId}/request-changes":{"post":{"operationId":"ApprovalsController_requestChanges","summary":"Request changes on request","description":"Request changes from applicant for a license request","parameters":[{"name":"requestId","required":true,"in":"path","description":"License request ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Changes requested successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponseDto"}}}},"400":{"description":"Invalid request or no pending approval found"},"404":{"description":"Request not found"}},"tags":["Approvals"],"security":[{"bearer":[]}]}},"/api/v1/approvals/{approvalId}":{"get":{"operationId":"ApprovalsController_findById","summary":"Get approval by ID","description":"Retrieve approval details by approval ID","parameters":[{"name":"approvalId","required":true,"in":"path","description":"Approval ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Approval details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponseDto"}}}},"404":{"description":"Approval not found"}},"tags":["Approvals"],"security":[{"bearer":[]}]}},"/api/v1/approvals/requests/{requestId}":{"get":{"operationId":"ApprovalsController_findByRequestId","summary":"Get approvals for request","description":"Retrieve all approvals for a license request","parameters":[{"name":"requestId","required":true,"in":"path","description":"License request ID (UUID)","schema":{"type":"string"}},{"name":"includeInvalidated","required":false,"in":"query","description":"Include invalidated approvals (default: false)","example":"false","schema":{"type":"string"}}],"responses":{"200":{"description":"List of approvals","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalResponseDto"}}}}},"404":{"description":"Request not found"}},"tags":["Approvals"],"security":[{"bearer":[]}]}},"/api/v1/approvals/department/{departmentCode}":{"get":{"operationId":"ApprovalsController_findByDepartment","summary":"Get approvals by department","description":"Retrieve approvals for a specific department with pagination","parameters":[{"name":"departmentCode","required":true,"in":"path","description":"Department code","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Items per page (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of approvals"}},"tags":["Approvals"],"security":[{"bearer":[]}]}},"/api/v1/approvals/{approvalId}/revalidate":{"put":{"operationId":"ApprovalsController_revalidate","summary":"Revalidate approval","description":"Revalidate an invalidated approval after document updates","parameters":[{"name":"approvalId","required":true,"in":"path","description":"Approval ID (UUID)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevalidateDto"}}}},"responses":{"200":{"description":"Approval revalidated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponseDto"}}}},"400":{"description":"Approval is not in invalidated state"},"404":{"description":"Approval not found"}},"tags":["Approvals"],"security":[{"bearer":[]}]}},"/api/v1/workflows":{"post":{"operationId":"WorkflowsController_create","summary":"Create new workflow","description":"Create a new workflow configuration for license processing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowDto"}}}},"responses":{"201":{"description":"Workflow created successfully"},"400":{"description":"Invalid workflow definition"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden - Admin only"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]},"get":{"operationId":"WorkflowsController_findAll","summary":"List all workflows","description":"Get all workflow configurations with optional active filter","parameters":[{"name":"isActive","required":false,"in":"query","description":"Filter by active status","schema":{"type":"boolean"}}],"responses":{"200":{"description":"List of workflows"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]}},"/api/v1/workflows/{id}":{"get":{"operationId":"WorkflowsController_findById","summary":"Get workflow by ID","description":"Get a specific workflow configuration by ID","parameters":[{"name":"id","required":true,"in":"path","description":"Workflow ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow details"},"404":{"description":"Workflow not found"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]},"patch":{"operationId":"WorkflowsController_update","summary":"Update workflow","description":"Update an existing workflow configuration","parameters":[{"name":"id","required":true,"in":"path","description":"Workflow ID (UUID)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowDto"}}}},"responses":{"200":{"description":"Workflow updated successfully"},"400":{"description":"Invalid update or workflow is inactive"},"404":{"description":"Workflow not found"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]}},"/api/v1/workflows/type/{workflowType}":{"get":{"operationId":"WorkflowsController_findByType","summary":"Get workflow by type","description":"Get the active workflow for a specific workflow type","parameters":[{"name":"workflowType","required":true,"in":"path","description":"Workflow type identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow details"},"404":{"description":"No active workflow found for type"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]}},"/api/v1/workflows/{id}/preview":{"get":{"operationId":"WorkflowsController_preview","summary":"Preview workflow structure","description":"Get a preview of the workflow stages and departments","parameters":[{"name":"id","required":true,"in":"path","description":"Workflow ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow preview"},"404":{"description":"Workflow not found"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]}},"/api/v1/workflows/{id}/validate":{"post":{"operationId":"WorkflowsController_validate","summary":"Validate workflow definition","description":"Validate the definition of an existing workflow","parameters":[{"name":"id","required":true,"in":"path","description":"Workflow ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Validation result"},"404":{"description":"Workflow not found"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]}},"/api/v1/workflows/{id}/deactivate":{"post":{"operationId":"WorkflowsController_deactivate","summary":"Deactivate workflow","description":"Deactivate a workflow so it is no longer used for new requests","parameters":[{"name":"id","required":true,"in":"path","description":"Workflow ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow deactivated"},"404":{"description":"Workflow not found"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]}},"/api/v1/workflows/{id}/activate":{"post":{"operationId":"WorkflowsController_activate","summary":"Activate workflow","description":"Re-activate a previously deactivated workflow","parameters":[{"name":"id","required":true,"in":"path","description":"Workflow ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow activated"},"404":{"description":"Workflow not found"}},"tags":["Workflows"],"security":[{"BearerAuth":[]}]}},"/api/v1/webhooks/{departmentId}":{"post":{"operationId":"WebhooksController_register","summary":"Register webhook","description":"Register a new webhook endpoint for a department to receive event notifications","parameters":[{"name":"departmentId","required":true,"in":"path","description":"Department ID (UUID)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookDto"}}}},"responses":{"201":{"description":"Webhook registered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponseDto"}}}},"400":{"description":"Invalid webhook data"},"401":{"description":"Unauthorized"}},"tags":["Webhooks"],"security":[{"BearerAuth":[]}]}},"/api/v1/webhooks/department/{departmentId}":{"get":{"operationId":"WebhooksController_findAll","summary":"List webhooks for department","description":"Get all webhook subscriptions for a specific department","parameters":[{"name":"departmentId","required":true,"in":"path","description":"Department ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"List of webhooks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookResponseDto"}}}}}},"tags":["Webhooks"],"security":[{"BearerAuth":[]}]}},"/api/v1/webhooks/{id}":{"get":{"operationId":"WebhooksController_findById","summary":"Get webhook by ID","description":"Get details of a specific webhook subscription","parameters":[{"name":"id","required":true,"in":"path","description":"Webhook ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponseDto"}}}},"404":{"description":"Webhook not found"}},"tags":["Webhooks"],"security":[{"BearerAuth":[]}]},"patch":{"operationId":"WebhooksController_update","summary":"Update webhook","description":"Update webhook URL, events, or active status","parameters":[{"name":"id","required":true,"in":"path","description":"Webhook ID (UUID)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookDto"}}}},"responses":{"200":{"description":"Webhook updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponseDto"}}}},"404":{"description":"Webhook not found"}},"tags":["Webhooks"],"security":[{"BearerAuth":[]}]},"delete":{"operationId":"WebhooksController_delete","summary":"Delete webhook","description":"Remove a webhook subscription","parameters":[{"name":"id","required":true,"in":"path","description":"Webhook ID (UUID)","schema":{"type":"string"}}],"responses":{"204":{"description":"Webhook deleted successfully"},"404":{"description":"Webhook not found"}},"tags":["Webhooks"],"security":[{"BearerAuth":[]}]}},"/api/v1/webhooks/{id}/test":{"post":{"operationId":"WebhooksController_test","summary":"Test webhook","description":"Send a test event to the webhook endpoint to verify connectivity","parameters":[{"name":"id","required":true,"in":"path","description":"Webhook ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook test result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResultDto"}}}},"404":{"description":"Webhook not found"}},"tags":["Webhooks"],"security":[{"BearerAuth":[]}]}},"/api/v1/webhooks/{id}/logs":{"get":{"operationId":"WebhooksController_getLogs","summary":"Get webhook delivery logs","description":"Get paginated delivery logs for a specific webhook","parameters":[{"name":"id","required":true,"in":"path","description":"Webhook ID (UUID)","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","example":1,"schema":{"minimum":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Items per page (default: 20)","example":10,"schema":{"minimum":1,"maximum":100,"type":"number"}}],"responses":{"200":{"description":"Webhook delivery logs"},"404":{"description":"Webhook not found"}},"tags":["Webhooks"],"security":[{"BearerAuth":[]}]}},"/api/v1/admin/stats":{"get":{"operationId":"AdminController_getStats","summary":"Get platform statistics","description":"Get overall platform statistics including request counts, user counts, and transaction data","parameters":[],"responses":{"200":{"description":"Platform statistics"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden - Admin only"}},"tags":["Admin"],"security":[{"BearerAuth":[]}]}},"/api/v1/admin/health":{"get":{"operationId":"AdminController_getHealth","summary":"Get system health","description":"Get health status of all platform services (database, blockchain, storage, queue)","parameters":[],"responses":{"200":{"description":"System health status"}},"tags":["Admin"],"security":[{"BearerAuth":[]}]}},"/api/v1/admin/activity":{"get":{"operationId":"AdminController_getRecentActivity","summary":"Get recent activity","description":"Get recent audit log entries for platform activity monitoring","parameters":[{"name":"limit","required":false,"in":"query","description":"Number of recent entries (default: 20)","schema":{"type":"number"}}],"responses":{"200":{"description":"Recent activity logs"}},"tags":["Admin"],"security":[{"BearerAuth":[]}]}},"/api/v1/admin/blockchain/transactions":{"get":{"operationId":"AdminController_getBlockchainTransactions","summary":"List blockchain transactions","description":"Get paginated list of blockchain transactions with optional status filter","parameters":[{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Items per page (default: 20)","schema":{"type":"number"}},{"name":"status","required":false,"in":"query","description":"Filter by transaction status (PENDING, CONFIRMED, FAILED)","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated blockchain transactions"}},"tags":["Admin"],"security":[{"BearerAuth":[]}]}},"/api/v1/audit/logs":{"get":{"operationId":"AuditController_findAll","summary":"Query audit logs","description":"Get paginated audit logs with optional filters by entity, action, actor, and date range","parameters":[{"name":"limit","required":false,"in":"query","description":"Items per page (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"endDate","required":false,"in":"query","description":"Filter to date (ISO 8601)","schema":{}},{"name":"startDate","required":false,"in":"query","description":"Filter from date (ISO 8601)","schema":{}},{"name":"actorId","required":false,"in":"query","description":"Filter by actor ID","schema":{}},{"name":"actorType","required":false,"in":"query","description":"Filter by actor type (APPLICANT, DEPARTMENT, SYSTEM, ADMIN)","schema":{}},{"name":"action","required":false,"in":"query","description":"Filter by action (CREATE, UPDATE, DELETE, APPROVE, REJECT, etc.)","schema":{}},{"name":"entityId","required":false,"in":"query","description":"Filter by entity ID","schema":{}},{"name":"entityType","required":false,"in":"query","description":"Filter by entity type (REQUEST, DOCUMENT, DEPARTMENT, etc.)","schema":{}}],"responses":{"200":{"description":"Paginated audit logs"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden - Admin only"}},"tags":["Audit"],"security":[{"BearerAuth":[]}]}},"/api/v1/audit/entity/{entityType}/{entityId}":{"get":{"operationId":"AuditController_findByEntity","summary":"Get audit trail for entity","description":"Get complete audit trail for a specific entity (e.g., all changes to a request)","parameters":[{"name":"entityType","required":true,"in":"path","description":"Entity type (REQUEST, DOCUMENT, DEPARTMENT, etc.)","schema":{"type":"string"}},{"name":"entityId","required":true,"in":"path","description":"Entity ID (UUID)","schema":{"type":"string"}}],"responses":{"200":{"description":"Audit trail for entity"}},"tags":["Audit"],"security":[{"BearerAuth":[]}]}},"/api/v1/audit/metadata":{"get":{"operationId":"AuditController_getMetadata","summary":"Get audit metadata","description":"Get available audit actions, entity types, and actor types for filtering","parameters":[],"responses":{"200":{"description":"Audit metadata"}},"tags":["Audit"],"security":[{"BearerAuth":[]}]}},"/api/v1/health":{"get":{"operationId":"HealthController_check","summary":"Basic health check","description":"Returns basic service health status","parameters":[],"responses":{"200":{"description":"Service is healthy"}},"tags":["Health"]}},"/api/v1/health/ready":{"get":{"operationId":"HealthController_readiness","summary":"Readiness check","description":"Returns whether the service is ready to accept traffic","parameters":[],"responses":{"200":{"description":"Service is ready"}},"tags":["Health"]}},"/api/v1/health/live":{"get":{"operationId":"HealthController_liveness","summary":"Liveness check","description":"Returns whether the service process is alive","parameters":[],"responses":{"200":{"description":"Service is alive"}},"tags":["Health"]}}},"info":{"title":"Goa GEL API","description":"Blockchain Document Verification Platform for Government of Goa","version":"1.0.0","contact":{}},"tags":[{"name":"Auth","description":"Authentication and authorization"},{"name":"Applicants","description":"Applicant management"},{"name":"Requests","description":"License request operations"},{"name":"Documents","description":"Document upload and retrieval"},{"name":"Approvals","description":"Department approval actions"},{"name":"Departments","description":"Department management"},{"name":"Workflows","description":"Workflow configuration"},{"name":"Webhooks","description":"Webhook management"},{"name":"Admin","description":"Platform administration"},{"name":"Audit","description":"Audit trail and logging"},{"name":"Health","description":"Health check endpoints"}],"servers":[{"url":"http://localhost:3001","description":"Local Development"},{"url":"https://api.goagel.gov.in","description":"Production"}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"JWT token from DigiLocker authentication"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Department API Key"}},"schemas":{"LoginDto":{"type":"object","properties":{"apiKey":{"type":"string","description":"Department API Key","example":"fire_api_key_123"},"departmentCode":{"type":"string","description":"Department Code","example":"FIRE_DEPT"}},"required":["apiKey","departmentCode"]},"LoginResponseDto":{"type":"object","properties":{"accessToken":{"type":"string"},"department":{"type":"object"}},"required":["accessToken","department"]},"DigiLockerLoginDto":{"type":"object","properties":{"digilockerId":{"type":"string","description":"DigiLocker ID","example":"DL-GOA-123456789"},"name":{"type":"string","description":"User name"},"email":{"type":"string","description":"User email"},"phone":{"type":"string","description":"User phone"}},"required":["digilockerId"]},"DigiLockerLoginResponseDto":{"type":"object","properties":{"accessToken":{"type":"string"},"applicant":{"type":"object"}},"required":["accessToken","applicant"]},"CreateDepartmentDto":{"type":"object","properties":{"code":{"type":"string","description":"Department code (uppercase letters and underscores only)","example":"DEPT_001","pattern":"^[A-Z_]+$"},"name":{"type":"string","description":"Department name","example":"Finance Department"},"description":{"type":"string","description":"Department description","example":"Handles financial operations and compliance"},"contactEmail":{"type":"string","description":"Contact email for the department","example":"contact@department.gov.in"},"contactPhone":{"type":"string","description":"Contact phone number","example":"+91-11-XXXXXXXX"},"webhookUrl":{"type":"string","description":"Webhook URL for credential issuance events","example":"https://api.department.gov.in/webhooks/credentials"}},"required":["code","name"]},"PaginatedResponse":{"type":"object","properties":{"data":{"description":"Array of items","type":"array","items":{"type":"array"}},"total":{"type":"number","description":"Total number of items","example":100},"page":{"type":"number","description":"Current page number","example":1},"limit":{"type":"number","description":"Number of items per page","example":10},"totalPages":{"type":"number","description":"Total number of pages","example":10}},"required":["data","total","page","limit","totalPages"]},"DepartmentResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the department","example":"550e8400-e29b-41d4-a716-446655440000"},"code":{"type":"string","description":"Department code","example":"DEPT_001"},"name":{"type":"string","description":"Department name","example":"Finance Department"},"description":{"type":"string","description":"Department description","example":"Handles financial operations"},"contactEmail":{"type":"string","description":"Contact email","example":"contact@department.gov.in"},"contactPhone":{"type":"string","description":"Contact phone number","example":"+91-11-XXXXXXXX"},"webhookUrl":{"type":"string","description":"Webhook URL","example":"https://api.department.gov.in/webhooks/credentials"},"isActive":{"type":"boolean","description":"Whether the department is active","example":true},"createdAt":{"format":"date-time","type":"string","description":"Timestamp when the department was created","example":"2024-01-15T10:30:00Z"},"updatedAt":{"format":"date-time","type":"string","description":"Timestamp when the department was last updated","example":"2024-01-15T10:30:00Z"},"totalApplicants":{"type":"number","description":"Total number of applicants in this department","example":150},"issuedCredentials":{"type":"number","description":"Total number of issued credentials","example":145},"lastWebhookAt":{"format":"date-time","type":"string","description":"Timestamp of last webhook call","example":"2024-01-15T10:30:00Z"}},"required":["id","code","name","isActive","createdAt","updatedAt","totalApplicants","issuedCredentials"]},"UpdateDepartmentDto":{"type":"object","properties":{"code":{"type":"string","description":"Department code (uppercase letters and underscores only)","example":"DEPT_001","pattern":"^[A-Z_]+$"},"name":{"type":"string","description":"Department name","example":"Finance Department"},"description":{"type":"string","description":"Department description","example":"Handles financial operations and compliance"},"contactEmail":{"type":"string","description":"Contact email for the department","example":"contact@department.gov.in"},"contactPhone":{"type":"string","description":"Contact phone number","example":"+91-11-XXXXXXXX"},"webhookUrl":{"type":"string","description":"Webhook URL for credential issuance events","example":"https://api.department.gov.in/webhooks/credentials"}}},"DepartmentStatsDto":{"type":"object","properties":{"departmentCode":{"type":"string","description":"Department code","example":"DEPT_001"},"departmentName":{"type":"string","description":"Department name","example":"Finance Department"},"totalApplicants":{"type":"number","description":"Total number of applicants","example":150},"totalCredentialsIssued":{"type":"number","description":"Total number of credentials issued","example":145},"isActive":{"type":"boolean","description":"Whether the department is active","example":true},"createdAt":{"format":"date-time","type":"string","description":"Department creation timestamp","example":"2024-01-15T10:30:00Z"},"updatedAt":{"format":"date-time","type":"string","description":"Department last update timestamp","example":"2024-01-15T10:30:00Z"},"lastWebhookAt":{"format":"date-time","type":"string","description":"Timestamp of last webhook event","example":"2024-01-20T14:00:00Z"},"issueRate":{"type":"number","description":"Percentage of credentials issued vs applicants","example":96.67}},"required":["departmentCode","departmentName","totalApplicants","totalCredentialsIssued","isActive","createdAt","updatedAt","issueRate"]},"ApplicantResponseDto":{"type":"object","properties":{"id":{"type":"string"},"digilockerId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"walletAddress":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","digilockerId","name","email","isActive","createdAt","updatedAt"]},"CreateApplicantDto":{"type":"object","properties":{"digilockerId":{"type":"string","description":"DigiLocker ID","example":"DL-GOA-123456789"},"name":{"type":"string","description":"Full name","example":"John Doe"},"email":{"type":"string","description":"Email address","example":"john@example.com"},"phone":{"type":"string","description":"Phone number","example":"+91-9876543210"},"walletAddress":{"type":"string","description":"Ethereum wallet address"}},"required":["digilockerId","name","email"]},"UpdateApplicantDto":{"type":"object","properties":{"digilockerId":{"type":"string","description":"DigiLocker ID","example":"DL-GOA-123456789"},"name":{"type":"string","description":"Full name","example":"John Doe"},"email":{"type":"string","description":"Email address","example":"john@example.com"},"phone":{"type":"string","description":"Phone number","example":"+91-9876543210"},"walletAddress":{"type":"string","description":"Ethereum wallet address"}}},"CreateRequestDto":{"type":"object","properties":{"applicantId":{"type":"string","description":"Applicant ID (UUID)","example":"550e8400-e29b-41d4-a716-446655440000"},"requestType":{"type":"string","description":"Type of license request","enum":["NEW_LICENSE","RENEWAL","AMENDMENT","MODIFICATION","CANCELLATION"],"example":"NEW_LICENSE"},"workflowId":{"type":"string","description":"Workflow ID for the request","example":"550e8400-e29b-41d4-a716-446655440000"},"metadata":{"type":"object","description":"Additional metadata for the request","example":{"property":"value","businessName":"Example Business"}},"tokenId":{"type":"number","description":"Optional blockchain token ID","example":12345}},"required":["applicantId","requestType","workflowId","metadata"]},"RequestResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Request ID (UUID)","example":"550e8400-e29b-41d4-a716-446655440000"},"requestNumber":{"type":"string","description":"Unique request number","example":"RL-2024-000001"},"applicantId":{"type":"string","description":"Applicant ID","example":"550e8400-e29b-41d4-a716-446655440000"},"requestType":{"type":"string","description":"Type of license request","enum":["NEW_LICENSE","RENEWAL","AMENDMENT","MODIFICATION","CANCELLATION"]},"status":{"type":"string","description":"Current status of the request","enum":["DRAFT","SUBMITTED","IN_REVIEW","PENDING_RESUBMISSION","APPROVED","REJECTED","REVOKED","CANCELLED"]},"currentStageId":{"type":"string","description":"Current workflow stage ID","nullable":true},"metadata":{"type":"object","description":"Request metadata"},"blockchainTxHash":{"type":"string","description":"Blockchain transaction hash","nullable":true},"tokenId":{"type":"string","description":"Token ID on blockchain","nullable":true},"createdAt":{"format":"date-time","type":"string","description":"Request creation timestamp","example":"2024-01-15T10:30:00Z"},"updatedAt":{"format":"date-time","type":"string","description":"Request last update timestamp","example":"2024-01-16T14:45:00Z"},"submittedAt":{"format":"date-time","type":"string","description":"Request submission timestamp","nullable":true,"example":"2024-01-15T11:00:00Z"},"approvedAt":{"format":"date-time","type":"string","description":"Request approval timestamp","nullable":true,"example":"2024-01-20T09:00:00Z"}},"required":["id","requestNumber","applicantId","requestType","status","currentStageId","metadata","blockchainTxHash","tokenId","createdAt","updatedAt","submittedAt","approvedAt"]},"DocumentDetailDto":{"type":"object","properties":{"id":{"type":"string"},"docType":{"type":"string"},"originalFilename":{"type":"string"},"currentVersion":{"type":"number"},"currentHash":{"type":"string"},"minioBucket":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","docType","originalFilename","currentVersion","currentHash","minioBucket","isActive","createdAt","updatedAt"]},"ApprovalDetailDto":{"type":"object","properties":{"id":{"type":"string"},"departmentId":{"type":"string"},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED","CHANGES_REQUESTED","REVIEW_REQUIRED"]},"remarks":{"type":"string","nullable":true},"reviewedDocuments":{"type":"array","items":{"type":"string"}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"invalidatedAt":{"format":"date-time","type":"string","nullable":true},"invalidationReason":{"type":"string","nullable":true}},"required":["id","departmentId","status","remarks","reviewedDocuments","createdAt","updatedAt","invalidatedAt","invalidationReason"]},"RequestDetailResponseDto":{"type":"object","properties":{"id":{"type":"string"},"requestNumber":{"type":"string"},"applicantId":{"type":"string"},"requestType":{"type":"string","enum":["NEW_LICENSE","RENEWAL","AMENDMENT","MODIFICATION","CANCELLATION"]},"status":{"type":"string","enum":["DRAFT","SUBMITTED","IN_REVIEW","PENDING_RESUBMISSION","APPROVED","REJECTED","REVOKED","CANCELLED"]},"currentStageId":{"type":"string","nullable":true},"metadata":{"type":"object"},"blockchainTxHash":{"type":"string","nullable":true},"tokenId":{"type":"string","nullable":true},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentDetailDto"}},"approvals":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalDetailDto"}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"submittedAt":{"format":"date-time","type":"string","nullable":true},"approvedAt":{"format":"date-time","type":"string","nullable":true}},"required":["id","requestNumber","applicantId","requestType","status","currentStageId","metadata","blockchainTxHash","tokenId","documents","approvals","createdAt","updatedAt","submittedAt","approvedAt"]},"UpdateRequestDto":{"type":"object","properties":{"businessName":{"type":"string","description":"Updated business/entity name","maxLength":255,"example":"Updated Business Name Ltd."},"description":{"type":"string","description":"Updated description of the request","maxLength":2000,"example":"Updated description with more details"},"metadata":{"type":"object","description":"Updated metadata for the request","example":{"property":"updated_value","timestamp":"2024-01-16T10:30:00Z"}}}},"TimelineEventDto":{"type":"object","properties":{"id":{"type":"string","description":"Event ID (UUID)"},"requestId":{"type":"string","description":"Request ID"},"eventType":{"type":"string","description":"Type of timeline event","enum":["CREATED","SUBMITTED","STATUS_CHANGED","DOCUMENT_ADDED","DOCUMENT_UPDATED","APPROVAL_REQUESTED","APPROVAL_GRANTED","APPROVAL_REJECTED","APPROVAL_INVALIDATED","COMMENTS_ADDED","CANCELLED"]},"description":{"type":"string","description":"Event description"},"actor":{"type":"string","description":"Actor/user who triggered the event","nullable":true},"metadata":{"type":"object","description":"Additional event metadata"},"timestamp":{"format":"date-time","type":"string","description":"Event timestamp"},"blockchainTxHash":{"type":"string","description":"Blockchain transaction hash","nullable":true}},"required":["id","requestId","eventType","description","actor","metadata","timestamp","blockchainTxHash"]},"UploadDocumentDto":{"type":"object","properties":{"docType":{"type":"string","description":"Document type","enum":["FIRE_SAFETY_CERTIFICATE","BUILDING_PLAN","PROPERTY_OWNERSHIP","INSPECTION_REPORT","POLLUTION_CERTIFICATE","ELECTRICAL_SAFETY_CERTIFICATE","STRUCTURAL_STABILITY_CERTIFICATE","IDENTITY_PROOF","ADDRESS_PROOF","OTHER"],"example":"FIRE_SAFETY_CERTIFICATE"},"description":{"type":"string","description":"Optional description of the document","maxLength":500}},"required":["docType"]},"DocumentResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Document ID (UUID)"},"requestId":{"type":"string","description":"Request ID (UUID)"},"docType":{"type":"string","description":"Document type","example":"FIRE_SAFETY_CERTIFICATE"},"originalFilename":{"type":"string","description":"Original filename"},"currentVersion":{"type":"number","description":"Current version number"},"currentHash":{"type":"string","description":"SHA-256 hash of current version"},"minioBucket":{"type":"string","description":"MinIO bucket name"},"isActive":{"type":"boolean","description":"Whether document is active"},"createdAt":{"format":"date-time","type":"string","description":"Document creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Document last update timestamp"}},"required":["id","requestId","docType","originalFilename","currentVersion","currentHash","minioBucket","isActive","createdAt","updatedAt"]},"DownloadUrlResponseDto":{"type":"object","properties":{"url":{"type":"string","description":"Pre-signed download URL"},"expiresAt":{"format":"date-time","type":"string","description":"URL expiration timestamp"},"expiresIn":{"type":"number","description":"Time to live in seconds"}},"required":["url","expiresAt","expiresIn"]},"DocumentVersionResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Document version ID (UUID)"},"documentId":{"type":"string","description":"Document ID (UUID)"},"version":{"type":"number","description":"Version number"},"hash":{"type":"string","description":"SHA-256 hash of the file"},"minioPath":{"type":"string","description":"MinIO file path"},"fileSize":{"type":"string","description":"File size in bytes"},"mimeType":{"type":"string","description":"MIME type of the file"},"uploadedBy":{"type":"string","description":"User ID who uploaded this version"},"blockchainTxHash":{"type":"string","description":"Blockchain transaction hash","nullable":true},"createdAt":{"format":"date-time","type":"string","description":"Version creation timestamp"}},"required":["id","documentId","version","hash","minioPath","fileSize","mimeType","uploadedBy","blockchainTxHash","createdAt"]},"ApprovalResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Approval ID (UUID)","example":"550e8400-e29b-41d4-a716-446655440000"},"requestId":{"type":"string","description":"License request ID","example":"660e8400-e29b-41d4-a716-446655440001"},"departmentId":{"type":"string","description":"Department ID","example":"FIRE_SAFETY"},"departmentName":{"type":"string","description":"Department name","example":"Fire Safety Department"},"status":{"type":"string","description":"Current approval status","enum":["PENDING","APPROVED","REJECTED","CHANGES_REQUESTED","REVIEW_REQUIRED"]},"approvedBy":{"type":"string","description":"ID of the user who approved/rejected","example":"user-id-123"},"remarks":{"type":"string","description":"Reviewer remarks or comments","example":"All documents are in order and meet requirements."},"reviewedDocuments":{"description":"IDs of documents reviewed","example":["550e8400-e29b-41d4-a716-446655440000"],"type":"array","items":{"type":"string"}},"rejectionReason":{"type":"string","description":"Reason for rejection (if rejected)","enum":["DOCUMENTATION_INCOMPLETE","INCOMPLETE_DOCUMENTS","ELIGIBILITY_CRITERIA_NOT_MET","INCOMPLETE_INFORMATION","POLICY_VIOLATION","FRAUD_SUSPECTED","OTHER"]},"requiredDocuments":{"description":"List of required documents","example":["FIRE_SAFETY_CERTIFICATE","BUILDING_PLAN"],"type":"array","items":{"type":"string"}},"invalidatedAt":{"format":"date-time","type":"string","description":"When this approval was invalidated","example":"2024-01-20T15:30:00Z"},"invalidationReason":{"type":"string","description":"Reason for invalidation","example":"Document was modified after approval"},"revalidatedAt":{"format":"date-time","type":"string","description":"When this approval was revalidated after invalidation","example":"2024-01-20T16:00:00Z"},"createdAt":{"format":"date-time","type":"string","description":"Approval creation timestamp","example":"2024-01-15T10:30:00Z"},"updatedAt":{"format":"date-time","type":"string","description":"Approval last update timestamp","example":"2024-01-20T15:30:00Z"},"completedAt":{"format":"date-time","type":"string","description":"When the approval was completed (approved/rejected/etc)","example":"2024-01-20T14:30:00Z"}},"required":["id","requestId","departmentId","departmentName","status","remarks","createdAt","updatedAt"]},"RevalidateDto":{"type":"object","properties":{"remarks":{"type":"string","description":"Remarks confirming revalidation after document updates","minLength":10,"maxLength":1000,"example":"Updated documents have been reviewed and verified. Approval is revalidated."},"revalidatedBy":{"type":"string","description":"ID of the reviewer performing revalidation","example":"user-id-123"},"reviewedDocuments":{"description":"Updated list of reviewed document IDs","example":["550e8400-e29b-41d4-a716-446655440000"],"type":"array","items":{"type":"string"}}},"required":["remarks"]},"CreateWorkflowDto":{"type":"object","properties":{}},"UpdateWorkflowDto":{"type":"object","properties":{}},"CreateWebhookDto":{"type":"object","properties":{"url":{"type":"string","description":"Webhook URL to send events to","example":"https://example.com/webhooks/events"},"events":{"type":"array","description":"Array of event types to subscribe to","example":["APPROVAL_REQUIRED","REQUEST_APPROVED"],"items":{"type":"string","enum":["APPROVAL_REQUIRED","DOCUMENT_UPDATED","REQUEST_APPROVED","REQUEST_REJECTED","CHANGES_REQUESTED","LICENSE_MINTED","LICENSE_REVOKED"]}},"description":{"type":"string","description":"Optional description for the webhook","example":"Webhook for approval notifications"}},"required":["url","events"]},"WebhookResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"departmentId":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440001"},"url":{"type":"string","example":"https://example.com/webhooks/events"},"events":{"type":"array","example":["APPROVAL_REQUIRED","REQUEST_APPROVED"],"items":{"type":"string","enum":["APPROVAL_REQUIRED","DOCUMENT_UPDATED","REQUEST_APPROVED","REQUEST_REJECTED","CHANGES_REQUESTED","LICENSE_MINTED","LICENSE_REVOKED"]}},"isActive":{"type":"boolean","example":true},"createdAt":{"format":"date-time","type":"string","example":"2024-01-15T10:30:00Z"},"updatedAt":{"format":"date-time","type":"string","example":"2024-01-20T14:45:30Z"}},"required":["id","departmentId","url","events","isActive","createdAt","updatedAt"]},"UpdateWebhookDto":{"type":"object","properties":{"url":{"type":"string","description":"Webhook URL to send events to","example":"https://example.com/webhooks/events"},"events":{"type":"array","description":"Array of event types to subscribe to","items":{"type":"string","enum":["APPROVAL_REQUIRED","DOCUMENT_UPDATED","REQUEST_APPROVED","REQUEST_REJECTED","CHANGES_REQUESTED","LICENSE_MINTED","LICENSE_REVOKED"]}},"isActive":{"type":"boolean","description":"Enable or disable the webhook","example":true},"description":{"type":"string","description":"Optional description for the webhook"}}},"WebhookTestResultDto":{"type":"object","properties":{"success":{"type":"boolean","example":true},"statusCode":{"type":"number","example":200},"statusMessage":{"type":"string","example":"OK"},"responseTime":{"type":"number","example":125},"error":{"type":"string","example":null,"nullable":true}},"required":["success","statusCode","statusMessage","responseTime","error"]}}}}