Skip to content

[Enhancement] File Versioning for Approval Workflow #3390

Description

@anik-fahmid

Problem

When vendor uploads replacement file on approval-enabled marketplace, current approach moves product to Pending Review. This hides product from customers during approval (sales loss).

Proposed Behavior

Product stays Published with v1 file live. v2 queued for approval invisibly. Vendor keeps earning while admin reviews.

State v1 File v2 File Product Status Customers See Sales
Vendor uploads v2 Live Pending Published v1 works Keep earning ✓
Admin approves v2 Replaced Published v2 works Keep earning ✓
Admin rejects v2 Live Deleted Published v1 works Keep earning ✓

How File Versioning Works

Track two files: active (customers see) and pending (awaiting approval).

  • Vendor uploads → stays pending, old file stays live
  • Download check: is file pending? Only admin/vendor/pre-approval customers see it
  • Admin approves → pending becomes active, old file archived/deleted
  • Admin rejects → pending deleted, old file stays active

What Needs to Build

  1. File metadata storage: active_file_id, pending_file_id, file_status
  2. Download endpoint checks if file pending, gates access accordingly
  3. Approval swap: atomic replace of active file
  4. Split-order isolation: vendor A's pending doesn't affect vendor B
  5. Vendor editor shows: active file + pending status
  6. REST API exposes both states

Old File Handling

Keep for audit trail first year, then auto-delete. Vendor can manually restore if needed.

Timeline

Phase 1 (current PR #3372):

  • File holds v1 live during approval
  • Discard button (delete v2, keep v1)
  • Vendor notifications + docs

Phase 2 (this enhancement):

  • Full file versioning system
  • Product never goes Pending

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions