Description
Several critical operations within the API involve multiple database writes that execute independently. If one operation succeeds and another fails, the system may end up with partially persisted data, causing inconsistencies.
Examples may include:
User registration + profile creation
Property creation + metadata creation
Role assignment workflows
Payment or transaction processing
Multi-entity updates
The API should introduce proper transactional boundaries using TypeORM transactions.
Requirements
Identify services performing multiple write operations.
Use DataSource.transaction() or QueryRunner.
Ensure rollback when any operation fails.
Prevent partial writes.
Add logging for transaction failures.
Add tests covering rollback scenarios.
Acceptance Criteria
Critical operations execute atomically.
Database consistency is maintained.
Failed operations rollback completely.
Existing functionality remains unaffected.
Unit/integration tests are added.
Description
Several critical operations within the API involve multiple database writes that execute independently. If one operation succeeds and another fails, the system may end up with partially persisted data, causing inconsistencies.
Examples may include:
User registration + profile creation
Property creation + metadata creation
Role assignment workflows
Payment or transaction processing
Multi-entity updates
The API should introduce proper transactional boundaries using TypeORM transactions.
Requirements
Identify services performing multiple write operations.
Use DataSource.transaction() or QueryRunner.
Ensure rollback when any operation fails.
Prevent partial writes.
Add logging for transaction failures.
Add tests covering rollback scenarios.
Acceptance Criteria
Critical operations execute atomically.
Database consistency is maintained.
Failed operations rollback completely.
Existing functionality remains unaffected.
Unit/integration tests are added.