@tomei/rental 0.17.4-dev.8 → 0.17.4

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.8",
3
+ "version": "0.17.4",
4
4
  "description": "Tomei Rental Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -237,7 +237,7 @@ export class JointHirer extends ObjectBase {
237
237
  );
238
238
  }
239
239
 
240
- this._Rental = await Rental.init(this.RentalId, dbTransaction);
240
+ this._Rental = await Rental.init(dbTransaction, this.RentalId);
241
241
 
242
242
  if (!this._Rental) {
243
243
  throw new ClassError(
@@ -131,7 +131,7 @@ export class Rental extends ObjectBase {
131
131
  throw new ClassError(
132
132
  'Rental',
133
133
  'RentalErrMsg00',
134
- 'Failed To Initialize Price',
134
+ 'Failed To Initialize Rental',
135
135
  );
136
136
  }
137
137
  }
@@ -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