@tomei/rental 0.17.4-dev.11 → 0.17.4-dev.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/rental",
3
- "version": "0.17.4-dev.11",
3
+ "version": "0.17.4-dev.12",
4
4
  "description": "Tomei Rental Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -748,6 +748,7 @@ export class Rental extends ObjectBase {
748
748
  const jointHirers = await Rental._JointHirerRepo.findAll({
749
749
  where: {
750
750
  RentalId: this.RentalId,
751
+ Status: 'Active',
751
752
  },
752
753
  transaction: dbTransaction,
753
754
  });
@@ -808,12 +808,6 @@ export class RentalHirerChangeRequest
808
808
  jointHirer.CustomerId = customerId;
809
809
  jointHirer.CustomerType = customerType;
810
810
  await jointHirer.create(loginUser, dbTransaction);
811
-
812
- //d. Set the AccountType to "Joint" for the rental
813
- // const rental = await Rental.init(dbTransaction, this.RentalId);
814
- // await rental.update(loginUser, dbTransaction, {
815
- // AccountType: RentalAccountTypeEnum.JOINT,
816
- // });
817
811
  } else if (this.Type === HirerChangeRequestTypeEnum.REMOVE) {
818
812
  // a. Get joint hirer from remove hirer request
819
813
  const removeHirer = await this.getRemoveHirer(dbTransaction);
@@ -824,23 +818,6 @@ export class RentalHirerChangeRequest
824
818
 
825
819
  //Call jointHirer.remove() method by passing loginUser and dbTransaction
826
820
  await jointHirer.remove(loginUser, dbTransaction);
827
-
828
- // //find the number of joint hirers after removal
829
- // const rental = await Rental.init(dbTransaction, this.RentalId);
830
- // rental.AccountType = RentalAccountTypeEnum.JOINT;
831
- // const jointHirers = await rental.getJointHirers(dbTransaction);
832
-
833
- // //filter out the active joint hirers
834
- // const activeJointHirers = jointHirers.filter(
835
- // (hirer) => hirer.Status === 'Active',
836
- // );
837
-
838
- // //if jointHirers is empty, set rental.AccountType to "Single"
839
- // if (activeJointHirers.length === 0) {
840
- // await rental.update(loginUser, dbTransaction, {
841
- // AccountType: RentalAccountTypeEnum.SINGLE,
842
- // });
843
- // }
844
821
  }
845
822
 
846
823
  // 3. Call _Repo update method