Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Soft Delete for Payment Orders #401

Open
chibie opened this issue Jan 23, 2025 · 7 comments · May be fixed by #409
Open

Add Soft Delete for Payment Orders #401

chibie opened this issue Jan 23, 2025 · 7 comments · May be fixed by #409

Comments

@chibie
Copy link
Contributor

chibie commented Jan 23, 2025

User Story
As a system operator, I want payment orders to be soft deleted instead of permanently removed, to maintain data integrity and audit history while still allowing cleanup of old records.

Acceptance Criteria

  1. GIVEN a payment order is deleted
    WHEN using normal deletion
    THEN the record is soft deleted by setting deleted_at

  2. GIVEN querying payment orders
    WHEN no special context is provided
    THEN only non-deleted records are returned

  3. GIVEN querying payment orders
    WHEN using SkipSoftDelete context
    THEN all records including soft-deleted ones are returned

  4. GIVEN a sender profile is deleted
    WHEN the cascade delete triggers
    THEN associated payment orders are soft deleted

Tech Details

  • Create new SoftDeleteMixin in schema/mixins.go following Ent documentation for soft delete
  • Add SoftDeleteMixin to both LockPaymentOrder and PaymentOrder schemas
  • Update PaymentOrder edge in SenderProfile to use entsql.Cascade
  • Add SkipSoftDelete context utility function
  • Create database migration for new deleted_at field
  • Add soft delete functionality to LockPaymentOrder and PaymentOrder schemas
  • Ignore writing tests for this ticket

Notes/Assumptions

  • Both schemas currently use TimeMixin
  • Multiple mixins can be combined
  • Existing deletion logic will be replaced by soft delete
  • Permanent deletion still possible with SkipSoftDelete context

Open Questions

@od-hunter
Copy link

Hi, please can I be assigned this please? This would be my first time contributing to this project and I would love to be the given the opportunity to solve this issue please. I am good with tests and I have experience in html, css, JavaScript,TypeScript and solidity, and Cairo.

@Amizeey
Copy link

Amizeey commented Jan 23, 2025

I'd be happy to do this.

1 similar comment
@Fidel-wole
Copy link

I'd be happy to do this.

@Supa-mega
Copy link

Can I jump on this task? first time contributor

@caxtonacollins
Copy link

May I try my hand at this?

@chibie
Copy link
Contributor Author

chibie commented Jan 28, 2025

@Fidel-wole have you started work on this ticket?

@Fidel-wole
Copy link

I'm still going through the repository, will begin soon

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

Successfully merging a pull request may close this issue.

6 participants