@tomei/rental 0.17.3-dev.7 → 0.17.3-dev.8

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.
Files changed (78) hide show
  1. package/dist/components/agreement-signature/agreement-signature.d.ts +4 -0
  2. package/dist/components/agreement-signature/agreement-signature.js +8 -0
  3. package/dist/components/agreement-signature/agreement-signature.js.map +1 -1
  4. package/dist/interfaces/agreemeent-signature-attr.interface.d.ts +4 -0
  5. package/dist/src/ClassMappings/ItemClassMap.d.ts +4 -0
  6. package/dist/src/ClassMappings/ItemClassMap.js +8 -0
  7. package/dist/src/ClassMappings/ItemClassMap.js.map +1 -0
  8. package/dist/src/ClassMappings/index.d.ts +2 -0
  9. package/dist/src/ClassMappings/index.js +6 -0
  10. package/dist/src/ClassMappings/index.js.map +1 -0
  11. package/dist/src/components/agreement/agreement.js +91 -72
  12. package/dist/src/components/agreement/agreement.js.map +1 -1
  13. package/dist/src/components/agreement/agreement.repository.js +50 -35
  14. package/dist/src/components/agreement/agreement.repository.js.map +1 -1
  15. package/dist/src/components/agreement-history/agreement-history.js +21 -10
  16. package/dist/src/components/agreement-history/agreement-history.js.map +1 -1
  17. package/dist/src/components/agreement-history/agreement-history.repository.js +50 -35
  18. package/dist/src/components/agreement-history/agreement-history.repository.js.map +1 -1
  19. package/dist/src/components/agreement-signature/agreement-signature.js +70 -57
  20. package/dist/src/components/agreement-signature/agreement-signature.js.map +1 -1
  21. package/dist/src/components/agreement-signature/agreement-signature.repository.js +51 -36
  22. package/dist/src/components/agreement-signature/agreement-signature.repository.js.map +1 -1
  23. package/dist/src/components/booking/booking.js +231 -206
  24. package/dist/src/components/booking/booking.js.map +1 -1
  25. package/dist/src/components/booking/booking.repository.js +50 -35
  26. package/dist/src/components/booking/booking.repository.js.map +1 -1
  27. package/dist/src/components/hirer-change-request-new-hirer/hirer-change-request-new-hirer.js +62 -47
  28. package/dist/src/components/hirer-change-request-new-hirer/hirer-change-request-new-hirer.js.map +1 -1
  29. package/dist/src/components/hirer-change-request-new-hirer/hirer-change-request-new-hirer.repository.js +63 -46
  30. package/dist/src/components/hirer-change-request-new-hirer/hirer-change-request-new-hirer.repository.js.map +1 -1
  31. package/dist/src/components/hirer-change-request-remove-hirer/hirer-change-request-remove-hirer.js +64 -49
  32. package/dist/src/components/hirer-change-request-remove-hirer/hirer-change-request-remove-hirer.js.map +1 -1
  33. package/dist/src/components/hirer-change-request-remove-hirer/hirer-change-request-remove-hirer.repository.js +64 -47
  34. package/dist/src/components/hirer-change-request-remove-hirer/hirer-change-request-remove-hirer.repository.js.map +1 -1
  35. package/dist/src/components/hirer-change-request-signature/hirer-change-request-signature.js +167 -150
  36. package/dist/src/components/hirer-change-request-signature/hirer-change-request-signature.js.map +1 -1
  37. package/dist/src/components/hirer-change-request-signature/hirer-change-request-signature.repository.js +64 -47
  38. package/dist/src/components/hirer-change-request-signature/hirer-change-request-signature.repository.js.map +1 -1
  39. package/dist/src/components/joint-hirer/joint-hirer.d.ts +2 -0
  40. package/dist/src/components/joint-hirer/joint-hirer.js +133 -81
  41. package/dist/src/components/joint-hirer/joint-hirer.js.map +1 -1
  42. package/dist/src/components/joint-hirer/joint-hirer.repository.js +50 -35
  43. package/dist/src/components/joint-hirer/joint-hirer.repository.js.map +1 -1
  44. package/dist/src/components/rental/rental.d.ts +12 -3
  45. package/dist/src/components/rental/rental.js +755 -549
  46. package/dist/src/components/rental/rental.js.map +1 -1
  47. package/dist/src/components/rental/rental.repository.js +50 -35
  48. package/dist/src/components/rental/rental.repository.js.map +1 -1
  49. package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.js +456 -416
  50. package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.js.map +1 -1
  51. package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.repository.js +63 -46
  52. package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.repository.js.map +1 -1
  53. package/dist/src/components/rental-price/rental-price.js +46 -33
  54. package/dist/src/components/rental-price/rental-price.js.map +1 -1
  55. package/dist/src/components/rental-price/rental-price.repository.js +50 -35
  56. package/dist/src/components/rental-price/rental-price.repository.js.map +1 -1
  57. package/dist/src/enum/agreement-signature-verification-method.enum.d.ts +4 -0
  58. package/dist/src/enum/agreement-signature-verification-method.enum.js +9 -0
  59. package/dist/src/enum/agreement-signature-verification-method.enum.js.map +1 -0
  60. package/dist/src/enum/index.d.ts +2 -1
  61. package/dist/src/enum/index.js +3 -1
  62. package/dist/src/enum/index.js.map +1 -1
  63. package/dist/src/index.d.ts +2 -1
  64. package/dist/src/index.js +3 -1
  65. package/dist/src/index.js.map +1 -1
  66. package/dist/src/models/agreement-signature.entity.d.ts +4 -0
  67. package/dist/src/models/agreement-signature.entity.js +22 -0
  68. package/dist/src/models/agreement-signature.entity.js.map +1 -1
  69. package/dist/src/models/hirer-change-request-new-hirer.entity.d.ts +1 -1
  70. package/dist/src/models/hirer-change-request-remove-hirer.entity.d.ts +1 -1
  71. package/dist/src/models/hirer-change-request-signature.entity.d.ts +1 -1
  72. package/dist/src/models/joint-hirer.entity.js +0 -4
  73. package/dist/src/models/joint-hirer.entity.js.map +1 -1
  74. package/dist/tsconfig.build.tsbuildinfo +1 -1
  75. package/dist/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +1 -1
  77. package/src/components/agreement-signature/agreement-signature.ts +12 -0
  78. package/src/interfaces/agreemeent-signature-attr.interface.ts +4 -0
@@ -1,10 +1,21 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.JointHirer = void 0;
4
13
  const general_1 = require("@tomei/general");
5
14
  const joint_hirer_repository_1 = require("./joint-hirer.repository");
6
15
  const config_1 = require("@tomei/config");
7
16
  const activity_history_1 = require("@tomei/activity-history");
17
+ const rental_1 = require("../rental/rental");
18
+ const account_type_enum_1 = require("../../enum/account-type.enum");
8
19
  class JointHirer extends general_1.ObjectBase {
9
20
  get HirerId() {
10
21
  return this.ObjectId;
@@ -42,94 +53,135 @@ class JointHirer extends general_1.ObjectBase {
42
53
  UpdatedAt: this.UpdatedAt,
43
54
  };
44
55
  }
45
- static async init(hirerId, dbTransaction) {
46
- try {
47
- if (hirerId) {
48
- const jr = await JointHirer._Repository.findByPk(hirerId, dbTransaction);
49
- if (jr) {
50
- return new JointHirer(jr.get({ plain: true }));
56
+ static init(hirerId, dbTransaction) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ try {
59
+ if (hirerId) {
60
+ const jr = yield JointHirer._Repository.findByPk(hirerId, dbTransaction);
61
+ if (jr) {
62
+ return new JointHirer(jr.get({ plain: true }));
63
+ }
64
+ else {
65
+ throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg01', 'JointHirer not found');
66
+ }
51
67
  }
52
- else {
53
- throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg01', 'JointHirer not found');
68
+ return new JointHirer();
69
+ }
70
+ catch (error) {
71
+ throw error;
72
+ }
73
+ });
74
+ }
75
+ create(loginUser, dbTransaction) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ try {
78
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
79
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'JointHirer - Create');
80
+ if (!isPrivileged) {
81
+ throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg00', "You do not have 'JointHirer - Create' privilege.");
82
+ }
83
+ if (!this.RentalId || !this.CustomerId || !this.CustomerType) {
84
+ throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg03', 'RentalId, CustomerId and CustomerType are required.');
85
+ }
86
+ this.ObjectId = this.createId();
87
+ this.CreatedById = loginUser.ObjectId;
88
+ this.CreatedAt = new Date();
89
+ this.UpdatedById = loginUser.ObjectId;
90
+ this.UpdatedAt = new Date();
91
+ const entityValueAfter = {
92
+ HirerId: this.HirerId,
93
+ RentalId: this.RentalId,
94
+ CustomerId: this.CustomerId,
95
+ CustomerType: this.CustomerType,
96
+ Status: this.Status,
97
+ CreatedById: this.CreatedById,
98
+ CreatedAt: this.CreatedAt,
99
+ UpdatedById: this.UpdatedById,
100
+ UpdatedAt: this.UpdatedAt,
101
+ };
102
+ yield JointHirer._Repository.create(entityValueAfter, {
103
+ transaction: dbTransaction,
104
+ });
105
+ const activity = new activity_history_1.Activity();
106
+ activity.ObjectId = this._createId();
107
+ activity.Action = activity_history_1.ActionEnum.CREATE;
108
+ activity.Description = 'Add Joint Hirer';
109
+ activity.EntityId = this.ObjectId;
110
+ activity.EntityType = this.ObjectType;
111
+ activity.EntityValueBefore = JSON.stringify({});
112
+ activity.EntityValueAfter = JSON.stringify(entityValueAfter);
113
+ yield activity.create(loginUser.ObjectId, dbTransaction);
114
+ const rental = yield this.getRental(dbTransaction);
115
+ const totalIds = yield rental.getCustomerIds(loginUser, dbTransaction);
116
+ if (totalIds.length > 1 && rental.AccountType === 'Single') {
117
+ yield rental.update(loginUser, dbTransaction, {
118
+ AccountType: account_type_enum_1.RentalAccountTypeEnum.JOINT,
119
+ });
54
120
  }
121
+ return this;
55
122
  }
56
- return new JointHirer();
57
- }
58
- catch (error) {
59
- throw error;
60
- }
123
+ catch (error) {
124
+ throw error;
125
+ }
126
+ });
61
127
  }
62
- async create(loginUser, dbTransaction) {
63
- try {
64
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
65
- const isPrivileged = await loginUser.checkPrivileges(systemCode, 'JointHirer - Create');
66
- if (!isPrivileged) {
67
- throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg00', "You do not have 'JointHirer - Create' privilege.");
128
+ remove(loginUser, dbTransaction) {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ try {
131
+ if (!this.HirerId) {
132
+ throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg02', 'HirerId is required to remove Joint Hirer.');
133
+ }
134
+ if (this.Status === 'Inactive') {
135
+ return this;
136
+ }
137
+ const entityValueBefore = this.toJSON();
138
+ this.Status = 'Inactive';
139
+ this.UpdatedById = loginUser.ObjectId;
140
+ this.UpdatedAt = new Date();
141
+ const entityValueAfter = this.toJSON();
142
+ yield JointHirer._Repository.update(entityValueAfter, {
143
+ where: {
144
+ HirerId: this.HirerId,
145
+ },
146
+ transaction: dbTransaction,
147
+ });
148
+ const activity = new activity_history_1.Activity();
149
+ activity.ObjectId = this._createId();
150
+ activity.Action = activity_history_1.ActionEnum.UPDATE;
151
+ activity.Description = 'Mark Joint Hirer as Inactive';
152
+ activity.EntityId = this.ObjectId;
153
+ activity.EntityType = this.ObjectType;
154
+ activity.EntityValueBefore = JSON.stringify(entityValueBefore);
155
+ activity.EntityValueAfter = JSON.stringify(entityValueAfter);
156
+ yield activity.create(loginUser.ObjectId, dbTransaction);
157
+ const rental = yield this.getRental(dbTransaction);
158
+ const totalIds = yield rental.getCustomerIds(loginUser, dbTransaction);
159
+ if (totalIds.length === 1 && rental.AccountType === 'Joint') {
160
+ yield rental.update(loginUser, dbTransaction, {
161
+ AccountType: account_type_enum_1.RentalAccountTypeEnum.SINGLE,
162
+ });
163
+ }
164
+ return this;
68
165
  }
69
- if (!this.RentalId || !this.CustomerId || !this.CustomerType) {
70
- throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg03', 'RentalId, CustomerId and CustomerType are required.');
166
+ catch (error) {
167
+ throw error;
71
168
  }
72
- this.ObjectId = this.createId();
73
- this.CreatedById = loginUser.ObjectId;
74
- this.CreatedAt = new Date();
75
- this.UpdatedById = loginUser.ObjectId;
76
- this.UpdatedAt = new Date();
77
- const entityValueAfter = {
78
- HirerId: this.HirerId,
79
- RentalId: this.RentalId,
80
- CustomerId: this.CustomerId,
81
- CustomerType: this.CustomerType,
82
- Status: this.Status,
83
- CreatedById: this.CreatedById,
84
- CreatedAt: this.CreatedAt,
85
- UpdatedById: this.UpdatedById,
86
- UpdatedAt: this.UpdatedAt,
87
- };
88
- await JointHirer._Repository.create(entityValueAfter, {
89
- transaction: dbTransaction,
90
- });
91
- const activity = new activity_history_1.Activity();
92
- activity.ObjectId = this._createId();
93
- activity.Action = activity_history_1.ActionEnum.CREATE;
94
- activity.Description = 'Add Joint Hirer';
95
- activity.EntityId = this.ObjectId;
96
- activity.EntityType = this.ObjectType;
97
- activity.EntityValueBefore = JSON.stringify({});
98
- activity.EntityValueAfter = JSON.stringify(entityValueAfter);
99
- await activity.create(loginUser.ObjectId, dbTransaction);
100
- return this;
101
- }
102
- catch (error) {
103
- throw error;
104
- }
169
+ });
105
170
  }
106
- async remove(loginUser, dbTransaction) {
107
- try {
108
- const entityValueBefore = this.toJSON();
109
- this.Status = 'Inactive';
110
- this.UpdatedById = loginUser.ObjectId;
111
- this.UpdatedAt = new Date();
112
- const entityValueAfter = this.toJSON();
113
- await JointHirer._Repository.update(entityValueAfter, {
114
- where: {
115
- HirerId: this.HirerId,
116
- },
117
- transaction: dbTransaction,
118
- });
119
- const activity = new activity_history_1.Activity();
120
- activity.ObjectId = this._createId();
121
- activity.Action = activity_history_1.ActionEnum.UPDATE;
122
- activity.Description = 'Mark Joint Hirer as Inactive';
123
- activity.EntityId = this.ObjectId;
124
- activity.EntityType = this.ObjectType;
125
- activity.EntityValueBefore = JSON.stringify(entityValueBefore);
126
- activity.EntityValueAfter = JSON.stringify(entityValueAfter);
127
- await activity.create(loginUser.ObjectId, dbTransaction);
128
- return this;
129
- }
130
- catch (error) {
131
- throw error;
132
- }
171
+ getRental(dbTransaction) {
172
+ return __awaiter(this, void 0, void 0, function* () {
173
+ if (this._Rental) {
174
+ return this._Rental;
175
+ }
176
+ if (!this.RentalId) {
177
+ throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg04', 'RentalId is empty.');
178
+ }
179
+ this._Rental = yield rental_1.Rental.init(dbTransaction, this.RentalId);
180
+ if (!this._Rental) {
181
+ throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg05', 'Rental not found.');
182
+ }
183
+ return this._Rental;
184
+ });
133
185
  }
134
186
  }
135
187
  exports.JointHirer = JointHirer;
@@ -1 +1 @@
1
- {"version":3,"file":"joint-hirer.js","sourceRoot":"","sources":["../../../../src/components/joint-hirer/joint-hirer.ts"],"names":[],"mappings":";;;AAAA,4CAAwD;AACxD,qEAAgE;AAEhE,0CAAkD;AAElD,8DAA+D;AAE/D,MAAa,UAAW,SAAQ,oBAAU;IAcxC,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,CAAC,KAAa;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAID,YAAsB,cAAgC;QACpD,KAAK,EAAE,CAAC;QAtBV,eAAU,GAAW,YAAY,CAAC;QAClC,cAAS,GAAW,mBAAmB,CAAC;QAIxC,WAAM,GAAG,QAAQ,CAAC;QAkBhB,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;YACtC,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;YACxC,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC;YAC5C,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC;YAChD,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;YACpC,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC;YAC9C,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,SAAS,CAAC;YAC1C,IAAI,CAAC,WAAW,GAAG,cAAc,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B,mBAAmB,CACpB,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;KAAA;;AAjPH,gCAkPC;AA3NkB,sBAAW,GAAG,IAAI,6CAAoB,EAAE,AAA7B,CAA8B"}
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.JointHirerRepository = void 0;
4
13
  const general_1 = require("@tomei/general");
@@ -7,45 +16,51 @@ class JointHirerRepository extends general_1.RepositoryBase {
7
16
  constructor() {
8
17
  super(joint_hirer_entity_1.JointHirerModel);
9
18
  }
10
- async findByPk(id, transaction) {
11
- try {
12
- const result = await joint_hirer_entity_1.JointHirerModel.findByPk(id, {
13
- transaction: transaction,
14
- });
15
- return result;
16
- }
17
- catch (error) {
18
- throw new Error(`An Error occured when fetching : ${error.message}`);
19
- }
19
+ findByPk(id, transaction) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const result = yield joint_hirer_entity_1.JointHirerModel.findByPk(id, {
23
+ transaction: transaction,
24
+ });
25
+ return result;
26
+ }
27
+ catch (error) {
28
+ throw new Error(`An Error occured when fetching : ${error.message}`);
29
+ }
30
+ });
20
31
  }
21
- async delete(hirerId, dbTransaction) {
22
- try {
23
- const options = {
24
- where: {
25
- HirerId: hirerId,
26
- },
27
- transaction: dbTransaction,
28
- };
29
- await joint_hirer_entity_1.JointHirerModel.destroy(options);
30
- }
31
- catch (error) {
32
- throw new Error(`An Error occured when delete : ${error.message}`);
33
- }
32
+ delete(hirerId, dbTransaction) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ try {
35
+ const options = {
36
+ where: {
37
+ HirerId: hirerId,
38
+ },
39
+ transaction: dbTransaction,
40
+ };
41
+ yield joint_hirer_entity_1.JointHirerModel.destroy(options);
42
+ }
43
+ catch (error) {
44
+ throw new Error(`An Error occured when delete : ${error.message}`);
45
+ }
46
+ });
34
47
  }
35
- async findAndCountAll(options) {
36
- try {
37
- let jointHirers;
38
- if (options) {
39
- jointHirers = await joint_hirer_entity_1.JointHirerModel.findAndCountAll(options);
48
+ findAndCountAll(options) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ try {
51
+ let jointHirers;
52
+ if (options) {
53
+ jointHirers = yield joint_hirer_entity_1.JointHirerModel.findAndCountAll(options);
54
+ }
55
+ else {
56
+ jointHirers = yield joint_hirer_entity_1.JointHirerModel.findAndCountAll();
57
+ }
58
+ return jointHirers;
40
59
  }
41
- else {
42
- jointHirers = await joint_hirer_entity_1.JointHirerModel.findAndCountAll();
60
+ catch (error) {
61
+ throw new Error(`An Error occured when retriving : ${error.message}`);
43
62
  }
44
- return jointHirers;
45
- }
46
- catch (error) {
47
- throw new Error(`An Error occured when retriving : ${error.message}`);
48
- }
63
+ });
49
64
  }
50
65
  }
51
66
  exports.JointHirerRepository = JointHirerRepository;
@@ -1 +1 @@
1
- {"version":3,"file":"joint-hirer.repository.js","sourceRoot":"","sources":["../../../../src/components/joint-hirer/joint-hirer.repository.ts"],"names":[],"mappings":";;;AAAA,4CAAiE;AACjE,wEAAkE;AAElE,MAAa,oBACX,SAAQ,wBAA+B;IAGvC;QACE,KAAK,CAAC,oCAAe,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,EAAU,EACV,WAAiB;QAEjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,oCAAe,CAAC,QAAQ,CAAC,EAAE,EAAE;gBAChD,WAAW,EAAE,WAAW;aACzB,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,aAAmB;QAC/C,IAAI,CAAC;YACH,MAAM,OAAO,GAAG;gBACd,KAAK,EAAE;oBACL,OAAO,EAAE,OAAO;iBACjB;gBACD,WAAW,EAAE,aAAa;aAC3B,CAAC;YACF,MAAM,oCAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAAa;QACjC,IAAI,CAAC;YACH,IAAI,WAAgB,CAAC;YACrB,IAAI,OAAO,EAAE,CAAC;gBACZ,WAAW,GAAG,MAAM,oCAAe,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACN,WAAW,GAAG,MAAM,oCAAe,CAAC,eAAe,EAAE,CAAC;YACxD,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;CACF;AAlDD,oDAkDC"}
1
+ {"version":3,"file":"joint-hirer.repository.js","sourceRoot":"","sources":["../../../../src/components/joint-hirer/joint-hirer.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,wEAAkE;AAElE,MAAa,oBACX,SAAQ,wBAA+B;IAGvC;Q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@@ import { IRentalAttr } from '../../interfaces/rental-attr.interface';
2
2
  import { RentalStatusEnum } from '../../enum/rental-status.enum';
3
3
  import { RentalRepository } from './rental.repository';
4
4
  import { ObjectBase } from '@tomei/general';
5
- import { AuthContext, LoginUser } from '@tomei/sso';
5
+ import { LoginUser } from '@tomei/sso';
6
6
  import { RentalPrice } from '../rental-price/rental-price';
7
7
  import { IRentalFindAllSearchAttr } from '../../interfaces/rental-find-all-search-attr.interface';
8
8
  import { RentalAccountTypeEnum } from '../../enum/account-type.enum';
@@ -11,6 +11,8 @@ import { AgreementRepository } from '../agreement/agreement.repository';
11
11
  import { JointHirerRepository } from '../joint-hirer/joint-hirer.repository';
12
12
  import { AgreementSignatureRepository } from '../agreement-signature/agreement-signature.repository';
13
13
  import { AgreementHistoryRepository } from '../agreement-history/agreement-history.repository';
14
+ import { Document, IAccountSystem } from '@tomei/finance';
15
+ import { AgreementSignatureVerificationMethodEnum } from '../../enum/agreement-signature-verification-method.enum';
14
16
  export declare class Rental extends ObjectBase {
15
17
  ObjectId: string;
16
18
  ObjectName: string;
@@ -28,6 +30,8 @@ export declare class Rental extends ObjectBase {
28
30
  AgreementNo: string;
29
31
  AccountType: RentalAccountTypeEnum;
30
32
  JointHirers: JointHirer[];
33
+ Invoices: Document[];
34
+ Item: any;
31
35
  protected _Status: RentalStatusEnum | string;
32
36
  protected _EscheatmentYN: string;
33
37
  protected _CreatedById: string;
@@ -52,13 +56,18 @@ export declare class Rental extends ObjectBase {
52
56
  static init(dbTransaction?: any, rentalId?: string): Promise<Rental>;
53
57
  create(rentalPrice: RentalPrice, loginUser: LoginUser, jointHirers?: JointHirer[], dbTransaction?: any): Promise<any>;
54
58
  static isItemAvailable(itemId: string, itemType: string, startDateTime: Date, endDateTime: Date, dbTransaction?: any): Promise<boolean>;
55
- static findAll(authContext: AuthContext, dbTransaction: any, page?: number, row?: number, search?: IRentalFindAllSearchAttr): Promise<any>;
59
+ static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, row?: number, search?: IRentalFindAllSearchAttr): Promise<any>;
56
60
  static checkActiveByItemId(loginUser: LoginUser, itemId: string, itemType: string, dbTransaction?: any): Promise<boolean>;
57
61
  setStartDateTime(startDateTime: Date): void;
58
62
  periodEndProcess(loginUser: LoginUser, dbTransaction: any, stockInventory: any): Promise<this>;
59
63
  getCustomerActiveRentals(loginUser: LoginUser, dbTransaction: any, CustomerId: string): Promise<IRentalAttr[]>;
60
64
  getJointHirers(dbTransaction: any): Promise<JointHirer[]>;
61
65
  getCustomerIds(loginUser: LoginUser, dbTransaction: any): Promise<string[]>;
62
- signAgreement(loginUser: LoginUser, party: string, PartyId: string, PartyType: string, dbTransaction: any, statusAfterSign?: RentalStatusEnum | string): Promise<void>;
66
+ signAgreement(loginUser: LoginUser, party: string, PartyId: string, PartyType: string, dbTransaction: any, statusAfterSign?: RentalStatusEnum | string, method?: AgreementSignatureVerificationMethodEnum, justification?: string): Promise<void>;
63
67
  generateAgreement(loginUser: LoginUser, dbTransaction: any, MediaId: string): Promise<void>;
68
+ toJSON(): IRentalAttr;
69
+ getInvoices(loginUser: LoginUser, dbTransaction: any, accountingSystem?: IAccountSystem): Promise<Document[]>;
70
+ getItem(dbTransaction: any): Promise<any>;
71
+ cancel(loginUser: LoginUser, dbTransaction: any, remarks: string): Promise<Rental>;
72
+ update(loginUser: LoginUser, dbTransaction: any, updates: Partial<IRentalAttr>): Promise<Rental>;
64
73
  }