Merged PR 1932: feat(remission): ensure package assignment before completing return receipts

feat(remission): ensure package assignment before completing return receipts

Add validation to check if a package is assigned to a return receipt before
allowing completion. When no package is assigned, automatically open the
package assignment dialog to let users scan/input a package number.

- Add hasAssignedPackage input to complete component and pass from parent
- Integrate RemissionStartService.assignPackage() in completion flow
- Add assignPackageOnly flag to conditionally hide step counter in dialog
- Update dialog data structure to support direct package assignment mode
- Enhance test coverage for new assignment scenarios

This ensures all completed return receipts have proper package tracking
and improves the user workflow by guiding them through required steps.

Ref: #5289
This commit is contained in:
Nino Righi
2025-09-03 13:15:32 +00:00
committed by Andreas Schickinger
parent 708ec01704
commit fa8e601660
10 changed files with 298 additions and 27 deletions

View File

@@ -68,6 +68,7 @@
<lib-remission-return-receipt-complete
[returnId]="returnId()"
[receiptId]="receiptId()"
[hasAssignedPackage]="hasAssignedPackage()"
[itemsLength]="items?.length"
(reloadData)="returnResource.reload()"
></lib-remission-return-receipt-complete>

View File

@@ -14,6 +14,7 @@ import { RemissionReturnReceiptDetailsItemComponent } from './remission-return-r
import { Location } from '@angular/common';
import { createReturnResource } from './resources/return.resource';
import {
getPackageNumbersFromReturn,
getReceiptItemsFromReturn,
getReceiptNumberFromReturn,
} from '@isa/remission/data-access';
@@ -105,4 +106,9 @@ export class RemissionReturnReceiptDetailsComponent {
const returnData = this.returnData();
return !!returnData && !returnData.completed;
});
hasAssignedPackage = computed(() => {
const returnData = this.returnData();
return getPackageNumbersFromReturn(returnData!) !== '';
});
}