@tomei/rental 0.12.2 → 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 (147) 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/eslint.config.mjs +37 -37
  11. package/jest.config.js +10 -10
  12. package/migrations/booking-table-migration.js +79 -79
  13. package/migrations/joint-hirer-table-migration.js +52 -52
  14. package/migrations/rental-aggrement-table-migration.js +30 -30
  15. package/migrations/rental-price-table-migration.js +32 -32
  16. package/migrations/rental-table-migrations.js +96 -96
  17. package/package.json +78 -78
  18. package/sonar-project.properties +12 -12
  19. package/src/components/agreement/agreement.repository.ts +54 -54
  20. package/src/components/agreement/agreement.ts +49 -49
  21. package/src/components/booking/booking.repository.ts +51 -51
  22. package/src/components/booking/booking.ts +492 -492
  23. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  24. package/src/components/joint-hirer/joint-hirer.ts +137 -137
  25. package/src/components/rental/rental.repository.ts +51 -51
  26. package/src/components/rental/rental.ts +963 -963
  27. package/src/components/rental-price/rental-price.repository.ts +54 -54
  28. package/src/components/rental-price/rental-price.ts +100 -100
  29. package/src/database.ts +27 -27
  30. package/src/enum/account-type.enum.ts +4 -4
  31. package/src/enum/booking.enum.ts +5 -5
  32. package/src/enum/index.ts +11 -11
  33. package/src/enum/rental-status.enum.ts +39 -39
  34. package/src/index.ts +28 -28
  35. package/src/interfaces/agreement-attr.interface.ts +7 -7
  36. package/src/interfaces/booking-attr.interface.ts +19 -19
  37. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  38. package/src/interfaces/index.ts +15 -15
  39. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  40. package/src/interfaces/rental-attr.interface.ts +25 -25
  41. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  42. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  43. package/src/models/agreement.entity.ts +39 -39
  44. package/src/models/booking.entity.ts +105 -105
  45. package/src/models/index.ts +13 -13
  46. package/src/models/joint-hirer.entity.ts +63 -63
  47. package/src/models/rental-price.entity.ts +38 -38
  48. package/src/models/rental.entity.ts +133 -133
  49. package/tsconfig.build.json +5 -5
  50. package/tsconfig.json +23 -23
  51. package/dist/index.d.ts +0 -1
  52. package/dist/index.js +0 -18
  53. package/dist/index.js.map +0 -1
  54. package/dist/src/components/agreement/agreement.d.ts +0 -17
  55. package/dist/src/components/agreement/agreement.js +0 -50
  56. package/dist/src/components/agreement/agreement.js.map +0 -1
  57. package/dist/src/components/agreement/agreement.repository.d.ts +0 -8
  58. package/dist/src/components/agreement/agreement.repository.js +0 -67
  59. package/dist/src/components/agreement/agreement.repository.js.map +0 -1
  60. package/dist/src/components/booking/booking.d.ts +0 -46
  61. package/dist/src/components/booking/booking.js +0 -314
  62. package/dist/src/components/booking/booking.js.map +0 -1
  63. package/dist/src/components/booking/booking.repository.d.ts +0 -8
  64. package/dist/src/components/booking/booking.repository.js +0 -67
  65. package/dist/src/components/booking/booking.repository.js.map +0 -1
  66. package/dist/src/components/joint-hirer/joint-hirer.d.ts +0 -23
  67. package/dist/src/components/joint-hirer/joint-hirer.js +0 -106
  68. package/dist/src/components/joint-hirer/joint-hirer.js.map +0 -1
  69. package/dist/src/components/joint-hirer/joint-hirer.repository.d.ts +0 -8
  70. package/dist/src/components/joint-hirer/joint-hirer.repository.js +0 -67
  71. package/dist/src/components/joint-hirer/joint-hirer.repository.js.map +0 -1
  72. package/dist/src/components/rental/rental.d.ts +0 -59
  73. package/dist/src/components/rental/rental.js +0 -619
  74. package/dist/src/components/rental/rental.js.map +0 -1
  75. package/dist/src/components/rental/rental.repository.d.ts +0 -8
  76. package/dist/src/components/rental/rental.repository.js +0 -67
  77. package/dist/src/components/rental/rental.repository.js.map +0 -1
  78. package/dist/src/components/rental-price/rental-price.d.ts +0 -18
  79. package/dist/src/components/rental-price/rental-price.js +0 -79
  80. package/dist/src/components/rental-price/rental-price.js.map +0 -1
  81. package/dist/src/components/rental-price/rental-price.repository.d.ts +0 -8
  82. package/dist/src/components/rental-price/rental-price.repository.js +0 -67
  83. package/dist/src/components/rental-price/rental-price.repository.js.map +0 -1
  84. package/dist/src/database.d.ts +0 -4
  85. package/dist/src/database.js +0 -25
  86. package/dist/src/database.js.map +0 -1
  87. package/dist/src/enum/account-type.enum.d.ts +0 -4
  88. package/dist/src/enum/account-type.enum.js +0 -9
  89. package/dist/src/enum/account-type.enum.js.map +0 -1
  90. package/dist/src/enum/aggrement-status.enum.d.ts +0 -5
  91. package/dist/src/enum/aggrement-status.enum.js +0 -10
  92. package/dist/src/enum/aggrement-status.enum.js.map +0 -1
  93. package/dist/src/enum/booking.enum.d.ts +0 -5
  94. package/dist/src/enum/booking.enum.js +0 -10
  95. package/dist/src/enum/booking.enum.js.map +0 -1
  96. package/dist/src/enum/index.d.ts +0 -5
  97. package/dist/src/enum/index.js +0 -12
  98. package/dist/src/enum/index.js.map +0 -1
  99. package/dist/src/enum/rental-status.enum.d.ts +0 -9
  100. package/dist/src/enum/rental-status.enum.js +0 -14
  101. package/dist/src/enum/rental-status.enum.js.map +0 -1
  102. package/dist/src/index.d.ts +0 -15
  103. package/dist/src/index.js +0 -43
  104. package/dist/src/index.js.map +0 -1
  105. package/dist/src/interfaces/agreement-attr.interface.d.ts +0 -7
  106. package/dist/src/interfaces/agreement-attr.interface.js +0 -3
  107. package/dist/src/interfaces/agreement-attr.interface.js.map +0 -1
  108. package/dist/src/interfaces/booking-attr.interface.d.ts +0 -18
  109. package/dist/src/interfaces/booking-attr.interface.js +0 -3
  110. package/dist/src/interfaces/booking-attr.interface.js.map +0 -1
  111. package/dist/src/interfaces/booking-find-all-search-attr.interface.d.ts +0 -12
  112. package/dist/src/interfaces/booking-find-all-search-attr.interface.js +0 -3
  113. package/dist/src/interfaces/booking-find-all-search-attr.interface.js.map +0 -1
  114. package/dist/src/interfaces/index.d.ts +0 -7
  115. package/dist/src/interfaces/index.js +0 -3
  116. package/dist/src/interfaces/index.js.map +0 -1
  117. package/dist/src/interfaces/joint-hirer-attr.interface.d.ts +0 -10
  118. package/dist/src/interfaces/joint-hirer-attr.interface.js +0 -3
  119. package/dist/src/interfaces/joint-hirer-attr.interface.js.map +0 -1
  120. package/dist/src/interfaces/rental-attr.interface.d.ts +0 -24
  121. package/dist/src/interfaces/rental-attr.interface.js +0 -3
  122. package/dist/src/interfaces/rental-attr.interface.js.map +0 -1
  123. package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +0 -10
  124. package/dist/src/interfaces/rental-find-all-search-attr.interface.js +0 -3
  125. package/dist/src/interfaces/rental-find-all-search-attr.interface.js.map +0 -1
  126. package/dist/src/interfaces/rental-price-attr.interface.d.ts +0 -7
  127. package/dist/src/interfaces/rental-price-attr.interface.js +0 -3
  128. package/dist/src/interfaces/rental-price-attr.interface.js.map +0 -1
  129. package/dist/src/models/agreement.entity.d.ts +0 -10
  130. package/dist/src/models/agreement.entity.js +0 -60
  131. package/dist/src/models/agreement.entity.js.map +0 -1
  132. package/dist/src/models/booking.entity.d.ts +0 -21
  133. package/dist/src/models/booking.entity.js +0 -128
  134. package/dist/src/models/booking.entity.js.map +0 -1
  135. package/dist/src/models/index.d.ts +0 -6
  136. package/dist/src/models/index.js +0 -14
  137. package/dist/src/models/index.js.map +0 -1
  138. package/dist/src/models/joint-hirer.entity.d.ts +0 -13
  139. package/dist/src/models/joint-hirer.entity.js +0 -79
  140. package/dist/src/models/joint-hirer.entity.js.map +0 -1
  141. package/dist/src/models/rental-price.entity.d.ts +0 -8
  142. package/dist/src/models/rental-price.entity.js +0 -59
  143. package/dist/src/models/rental-price.entity.js.map +0 -1
  144. package/dist/src/models/rental.entity.d.ts +0 -29
  145. package/dist/src/models/rental.entity.js +0 -160
  146. package/dist/src/models/rental.entity.js.map +0 -1
  147. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,133 +1,133 @@
1
- import {
2
- Column,
3
- DataType,
4
- Table,
5
- Model,
6
- ForeignKey,
7
- BelongsTo,
8
- CreatedAt,
9
- UpdatedAt,
10
- HasMany,
11
- } from 'sequelize-typescript';
12
- import { RentalPriceModel } from './rental-price.entity';
13
- import { RentalStatusEnum } from '../enum/rental-status.enum';
14
- import { JointHirerModel } from './joint-hirer.entity';
15
- import { RentalAccountTypeEnum } from '../enum/account-type.enum';
16
- import { AgreementModel } from './agreement.entity';
17
-
18
- @Table({
19
- tableName: 'rental_Rental',
20
- })
21
- export class RentalModel extends Model {
22
- @Column({
23
- primaryKey: true,
24
- allowNull: false,
25
- type: DataType.STRING(30),
26
- })
27
- RentalId: string;
28
-
29
- @Column({
30
- allowNull: false,
31
- type: DataType.STRING(30),
32
- })
33
- CustomerId: string;
34
-
35
- @Column({
36
- allowNull: false,
37
- type: DataType.STRING(30),
38
- })
39
- CustomerType: string;
40
-
41
- @Column({
42
- allowNull: false,
43
- type: DataType.STRING(30),
44
- })
45
- ItemId: string;
46
-
47
- @Column({
48
- allowNull: false,
49
- type: DataType.STRING(30),
50
- })
51
- ItemType: string;
52
-
53
- @ForeignKey(() => RentalPriceModel)
54
- @Column({
55
- allowNull: false,
56
- type: DataType.STRING(30),
57
- })
58
- PriceId: string;
59
-
60
- @Column({
61
- allowNull: false,
62
- type: DataType.DATE,
63
- })
64
- StartDateTime: Date;
65
-
66
- @Column({
67
- allowNull: false,
68
- type: DataType.DATE,
69
- })
70
- EndDateTime: Date;
71
-
72
- @Column({
73
- allowNull: false,
74
- type: DataType.STRING(50),
75
- })
76
- Status: RentalStatusEnum;
77
-
78
- @Column({
79
- type: DataType.STRING(3000),
80
- })
81
- CancelRemarks: string;
82
-
83
- @Column({
84
- type: DataType.STRING(3000),
85
- })
86
- TerminateRemarks: string;
87
-
88
- @Column({
89
- type: DataType.CHAR(1),
90
- })
91
- EscheatmentYN: string;
92
-
93
- @ForeignKey(() => AgreementModel)
94
- @Column({
95
- allowNull: false,
96
- unique: true,
97
- type: DataType.STRING(30),
98
- })
99
- AgreementNo: string;
100
-
101
- @Column({
102
- allowNull: false,
103
- type: DataType.STRING(10),
104
- })
105
- AccountType: RentalAccountTypeEnum;
106
-
107
- @Column({
108
- allowNull: false,
109
- type: DataType.STRING(30),
110
- })
111
- CreatedById: string;
112
-
113
- @CreatedAt
114
- CreatedAt: Date;
115
-
116
- @Column({
117
- allowNull: false,
118
- type: DataType.STRING(30),
119
- })
120
- UpdatedById: string;
121
-
122
- @UpdatedAt
123
- UpdatedAt: Date;
124
-
125
- @BelongsTo(() => RentalPriceModel)
126
- RentalPrice: RentalPriceModel;
127
-
128
- @BelongsTo(() => AgreementModel)
129
- Agreement: AgreementModel;
130
-
131
- @HasMany(() => JointHirerModel)
132
- JointHirers: JointHirerModel[];
133
- }
1
+ import {
2
+ Column,
3
+ DataType,
4
+ Table,
5
+ Model,
6
+ ForeignKey,
7
+ BelongsTo,
8
+ CreatedAt,
9
+ UpdatedAt,
10
+ HasMany,
11
+ } from 'sequelize-typescript';
12
+ import { RentalPriceModel } from './rental-price.entity';
13
+ import { RentalStatusEnum } from '../enum/rental-status.enum';
14
+ import { JointHirerModel } from './joint-hirer.entity';
15
+ import { RentalAccountTypeEnum } from '../enum/account-type.enum';
16
+ import { AgreementModel } from './agreement.entity';
17
+
18
+ @Table({
19
+ tableName: 'rental_Rental',
20
+ })
21
+ export class RentalModel extends Model {
22
+ @Column({
23
+ primaryKey: true,
24
+ allowNull: false,
25
+ type: DataType.STRING(30),
26
+ })
27
+ RentalId: string;
28
+
29
+ @Column({
30
+ allowNull: false,
31
+ type: DataType.STRING(30),
32
+ })
33
+ CustomerId: string;
34
+
35
+ @Column({
36
+ allowNull: false,
37
+ type: DataType.STRING(30),
38
+ })
39
+ CustomerType: string;
40
+
41
+ @Column({
42
+ allowNull: false,
43
+ type: DataType.STRING(30),
44
+ })
45
+ ItemId: string;
46
+
47
+ @Column({
48
+ allowNull: false,
49
+ type: DataType.STRING(30),
50
+ })
51
+ ItemType: string;
52
+
53
+ @ForeignKey(() => RentalPriceModel)
54
+ @Column({
55
+ allowNull: false,
56
+ type: DataType.STRING(30),
57
+ })
58
+ PriceId: string;
59
+
60
+ @Column({
61
+ allowNull: false,
62
+ type: DataType.DATE,
63
+ })
64
+ StartDateTime: Date;
65
+
66
+ @Column({
67
+ allowNull: false,
68
+ type: DataType.DATE,
69
+ })
70
+ EndDateTime: Date;
71
+
72
+ @Column({
73
+ allowNull: false,
74
+ type: DataType.STRING(50),
75
+ })
76
+ Status: RentalStatusEnum;
77
+
78
+ @Column({
79
+ type: DataType.STRING(3000),
80
+ })
81
+ CancelRemarks: string;
82
+
83
+ @Column({
84
+ type: DataType.STRING(3000),
85
+ })
86
+ TerminateRemarks: string;
87
+
88
+ @Column({
89
+ type: DataType.CHAR(1),
90
+ })
91
+ EscheatmentYN: string;
92
+
93
+ @ForeignKey(() => AgreementModel)
94
+ @Column({
95
+ allowNull: false,
96
+ unique: true,
97
+ type: DataType.STRING(30),
98
+ })
99
+ AgreementNo: string;
100
+
101
+ @Column({
102
+ allowNull: false,
103
+ type: DataType.STRING(10),
104
+ })
105
+ AccountType: RentalAccountTypeEnum;
106
+
107
+ @Column({
108
+ allowNull: false,
109
+ type: DataType.STRING(30),
110
+ })
111
+ CreatedById: string;
112
+
113
+ @CreatedAt
114
+ CreatedAt: Date;
115
+
116
+ @Column({
117
+ allowNull: false,
118
+ type: DataType.STRING(30),
119
+ })
120
+ UpdatedById: string;
121
+
122
+ @UpdatedAt
123
+ UpdatedAt: Date;
124
+
125
+ @BelongsTo(() => RentalPriceModel)
126
+ RentalPrice: RentalPriceModel;
127
+
128
+ @BelongsTo(() => AgreementModel)
129
+ Agreement: AgreementModel;
130
+
131
+ @HasMany(() => JointHirerModel)
132
+ JointHirers: JointHirerModel[];
133
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": ["**/*.ts"],
4
- "exclude": ["node_modules", "__tests__", "dist", "**/*spec.ts"]
5
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["**/*.ts"],
4
+ "exclude": ["node_modules", "__tests__", "dist", "**/*spec.ts"]
5
+ }
6
6
 
package/tsconfig.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "removeComments": true,
6
- "emitDecoratorMetadata": true,
7
- "experimentalDecorators": true,
8
- "allowSyntheticDefaultImports": true,
9
- "moduleResolution": "node",
10
- "target": "es6",
11
- "sourceMap": true,
12
- "outDir": "dist",
13
- "baseUrl": "./src",
14
- "rootDir": "./",
15
- "incremental": true,
16
- "skipLibCheck": true,
17
- "noImplicitAny": false,
18
- "strictBindCallApply": false,
19
- "forceConsistentCasingInFileNames": false,
20
- "noFallthroughCasesInSwitch": false,
21
- "strictNullChecks": false,
22
- },
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "declaration": true,
5
+ "removeComments": true,
6
+ "emitDecoratorMetadata": true,
7
+ "experimentalDecorators": true,
8
+ "allowSyntheticDefaultImports": true,
9
+ "moduleResolution": "node",
10
+ "target": "es6",
11
+ "sourceMap": true,
12
+ "outDir": "dist",
13
+ "baseUrl": "./src",
14
+ "rootDir": "./",
15
+ "incremental": true,
16
+ "skipLibCheck": true,
17
+ "noImplicitAny": false,
18
+ "strictBindCallApply": false,
19
+ "forceConsistentCasingInFileNames": false,
20
+ "noFallthroughCasesInSwitch": false,
21
+ "strictNullChecks": false,
22
+ },
23
+ }
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './src';
package/dist/index.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src"), exports);
18
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB"}
@@ -1,17 +0,0 @@
1
- import { ObjectBase } from '@tomei/general';
2
- import { IAgreementAttr } from '../../interfaces/agreement-attr.interface';
3
- import { AggrementStatusEnum } from '../../enum/aggrement-status.enum';
4
- export declare class Agreement extends ObjectBase {
5
- ObjectId: string;
6
- ObjectName: string;
7
- ObjectType: string;
8
- TableName: string;
9
- Status: AggrementStatusEnum;
10
- DateSigned: Date;
11
- MediaId: string;
12
- private static _Repo;
13
- get AgreementNo(): string;
14
- set AgreementNo(value: string);
15
- protected constructor(agreementAttr?: IAgreementAttr);
16
- static init(agreementNo?: string, dbTransaction?: any): Promise<Agreement>;
17
- }
@@ -1,50 +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.Agreement = void 0;
13
- const general_1 = require("@tomei/general");
14
- const agreement_repository_1 = require("./agreement.repository");
15
- class Agreement extends general_1.ObjectBase {
16
- get AgreementNo() {
17
- return this.ObjectId;
18
- }
19
- set AgreementNo(value) {
20
- this.ObjectId = value;
21
- }
22
- constructor(agreementAttr) {
23
- super();
24
- this.ObjectType = 'Agreement';
25
- this.TableName = 'rental_Agreement';
26
- if (agreementAttr) {
27
- this.ObjectId = agreementAttr.AgreementNo;
28
- this.Status = agreementAttr.Status;
29
- this.DateSigned = agreementAttr.DateSigned;
30
- this.MediaId = agreementAttr.MediaId;
31
- }
32
- }
33
- static init(agreementNo, dbTransaction) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- try {
36
- if (agreementNo) {
37
- const agreement = yield this._Repo.findByPk(agreementNo, dbTransaction);
38
- return new Agreement(agreement === null || agreement === void 0 ? void 0 : agreement.get({ plain: true }));
39
- }
40
- return new Agreement();
41
- }
42
- catch (error) {
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.Agreement = Agreement;
49
- Agreement._Repo = new agreement_repository_1.AgreementRepository();
50
- //# sourceMappingURL=agreement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agreement.js","sourceRoot":"","sources":["../../../../src/components/agreement/agreement.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA4C;AAE5C,iEAA6D;AAG7D,MAAa,SAAU,SAAQ,oBAAU;IAWvC,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,WAAW,CAAC,KAAa;QAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,YAAsB,aAA8B;QAClD,KAAK,EAAE,CAAC;QAjBV,eAAU,GAAW,WAAW,CAAC;QACjC,cAAS,GAAG,kBAAkB,CAAC;QAiB7B,IAAI,aAAa,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,WAAW,CAAC;YAC1C,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;YACnC,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;YAC3C,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;QACvC,CAAC;IACH,CAAC;IAEM,MAAM,CAAO,IAAI,CACtB,WAAoB,EACpB,aAAmB;;YAEnB,IAAI,CAAC;gBACH,IAAI,WAAW,EAAE,CAAC;oBAChB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;oBACxE,OAAO,IAAI,SAAS,CAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACxD,CAAC;gBACD,OAAO,IAAI,SAAS,EAAE,CAAC;YACzB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;;AA1CH,8BA2CC;AAlCgB,eAAK,GAAG,IAAI,0CAAmB,EAAE,AAA5B,CAA6B"}
@@ -1,8 +0,0 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import { AgreementModel } from '../../models/agreement.entity';
3
- export declare class AgreementRepository extends RepositoryBase<AgreementModel> implements IRepositoryBase<AgreementModel> {
4
- constructor();
5
- findByPk(id: string, transaction?: any): Promise<AgreementModel | null>;
6
- delete(AgreementNo: string, dbTransaction?: any): Promise<void>;
7
- findAndCountAll(options?: any): Promise<any>;
8
- }
@@ -1,67 +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.AgreementRepository = void 0;
13
- const general_1 = require("@tomei/general");
14
- const agreement_entity_1 = require("../../models/agreement.entity");
15
- class AgreementRepository extends general_1.RepositoryBase {
16
- constructor() {
17
- super(agreement_entity_1.AgreementModel);
18
- }
19
- findByPk(id, transaction) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- const result = yield agreement_entity_1.AgreementModel.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(AgreementNo, dbTransaction) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- try {
35
- const options = {
36
- where: {
37
- AgreementNo,
38
- },
39
- transaction: dbTransaction,
40
- };
41
- yield agreement_entity_1.AgreementModel.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 Agreements;
52
- if (options) {
53
- Agreements = yield agreement_entity_1.AgreementModel.findAndCountAll(options);
54
- }
55
- else {
56
- Agreements = yield agreement_entity_1.AgreementModel.findAndCountAll();
57
- }
58
- return Agreements;
59
- }
60
- catch (error) {
61
- throw new Error(`An Error occured when retriving : ${error.message}`);
62
- }
63
- });
64
- }
65
- }
66
- exports.AgreementRepository = AgreementRepository;
67
- //# sourceMappingURL=agreement.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agreement.repository.js","sourceRoot":"","sources":["../../../../src/components/agreement/agreement.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,oEAA+D;AAE/D,MAAa,mBACX,SAAQ,wBAA8B;IAGtC;QACE,KAAK,CAAC,iCAAc,CAAC,CAAC;IACxB,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,iCAAc,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAC/C,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,WAAmB,EAAE,aAAmB;;YACnD,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,WAAW;qBACZ;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,iCAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,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,UAAe,CAAC;gBACpB,IAAI,OAAO,EAAE,CAAC;oBACZ,UAAU,GAAG,MAAM,iCAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAC7D,CAAC;qBAAM,CAAC;oBACN,UAAU,GAAG,MAAM,iCAAc,CAAC,eAAe,EAAE,CAAC;gBACtD,CAAC;gBACD,OAAO,UAAU,CAAC;YACpB,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,kDAkDC"}
@@ -1,46 +0,0 @@
1
- import { ObjectBase } from '@tomei/general';
2
- import { BookingStatusEnum } from '../../enum/booking.enum';
3
- import { IBookingAttr } from '../../interfaces/booking-attr.interface';
4
- import { BookingRepository } from './booking.repository';
5
- import { LoginUser } from '@tomei/sso';
6
- import { RentalPrice } from '../rental-price/rental-price';
7
- import { WhereOptions } from 'sequelize';
8
- import { IBookingFindAllSearchAttr } from '../../interfaces/booking-find-all-search-attr.interface';
9
- export declare class Booking extends ObjectBase {
10
- ObjectId: string;
11
- ObjectName: string;
12
- ObjectType: string;
13
- TableName: string;
14
- CustomerId: string;
15
- CustomerType: string;
16
- ItemId: string;
17
- ItemType: string;
18
- PriceId: string;
19
- protected _ScheduledStartDateTime: Date;
20
- protected _ScheduledEndDateTime: Date;
21
- BookingFee: number;
22
- Status: BookingStatusEnum;
23
- CancelRemarks: string;
24
- protected _CreatedById: string;
25
- protected _CreatedAt: Date;
26
- protected _UpdatedById: string;
27
- protected _UpdatedAt: Date;
28
- protected static _Repo: BookingRepository;
29
- get BookingNo(): string;
30
- set BookingNo(value: string);
31
- get CreatedById(): string;
32
- get CreatedAt(): Date;
33
- get UpdatedById(): string;
34
- get UpdatedAt(): Date;
35
- get ScheduledStartDateTime(): Date;
36
- get ScheduledEndDateTime(): Date;
37
- setScheduledStartDateTime(datetime: Date): Promise<void>;
38
- setScheduledEndDateTime(datetime: Date): Promise<void>;
39
- protected constructor(bookingAttr?: IBookingAttr);
40
- static init(dbTransaction?: any, bookingNo?: string): Promise<Booking>;
41
- create(dbTransaction: any, loginUser: LoginUser, rentalPrice: RentalPrice): Promise<this>;
42
- static isBookingItemAvailable(dbTransaction: any, itemId: string, itemType: string, startDateTime: Date, endDateTime: Date): Promise<boolean>;
43
- static findAll(dbTransaction: any, page?: number, row?: number, search?: IBookingFindAllSearchAttr): Promise<any>;
44
- static findOne(loginUser: LoginUser, dbTransaction: any, searchOptions: WhereOptions): Promise<Booking>;
45
- static updateLeadToCustomer(loginUser: LoginUser, dbTransaction: any, LeadId: string, CustomerId: string): Promise<void>;
46
- }