@tomei/rental 0.12.4 → 0.13.0

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 (99) hide show
  1. package/.commitlintrc.json +22 -22
  2. package/.gitlab-ci.yml +16 -16
  3. package/.husky/commit-msg +15 -15
  4. package/.husky/pre-commit +7 -7
  5. package/.prettierrc +4 -4
  6. package/Jenkinsfile +51 -51
  7. package/README.md +8 -8
  8. package/dist/src/components/agreement/agreement.d.ts +6 -1
  9. package/dist/src/components/agreement/agreement.js +39 -0
  10. package/dist/src/components/agreement/agreement.js.map +1 -1
  11. package/dist/src/components/hirer-signature/hirer-signature.d.ts +27 -0
  12. package/dist/src/components/hirer-signature/hirer-signature.js +112 -0
  13. package/dist/src/components/hirer-signature/hirer-signature.js.map +1 -0
  14. package/dist/src/components/hirer-signature/hirer-signature.repository.d.ts +8 -0
  15. package/dist/src/components/hirer-signature/hirer-signature.repository.js +67 -0
  16. package/dist/src/components/hirer-signature/hirer-signature.repository.js.map +1 -0
  17. package/dist/src/components/rental/rental.d.ts +3 -1
  18. package/dist/src/components/rental/rental.js +84 -16
  19. package/dist/src/components/rental/rental.js.map +1 -1
  20. package/dist/src/database.js +2 -0
  21. package/dist/src/database.js.map +1 -1
  22. package/dist/src/enum/hirer-signature-status.enum.d.ts +4 -0
  23. package/dist/src/enum/hirer-signature-status.enum.js +9 -0
  24. package/dist/src/enum/hirer-signature-status.enum.js.map +1 -0
  25. package/dist/src/enum/hirer-type.enum.d.ts +4 -0
  26. package/dist/src/enum/hirer-type.enum.js +9 -0
  27. package/dist/src/enum/hirer-type.enum.js.map +1 -0
  28. package/dist/src/enum/index.d.ts +3 -1
  29. package/dist/src/enum/index.js +5 -1
  30. package/dist/src/enum/index.js.map +1 -1
  31. package/dist/src/index.d.ts +3 -1
  32. package/dist/src/index.js +5 -1
  33. package/dist/src/index.js.map +1 -1
  34. package/dist/src/interfaces/hirer-signature-attr.interface.d.ts +14 -0
  35. package/dist/src/interfaces/hirer-signature-attr.interface.js +3 -0
  36. package/dist/src/interfaces/hirer-signature-attr.interface.js.map +1 -0
  37. package/dist/src/interfaces/index.d.ts +3 -1
  38. package/dist/src/interfaces/response-hirer-signature-attr.interface.d.ts +15 -0
  39. package/dist/src/interfaces/response-hirer-signature-attr.interface.js +3 -0
  40. package/dist/src/interfaces/response-hirer-signature-attr.interface.js.map +1 -0
  41. package/dist/src/models/agreement.entity.d.ts +2 -0
  42. package/dist/src/models/agreement.entity.js +5 -0
  43. package/dist/src/models/agreement.entity.js.map +1 -1
  44. package/dist/src/models/hirer-signature.entity.d.ts +16 -0
  45. package/dist/src/models/hirer-signature.entity.js +100 -0
  46. package/dist/src/models/hirer-signature.entity.js.map +1 -0
  47. package/dist/src/models/index.d.ts +2 -1
  48. package/dist/src/models/index.js +3 -1
  49. package/dist/src/models/index.js.map +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/eslint.config.mjs +58 -58
  52. package/jest.config.js +10 -10
  53. package/migrations/booking-table-migration.js +79 -79
  54. package/migrations/hirer-signature-table-migration.js +64 -0
  55. package/migrations/joint-hirer-table-migration.js +52 -52
  56. package/migrations/rental-aggrement-table-migration.js +30 -30
  57. package/migrations/rental-price-table-migration.js +32 -32
  58. package/migrations/rental-table-migrations.js +96 -96
  59. package/package.json +75 -75
  60. package/sonar-project.properties +12 -12
  61. package/src/components/agreement/agreement.repository.ts +54 -54
  62. package/src/components/agreement/agreement.ts +117 -49
  63. package/src/components/booking/booking.repository.ts +51 -51
  64. package/src/components/booking/booking.ts +492 -492
  65. package/src/components/hirer-signature/hirer-signature.repository.ts +54 -0
  66. package/src/components/hirer-signature/hirer-signature.ts +140 -0
  67. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  68. package/src/components/joint-hirer/joint-hirer.ts +137 -137
  69. package/src/components/rental/rental.repository.ts +51 -51
  70. package/src/components/rental/rental.ts +1073 -963
  71. package/src/components/rental-price/rental-price.repository.ts +54 -54
  72. package/src/components/rental-price/rental-price.ts +100 -100
  73. package/src/database.ts +29 -27
  74. package/src/enum/account-type.enum.ts +4 -4
  75. package/src/enum/booking.enum.ts +5 -5
  76. package/src/enum/hirer-signature-status.enum.ts +4 -0
  77. package/src/enum/hirer-type.enum.ts +4 -0
  78. package/src/enum/index.ts +15 -11
  79. package/src/enum/rental-status.enum.ts +39 -39
  80. package/src/index.ts +32 -28
  81. package/src/interfaces/agreement-attr.interface.ts +7 -7
  82. package/src/interfaces/booking-attr.interface.ts +19 -19
  83. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  84. package/src/interfaces/hirer-signature-attr.interface.ts +15 -0
  85. package/src/interfaces/index.ts +19 -15
  86. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  87. package/src/interfaces/rental-attr.interface.ts +25 -25
  88. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  89. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  90. package/src/interfaces/response-hirer-signature-attr.interface.ts +16 -0
  91. package/src/models/agreement.entity.ts +43 -39
  92. package/src/models/booking.entity.ts +105 -105
  93. package/src/models/hirer-signature.entity.ts +81 -0
  94. package/src/models/index.ts +15 -13
  95. package/src/models/joint-hirer.entity.ts +63 -63
  96. package/src/models/rental-price.entity.ts +38 -38
  97. package/src/models/rental.entity.ts +133 -133
  98. package/tsconfig.build.json +5 -5
  99. package/tsconfig.json +24 -24
@@ -1,63 +1,63 @@
1
- import {
2
- Column,
3
- DataType,
4
- Table,
5
- Model,
6
- ForeignKey,
7
- BelongsTo,
8
- CreatedAt,
9
- UpdatedAt,
10
- } from 'sequelize-typescript';
11
- import { RentalModel } from './rental.entity';
12
-
13
- @Table({
14
- tableName: 'rental_JointHirer',
15
- })
16
- export class JointHirerModel extends Model {
17
- @Column({
18
- primaryKey: true,
19
- allowNull: false,
20
- type: DataType.STRING(30),
21
- })
22
- HirerId: string;
23
-
24
- @ForeignKey(() => RentalModel)
25
- @Column({
26
- allowNull: false,
27
- type: DataType.STRING(30),
28
- })
29
- RentalId: string;
30
-
31
- @Column({
32
- allowNull: false,
33
- type: DataType.STRING(30),
34
- })
35
- CustomerId: string;
36
-
37
- @Column({
38
- allowNull: false,
39
- type: DataType.STRING(30),
40
- })
41
- CustomerType: string;
42
-
43
- @Column({
44
- allowNull: false,
45
- type: DataType.STRING(30),
46
- })
47
- CreatedById: string;
48
-
49
- @CreatedAt
50
- CreatedAt: Date;
51
-
52
- @Column({
53
- allowNull: false,
54
- type: DataType.STRING(30),
55
- })
56
- UpdatedById: string;
57
-
58
- @UpdatedAt
59
- UpdatedAt: Date;
60
-
61
- @BelongsTo(() => RentalModel)
62
- RentalPrice: RentalModel;
63
- }
1
+ import {
2
+ Column,
3
+ DataType,
4
+ Table,
5
+ Model,
6
+ ForeignKey,
7
+ BelongsTo,
8
+ CreatedAt,
9
+ UpdatedAt,
10
+ } from 'sequelize-typescript';
11
+ import { RentalModel } from './rental.entity';
12
+
13
+ @Table({
14
+ tableName: 'rental_JointHirer',
15
+ })
16
+ export class JointHirerModel extends Model {
17
+ @Column({
18
+ primaryKey: true,
19
+ allowNull: false,
20
+ type: DataType.STRING(30),
21
+ })
22
+ HirerId: string;
23
+
24
+ @ForeignKey(() => RentalModel)
25
+ @Column({
26
+ allowNull: false,
27
+ type: DataType.STRING(30),
28
+ })
29
+ RentalId: string;
30
+
31
+ @Column({
32
+ allowNull: false,
33
+ type: DataType.STRING(30),
34
+ })
35
+ CustomerId: string;
36
+
37
+ @Column({
38
+ allowNull: false,
39
+ type: DataType.STRING(30),
40
+ })
41
+ CustomerType: string;
42
+
43
+ @Column({
44
+ allowNull: false,
45
+ type: DataType.STRING(30),
46
+ })
47
+ CreatedById: string;
48
+
49
+ @CreatedAt
50
+ CreatedAt: Date;
51
+
52
+ @Column({
53
+ allowNull: false,
54
+ type: DataType.STRING(30),
55
+ })
56
+ UpdatedById: string;
57
+
58
+ @UpdatedAt
59
+ UpdatedAt: Date;
60
+
61
+ @BelongsTo(() => RentalModel)
62
+ RentalPrice: RentalModel;
63
+ }
@@ -1,38 +1,38 @@
1
- import { Column, DataType, Table, Model } from 'sequelize-typescript';
2
-
3
- @Table({
4
- tableName: 'rental_Price',
5
- timestamps: false,
6
- createdAt: false,
7
- updatedAt: false,
8
- })
9
- export class RentalPriceModel extends Model {
10
- @Column({
11
- primaryKey: true,
12
- allowNull: false,
13
- type: DataType.STRING(30),
14
- })
15
- PriceId: string;
16
-
17
- @Column({
18
- allowNull: false,
19
- type: DataType.DECIMAL(10, 2),
20
- })
21
- RetailPrice: number;
22
-
23
- @Column({
24
- allowNull: false,
25
- type: DataType.CHAR(3),
26
- })
27
- Currency: string;
28
-
29
- @Column({
30
- type: DataType.STRING(10),
31
- })
32
- PromoCode: string;
33
-
34
- @Column({
35
- type: DataType.STRING(3000),
36
- })
37
- Remarks: string;
38
- }
1
+ import { Column, DataType, Table, Model } from 'sequelize-typescript';
2
+
3
+ @Table({
4
+ tableName: 'rental_Price',
5
+ timestamps: false,
6
+ createdAt: false,
7
+ updatedAt: false,
8
+ })
9
+ export class RentalPriceModel extends Model {
10
+ @Column({
11
+ primaryKey: true,
12
+ allowNull: false,
13
+ type: DataType.STRING(30),
14
+ })
15
+ PriceId: string;
16
+
17
+ @Column({
18
+ allowNull: false,
19
+ type: DataType.DECIMAL(10, 2),
20
+ })
21
+ RetailPrice: number;
22
+
23
+ @Column({
24
+ allowNull: false,
25
+ type: DataType.CHAR(3),
26
+ })
27
+ Currency: string;
28
+
29
+ @Column({
30
+ type: DataType.STRING(10),
31
+ })
32
+ PromoCode: string;
33
+
34
+ @Column({
35
+ type: DataType.STRING(3000),
36
+ })
37
+ Remarks: string;
38
+ }
@@ -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,24 +1,24 @@
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
- "exclude": ["node_modules", "dist"]
24
- }
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
+ "exclude": ["node_modules", "dist"]
24
+ }