@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,15 +1,19 @@
1
- import { IRentalAttr } from './rental-attr.interface';
2
- import { IRentalPriceAttr } from './rental-price-attr.interface';
3
- import { IRentalFindAllSearchAttr } from './rental-find-all-search-attr.interface';
4
- import { IBookingAttr } from './booking-attr.interface';
5
- import { IAgreementAttr } from './agreement-attr.interface';
6
- import { IBookingFindAllSearchAttr } from './booking-find-all-search-attr.interface';
7
-
8
- export {
9
- IRentalAttr,
10
- IRentalPriceAttr,
11
- IRentalFindAllSearchAttr,
12
- IBookingAttr,
13
- IAgreementAttr,
14
- IBookingFindAllSearchAttr,
15
- };
1
+ import { IRentalAttr } from './rental-attr.interface';
2
+ import { IRentalPriceAttr } from './rental-price-attr.interface';
3
+ import { IRentalFindAllSearchAttr } from './rental-find-all-search-attr.interface';
4
+ import { IBookingAttr } from './booking-attr.interface';
5
+ import { IAgreementAttr } from './agreement-attr.interface';
6
+ import { IBookingFindAllSearchAttr } from './booking-find-all-search-attr.interface';
7
+ import { IHirerSignatureAttr } from './hirer-signature-attr.interface';
8
+ import { IResponseHirerSignature } from './response-hirer-signature-attr.interface';
9
+
10
+ export {
11
+ IRentalAttr,
12
+ IRentalPriceAttr,
13
+ IRentalFindAllSearchAttr,
14
+ IBookingAttr,
15
+ IAgreementAttr,
16
+ IBookingFindAllSearchAttr,
17
+ IHirerSignatureAttr,
18
+ IResponseHirerSignature,
19
+ };
@@ -1,10 +1,10 @@
1
- export interface IJointHirerAttr {
2
- HirerId: string;
3
- RentalId: string;
4
- CustomerId: string;
5
- CustomerType: string;
6
- CreatedById: string;
7
- CreatedAt: Date;
8
- UpdatedById: string;
9
- UpdatedAt: Date;
10
- }
1
+ export interface IJointHirerAttr {
2
+ HirerId: string;
3
+ RentalId: string;
4
+ CustomerId: string;
5
+ CustomerType: string;
6
+ CreatedById: string;
7
+ CreatedAt: Date;
8
+ UpdatedById: string;
9
+ UpdatedAt: Date;
10
+ }
@@ -1,25 +1,25 @@
1
- import { RentalStatusEnum } from '../enum/rental-status.enum';
2
- import { RentalAccountTypeEnum } from '../enum/account-type.enum';
3
- import { IJointHirerAttr } from './joint-hirer-attr.interface';
4
-
5
- export interface IRentalAttr {
6
- RentalId: string;
7
- CustomerId: string;
8
- CustomerType: string;
9
- ItemId: string;
10
- ItemType: string;
11
- PriceId: string;
12
- StartDateTime: Date;
13
- EndDateTime: Date;
14
- CancelRemarks: string;
15
- TerminateRemarks: string;
16
- AgreementNo: string;
17
- AccountType: RentalAccountTypeEnum;
18
- Status: RentalStatusEnum;
19
- EscheatmentYN: string;
20
- CreatedById: string;
21
- CreatedAt: Date;
22
- UpdatedById: string;
23
- UpdatedAt: Date;
24
- JointHirers?: IJointHirerAttr[];
25
- }
1
+ import { RentalStatusEnum } from '../enum/rental-status.enum';
2
+ import { RentalAccountTypeEnum } from '../enum/account-type.enum';
3
+ import { IJointHirerAttr } from './joint-hirer-attr.interface';
4
+
5
+ export interface IRentalAttr {
6
+ RentalId: string;
7
+ CustomerId: string;
8
+ CustomerType: string;
9
+ ItemId: string;
10
+ ItemType: string;
11
+ PriceId: string;
12
+ StartDateTime: Date;
13
+ EndDateTime: Date;
14
+ CancelRemarks: string;
15
+ TerminateRemarks: string;
16
+ AgreementNo: string;
17
+ AccountType: RentalAccountTypeEnum;
18
+ Status: RentalStatusEnum;
19
+ EscheatmentYN: string;
20
+ CreatedById: string;
21
+ CreatedAt: Date;
22
+ UpdatedById: string;
23
+ UpdatedAt: Date;
24
+ JointHirers?: IJointHirerAttr[];
25
+ }
@@ -1,11 +1,11 @@
1
- import { RentalStatusEnum } from '../enum/rental-status.enum';
2
-
3
- export interface IRentalFindAllSearchAttr {
4
- Status?: RentalStatusEnum;
5
- StartDateTime?: Date;
6
- EndDateTime?: Date;
7
- ItemId?: string;
8
- ItemType?: string;
9
- CustomerId?: string;
10
- CustomerType?: string;
11
- }
1
+ import { RentalStatusEnum } from '../enum/rental-status.enum';
2
+
3
+ export interface IRentalFindAllSearchAttr {
4
+ Status?: RentalStatusEnum;
5
+ StartDateTime?: Date;
6
+ EndDateTime?: Date;
7
+ ItemId?: string;
8
+ ItemType?: string;
9
+ CustomerId?: string;
10
+ CustomerType?: string;
11
+ }
@@ -1,7 +1,7 @@
1
- export interface IRentalPriceAttr {
2
- PriceId: string;
3
- RetailPrice: number;
4
- Currency: string;
5
- PromoCode: string;
6
- Remarks: string;
7
- }
1
+ export interface IRentalPriceAttr {
2
+ PriceId: string;
3
+ RetailPrice: number;
4
+ Currency: string;
5
+ PromoCode: string;
6
+ Remarks: string;
7
+ }
@@ -0,0 +1,16 @@
1
+ import { HirerSignatureStatusEnum } from '../enum/hirer-signature-status.enum';
2
+
3
+ export interface IResponseHirerSignature {
4
+ HirerSignatureId: string;
5
+ AgreementNo: string;
6
+ HirerType: string;
7
+ CustomerId: string;
8
+ CustomerName: string;
9
+ CustomerType: string;
10
+ SignatureStatus: HirerSignatureStatusEnum;
11
+ SignedAt: Date;
12
+ CreatedById: string;
13
+ CreatedAt: Date;
14
+ UpdatedById: string;
15
+ UpdatedAt: Date;
16
+ }
@@ -1,39 +1,43 @@
1
- import { Column, DataType, Table, Model, HasMany } from 'sequelize-typescript';
2
- import { RentalModel } from './rental.entity';
3
- import { AggrementStatusEnum } from '../enum/aggrement-status.enum';
4
-
5
- @Table({
6
- tableName: 'rental_Agreement',
7
- createdAt: false,
8
- updatedAt: false,
9
- timestamps: false,
10
- })
11
- export class AgreementModel extends Model {
12
- @Column({
13
- primaryKey: true,
14
- allowNull: false,
15
- type: DataType.STRING(30),
16
- })
17
- AgreementNo: string;
18
-
19
- @Column({
20
- allowNull: false,
21
- type: DataType.STRING(20),
22
- })
23
- Status: AggrementStatusEnum;
24
-
25
- @Column({
26
- allowNull: true,
27
- type: DataType.DATE,
28
- })
29
- DateSigned: Date;
30
-
31
- @Column({
32
- allowNull: true,
33
- type: DataType.STRING(30),
34
- })
35
- MediaId: string;
36
-
37
- @HasMany(() => RentalModel)
38
- Rentals: RentalModel[];
39
- }
1
+ import { Column, DataType, Table, Model, HasMany } from 'sequelize-typescript';
2
+ import { RentalModel } from './rental.entity';
3
+ import { AggrementStatusEnum } from '../enum/aggrement-status.enum';
4
+ import { HirerSignatureModel } from './hirer-signature.entity';
5
+
6
+ @Table({
7
+ tableName: 'rental_Agreement',
8
+ createdAt: false,
9
+ updatedAt: false,
10
+ timestamps: false,
11
+ })
12
+ export class AgreementModel extends Model {
13
+ @Column({
14
+ primaryKey: true,
15
+ allowNull: false,
16
+ type: DataType.STRING(30),
17
+ })
18
+ AgreementNo: string;
19
+
20
+ @Column({
21
+ allowNull: false,
22
+ type: DataType.STRING(20),
23
+ })
24
+ Status: AggrementStatusEnum;
25
+
26
+ @Column({
27
+ allowNull: true,
28
+ type: DataType.DATE,
29
+ })
30
+ DateSigned: Date;
31
+
32
+ @Column({
33
+ allowNull: true,
34
+ type: DataType.STRING(30),
35
+ })
36
+ MediaId: string;
37
+
38
+ @HasMany(() => RentalModel)
39
+ Rentals: RentalModel[];
40
+
41
+ @HasMany(() => HirerSignatureModel)
42
+ HirerSignatures: HirerSignatureModel[];
43
+ }
@@ -1,105 +1,105 @@
1
- import {
2
- Column,
3
- DataType,
4
- Table,
5
- Model,
6
- ForeignKey,
7
- BelongsTo,
8
- CreatedAt,
9
- UpdatedAt,
10
- } from 'sequelize-typescript';
11
- import { RentalPriceModel } from './rental-price.entity';
12
- import { BookingStatusEnum } from '../enum/booking.enum';
13
-
14
- @Table({
15
- tableName: 'booking_Booking',
16
- })
17
- export class BookingModel extends Model {
18
- @Column({
19
- primaryKey: true,
20
- allowNull: false,
21
- type: DataType.STRING(30),
22
- })
23
- BookingNo: string;
24
-
25
- @Column({
26
- allowNull: false,
27
- type: DataType.STRING(30),
28
- })
29
- CustomerId: string;
30
-
31
- @Column({
32
- allowNull: false,
33
- type: DataType.STRING(30),
34
- })
35
- CustomerType: string;
36
-
37
- @Column({
38
- allowNull: false,
39
- type: DataType.STRING(30),
40
- })
41
- ItemId: string;
42
-
43
- @Column({
44
- allowNull: false,
45
- type: DataType.STRING(30),
46
- })
47
- ItemType: string;
48
-
49
- @ForeignKey(() => RentalPriceModel)
50
- @Column({
51
- allowNull: false,
52
- type: DataType.STRING(30),
53
- })
54
- PriceId: string;
55
-
56
- @Column({
57
- allowNull: false,
58
- type: DataType.DATE,
59
- })
60
- ScheduledStartDateTime: Date;
61
-
62
- @Column({
63
- allowNull: false,
64
- type: DataType.DATE,
65
- })
66
- ScheduledEndDateTime: Date;
67
-
68
- @Column({
69
- allowNull: true,
70
- type: DataType.DECIMAL(10, 2),
71
- })
72
- BookingFee: number;
73
-
74
- @Column({
75
- allowNull: false,
76
- type: DataType.STRING(20),
77
- })
78
- Status: BookingStatusEnum;
79
-
80
- @Column({
81
- type: DataType.STRING(3000),
82
- })
83
- CancelRemarks: string;
84
-
85
- @Column({
86
- allowNull: false,
87
- type: DataType.STRING(30),
88
- })
89
- CreatedById: string;
90
-
91
- @CreatedAt
92
- CreatedAt: Date;
93
-
94
- @Column({
95
- allowNull: false,
96
- type: DataType.STRING(30),
97
- })
98
- UpdatedById: string;
99
-
100
- @UpdatedAt
101
- UpdatedAt: Date;
102
-
103
- @BelongsTo(() => RentalPriceModel)
104
- RentalPrice: RentalPriceModel;
105
- }
1
+ import {
2
+ Column,
3
+ DataType,
4
+ Table,
5
+ Model,
6
+ ForeignKey,
7
+ BelongsTo,
8
+ CreatedAt,
9
+ UpdatedAt,
10
+ } from 'sequelize-typescript';
11
+ import { RentalPriceModel } from './rental-price.entity';
12
+ import { BookingStatusEnum } from '../enum/booking.enum';
13
+
14
+ @Table({
15
+ tableName: 'booking_Booking',
16
+ })
17
+ export class BookingModel extends Model {
18
+ @Column({
19
+ primaryKey: true,
20
+ allowNull: false,
21
+ type: DataType.STRING(30),
22
+ })
23
+ BookingNo: string;
24
+
25
+ @Column({
26
+ allowNull: false,
27
+ type: DataType.STRING(30),
28
+ })
29
+ CustomerId: string;
30
+
31
+ @Column({
32
+ allowNull: false,
33
+ type: DataType.STRING(30),
34
+ })
35
+ CustomerType: string;
36
+
37
+ @Column({
38
+ allowNull: false,
39
+ type: DataType.STRING(30),
40
+ })
41
+ ItemId: string;
42
+
43
+ @Column({
44
+ allowNull: false,
45
+ type: DataType.STRING(30),
46
+ })
47
+ ItemType: string;
48
+
49
+ @ForeignKey(() => RentalPriceModel)
50
+ @Column({
51
+ allowNull: false,
52
+ type: DataType.STRING(30),
53
+ })
54
+ PriceId: string;
55
+
56
+ @Column({
57
+ allowNull: false,
58
+ type: DataType.DATE,
59
+ })
60
+ ScheduledStartDateTime: Date;
61
+
62
+ @Column({
63
+ allowNull: false,
64
+ type: DataType.DATE,
65
+ })
66
+ ScheduledEndDateTime: Date;
67
+
68
+ @Column({
69
+ allowNull: true,
70
+ type: DataType.DECIMAL(10, 2),
71
+ })
72
+ BookingFee: number;
73
+
74
+ @Column({
75
+ allowNull: false,
76
+ type: DataType.STRING(20),
77
+ })
78
+ Status: BookingStatusEnum;
79
+
80
+ @Column({
81
+ type: DataType.STRING(3000),
82
+ })
83
+ CancelRemarks: string;
84
+
85
+ @Column({
86
+ allowNull: false,
87
+ type: DataType.STRING(30),
88
+ })
89
+ CreatedById: string;
90
+
91
+ @CreatedAt
92
+ CreatedAt: Date;
93
+
94
+ @Column({
95
+ allowNull: false,
96
+ type: DataType.STRING(30),
97
+ })
98
+ UpdatedById: string;
99
+
100
+ @UpdatedAt
101
+ UpdatedAt: Date;
102
+
103
+ @BelongsTo(() => RentalPriceModel)
104
+ RentalPrice: RentalPriceModel;
105
+ }
@@ -0,0 +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,13 +1,15 @@
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
-
7
- export {
8
- RentalModel,
9
- RentalPriceModel,
10
- BookingModel,
11
- JointHirerModel,
12
- AgreementModel,
13
- };
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
+
8
+ export {
9
+ RentalModel,
10
+ RentalPriceModel,
11
+ BookingModel,
12
+ JointHirerModel,
13
+ AgreementModel,
14
+ HirerSignatureModel,
15
+ };