Skip to content

Conversation

@google-labs-jules
Copy link

This submission implements the "Delete Case Cascade" feature for the Sanctum Advocate module. It allows users to delete a legal case, which removes the case metadata and unlinks all associated payment tags (support/potential support) but strictly preserves the raw payment records and other artifacts. This ensures users can safely "reset" a case without losing their original data. The operation is transactional and audit-logged via the Witness system.

Implementation details:

  • Android Layer:
    • LegalCaseEntity, PaymentEventEntity, WitnessEvent, SubscriptionEntity defined in com.sanctum.data.
    • SanctumDatabase configured with these entities.
    • NativeAdvocateModule implements listCases, createCase, and deleteCaseWithCascade.
    • deleteCaseWithCascade uses a database transaction to ensuring atomicity between deleting the case row and updating payment rows to nullify case_id and legal_category.
    • Logging uses JSONObject for safe JSON construction.
  • React Native Layer:
    • NativeAdvocateModule.ts defines the typed interface.
    • useAdvocateCases hook manages state and exposes the delete function.
    • SupportLedgerScreen includes a Danger Zone with a confirmation dialog explaining the data retention policy.

PR created automatically by Jules for task 13727505106297253299 started by @cyserman

Implements the "Delete Case" feature for the Advocate module with transactional safety and data retention guarantees.

Key changes:
- Android: Added `LegalCaseEntity`, `PaymentEventEntity`, `WitnessEvent`, `SubscriptionEntity` and associated DAOs.
- Android: Implemented `NativeAdvocateModule` with `deleteCaseWithCascade`, `listCases`, and `createCase`.
- Android: `deleteCaseWithCascade` runs in a transaction to delete the case and clear tags from payments without deleting the payments themselves.
- TypeScript: Added `NativeAdvocateModule.ts` bridge and `useAdvocateCases.ts` hook.
- UI: Added `SupportLedgerScreen` with a "Danger Zone" to trigger the deletion.
- Fixes: Corrected JSON injection in logging and updated Entity schemas to match spec.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant