@tomei/rental 0.10.3 → 0.11.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 (59) 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/src/components/agreement/agreement.d.ts +1 -0
  11. package/dist/src/components/agreement/agreement.js +1 -0
  12. package/dist/src/components/agreement/agreement.js.map +1 -1
  13. package/dist/src/components/rental/rental.d.ts +1 -0
  14. package/dist/src/components/rental/rental.js +54 -15
  15. package/dist/src/components/rental/rental.js.map +1 -1
  16. package/dist/src/interfaces/agreement-attr.interface.d.ts +2 -1
  17. package/dist/src/models/agreement.entity.d.ts +1 -0
  18. package/dist/src/models/agreement.entity.js +7 -0
  19. package/dist/src/models/agreement.entity.js.map +1 -1
  20. package/dist/tsconfig.tsbuildinfo +1 -1
  21. package/jest.config.js +10 -10
  22. package/migrations/booking-table-migration.js +79 -79
  23. package/migrations/joint-hirer-table-migration.js +52 -52
  24. package/migrations/rental-aggrement-table-migration.js +30 -26
  25. package/migrations/rental-price-table-migration.js +32 -32
  26. package/migrations/rental-table-migrations.js +96 -96
  27. package/package.json +75 -75
  28. package/sonar-project.properties +12 -12
  29. package/src/components/agreement/agreement.repository.ts +54 -54
  30. package/src/components/agreement/agreement.ts +49 -46
  31. package/src/components/booking/booking.repository.ts +51 -51
  32. package/src/components/booking/booking.ts +343 -343
  33. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  34. package/src/components/rental/rental.repository.ts +51 -51
  35. package/src/components/rental/rental.ts +960 -861
  36. package/src/components/rental-price/rental-price.repository.ts +54 -54
  37. package/src/components/rental-price/rental-price.ts +100 -100
  38. package/src/database.ts +27 -27
  39. package/src/enum/account-type.enum.ts +4 -4
  40. package/src/enum/booking.enum.ts +5 -5
  41. package/src/enum/index.ts +11 -11
  42. package/src/enum/rental-status.enum.ts +39 -39
  43. package/src/index.ts +28 -28
  44. package/src/interfaces/agreement-attr.interface.ts +7 -6
  45. package/src/interfaces/booking-attr.interface.ts +19 -19
  46. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  47. package/src/interfaces/index.ts +15 -15
  48. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  49. package/src/interfaces/rental-attr.interface.ts +25 -25
  50. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  51. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  52. package/src/models/agreement.entity.ts +39 -33
  53. package/src/models/booking.entity.ts +105 -105
  54. package/src/models/index.ts +13 -13
  55. package/src/models/joint-hirer.entity.ts +63 -63
  56. package/src/models/rental-price.entity.ts +38 -38
  57. package/src/models/rental.entity.ts +133 -133
  58. package/tsconfig.build.json +5 -5
  59. package/tsconfig.json +23 -23
@@ -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
+ }
@@ -1,33 +1,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
-
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
- @HasMany(() => RentalModel)
32
- Rentals: RentalModel[];
33
- }
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,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
+ }
@@ -1,13 +1,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
-
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
+
7
+ export {
8
+ RentalModel,
9
+ RentalPriceModel,
10
+ BookingModel,
11
+ JointHirerModel,
12
+ AgreementModel,
13
+ };
@@ -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
+ }