@tomei/rental 0.12.0 → 0.12.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.
Files changed (108) hide show
  1. package/eslint.config.mjs +37 -0
  2. package/migrations/booking-table-migration.js +1 -1
  3. package/migrations/joint-hirer-table-migration.js +1 -1
  4. package/migrations/rental-aggrement-table-migration.js +1 -1
  5. package/migrations/rental-price-table-migration.js +1 -1
  6. package/migrations/rental-table-migrations.js +1 -1
  7. package/package.json +33 -30
  8. package/src/components/booking/booking.ts +1 -1
  9. package/src/components/joint-hirer/joint-hirer.ts +137 -137
  10. package/src/components/rental/rental.ts +7 -10
  11. package/.eslintignore +0 -1
  12. package/dist/index.d.ts +0 -1
  13. package/dist/index.js +0 -18
  14. package/dist/index.js.map +0 -1
  15. package/dist/src/components/agreement/agreement.d.ts +0 -17
  16. package/dist/src/components/agreement/agreement.js +0 -50
  17. package/dist/src/components/agreement/agreement.js.map +0 -1
  18. package/dist/src/components/agreement/agreement.repository.d.ts +0 -8
  19. package/dist/src/components/agreement/agreement.repository.js +0 -67
  20. package/dist/src/components/agreement/agreement.repository.js.map +0 -1
  21. package/dist/src/components/booking/booking.d.ts +0 -46
  22. package/dist/src/components/booking/booking.js +0 -314
  23. package/dist/src/components/booking/booking.js.map +0 -1
  24. package/dist/src/components/booking/booking.repository.d.ts +0 -8
  25. package/dist/src/components/booking/booking.repository.js +0 -67
  26. package/dist/src/components/booking/booking.repository.js.map +0 -1
  27. package/dist/src/components/joint-hirer/joint-hirer.d.ts +0 -23
  28. package/dist/src/components/joint-hirer/joint-hirer.js +0 -106
  29. package/dist/src/components/joint-hirer/joint-hirer.js.map +0 -1
  30. package/dist/src/components/joint-hirer/joint-hirer.repository.d.ts +0 -8
  31. package/dist/src/components/joint-hirer/joint-hirer.repository.js +0 -67
  32. package/dist/src/components/joint-hirer/joint-hirer.repository.js.map +0 -1
  33. package/dist/src/components/rental/rental.d.ts +0 -59
  34. package/dist/src/components/rental/rental.js +0 -619
  35. package/dist/src/components/rental/rental.js.map +0 -1
  36. package/dist/src/components/rental/rental.repository.d.ts +0 -8
  37. package/dist/src/components/rental/rental.repository.js +0 -67
  38. package/dist/src/components/rental/rental.repository.js.map +0 -1
  39. package/dist/src/components/rental-price/rental-price.d.ts +0 -18
  40. package/dist/src/components/rental-price/rental-price.js +0 -79
  41. package/dist/src/components/rental-price/rental-price.js.map +0 -1
  42. package/dist/src/components/rental-price/rental-price.repository.d.ts +0 -8
  43. package/dist/src/components/rental-price/rental-price.repository.js +0 -67
  44. package/dist/src/components/rental-price/rental-price.repository.js.map +0 -1
  45. package/dist/src/database.d.ts +0 -4
  46. package/dist/src/database.js +0 -26
  47. package/dist/src/database.js.map +0 -1
  48. package/dist/src/enum/account-type.enum.d.ts +0 -4
  49. package/dist/src/enum/account-type.enum.js +0 -9
  50. package/dist/src/enum/account-type.enum.js.map +0 -1
  51. package/dist/src/enum/aggrement-status.enum.d.ts +0 -5
  52. package/dist/src/enum/aggrement-status.enum.js +0 -10
  53. package/dist/src/enum/aggrement-status.enum.js.map +0 -1
  54. package/dist/src/enum/booking.enum.d.ts +0 -5
  55. package/dist/src/enum/booking.enum.js +0 -10
  56. package/dist/src/enum/booking.enum.js.map +0 -1
  57. package/dist/src/enum/index.d.ts +0 -5
  58. package/dist/src/enum/index.js +0 -12
  59. package/dist/src/enum/index.js.map +0 -1
  60. package/dist/src/enum/rental-status.enum.d.ts +0 -9
  61. package/dist/src/enum/rental-status.enum.js +0 -14
  62. package/dist/src/enum/rental-status.enum.js.map +0 -1
  63. package/dist/src/index.d.ts +0 -15
  64. package/dist/src/index.js +0 -43
  65. package/dist/src/index.js.map +0 -1
  66. package/dist/src/interfaces/agreement-attr.interface.d.ts +0 -7
  67. package/dist/src/interfaces/agreement-attr.interface.js +0 -3
  68. package/dist/src/interfaces/agreement-attr.interface.js.map +0 -1
  69. package/dist/src/interfaces/booking-attr.interface.d.ts +0 -18
  70. package/dist/src/interfaces/booking-attr.interface.js +0 -3
  71. package/dist/src/interfaces/booking-attr.interface.js.map +0 -1
  72. package/dist/src/interfaces/booking-find-all-search-attr.interface.d.ts +0 -12
  73. package/dist/src/interfaces/booking-find-all-search-attr.interface.js +0 -3
  74. package/dist/src/interfaces/booking-find-all-search-attr.interface.js.map +0 -1
  75. package/dist/src/interfaces/index.d.ts +0 -7
  76. package/dist/src/interfaces/index.js +0 -3
  77. package/dist/src/interfaces/index.js.map +0 -1
  78. package/dist/src/interfaces/joint-hirer-attr.interface.d.ts +0 -10
  79. package/dist/src/interfaces/joint-hirer-attr.interface.js +0 -3
  80. package/dist/src/interfaces/joint-hirer-attr.interface.js.map +0 -1
  81. package/dist/src/interfaces/rental-attr.interface.d.ts +0 -24
  82. package/dist/src/interfaces/rental-attr.interface.js +0 -3
  83. package/dist/src/interfaces/rental-attr.interface.js.map +0 -1
  84. package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +0 -10
  85. package/dist/src/interfaces/rental-find-all-search-attr.interface.js +0 -3
  86. package/dist/src/interfaces/rental-find-all-search-attr.interface.js.map +0 -1
  87. package/dist/src/interfaces/rental-price-attr.interface.d.ts +0 -7
  88. package/dist/src/interfaces/rental-price-attr.interface.js +0 -3
  89. package/dist/src/interfaces/rental-price-attr.interface.js.map +0 -1
  90. package/dist/src/models/agreement.entity.d.ts +0 -10
  91. package/dist/src/models/agreement.entity.js +0 -60
  92. package/dist/src/models/agreement.entity.js.map +0 -1
  93. package/dist/src/models/booking.entity.d.ts +0 -21
  94. package/dist/src/models/booking.entity.js +0 -128
  95. package/dist/src/models/booking.entity.js.map +0 -1
  96. package/dist/src/models/index.d.ts +0 -6
  97. package/dist/src/models/index.js +0 -14
  98. package/dist/src/models/index.js.map +0 -1
  99. package/dist/src/models/joint-hirer.entity.d.ts +0 -13
  100. package/dist/src/models/joint-hirer.entity.js +0 -79
  101. package/dist/src/models/joint-hirer.entity.js.map +0 -1
  102. package/dist/src/models/rental-price.entity.d.ts +0 -8
  103. package/dist/src/models/rental-price.entity.js +0 -59
  104. package/dist/src/models/rental-price.entity.js.map +0 -1
  105. package/dist/src/models/rental.entity.d.ts +0 -29
  106. package/dist/src/models/rental.entity.js +0 -160
  107. package/dist/src/models/rental.entity.js.map +0 -1
  108. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,619 +0,0 @@
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
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Rental = void 0;
13
- const rental_status_enum_1 = require("../../enum/rental-status.enum");
14
- const rental_repository_1 = require("./rental.repository");
15
- const general_1 = require("@tomei/general");
16
- const config_1 = require("@tomei/config");
17
- const sequelize_1 = require("sequelize");
18
- const activity_history_1 = require("@tomei/activity-history");
19
- const joint_hirer_entity_1 = require("../../models/joint-hirer.entity");
20
- const agreement_repository_1 = require("../agreement/agreement.repository");
21
- const rentalDb = require("../../database");
22
- const rental_entity_1 = require("../../models/rental.entity");
23
- const joint_hirer_repository_1 = require("../joint-hirer/joint-hirer.repository");
24
- const models_1 = require("../../models");
25
- const agreement_1 = require("../agreement/agreement");
26
- const aggrement_status_enum_1 = require("../../enum/aggrement-status.enum");
27
- class Rental extends general_1.ObjectBase {
28
- get RentalId() {
29
- return this.ObjectId;
30
- }
31
- set RentalId(value) {
32
- this.ObjectId = value;
33
- }
34
- get Status() {
35
- return this._Status;
36
- }
37
- get EscheatmentYN() {
38
- return this._EscheatmentYN;
39
- }
40
- get CreatedById() {
41
- return this._CreatedById;
42
- }
43
- get CreatedAt() {
44
- return this._CreatedAt;
45
- }
46
- get UpdatedById() {
47
- return this._UpdatedById;
48
- }
49
- get UpdatedAt() {
50
- return this._UpdatedAt;
51
- }
52
- setTerminated() {
53
- this._Status = rental_status_enum_1.RentalStatusEnum.TERMINATED;
54
- }
55
- constructor(rentalAttr) {
56
- super();
57
- this.ObjectType = 'Rental';
58
- this.JointHirers = [];
59
- this._EscheatmentYN = 'N';
60
- if (rentalAttr) {
61
- this.RentalId = rentalAttr.RentalId;
62
- this.CustomerId = rentalAttr.CustomerId;
63
- this.CustomerType = rentalAttr.CustomerType;
64
- this.ItemId = rentalAttr.ItemId;
65
- this.ItemType = rentalAttr.ItemType;
66
- this.PriceId = rentalAttr.PriceId;
67
- this.StartDateTime = rentalAttr.StartDateTime;
68
- this.EndDateTime = rentalAttr.EndDateTime;
69
- this.CancelRemarks = rentalAttr.CancelRemarks;
70
- this.TerminateRemarks = rentalAttr.TerminateRemarks;
71
- this.AgreementNo = rentalAttr.AgreementNo;
72
- this.AccountType = rentalAttr.AccountType;
73
- this._Status = rentalAttr.Status;
74
- this._EscheatmentYN = rentalAttr.EscheatmentYN;
75
- this._CreatedById = rentalAttr.CreatedById;
76
- this._CreatedAt = rentalAttr.CreatedAt;
77
- this._UpdatedById = rentalAttr.UpdatedById;
78
- this._UpdatedAt = rentalAttr.UpdatedAt;
79
- }
80
- }
81
- static init(dbTransaction, rentalId) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- try {
84
- if (rentalId) {
85
- const rental = yield Rental._Repo.findByPk(rentalId, dbTransaction);
86
- if (rental) {
87
- return new Rental(rental);
88
- }
89
- else {
90
- throw new general_1.ClassError('Rental', 'RentalErrMsg00', 'Rental Not Found');
91
- }
92
- }
93
- return new Rental();
94
- }
95
- catch (error) {
96
- throw new general_1.ClassError('Rental', 'RentalErrMsg00', 'Failed To Initialize Price');
97
- }
98
- });
99
- }
100
- create(rentalPrice, loginUser, jointHirers, dbTransaction) {
101
- return __awaiter(this, void 0, void 0, function* () {
102
- try {
103
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
104
- const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Rental - Create');
105
- if (!isPrivileged) {
106
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'Rental - Create' privilege.");
107
- }
108
- const isItemAvailable = yield Rental.isItemAvailable(this.ItemId, this.ItemType, this.StartDateTime, this.EndDateTime, dbTransaction);
109
- if (!isItemAvailable) {
110
- throw new general_1.ClassError('Rental', 'RentalErrMsg02', 'Rental Item is not available at current date.');
111
- }
112
- yield Rental._AgreementRepo.create({
113
- AgreementNo: this.AgreementNo,
114
- Status: 'Not Generated',
115
- }, {
116
- transaction: dbTransaction,
117
- });
118
- if (!rentalPrice.PriceId) {
119
- const rentalPriceData = yield rentalPrice.create(loginUser, dbTransaction);
120
- this.PriceId = rentalPriceData.PriceId;
121
- }
122
- else {
123
- this.PriceId = rentalPrice.PriceId;
124
- }
125
- this.RentalId = this.createId();
126
- this._Status = rental_status_enum_1.RentalStatusEnum.PENDING_SIGNING;
127
- this._CreatedById = loginUser.ObjectId;
128
- this._UpdatedById = loginUser.ObjectId;
129
- this._CreatedAt = new Date();
130
- this._UpdatedAt = new Date();
131
- const data = {
132
- RentalId: this.RentalId,
133
- CustomerId: this.CustomerId,
134
- CustomerType: this.CustomerType,
135
- ItemId: this.ItemId,
136
- ItemType: this.ItemType,
137
- PriceId: this.PriceId,
138
- StartDateTime: this.StartDateTime,
139
- EndDateTime: this.EndDateTime,
140
- CancelRemarks: this.CancelRemarks,
141
- TerminateRemarks: this.TerminateRemarks,
142
- AgreementNo: this.AgreementNo,
143
- AccountType: this.AccountType,
144
- Status: this.Status,
145
- EscheatmentYN: this.EscheatmentYN,
146
- CreatedById: this.CreatedById,
147
- CreatedAt: this.CreatedAt,
148
- UpdatedById: this.UpdatedById,
149
- UpdatedAt: this.UpdatedAt,
150
- };
151
- yield Rental._Repo.create(data, {
152
- transaction: dbTransaction,
153
- });
154
- if (jointHirers) {
155
- for (let i = 0; i < jointHirers.length; i++) {
156
- jointHirers[i].RentalId = this.RentalId;
157
- yield jointHirers[i].create(loginUser, dbTransaction);
158
- this.JointHirers.push(jointHirers[i]);
159
- }
160
- }
161
- const activity = new activity_history_1.Activity();
162
- activity.ActivityId = activity.createId();
163
- activity.Action = activity_history_1.ActionEnum.ADD;
164
- activity.Description = 'Add Rental';
165
- activity.EntityType = 'Rental';
166
- activity.EntityId = this.RentalId;
167
- activity.EntityValueBefore = JSON.stringify({});
168
- activity.EntityValueAfter = JSON.stringify(data);
169
- yield activity.create(loginUser.ObjectId, dbTransaction);
170
- return this;
171
- }
172
- catch (error) {
173
- throw error;
174
- }
175
- });
176
- }
177
- static isItemAvailable(itemId, itemType, startDateTime, endDateTime, dbTransaction) {
178
- return __awaiter(this, void 0, void 0, function* () {
179
- try {
180
- const item = yield Rental._Repo.findOne({
181
- where: {
182
- ItemId: itemId,
183
- ItemType: itemType,
184
- StartDateTime: {
185
- [sequelize_1.Op.lte]: endDateTime,
186
- },
187
- EndDateTime: {
188
- [sequelize_1.Op.gte]: startDateTime,
189
- },
190
- },
191
- transaction: dbTransaction,
192
- });
193
- if (item) {
194
- return false;
195
- }
196
- else {
197
- return true;
198
- }
199
- }
200
- catch (error) {
201
- throw error;
202
- }
203
- });
204
- }
205
- static findAll(loginUser, dbTransaction, page, row, search) {
206
- var _a;
207
- return __awaiter(this, void 0, void 0, function* () {
208
- try {
209
- const systemCode = yield config_1.ApplicationConfig.getComponentConfigValue('system-code');
210
- const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Rental - View');
211
- if (!isPrivileged) {
212
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'Rental - View' privilege.");
213
- }
214
- const queryObj = {};
215
- let options = {
216
- transaction: dbTransaction,
217
- order: [['CreatedAt', 'DESC']],
218
- };
219
- if (page && row) {
220
- options = Object.assign(Object.assign({}, options), { limit: row, offset: row * (page - 1) });
221
- }
222
- if (search) {
223
- Object.entries(search).forEach(([key, value]) => {
224
- if (key === 'StartDateTime') {
225
- queryObj[key] = {
226
- [sequelize_1.Op.gte]: value,
227
- };
228
- }
229
- else if (key === 'EndDateTime') {
230
- queryObj[key] = {
231
- [sequelize_1.Op.lte]: value,
232
- };
233
- }
234
- else if (key === 'CustomerId') {
235
- queryObj[key] = {
236
- [sequelize_1.Op.substring]: value,
237
- };
238
- options.include = [
239
- {
240
- model: joint_hirer_entity_1.JointHirerModel,
241
- required: false,
242
- where: {
243
- CustomerId: {
244
- [sequelize_1.Op.substring]: value,
245
- },
246
- },
247
- },
248
- ];
249
- }
250
- else {
251
- queryObj[key] = {
252
- [sequelize_1.Op.substring]: value,
253
- };
254
- }
255
- });
256
- if (((_a = options === null || options === void 0 ? void 0 : options.include) === null || _a === void 0 ? void 0 : _a.length) > 1) {
257
- options.include.push({
258
- model: models_1.AgreementModel,
259
- required: false,
260
- });
261
- }
262
- else {
263
- options.include = [
264
- {
265
- model: models_1.AgreementModel,
266
- required: false,
267
- },
268
- ];
269
- }
270
- options = Object.assign(Object.assign({}, options), { where: queryObj });
271
- }
272
- return yield Rental._Repo.findAndCountAll(options);
273
- }
274
- catch (err) {
275
- throw err;
276
- }
277
- });
278
- }
279
- static checkActiveByItemId(loginUser, itemId, itemType, dbTransaction) {
280
- return __awaiter(this, void 0, void 0, function* () {
281
- try {
282
- const systemCode = yield config_1.ApplicationConfig.getComponentConfigValue('system-code');
283
- const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Rental - View');
284
- if (!isPrivileged) {
285
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'Rental - View' privilege.");
286
- }
287
- const queryObj = {
288
- ItemId: itemId,
289
- ItemType: itemType,
290
- Status: rental_status_enum_1.RentalStatusEnum.ACTIVE,
291
- };
292
- const options = {
293
- transaction: dbTransaction,
294
- where: queryObj,
295
- };
296
- const rental = yield Rental._Repo.findOne(options);
297
- if (rental) {
298
- return true;
299
- }
300
- else {
301
- return false;
302
- }
303
- }
304
- catch (err) {
305
- throw err;
306
- }
307
- });
308
- }
309
- setStartDateTime(startDateTime) {
310
- const startDateTimeObject = new Date(startDateTime);
311
- startDateTimeObject.setHours(0, 0, 0, 0);
312
- if (startDateTimeObject < new Date(new Date().setHours(0, 0, 0, 0))) {
313
- throw new general_1.ClassError('Rental', 'RentalErrMsg02', 'StartDateTime cannot be a past datetime.');
314
- }
315
- if (this.EndDateTime && startDateTimeObject > this.EndDateTime) {
316
- throw new general_1.ClassError('Rental', 'RentalErrMsg03', 'StartDateTime cannot be more than EndDateTime.');
317
- }
318
- if (startDateTimeObject > new Date(new Date().setHours(0, 0, 0, 0))) {
319
- this._Status = rental_status_enum_1.RentalStatusEnum.RESERVED;
320
- }
321
- else {
322
- this._Status = rental_status_enum_1.RentalStatusEnum.ACTIVE;
323
- }
324
- }
325
- periodEndProcess(loginUser, dbTransaction, stockInventory) {
326
- return __awaiter(this, void 0, void 0, function* () {
327
- try {
328
- const systemCode = yield config_1.ApplicationConfig.getComponentConfigValue('system-code');
329
- const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Rental – PeriodEndProcess');
330
- if (!isPrivileged) {
331
- throw new general_1.ClassError('Rental', 'RentalErrMsg04', "You do not have 'Rental - PeriodEndProcess' privilege.");
332
- }
333
- if (this.AgreementNo === undefined || this.AgreementNo === null) {
334
- throw new general_1.ClassError('Rental', 'RentalErrMsg05', 'Rental must be existing rental.');
335
- }
336
- if (this.EndDateTime === new Date(new Date().setHours(0, 0, 0, 0))) {
337
- throw new general_1.ClassError('Rental', 'RentalErrMsg06', 'Rental period is not ending today.');
338
- }
339
- yield stockInventory.setAvailable(loginUser, dbTransaction);
340
- const entityValueBefore = {
341
- RentalId: this.RentalId,
342
- CustomerId: this.CustomerId,
343
- CustomerType: this.CustomerType,
344
- ItemId: this.ItemId,
345
- ItemType: this.ItemType,
346
- PriceId: this.PriceId,
347
- StartDateTime: this.StartDateTime,
348
- EndDateTime: this.EndDateTime,
349
- CancelRemarks: this.CancelRemarks,
350
- TerminateRemarks: this.TerminateRemarks,
351
- AgreementNo: this.AgreementNo,
352
- AccountType: this.AccountType,
353
- Status: this.Status,
354
- EscheatmentYN: this.EscheatmentYN,
355
- CreatedById: this.CreatedById,
356
- CreatedAt: this.CreatedAt,
357
- UpdatedById: this.UpdatedById,
358
- UpdatedAt: this.UpdatedAt,
359
- };
360
- this.setTerminated();
361
- this._UpdatedById = loginUser.ObjectId;
362
- this._UpdatedAt = new Date();
363
- const entityValueAfter = {
364
- RentalId: this.RentalId,
365
- CustomerId: this.CustomerId,
366
- CustomerType: this.CustomerType,
367
- ItemId: this.ItemId,
368
- ItemType: this.ItemType,
369
- PriceId: this.PriceId,
370
- StartDateTime: this.StartDateTime,
371
- EndDateTime: this.EndDateTime,
372
- CancelRemarks: this.CancelRemarks,
373
- TerminateRemarks: this.TerminateRemarks,
374
- AgreementNo: this.AgreementNo,
375
- AccountType: this.AccountType,
376
- Status: this.Status,
377
- EscheatmentYN: this.EscheatmentYN,
378
- CreatedById: this.CreatedById,
379
- CreatedAt: this.CreatedAt,
380
- UpdatedById: this.UpdatedById,
381
- UpdatedAt: this.UpdatedAt,
382
- };
383
- const activity = new activity_history_1.Activity();
384
- activity.ActivityId = activity.createId();
385
- activity.Action = activity_history_1.ActionEnum.UPDATE;
386
- activity.Description = 'Set Rental as Terminated';
387
- activity.EntityType = 'Rental';
388
- activity.EntityId = this.RentalId;
389
- activity.EntityValueBefore = JSON.stringify(entityValueBefore);
390
- activity.EntityValueAfter = JSON.stringify(entityValueAfter);
391
- yield activity.create(loginUser.ObjectId, dbTransaction);
392
- return this;
393
- }
394
- catch (err) {
395
- throw err;
396
- }
397
- });
398
- }
399
- getCustomerActiveRentals(loginUser, dbTransaction, CustomerId) {
400
- return __awaiter(this, void 0, void 0, function* () {
401
- try {
402
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
403
- const isPrivileged = loginUser.checkPrivileges(systemCode, 'RENTAL_VIEW');
404
- if (!isPrivileged) {
405
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'Rental - View' privilege.");
406
- }
407
- const query = `
408
- SELECT
409
- r.*
410
- FROM
411
- rental_Rental r
412
- LEFT JOIN
413
- rental_JointHirer jh ON r.RentalId = jh.RentalId
414
- WHERE
415
- r.Status = 'Active'
416
- AND (
417
- r.CustomerId = '${CustomerId}'
418
- OR jh.CustomerId = '${CustomerId}'
419
- )
420
- GROUP BY
421
- r.RentalId
422
- `;
423
- const db = rentalDb.getConnection();
424
- const result = yield db.query(query, {
425
- type: sequelize_1.QueryTypes.SELECT,
426
- transaction: dbTransaction,
427
- model: rental_entity_1.RentalModel,
428
- mapToModel: true,
429
- });
430
- const records = result.map((record) => {
431
- return {
432
- RentalId: record.RentalId,
433
- CustomerId: record.CustomerId,
434
- CustomerType: record.CustomerType,
435
- ItemId: record.ItemId,
436
- ItemType: record.ItemType,
437
- PriceId: record.PriceId,
438
- StartDateTime: record.StartDateTime,
439
- EndDateTime: record.EndDateTime,
440
- CancelRemarks: record.CancelRemarks,
441
- TerminateRemarks: record.TerminateRemarks,
442
- AgreementNo: record.AgreementNo,
443
- AccountType: record.AccountType,
444
- Status: record.Status,
445
- EscheatmentYN: record.EscheatmentYN,
446
- CreatedById: record.CreatedById,
447
- CreatedAt: record.CreatedAt,
448
- UpdatedById: record.UpdatedById,
449
- UpdatedAt: record.UpdatedAt,
450
- };
451
- });
452
- return records;
453
- }
454
- catch (error) {
455
- throw error;
456
- }
457
- });
458
- }
459
- getCustomerIds(loginUser, dbTransaction) {
460
- return __awaiter(this, void 0, void 0, function* () {
461
- try {
462
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
463
- const isPrivileged = loginUser.checkPrivileges(systemCode, 'RENTAL_VIEW');
464
- if (!isPrivileged) {
465
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'Rental - View' privilege.");
466
- }
467
- if (!this.RentalId) {
468
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', 'RentalId is missing');
469
- }
470
- const options = {
471
- where: {
472
- RentalId: this.RentalId,
473
- },
474
- transaction: dbTransaction,
475
- };
476
- const joinHirers = yield Rental._JointHirerRepo.findAll(options);
477
- const customerIds = [this.CustomerId];
478
- for (let i = 0; i < joinHirers.length; i++) {
479
- const jointHirer = joinHirers[i];
480
- customerIds.push(jointHirer.CustomerId);
481
- }
482
- return customerIds;
483
- }
484
- catch (error) {
485
- throw error;
486
- }
487
- });
488
- }
489
- signAgreement(loginUser, dbTransaction) {
490
- return __awaiter(this, void 0, void 0, function* () {
491
- try {
492
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
493
- const isPrivileged = loginUser.checkPrivileges(systemCode, 'RENTAL_SIGN');
494
- if (!isPrivileged) {
495
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'RENTAL_SIGN' privilege.");
496
- }
497
- const agreement = yield agreement_1.Agreement.init(this.AgreementNo, dbTransaction);
498
- if (this.Status !== rental_status_enum_1.RentalStatusEnum.PENDING_SIGNING &&
499
- agreement.Status !== aggrement_status_enum_1.AggrementStatusEnum.GENERATED) {
500
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', 'Rental is not ready to be signed yet.');
501
- }
502
- const entityValueAgreementBefore = {
503
- AgreementNo: agreement.AgreementNo,
504
- Status: agreement.Status,
505
- DateSigned: agreement.DateSigned,
506
- };
507
- const payload = {
508
- DateSigned: new Date(),
509
- Status: aggrement_status_enum_1.AggrementStatusEnum.SIGNED,
510
- };
511
- yield Rental._AgreementRepo.update(payload, {
512
- where: {
513
- AgreementNo: this.AgreementNo,
514
- },
515
- transaction: dbTransaction,
516
- });
517
- const entityValueAgreementAfter = Object.assign({ entityValueAgreementBefore }, payload);
518
- const activity = new activity_history_1.Activity();
519
- activity.ActivityId = activity.createId();
520
- activity.Action = activity_history_1.ActionEnum.UPDATE;
521
- activity.Description = 'Update agreement';
522
- activity.EntityType = 'RentalAgreement';
523
- activity.EntityId = this.AgreementNo;
524
- activity.EntityValueBefore = JSON.stringify(entityValueAgreementBefore);
525
- activity.EntityValueAfter = JSON.stringify(entityValueAgreementAfter);
526
- yield activity.create(loginUser.ObjectId, dbTransaction);
527
- const entityValueRentalBefore = {
528
- RentalId: this.RentalId,
529
- CustomerId: this.CustomerId,
530
- CustomerType: this.CustomerType,
531
- ItemId: this.ItemId,
532
- ItemType: this.ItemType,
533
- PriceId: this.PriceId,
534
- StartDateTime: this.StartDateTime,
535
- EndDateTime: this.EndDateTime,
536
- CancelRemarks: this.CancelRemarks,
537
- TerminateRemarks: this.TerminateRemarks,
538
- AgreementNo: this.AgreementNo,
539
- AccountType: this.AccountType,
540
- Status: this.Status,
541
- EscheatmentYN: this.EscheatmentYN,
542
- CreatedById: this.CreatedById,
543
- CreatedAt: this.CreatedAt,
544
- UpdatedById: this.UpdatedById,
545
- UpdatedAt: this.UpdatedAt,
546
- };
547
- const payloadRental = {
548
- Status: rental_status_enum_1.RentalStatusEnum.PENDING_KEY_COLLECTION,
549
- UpdatedById: loginUser.ObjectId,
550
- UpdatedAt: new Date(),
551
- };
552
- yield Rental._Repo.update(payloadRental, {
553
- where: {
554
- RentalId: this.RentalId,
555
- },
556
- transaction: dbTransaction,
557
- });
558
- const entityValueRentalAfter = Object.assign({ entityValueRentalBefore }, payloadRental);
559
- const rentalActivity = new activity_history_1.Activity();
560
- rentalActivity.ActivityId = activity.createId();
561
- rentalActivity.Action = activity_history_1.ActionEnum.UPDATE;
562
- rentalActivity.Description = 'Sign rental agreement';
563
- rentalActivity.EntityType = 'Rental';
564
- rentalActivity.EntityId = this.RentalId;
565
- rentalActivity.EntityValueBefore = JSON.stringify(entityValueRentalBefore);
566
- rentalActivity.EntityValueAfter = JSON.stringify(entityValueRentalAfter);
567
- yield rentalActivity.create(loginUser.ObjectId, dbTransaction);
568
- }
569
- catch (error) {
570
- throw error;
571
- }
572
- });
573
- }
574
- generateAgreement(loginUser, dbTransaction, MediaId) {
575
- return __awaiter(this, void 0, void 0, function* () {
576
- try {
577
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
578
- const isPrivileged = loginUser.checkPrivileges(systemCode, 'RENTAL_AGREEMENT_CREATE');
579
- if (!isPrivileged) {
580
- throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'RENTAL_AGREEMENT_CREATE' privilege.");
581
- }
582
- const agreement = yield agreement_1.Agreement.init(this.AgreementNo, dbTransaction);
583
- if (!MediaId) {
584
- throw new general_1.ClassError('Rental', 'RentalErrMsg0X', 'MediaId is required.');
585
- }
586
- const EntityValueBefore = agreement;
587
- agreement.Status = aggrement_status_enum_1.AggrementStatusEnum.GENERATED;
588
- agreement.MediaId = MediaId;
589
- yield Rental._AgreementRepo.update({
590
- Status: agreement.Status,
591
- MediaId: agreement.MediaId,
592
- }, {
593
- where: {
594
- AgreementNo: this.AgreementNo,
595
- },
596
- transaction: dbTransaction,
597
- });
598
- const EntityValueAfter = agreement;
599
- const activity = new activity_history_1.Activity();
600
- activity.ActivityId = activity.createId();
601
- activity.Action = activity_history_1.ActionEnum.UPDATE;
602
- activity.Description = 'Generate agreement.';
603
- activity.EntityType = 'RentalAgreement';
604
- activity.EntityId = this.AgreementNo;
605
- activity.EntityValueBefore = JSON.stringify(EntityValueBefore);
606
- activity.EntityValueAfter = JSON.stringify(EntityValueAfter);
607
- yield activity.create(loginUser.ObjectId, dbTransaction);
608
- }
609
- catch (error) {
610
- throw error;
611
- }
612
- });
613
- }
614
- }
615
- exports.Rental = Rental;
616
- Rental._Repo = new rental_repository_1.RentalRepository();
617
- Rental._AgreementRepo = new agreement_repository_1.AgreementRepository();
618
- Rental._JointHirerRepo = new joint_hirer_repository_1.JointHirerRepository();
619
- //# sourceMappingURL=rental.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rental.js","sourceRoot":"","sources":["../../../../src/components/rental/rental.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sEAAiE;AACjE,2DAAuD;AAC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,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBAK7D,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;aAC1D;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;;AA/6BH,wBAg7BC;AAz5BkB,YAAK,GAAG,IAAI,oCAAgB,EAAE,CAAC;AAC/B,qBAAc,GAAG,IAAI,0CAAmB,EAAE,CAAC;AAC3C,sBAAe,GAAG,IAAI,6CAAoB,EAAE,CAAC"}
@@ -1,8 +0,0 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import { RentalModel } from '../../models/rental.entity';
3
- export declare class RentalRepository extends RepositoryBase<RentalModel> implements IRepositoryBase<RentalModel> {
4
- constructor();
5
- findByPk(id: string, transaction?: any): Promise<RentalModel | null>;
6
- delete(RentalId: string, dbTransaction?: any): Promise<void>;
7
- findAndCountAll(options?: any): Promise<any>;
8
- }