π Description
AnchorRepository and LiquidityRepository both expose a remove, but SettlementRepository only has create/save β there's no way to delete a settlement record outright. This is fine for normal lifecycle operations (which use cancel, not deletion), but there's no supported path for, e.g., purging test fixtures or correcting an erroneously-created settlement record without restarting the process.
π§© Requirements and context
- Add
remove(id: number): boolean to SettlementRepository, matching the return-true-if-existed convention already used by AnchorRepository.remove/LiquidityRepository.remove.
- This is a repository-layer primitive only β do not wire it to a public route in this issue unless it's clearly gated as an administrative operation; if adding a route, require the configured API key and note the destructive nature in the endpoint's summary.
π οΈ Suggested execution
- Add
remove to src/repositories/settlementRepository.ts.
- Add tests in
src/repositories/settlementRepository.test.ts covering removal of an existing id, a non-existent id, and that count()/all() reflect the removal.
- If a route is added, gate it behind
apiKeyAuth (already true for all mutating routes when configured) and document the destructive/administrative nature explicitly in openapi.ts.
β
Acceptance criteria
π Security notes
A destructive delete on financial-adjacent settlement records; if exposed via a route, it must not be reachable without the same protections as other mutating endpoints, and ideally requires an explicit acknowledgement that it bypasses the normal cancel/execute lifecycle.
π Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
π Description
AnchorRepositoryandLiquidityRepositoryboth expose aremove, butSettlementRepositoryonly hascreate/saveβ there's no way to delete a settlement record outright. This is fine for normal lifecycle operations (which usecancel, not deletion), but there's no supported path for, e.g., purging test fixtures or correcting an erroneously-created settlement record without restarting the process.π§© Requirements and context
remove(id: number): booleantoSettlementRepository, matching the return-true-if-existed convention already used byAnchorRepository.remove/LiquidityRepository.remove.π οΈ Suggested execution
removetosrc/repositories/settlementRepository.ts.src/repositories/settlementRepository.test.tscovering removal of an existing id, a non-existent id, and thatcount()/all()reflect the removal.apiKeyAuth(already true for all mutating routes when configured) and document the destructive/administrative nature explicitly inopenapi.ts.β Acceptance criteria
SettlementRepository.remove(id)removes the settlement and returnstrue; returnsfalsefor an unknown id.count()andall()correctly reflect removal.π Security notes
A destructive delete on financial-adjacent settlement records; if exposed via a route, it must not be reachable without the same protections as other mutating endpoints, and ideally requires an explicit acknowledgement that it bypasses the normal cancel/execute lifecycle.
π Guidelines