@tomei/rental 0.16.2 → 0.16.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 (64) 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.js +7 -7
  9. package/dist/src/components/rental/rental.js +15 -15
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/eslint.config.mjs +58 -58
  12. package/jest.config.js +10 -10
  13. package/migrations/booking-table-migration.js +79 -79
  14. package/migrations/hirer-signature-table-migration.js +64 -64
  15. package/migrations/joint-hirer-table-migration.js +52 -52
  16. package/migrations/rental-aggreement-history-migration.js +41 -41
  17. package/migrations/rental-aggrement-table-migration.js +30 -30
  18. package/migrations/rental-price-table-migration.js +32 -32
  19. package/migrations/rental-table-migrations.js +96 -96
  20. package/package.json +75 -75
  21. package/sonar-project.properties +12 -12
  22. package/src/components/agreement/agreement.repository.ts +54 -54
  23. package/src/components/agreement/agreement.ts +180 -180
  24. package/src/components/agreement-history/agreement-history.repository.ts +54 -54
  25. package/src/components/agreement-history/agreement-history.ts +57 -57
  26. package/src/components/booking/booking.repository.ts +51 -51
  27. package/src/components/booking/booking.ts +492 -492
  28. package/src/components/hirer-signature/hirer-signature.repository.ts +54 -54
  29. package/src/components/hirer-signature/hirer-signature.ts +140 -140
  30. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  31. package/src/components/joint-hirer/joint-hirer.ts +137 -137
  32. package/src/components/rental/rental.repository.ts +51 -51
  33. package/src/components/rental/rental.ts +1116 -1116
  34. package/src/components/rental-price/rental-price.repository.ts +54 -54
  35. package/src/components/rental-price/rental-price.ts +100 -100
  36. package/src/database.ts +31 -31
  37. package/src/enum/account-type.enum.ts +4 -4
  38. package/src/enum/booking.enum.ts +5 -5
  39. package/src/enum/hirer-signature-status.enum.ts +4 -4
  40. package/src/enum/hirer-type.enum.ts +4 -4
  41. package/src/enum/index.ts +15 -15
  42. package/src/enum/rental-status.enum.ts +39 -39
  43. package/src/index.ts +36 -36
  44. package/src/interfaces/agreement-attr.interface.ts +7 -7
  45. package/src/interfaces/agreement-history-attr.interface.ts +7 -7
  46. package/src/interfaces/booking-attr.interface.ts +19 -19
  47. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  48. package/src/interfaces/hirer-signature-attr.interface.ts +15 -15
  49. package/src/interfaces/index.ts +19 -19
  50. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  51. package/src/interfaces/rental-attr.interface.ts +25 -25
  52. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  53. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  54. package/src/interfaces/response-hirer-signature-attr.interface.ts +15 -15
  55. package/src/models/agreement-history.entity.ts +51 -51
  56. package/src/models/agreement.entity.ts +47 -47
  57. package/src/models/booking.entity.ts +105 -105
  58. package/src/models/hirer-signature.entity.ts +81 -81
  59. package/src/models/index.ts +17 -17
  60. package/src/models/joint-hirer.entity.ts +63 -63
  61. package/src/models/rental-price.entity.ts +38 -38
  62. package/src/models/rental.entity.ts +133 -133
  63. package/tsconfig.build.json +5 -5
  64. package/tsconfig.json +24 -24
@@ -1,81 +1,81 @@
1
- import {
2
- Column,
3
- DataType,
4
- Table,
5
- Model,
6
- ForeignKey,
7
- BelongsTo,
8
- CreatedAt,
9
- UpdatedAt,
10
- } from 'sequelize-typescript';
11
- import { AgreementModel } from './agreement.entity';
12
-
13
- @Table({
14
- tableName: 'rental_HirerSignature',
15
- })
16
- export class HirerSignatureModel extends Model {
17
- @Column({
18
- primaryKey: true,
19
- allowNull: false,
20
- type: DataType.STRING(30),
21
- })
22
- HirerSignatureId: string;
23
-
24
- @ForeignKey(() => AgreementModel)
25
- @Column({
26
- allowNull: false,
27
- type: DataType.STRING(30),
28
- })
29
- AgreementNo: string;
30
-
31
- @Column({
32
- allowNull: false,
33
- type: DataType.STRING(10),
34
- })
35
- HirerType: string;
36
-
37
- @Column({
38
- allowNull: false,
39
- type: DataType.STRING(30),
40
- })
41
- CustomerId: string;
42
-
43
- @Column({
44
- allowNull: false,
45
- type: DataType.STRING(30),
46
- })
47
- CustomerType: string;
48
-
49
- @Column({
50
- allowNull: false,
51
- type: DataType.STRING(10),
52
- })
53
- SignatureStatus: string;
54
-
55
- @Column({
56
- allowNull: false,
57
- type: DataType.DATE,
58
- })
59
- SignedAt: Date;
60
-
61
- @Column({
62
- allowNull: false,
63
- type: DataType.STRING(30),
64
- })
65
- CreatedById: string;
66
-
67
- @CreatedAt
68
- CreatedAt: Date;
69
-
70
- @Column({
71
- allowNull: false,
72
- type: DataType.STRING(30),
73
- })
74
- UpdatedById: string;
75
-
76
- @UpdatedAt
77
- UpdatedAt: Date;
78
-
79
- @BelongsTo(() => AgreementModel)
80
- Agreement: AgreementModel;
81
- }
1
+ import {
2
+ Column,
3
+ DataType,
4
+ Table,
5
+ Model,
6
+ ForeignKey,
7
+ BelongsTo,
8
+ CreatedAt,
9
+ UpdatedAt,
10
+ } from 'sequelize-typescript';
11
+ import { AgreementModel } from './agreement.entity';
12
+
13
+ @Table({
14
+ tableName: 'rental_HirerSignature',
15
+ })
16
+ export class HirerSignatureModel extends Model {
17
+ @Column({
18
+ primaryKey: true,
19
+ allowNull: false,
20
+ type: DataType.STRING(30),
21
+ })
22
+ HirerSignatureId: string;
23
+
24
+ @ForeignKey(() => AgreementModel)
25
+ @Column({
26
+ allowNull: false,
27
+ type: DataType.STRING(30),
28
+ })
29
+ AgreementNo: string;
30
+
31
+ @Column({
32
+ allowNull: false,
33
+ type: DataType.STRING(10),
34
+ })
35
+ HirerType: string;
36
+
37
+ @Column({
38
+ allowNull: false,
39
+ type: DataType.STRING(30),
40
+ })
41
+ CustomerId: string;
42
+
43
+ @Column({
44
+ allowNull: false,
45
+ type: DataType.STRING(30),
46
+ })
47
+ CustomerType: string;
48
+
49
+ @Column({
50
+ allowNull: false,
51
+ type: DataType.STRING(10),
52
+ })
53
+ SignatureStatus: string;
54
+
55
+ @Column({
56
+ allowNull: false,
57
+ type: DataType.DATE,
58
+ })
59
+ SignedAt: Date;
60
+
61
+ @Column({
62
+ allowNull: false,
63
+ type: DataType.STRING(30),
64
+ })
65
+ CreatedById: string;
66
+
67
+ @CreatedAt
68
+ CreatedAt: Date;
69
+
70
+ @Column({
71
+ allowNull: false,
72
+ type: DataType.STRING(30),
73
+ })
74
+ UpdatedById: string;
75
+
76
+ @UpdatedAt
77
+ UpdatedAt: Date;
78
+
79
+ @BelongsTo(() => AgreementModel)
80
+ Agreement: AgreementModel;
81
+ }
@@ -1,17 +1,17 @@
1
- import { RentalModel } from './rental.entity';
2
- import { RentalPriceModel } from './rental-price.entity';
3
- import { BookingModel } from './booking.entity';
4
- import { JointHirerModel } from './joint-hirer.entity';
5
- import { AgreementModel } from './agreement.entity';
6
- import { HirerSignatureModel } from './hirer-signature.entity';
7
- import { AgreementHistoryModel } from './agreement-history.entity';
8
-
9
- export {
10
- RentalModel,
11
- RentalPriceModel,
12
- BookingModel,
13
- JointHirerModel,
14
- AgreementModel,
15
- HirerSignatureModel,
16
- AgreementHistoryModel,
17
- };
1
+ import { RentalModel } from './rental.entity';
2
+ import { RentalPriceModel } from './rental-price.entity';
3
+ import { BookingModel } from './booking.entity';
4
+ import { JointHirerModel } from './joint-hirer.entity';
5
+ import { AgreementModel } from './agreement.entity';
6
+ import { HirerSignatureModel } from './hirer-signature.entity';
7
+ import { AgreementHistoryModel } from './agreement-history.entity';
8
+
9
+ export {
10
+ RentalModel,
11
+ RentalPriceModel,
12
+ BookingModel,
13
+ JointHirerModel,
14
+ AgreementModel,
15
+ HirerSignatureModel,
16
+ AgreementHistoryModel,
17
+ };
@@ -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