Skip to content

[Backend] Soft Delete Implementation for Bounties #235

@gabito1451

Description

@gabito1451

Independence Note: Simply modifying generic Prisma middleware or schema fields.

Context:
If a Guild Admin deletes a bounty, we don't want to permanently wipe the database record due to audit trails and on-chain syncing mismatches.

Objective:
Refactor the Bounty entity to utilize "Soft Deletes".

Acceptance Criteria:

  • Add a deletedAt DateTime column (nullable) to the Bounty model in schema.prisma.
  • Generate the new Prisma client.
  • Update the GET /bounties endpoints to explicitly filter out any records where deletedAt is NOT NULL.
  • Change the DELETE /bounties/:id endpoint to perform an UPDATE setting deletedAt = NOW() rather than a destructive Prisma .delete().

Technical Pointers:

  • You can use Prisma extensions or explicit query arguments. Avoid Prisma middleware as it is deprecated in Prisma 5.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions