@tomei/rental 0.17.4-dev.2 → 0.17.4-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.js +19 -12
- package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/rental-hirer-change-request/rental-hirer-change-request.ts +23 -13
package/package.json
CHANGED
|
@@ -445,6 +445,7 @@ export class RentalHirerChangeRequest
|
|
|
445
445
|
}
|
|
446
446
|
|
|
447
447
|
// 2. Prepare all signature data (main + joint) in one go
|
|
448
|
+
this.Rental.AccountType = RentalAccountTypeEnum.JOINT;
|
|
448
449
|
const jointHirers = await this.Rental.getJointHirers(dbTransaction);
|
|
449
450
|
|
|
450
451
|
// Main hirer signature
|
|
@@ -454,23 +455,32 @@ export class RentalHirerChangeRequest
|
|
|
454
455
|
mainSignature.HirerType = HirerChangeRequestHirerRoleEnum.MAIN;
|
|
455
456
|
mainSignature.Method = 'Upload';
|
|
456
457
|
|
|
457
|
-
// Joint hirer signatures
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
458
|
+
// Joint hirer signatures - only if there are joint hirers
|
|
459
|
+
let jointSignatures = [];
|
|
460
|
+
if (jointHirers.length > 0) {
|
|
461
|
+
const jointSignaturePromises = jointHirers.map(async (jointHirer) => {
|
|
462
|
+
const signature = await HirerChangeRequestSignature.init();
|
|
463
|
+
signature.RequestId = this.RequestId;
|
|
464
|
+
signature.JointHirerId = jointHirer.HirerId;
|
|
465
|
+
signature.HirerType = HirerChangeRequestHirerRoleEnum.JOINT;
|
|
466
|
+
signature.Method = 'Upload';
|
|
467
|
+
return signature;
|
|
468
|
+
});
|
|
466
469
|
|
|
467
|
-
|
|
470
|
+
jointSignatures = await Promise.all(jointSignaturePromises);
|
|
471
|
+
}
|
|
468
472
|
|
|
469
473
|
// 3. Create all signatures in parallel
|
|
470
|
-
|
|
474
|
+
const signaturesToCreate = [
|
|
471
475
|
mainSignature.create(loginUser, dbTransaction),
|
|
472
|
-
|
|
473
|
-
|
|
476
|
+
];
|
|
477
|
+
if (jointSignatures.length > 0) {
|
|
478
|
+
signaturesToCreate.push(
|
|
479
|
+
...jointSignatures.map((sig) => sig.create(loginUser, dbTransaction)),
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
await Promise.all(signaturesToCreate);
|
|
474
484
|
|
|
475
485
|
this.Signatures = [mainSignature, ...jointSignatures];
|
|
476
486
|
} catch (error) {
|