Description
Add optimistic locking (version column) to credit line records so concurrent updates do not silently overwrite each other. Return a 409 conflict with a clear error code when version mismatch occurs.
Requirements and context
- Must be secure, tested, and documented.
- Must define retry strategy for callers.
Suggested execution
git checkout -b feature/optimistic-locking-creditline
Implement changes
- Add
version column and update repositories to check-and-increment.
- Integration tests for concurrent update conflict.
- Update OpenAPI error responses.
Test and commit
Example commit message
feat(db): optimistic locking for credit line updates with 409 conflicts
Guidelines
Description
Add optimistic locking (version column) to credit line records so concurrent updates do not silently overwrite each other. Return a 409 conflict with a clear error code when version mismatch occurs.
Requirements and context
Suggested execution
Implement changes
versioncolumn and update repositories to check-and-increment.Test and commit
npm testExample commit message
Guidelines