@tomei/rental 0.12.0 → 0.12.2

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 (136) hide show
  1. package/.commitlintrc.json +22 -22
  2. package/.eslintrc +16 -16
  3. package/.eslintrc.js +35 -35
  4. package/.gitlab-ci.yml +16 -16
  5. package/.husky/commit-msg +15 -15
  6. package/.husky/pre-commit +7 -7
  7. package/.prettierrc +4 -4
  8. package/Jenkinsfile +51 -51
  9. package/README.md +8 -8
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +17 -17
  12. package/dist/src/components/agreement/agreement.d.ts +17 -17
  13. package/dist/src/components/agreement/agreement.js +49 -49
  14. package/dist/src/components/agreement/agreement.js.map +1 -1
  15. package/dist/src/components/agreement/agreement.repository.d.ts +8 -8
  16. package/dist/src/components/agreement/agreement.repository.js +66 -66
  17. package/dist/src/components/agreement/agreement.repository.js.map +1 -1
  18. package/dist/src/components/booking/booking.d.ts +46 -46
  19. package/dist/src/components/booking/booking.js +313 -313
  20. package/dist/src/components/booking/booking.js.map +1 -1
  21. package/dist/src/components/booking/booking.repository.d.ts +8 -8
  22. package/dist/src/components/booking/booking.repository.js +66 -66
  23. package/dist/src/components/booking/booking.repository.js.map +1 -1
  24. package/dist/src/components/joint-hirer/joint-hirer.d.ts +23 -23
  25. package/dist/src/components/joint-hirer/joint-hirer.js +105 -105
  26. package/dist/src/components/joint-hirer/joint-hirer.js.map +1 -1
  27. package/dist/src/components/joint-hirer/joint-hirer.repository.d.ts +8 -8
  28. package/dist/src/components/joint-hirer/joint-hirer.repository.js +66 -66
  29. package/dist/src/components/joint-hirer/joint-hirer.repository.js.map +1 -1
  30. package/dist/src/components/rental/rental.d.ts +59 -59
  31. package/dist/src/components/rental/rental.js +618 -618
  32. package/dist/src/components/rental/rental.js.map +1 -1
  33. package/dist/src/components/rental/rental.repository.d.ts +8 -8
  34. package/dist/src/components/rental/rental.repository.js +66 -66
  35. package/dist/src/components/rental/rental.repository.js.map +1 -1
  36. package/dist/src/components/rental-price/rental-price.d.ts +18 -18
  37. package/dist/src/components/rental-price/rental-price.js +78 -78
  38. package/dist/src/components/rental-price/rental-price.js.map +1 -1
  39. package/dist/src/components/rental-price/rental-price.repository.d.ts +8 -8
  40. package/dist/src/components/rental-price/rental-price.repository.js +66 -66
  41. package/dist/src/components/rental-price/rental-price.repository.js.map +1 -1
  42. package/dist/src/database.d.ts +4 -4
  43. package/dist/src/database.js +24 -25
  44. package/dist/src/database.js.map +1 -1
  45. package/dist/src/enum/account-type.enum.d.ts +4 -4
  46. package/dist/src/enum/account-type.enum.js +8 -8
  47. package/dist/src/enum/account-type.enum.js.map +1 -1
  48. package/dist/src/enum/aggrement-status.enum.d.ts +5 -5
  49. package/dist/src/enum/aggrement-status.enum.js +9 -9
  50. package/dist/src/enum/aggrement-status.enum.js.map +1 -1
  51. package/dist/src/enum/booking.enum.d.ts +5 -5
  52. package/dist/src/enum/booking.enum.js +9 -9
  53. package/dist/src/enum/booking.enum.js.map +1 -1
  54. package/dist/src/enum/index.d.ts +5 -5
  55. package/dist/src/enum/index.js +11 -11
  56. package/dist/src/enum/rental-status.enum.d.ts +9 -9
  57. package/dist/src/enum/rental-status.enum.js +13 -13
  58. package/dist/src/enum/rental-status.enum.js.map +1 -1
  59. package/dist/src/index.d.ts +15 -15
  60. package/dist/src/index.js +42 -42
  61. package/dist/src/interfaces/agreement-attr.interface.d.ts +7 -7
  62. package/dist/src/interfaces/agreement-attr.interface.js +2 -2
  63. package/dist/src/interfaces/booking-attr.interface.d.ts +18 -18
  64. package/dist/src/interfaces/booking-attr.interface.js +2 -2
  65. package/dist/src/interfaces/booking-find-all-search-attr.interface.d.ts +12 -12
  66. package/dist/src/interfaces/booking-find-all-search-attr.interface.js +2 -2
  67. package/dist/src/interfaces/index.d.ts +7 -7
  68. package/dist/src/interfaces/index.js +2 -2
  69. package/dist/src/interfaces/joint-hirer-attr.interface.d.ts +10 -10
  70. package/dist/src/interfaces/joint-hirer-attr.interface.js +2 -2
  71. package/dist/src/interfaces/rental-attr.interface.d.ts +24 -24
  72. package/dist/src/interfaces/rental-attr.interface.js +2 -2
  73. package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +10 -10
  74. package/dist/src/interfaces/rental-find-all-search-attr.interface.js +2 -2
  75. package/dist/src/interfaces/rental-price-attr.interface.d.ts +7 -7
  76. package/dist/src/interfaces/rental-price-attr.interface.js +2 -2
  77. package/dist/src/models/agreement.entity.d.ts +10 -10
  78. package/dist/src/models/agreement.entity.js +59 -59
  79. package/dist/src/models/agreement.entity.js.map +1 -1
  80. package/dist/src/models/booking.entity.d.ts +21 -21
  81. package/dist/src/models/booking.entity.js +127 -127
  82. package/dist/src/models/booking.entity.js.map +1 -1
  83. package/dist/src/models/index.d.ts +6 -6
  84. package/dist/src/models/index.js +13 -13
  85. package/dist/src/models/joint-hirer.entity.d.ts +13 -13
  86. package/dist/src/models/joint-hirer.entity.js +78 -78
  87. package/dist/src/models/joint-hirer.entity.js.map +1 -1
  88. package/dist/src/models/rental-price.entity.d.ts +8 -8
  89. package/dist/src/models/rental-price.entity.js +58 -58
  90. package/dist/src/models/rental-price.entity.js.map +1 -1
  91. package/dist/src/models/rental.entity.d.ts +29 -29
  92. package/dist/src/models/rental.entity.js +159 -159
  93. package/dist/src/models/rental.entity.js.map +1 -1
  94. package/dist/tsconfig.tsbuildinfo +1 -1
  95. package/eslint.config.mjs +37 -0
  96. package/jest.config.js +10 -10
  97. package/migrations/booking-table-migration.js +79 -79
  98. package/migrations/joint-hirer-table-migration.js +52 -52
  99. package/migrations/rental-aggrement-table-migration.js +30 -30
  100. package/migrations/rental-price-table-migration.js +32 -32
  101. package/migrations/rental-table-migrations.js +96 -96
  102. package/package.json +78 -75
  103. package/sonar-project.properties +12 -12
  104. package/src/components/agreement/agreement.repository.ts +54 -54
  105. package/src/components/agreement/agreement.ts +49 -49
  106. package/src/components/booking/booking.repository.ts +51 -51
  107. package/src/components/booking/booking.ts +492 -492
  108. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  109. package/src/components/joint-hirer/joint-hirer.ts +1 -1
  110. package/src/components/rental/rental.repository.ts +51 -51
  111. package/src/components/rental/rental.ts +963 -966
  112. package/src/components/rental-price/rental-price.repository.ts +54 -54
  113. package/src/components/rental-price/rental-price.ts +100 -100
  114. package/src/database.ts +27 -27
  115. package/src/enum/account-type.enum.ts +4 -4
  116. package/src/enum/booking.enum.ts +5 -5
  117. package/src/enum/index.ts +11 -11
  118. package/src/enum/rental-status.enum.ts +39 -39
  119. package/src/index.ts +28 -28
  120. package/src/interfaces/agreement-attr.interface.ts +7 -7
  121. package/src/interfaces/booking-attr.interface.ts +19 -19
  122. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  123. package/src/interfaces/index.ts +15 -15
  124. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  125. package/src/interfaces/rental-attr.interface.ts +25 -25
  126. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  127. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  128. package/src/models/agreement.entity.ts +39 -39
  129. package/src/models/booking.entity.ts +105 -105
  130. package/src/models/index.ts +13 -13
  131. package/src/models/joint-hirer.entity.ts +63 -63
  132. package/src/models/rental-price.entity.ts +38 -38
  133. package/src/models/rental.entity.ts +133 -133
  134. package/tsconfig.build.json +5 -5
  135. package/tsconfig.json +23 -23
  136. package/.eslintignore +0 -1
@@ -1,67 +1,67 @@
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.JointHirerRepository = void 0;
13
- const general_1 = require("@tomei/general");
14
- const joint_hirer_entity_1 = require("../../models/joint-hirer.entity");
15
- class JointHirerRepository extends general_1.RepositoryBase {
16
- constructor() {
17
- super(joint_hirer_entity_1.JointHirerModel);
18
- }
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
- });
31
- }
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
- });
47
- }
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;
59
- }
60
- catch (error) {
61
- throw new Error(`An Error occured when retriving : ${error.message}`);
62
- }
63
- });
64
- }
65
- }
66
- exports.JointHirerRepository = JointHirerRepository;
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.JointHirerRepository = void 0;
13
+ const general_1 = require("@tomei/general");
14
+ const joint_hirer_entity_1 = require("../../models/joint-hirer.entity");
15
+ class JointHirerRepository extends general_1.RepositoryBase {
16
+ constructor() {
17
+ super(joint_hirer_entity_1.JointHirerModel);
18
+ }
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
+ });
31
+ }
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
+ });
47
+ }
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;
59
+ }
60
+ catch (error) {
61
+ throw new Error(`An Error occured when retriving : ${error.message}`);
62
+ }
63
+ });
64
+ }
65
+ }
66
+ exports.JointHirerRepository = JointHirerRepository;
67
67
  //# sourceMappingURL=joint-hirer.repository.js.map
@@ -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;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,oCAAe,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAChD,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACtE;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,OAAe,EAAE,aAAmB;;YAC/C,IAAI;gBACF,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,OAAO,EAAE,OAAO;qBACjB;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,oCAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aACxC;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACpE;QACH,CAAC;KAAA;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI;gBACF,IAAI,WAAgB,CAAC;gBACrB,IAAI,OAAO,EAAE;oBACX,WAAW,GAAG,MAAM,oCAAe,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;iBAC9D;qBAAM;oBACL,WAAW,GAAG,MAAM,oCAAe,CAAC,eAAe,EAAE,CAAC;iBACvD;gBACD,OAAO,WAAW,CAAC;aACpB;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACvE;QACH,CAAC;KAAA;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;QACE,KAAK,CAAC,oCAAe,CAAC,CAAC;IACzB,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,oCAAe,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAChD,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,OAAe,EAAE,aAAmB;;YAC/C,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,OAAO,EAAE,OAAO;qBACjB;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,oCAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;KAAA;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI,CAAC;gBACH,IAAI,WAAgB,CAAC;gBACrB,IAAI,OAAO,EAAE,CAAC;oBACZ,WAAW,GAAG,MAAM,oCAAe,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAC/D,CAAC;qBAAM,CAAC;oBACN,WAAW,GAAG,MAAM,oCAAe,CAAC,eAAe,EAAE,CAAC;gBACxD,CAAC;gBACD,OAAO,WAAW,CAAC;YACrB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;KAAA;CACF;AAlDD,oDAkDC"}
@@ -1,59 +1,59 @@
1
- import { IRentalAttr } from '../../interfaces/rental-attr.interface';
2
- import { RentalStatusEnum } from '../../enum/rental-status.enum';
3
- import { RentalRepository } from './rental.repository';
4
- import { ObjectBase } from '@tomei/general';
5
- import { LoginUser } from '@tomei/sso';
6
- import { RentalPrice } from '../rental-price/rental-price';
7
- import { IRentalFindAllSearchAttr } from '../../interfaces/rental-find-all-search-attr.interface';
8
- import { RentalAccountTypeEnum } from '../../enum/account-type.enum';
9
- import { JointHirer } from '../joint-hirer/joint-hirer';
10
- import { AgreementRepository } from '../agreement/agreement.repository';
11
- import { JointHirerRepository } from '../joint-hirer/joint-hirer.repository';
12
- export declare class Rental extends ObjectBase {
13
- ObjectId: string;
14
- ObjectName: string;
15
- ObjectType: string;
16
- TableName: string;
17
- CustomerId: string;
18
- CustomerType: string;
19
- ItemId: string;
20
- ItemType: string;
21
- PriceId: string;
22
- StartDateTime: Date;
23
- EndDateTime: Date;
24
- CancelRemarks: string;
25
- TerminateRemarks: string;
26
- AgreementNo: string;
27
- AccountType: RentalAccountTypeEnum;
28
- JointHirers: JointHirer[];
29
- protected _Status: RentalStatusEnum;
30
- protected _EscheatmentYN: string;
31
- protected _CreatedById: string;
32
- protected _CreatedAt: Date;
33
- protected _UpdatedById: string;
34
- protected _UpdatedAt: Date;
35
- protected static _Repo: RentalRepository;
36
- protected static _AgreementRepo: AgreementRepository;
37
- protected static _JointHirerRepo: JointHirerRepository;
38
- get RentalId(): string;
39
- set RentalId(value: string);
40
- get Status(): RentalStatusEnum;
41
- get EscheatmentYN(): string;
42
- get CreatedById(): string;
43
- get CreatedAt(): Date;
44
- get UpdatedById(): string;
45
- get UpdatedAt(): Date;
46
- private setTerminated;
47
- protected constructor(rentalAttr?: IRentalAttr);
48
- static init(dbTransaction?: any, rentalId?: string): Promise<Rental>;
49
- create(rentalPrice: RentalPrice, loginUser: LoginUser, jointHirers?: JointHirer[], dbTransaction?: any): Promise<any>;
50
- static isItemAvailable(itemId: string, itemType: string, startDateTime: Date, endDateTime: Date, dbTransaction?: any): Promise<boolean>;
51
- static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, row?: number, search?: IRentalFindAllSearchAttr): Promise<any>;
52
- static checkActiveByItemId(loginUser: LoginUser, itemId: string, itemType: string, dbTransaction?: any): Promise<boolean>;
53
- setStartDateTime(startDateTime: Date): void;
54
- periodEndProcess(loginUser: LoginUser, dbTransaction: any, stockInventory: any): Promise<this>;
55
- getCustomerActiveRentals(loginUser: LoginUser, dbTransaction: any, CustomerId: string): Promise<IRentalAttr[]>;
56
- getCustomerIds(loginUser: LoginUser, dbTransaction: any): Promise<string[]>;
57
- signAgreement(loginUser: LoginUser, dbTransaction: any): Promise<void>;
58
- generateAgreement(loginUser: LoginUser, dbTransaction: any, MediaId: string): Promise<void>;
59
- }
1
+ import { IRentalAttr } from '../../interfaces/rental-attr.interface';
2
+ import { RentalStatusEnum } from '../../enum/rental-status.enum';
3
+ import { RentalRepository } from './rental.repository';
4
+ import { ObjectBase } from '@tomei/general';
5
+ import { LoginUser } from '@tomei/sso';
6
+ import { RentalPrice } from '../rental-price/rental-price';
7
+ import { IRentalFindAllSearchAttr } from '../../interfaces/rental-find-all-search-attr.interface';
8
+ import { RentalAccountTypeEnum } from '../../enum/account-type.enum';
9
+ import { JointHirer } from '../joint-hirer/joint-hirer';
10
+ import { AgreementRepository } from '../agreement/agreement.repository';
11
+ import { JointHirerRepository } from '../joint-hirer/joint-hirer.repository';
12
+ export declare class Rental extends ObjectBase {
13
+ ObjectId: string;
14
+ ObjectName: string;
15
+ ObjectType: string;
16
+ TableName: string;
17
+ CustomerId: string;
18
+ CustomerType: string;
19
+ ItemId: string;
20
+ ItemType: string;
21
+ PriceId: string;
22
+ StartDateTime: Date;
23
+ EndDateTime: Date;
24
+ CancelRemarks: string;
25
+ TerminateRemarks: string;
26
+ AgreementNo: string;
27
+ AccountType: RentalAccountTypeEnum;
28
+ JointHirers: JointHirer[];
29
+ protected _Status: RentalStatusEnum;
30
+ protected _EscheatmentYN: string;
31
+ protected _CreatedById: string;
32
+ protected _CreatedAt: Date;
33
+ protected _UpdatedById: string;
34
+ protected _UpdatedAt: Date;
35
+ protected static _Repo: RentalRepository;
36
+ protected static _AgreementRepo: AgreementRepository;
37
+ protected static _JointHirerRepo: JointHirerRepository;
38
+ get RentalId(): string;
39
+ set RentalId(value: string);
40
+ get Status(): RentalStatusEnum;
41
+ get EscheatmentYN(): string;
42
+ get CreatedById(): string;
43
+ get CreatedAt(): Date;
44
+ get UpdatedById(): string;
45
+ get UpdatedAt(): Date;
46
+ private setTerminated;
47
+ protected constructor(rentalAttr?: IRentalAttr);
48
+ static init(dbTransaction?: any, rentalId?: string): Promise<Rental>;
49
+ create(rentalPrice: RentalPrice, loginUser: LoginUser, jointHirers?: JointHirer[], dbTransaction?: any): Promise<any>;
50
+ static isItemAvailable(itemId: string, itemType: string, startDateTime: Date, endDateTime: Date, dbTransaction?: any): Promise<boolean>;
51
+ static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, row?: number, search?: IRentalFindAllSearchAttr): Promise<any>;
52
+ static checkActiveByItemId(loginUser: LoginUser, itemId: string, itemType: string, dbTransaction?: any): Promise<boolean>;
53
+ setStartDateTime(startDateTime: Date): void;
54
+ periodEndProcess(loginUser: LoginUser, dbTransaction: any, stockInventory: any): Promise<this>;
55
+ getCustomerActiveRentals(loginUser: LoginUser, dbTransaction: any, CustomerId: string): Promise<IRentalAttr[]>;
56
+ getCustomerIds(loginUser: LoginUser, dbTransaction: any): Promise<string[]>;
57
+ signAgreement(loginUser: LoginUser, dbTransaction: any): Promise<void>;
58
+ generateAgreement(loginUser: LoginUser, dbTransaction: any, MediaId: string): Promise<void>;
59
+ }