Settlement draft save failed because the frontend merged advance reference line items into every save (including draft) and the backend enforced Advance+Settlement attachment pairing on all draft updates. Fixed both: draft payload sends settlement lines only; attachment cross-check runs only on submit (or non-draft attachment updates). Verify on Bug/SYS-2105/Detail-Items-Advance-Settlement in FE and BE repos.
Bug/SYS-2105/Detail-Items-Advance-Settlement (remote already had partial FE fix by Riza).detailItems with excludedItems; include advance reference items in API payload only on submit.FilesRequired cross-validation to submit transition (and non-draft attachment-only updates).Frontend (frontend-claim-dev, branch Bug/SYS-2105/Detail-Items-Advance-Settlement):
detailItemsForPayload (no in-place detailItems mutation).detailItemsForPayload merges excludedItems only when status === 'submitted'; draft uses this.detailItems only.console.log in error handler.Backend (backend-claim-dev, branch Bug/SYS-2105/Detail-Items-Advance-Settlement):
updatePaymentRequest: Advance/Settlement attachment cross-validation runs only when targetStatus === submitted and previous status was not submitted.updatePaymentRequestAttachments: same rule skipped when settlement status === draft.| Criterion | Verification |
|---|---|
| User can save settlement as draft without attachments | Save as Draft on empty settlement attachments → no FilesRequired error; status stays draft |
| Advance detail items do not appear on draft save | After failed or successful draft save, detail table shows only settlement lines (is_settlement_item === false) |
| Submit still enforces attachments when required | Submit without settlement attachment (and no advance attachments) → still blocked with settlement attachment message |
| Risk | Impact | Mitigation |
|---|---|---|
Draft save with empty items array may delete advance reference rows server-side | Settlement totals/advance offset wrong after draft | FE still sends existing settlement lines; advance refs remain in DB until submit merge — watch QA if user had only advance refs visible |
| BE branch not on remote yet | Deploy needs push | Push Bug/SYS-2105/Detail-Items-Advance-Settlement on backend-claim-dev |
updatePaymentRequest draft settlement (none found in repo).consumer.anabatic.com + Nest API) per acceptance table.frontend-claim-dev/src/app/modules/payment-request/payment-request.component.tsbackend-claim-dev/src/modules/payment-request/services/payment-request-trans.service.tsclickup-execute-SYS-2105-2026-05-20.md (removed 2026-05-21 after move to project context).