Skip to content

Track KYC document reuploads and preserve audit history for replaced files #147

Description

@grantfox-oss

Context

The KYC upload flow in src/controllers/upload.controller.ts replaces the existing document URL for a submission, but the system does not clearly preserve the history of what was previously uploaded. This creates ambiguity for compliance review and manual moderation.

Problem statement

Implement a simple audit trail for KYC document reuploads so moderators and operators can see when a document was replaced and which file versions were previously associated with the submission.

Current behavior

  • The controller updates the KYC submission document URL directly when a new file is uploaded.
  • Previous document URLs are not preserved in a structured way for later review.

Required behavior

  • Each document reupload should create a traceable history entry that records the replaced file reference and timestamp.
  • The system should expose the history in a way that can be consumed by a future moderation view or API endpoint.
  • The implementation should not break the current upload flow.

Constraints

  • The change should avoid introducing a new storage backend or major schema redesign.
  • Existing KYC upload behavior should remain compatible.

Acceptance criteria

  • Replacing a KYC document creates a stored history record.
  • The history retains enough information to identify the replaced file and when it was replaced.
  • Unit tests cover successful history creation and missing-data cases.

Out of scope

  • Building a full moderation dashboard.
  • Changing the KYC submission schema beyond what is necessary for history tracking.

Hints and references

  • Review the KYC submission model and the upload controller logic for where the replacement should be recorded.

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions