REPOSITORY CODING · EASY
A credit hold is captured at its expiry deadline
The capture endpoint accepts a hold at its expiry timestamp. Trace the HTTP controller through the hold service and correct the boundary.
Database EngineeringBusiness credit reservations
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
Java · 30 minute session
- open creates an account with id, owner and positive integer limit in cents. inspect reads its used and reserved balances.
- reserve takes a hold id, account, actor, positive amount, now and expiresAt greater than now. Only the owner reserves. Amount must fit limit minus used minus reserved.
- capture requires the owner, a reserved hold and now strictly before expiry. Reserved credit becomes used credit atomically.
- release requires the owner and a reserved hold. Captured and released holds are terminal. Expired holds remain reserved until explicitly released.
- Every command includes tenant. Mutations and audit commit together; failAudit must roll back. An optional request key replays the same result and rejects changed payloads. history returns tenant audit records.
Spring Boot · 30 minute session
- open creates an account with id, owner and positive integer limit in cents. inspect reads its used and reserved balances.
- reserve takes a hold id, account, actor, positive amount, now and expiresAt greater than now. Only the owner reserves. Amount must fit limit minus used minus reserved.
- capture requires the owner, a reserved hold and now strictly before expiry. Reserved credit becomes used credit atomically.
- release requires the owner and a reserved hold. Captured and released holds are terminal. Expired holds remain reserved until explicitly released.
- Every command includes tenant. Mutations and audit commit together; failAudit must roll back. An optional request key replays the same result and rejects changed payloads. history returns tenant audit records.