@tomei/rental 0.9.4 → 0.9.5

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 (51) 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/rental/rental.js +29 -13
  11. package/dist/src/components/rental/rental.js.map +1 -1
  12. package/dist/tsconfig.tsbuildinfo +1 -1
  13. package/jest.config.js +10 -10
  14. package/migrations/booking-table-migration.js +79 -79
  15. package/migrations/joint-hirer-table-migration.js +52 -52
  16. package/migrations/rental-aggrement-table-migration.js +22 -22
  17. package/migrations/rental-price-table-migration.js +32 -32
  18. package/migrations/rental-table-migrations.js +96 -96
  19. package/package.json +75 -75
  20. package/sonar-project.properties +12 -12
  21. package/src/components/agreement/agreement.repository.ts +54 -54
  22. package/src/components/agreement/agreement.ts +43 -43
  23. package/src/components/booking/booking.repository.ts +51 -51
  24. package/src/components/booking/booking.ts +291 -291
  25. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  26. package/src/components/rental/rental.repository.ts +51 -51
  27. package/src/components/rental/rental.ts +720 -706
  28. package/src/components/rental-price/rental-price.repository.ts +54 -54
  29. package/src/components/rental-price/rental-price.ts +100 -100
  30. package/src/database.ts +27 -27
  31. package/src/enum/account-type.enum.ts +4 -4
  32. package/src/enum/booking.enum.ts +5 -5
  33. package/src/enum/index.ts +5 -5
  34. package/src/enum/rental-status.enum.ts +39 -39
  35. package/src/index.ts +28 -28
  36. package/src/interfaces/agreement-attr.interface.ts +4 -4
  37. package/src/interfaces/booking-attr.interface.ts +19 -19
  38. package/src/interfaces/index.ts +13 -13
  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 +26 -26
  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/tomei-rental-0.9.4.tgz +0 -0
  50. package/tsconfig.build.json +5 -5
  51. package/tsconfig.json +23 -23
@@ -1,79 +1,79 @@
1
- 'use strict';
2
-
3
- /** @type {import('sequelize-cli').Migration} */
4
- module.exports = {
5
- async up(queryInterface, Sequelize) {
6
- await queryInterface.createTable('booking_Booking', {
7
- BookingNo: {
8
- type: Sequelize.STRING(30),
9
- allowNull: false,
10
- primaryKey: true,
11
- },
12
- CustomerId: {
13
- type: Sequelize.STRING(30),
14
- allowNull: false,
15
- },
16
- CustomerType: {
17
- type: Sequelize.STRING(30),
18
- allowNull: false,
19
- },
20
- ItemId: {
21
- type: Sequelize.STRING(30),
22
- allowNull: false,
23
- },
24
- ItemType: {
25
- type: Sequelize.STRING(30),
26
- allowNull: false,
27
- },
28
- PriceId: {
29
- type: Sequelize.STRING(30),
30
- allowNull: false,
31
- references: {
32
- model: 'rental_Price',
33
- key: 'PriceId',
34
- },
35
- onUpdate: 'CASCADE',
36
- onDelete: 'CASCADE',
37
- },
38
- ScheduledStartDateTime: {
39
- type: Sequelize.DATE,
40
- allowNull: false,
41
- },
42
- ScheduledEndDateTime: {
43
- type: Sequelize.DATE,
44
- allowNull: false,
45
- },
46
- BookingFee: {
47
- type: Sequelize.DECIMAL(10, 2),
48
- allowNull: true,
49
- },
50
- Status: {
51
- type: Sequelize.STRING(20),
52
- allowNull: false,
53
- },
54
- CancelRemarks: {
55
- type: Sequelize.STRING(3000),
56
- },
57
- CreatedById: {
58
- type: Sequelize.STRING(30),
59
- allowNull: false,
60
- },
61
- CreatedAt: {
62
- type: Sequelize.DATE,
63
- allowNull: false,
64
- },
65
- UpdatedById: {
66
- type: Sequelize.STRING(30),
67
- allowNull: false,
68
- },
69
- UpdatedAt: {
70
- type: Sequelize.DATE,
71
- allowNull: false,
72
- },
73
- });
74
- },
75
-
76
- async down(queryInterface, Sequelize) {
77
- await queryInterface.dropTable('booking_Booking');
78
- },
79
- };
1
+ 'use strict';
2
+
3
+ /** @type {import('sequelize-cli').Migration} */
4
+ module.exports = {
5
+ async up(queryInterface, Sequelize) {
6
+ await queryInterface.createTable('booking_Booking', {
7
+ BookingNo: {
8
+ type: Sequelize.STRING(30),
9
+ allowNull: false,
10
+ primaryKey: true,
11
+ },
12
+ CustomerId: {
13
+ type: Sequelize.STRING(30),
14
+ allowNull: false,
15
+ },
16
+ CustomerType: {
17
+ type: Sequelize.STRING(30),
18
+ allowNull: false,
19
+ },
20
+ ItemId: {
21
+ type: Sequelize.STRING(30),
22
+ allowNull: false,
23
+ },
24
+ ItemType: {
25
+ type: Sequelize.STRING(30),
26
+ allowNull: false,
27
+ },
28
+ PriceId: {
29
+ type: Sequelize.STRING(30),
30
+ allowNull: false,
31
+ references: {
32
+ model: 'rental_Price',
33
+ key: 'PriceId',
34
+ },
35
+ onUpdate: 'CASCADE',
36
+ onDelete: 'CASCADE',
37
+ },
38
+ ScheduledStartDateTime: {
39
+ type: Sequelize.DATE,
40
+ allowNull: false,
41
+ },
42
+ ScheduledEndDateTime: {
43
+ type: Sequelize.DATE,
44
+ allowNull: false,
45
+ },
46
+ BookingFee: {
47
+ type: Sequelize.DECIMAL(10, 2),
48
+ allowNull: true,
49
+ },
50
+ Status: {
51
+ type: Sequelize.STRING(20),
52
+ allowNull: false,
53
+ },
54
+ CancelRemarks: {
55
+ type: Sequelize.STRING(3000),
56
+ },
57
+ CreatedById: {
58
+ type: Sequelize.STRING(30),
59
+ allowNull: false,
60
+ },
61
+ CreatedAt: {
62
+ type: Sequelize.DATE,
63
+ allowNull: false,
64
+ },
65
+ UpdatedById: {
66
+ type: Sequelize.STRING(30),
67
+ allowNull: false,
68
+ },
69
+ UpdatedAt: {
70
+ type: Sequelize.DATE,
71
+ allowNull: false,
72
+ },
73
+ });
74
+ },
75
+
76
+ async down(queryInterface, Sequelize) {
77
+ await queryInterface.dropTable('booking_Booking');
78
+ },
79
+ };
@@ -1,52 +1,52 @@
1
- 'use strict';
2
-
3
- /** @type {import('sequelize-cli').Migration} */
4
- module.exports = {
5
- async up(queryInterface, Sequelize) {
6
- await queryInterface.createTable('rental_JointHirer', {
7
- HirerId: {
8
- type: Sequelize.STRING(30),
9
- allowNull: false,
10
- primaryKey: true,
11
- },
12
- RentalId: {
13
- type: Sequelize.STRING(30),
14
- allowNull: false,
15
- references: {
16
- model: 'rental_Rental',
17
- key: 'RentalId',
18
- },
19
- onUpdate: 'CASCADE',
20
- onDelete: 'CASCADE',
21
- },
22
- CustomerId: {
23
- type: Sequelize.STRING(30),
24
- allowNull: false,
25
- },
26
- CustomerType: {
27
- type: Sequelize.STRING(30),
28
- allowNull: false,
29
- },
30
- CreatedById: {
31
- type: Sequelize.STRING(30),
32
- allowNull: false,
33
- },
34
- CreatedAt: {
35
- type: Sequelize.DATE,
36
- allowNull: false,
37
- },
38
- UpdatedById: {
39
- type: Sequelize.STRING(30),
40
- allowNull: false,
41
- },
42
- UpdatedAt: {
43
- type: Sequelize.DATE,
44
- allowNull: false,
45
- },
46
- });
47
- },
48
-
49
- async down(queryInterface, Sequelize) {
50
- await queryInterface.dropTable('rental_JointHirer');
51
- },
52
- };
1
+ 'use strict';
2
+
3
+ /** @type {import('sequelize-cli').Migration} */
4
+ module.exports = {
5
+ async up(queryInterface, Sequelize) {
6
+ await queryInterface.createTable('rental_JointHirer', {
7
+ HirerId: {
8
+ type: Sequelize.STRING(30),
9
+ allowNull: false,
10
+ primaryKey: true,
11
+ },
12
+ RentalId: {
13
+ type: Sequelize.STRING(30),
14
+ allowNull: false,
15
+ references: {
16
+ model: 'rental_Rental',
17
+ key: 'RentalId',
18
+ },
19
+ onUpdate: 'CASCADE',
20
+ onDelete: 'CASCADE',
21
+ },
22
+ CustomerId: {
23
+ type: Sequelize.STRING(30),
24
+ allowNull: false,
25
+ },
26
+ CustomerType: {
27
+ type: Sequelize.STRING(30),
28
+ allowNull: false,
29
+ },
30
+ CreatedById: {
31
+ type: Sequelize.STRING(30),
32
+ allowNull: false,
33
+ },
34
+ CreatedAt: {
35
+ type: Sequelize.DATE,
36
+ allowNull: false,
37
+ },
38
+ UpdatedById: {
39
+ type: Sequelize.STRING(30),
40
+ allowNull: false,
41
+ },
42
+ UpdatedAt: {
43
+ type: Sequelize.DATE,
44
+ allowNull: false,
45
+ },
46
+ });
47
+ },
48
+
49
+ async down(queryInterface, Sequelize) {
50
+ await queryInterface.dropTable('rental_JointHirer');
51
+ },
52
+ };
@@ -1,22 +1,22 @@
1
- 'use strict';
2
-
3
- /** @type {import('sequelize-cli').Migration} */
4
- module.exports = {
5
- async up(queryInterface, Sequelize) {
6
- await queryInterface.createTable('rental_Agreement', {
7
- AgreementNo: {
8
- type: Sequelize.STRING(30),
9
- allowNull: false,
10
- primaryKey: true,
11
- },
12
- Status: {
13
- type: Sequelize.STRING(20),
14
- allowNull: false,
15
- },
16
- });
17
- },
18
-
19
- async down(queryInterface, Sequelize) {
20
- await queryInterface.dropTable('rental_Agreement');
21
- },
22
- };
1
+ 'use strict';
2
+
3
+ /** @type {import('sequelize-cli').Migration} */
4
+ module.exports = {
5
+ async up(queryInterface, Sequelize) {
6
+ await queryInterface.createTable('rental_Agreement', {
7
+ AgreementNo: {
8
+ type: Sequelize.STRING(30),
9
+ allowNull: false,
10
+ primaryKey: true,
11
+ },
12
+ Status: {
13
+ type: Sequelize.STRING(20),
14
+ allowNull: false,
15
+ },
16
+ });
17
+ },
18
+
19
+ async down(queryInterface, Sequelize) {
20
+ await queryInterface.dropTable('rental_Agreement');
21
+ },
22
+ };
@@ -1,32 +1,32 @@
1
- 'use strict';
2
-
3
- /** @type {import('sequelize-cli').Migration} */
4
- module.exports = {
5
- async up(queryInterface, Sequelize) {
6
- await queryInterface.createTable('rental_Price', {
7
- PriceId: {
8
- type: Sequelize.STRING(30),
9
- allowNull: false,
10
- primaryKey: true,
11
- },
12
- RetailPrice: {
13
- type: Sequelize.DECIMAL(10, 2),
14
- allowNull: false,
15
- },
16
- Currency: {
17
- type: Sequelize.CHAR(3),
18
- allowNull: false,
19
- },
20
- PromoCode: {
21
- type: Sequelize.STRING(10),
22
- },
23
- Remarks: {
24
- type: Sequelize.STRING(3000),
25
- },
26
- });
27
- },
28
-
29
- async down(queryInterface, Sequelize) {
30
- await queryInterface.dropTable('rental_Price');
31
- },
32
- };
1
+ 'use strict';
2
+
3
+ /** @type {import('sequelize-cli').Migration} */
4
+ module.exports = {
5
+ async up(queryInterface, Sequelize) {
6
+ await queryInterface.createTable('rental_Price', {
7
+ PriceId: {
8
+ type: Sequelize.STRING(30),
9
+ allowNull: false,
10
+ primaryKey: true,
11
+ },
12
+ RetailPrice: {
13
+ type: Sequelize.DECIMAL(10, 2),
14
+ allowNull: false,
15
+ },
16
+ Currency: {
17
+ type: Sequelize.CHAR(3),
18
+ allowNull: false,
19
+ },
20
+ PromoCode: {
21
+ type: Sequelize.STRING(10),
22
+ },
23
+ Remarks: {
24
+ type: Sequelize.STRING(3000),
25
+ },
26
+ });
27
+ },
28
+
29
+ async down(queryInterface, Sequelize) {
30
+ await queryInterface.dropTable('rental_Price');
31
+ },
32
+ };
@@ -1,96 +1,96 @@
1
- 'use strict';
2
-
3
- /** @type {import('sequelize-cli').Migration} */
4
- module.exports = {
5
- async up(queryInterface, Sequelize) {
6
- await queryInterface.createTable('rental_Rental', {
7
- RentalId: {
8
- type: Sequelize.STRING(30),
9
- allowNull: false,
10
- primaryKey: true,
11
- },
12
- CustomerId: {
13
- type: Sequelize.STRING(30),
14
- allowNull: false,
15
- },
16
- CustomerType: {
17
- type: Sequelize.STRING(30),
18
- allowNull: false,
19
- },
20
- ItemId: {
21
- type: Sequelize.STRING(30),
22
- allowNull: false,
23
- },
24
- ItemType: {
25
- type: Sequelize.STRING(30),
26
- allowNull: false,
27
- },
28
- PriceId: {
29
- type: Sequelize.STRING(30),
30
- allowNull: false,
31
- references: {
32
- model: 'rental_Price',
33
- key: 'PriceId',
34
- },
35
- onUpdate: 'CASCADE',
36
- onDelete: 'CASCADE',
37
- },
38
- StartDateTime: {
39
- type: Sequelize.DATE,
40
- allowNull: false,
41
- },
42
- EndDateTime: {
43
- type: Sequelize.DATE,
44
- allowNull: false,
45
- },
46
- Status: {
47
- type: Sequelize.STRING(20),
48
- allowNull: false,
49
- },
50
- CancelRemarks: {
51
- type: Sequelize.STRING(3000),
52
- },
53
- TerminateRemarks: {
54
- type: Sequelize.STRING(3000),
55
- },
56
- EscheatmentYN: {
57
- type: Sequelize.CHAR(1),
58
- },
59
- AgreementNo: {
60
- type: Sequelize.STRING(30),
61
- allowNull: false,
62
- unique: true,
63
- references: {
64
- model: 'rental_Agreement',
65
- key: 'AgreementNo',
66
- },
67
- onUpdate: 'CASCADE',
68
- onDelete: 'CASCADE',
69
- },
70
- AccountType: {
71
- type: Sequelize.STRING(10),
72
- allowNull: false,
73
- },
74
- CreatedById: {
75
- type: Sequelize.STRING(30),
76
- allowNull: false,
77
- },
78
- CreatedAt: {
79
- type: Sequelize.DATE,
80
- allowNull: false,
81
- },
82
- UpdatedById: {
83
- type: Sequelize.STRING(30),
84
- allowNull: false,
85
- },
86
- UpdatedAt: {
87
- type: Sequelize.DATE,
88
- allowNull: false,
89
- },
90
- });
91
- },
92
-
93
- async down(queryInterface, Sequelize) {
94
- await queryInterface.dropTable('rental_Rental');
95
- },
96
- };
1
+ 'use strict';
2
+
3
+ /** @type {import('sequelize-cli').Migration} */
4
+ module.exports = {
5
+ async up(queryInterface, Sequelize) {
6
+ await queryInterface.createTable('rental_Rental', {
7
+ RentalId: {
8
+ type: Sequelize.STRING(30),
9
+ allowNull: false,
10
+ primaryKey: true,
11
+ },
12
+ CustomerId: {
13
+ type: Sequelize.STRING(30),
14
+ allowNull: false,
15
+ },
16
+ CustomerType: {
17
+ type: Sequelize.STRING(30),
18
+ allowNull: false,
19
+ },
20
+ ItemId: {
21
+ type: Sequelize.STRING(30),
22
+ allowNull: false,
23
+ },
24
+ ItemType: {
25
+ type: Sequelize.STRING(30),
26
+ allowNull: false,
27
+ },
28
+ PriceId: {
29
+ type: Sequelize.STRING(30),
30
+ allowNull: false,
31
+ references: {
32
+ model: 'rental_Price',
33
+ key: 'PriceId',
34
+ },
35
+ onUpdate: 'CASCADE',
36
+ onDelete: 'CASCADE',
37
+ },
38
+ StartDateTime: {
39
+ type: Sequelize.DATE,
40
+ allowNull: false,
41
+ },
42
+ EndDateTime: {
43
+ type: Sequelize.DATE,
44
+ allowNull: false,
45
+ },
46
+ Status: {
47
+ type: Sequelize.STRING(20),
48
+ allowNull: false,
49
+ },
50
+ CancelRemarks: {
51
+ type: Sequelize.STRING(3000),
52
+ },
53
+ TerminateRemarks: {
54
+ type: Sequelize.STRING(3000),
55
+ },
56
+ EscheatmentYN: {
57
+ type: Sequelize.CHAR(1),
58
+ },
59
+ AgreementNo: {
60
+ type: Sequelize.STRING(30),
61
+ allowNull: false,
62
+ unique: true,
63
+ references: {
64
+ model: 'rental_Agreement',
65
+ key: 'AgreementNo',
66
+ },
67
+ onUpdate: 'CASCADE',
68
+ onDelete: 'CASCADE',
69
+ },
70
+ AccountType: {
71
+ type: Sequelize.STRING(10),
72
+ allowNull: false,
73
+ },
74
+ CreatedById: {
75
+ type: Sequelize.STRING(30),
76
+ allowNull: false,
77
+ },
78
+ CreatedAt: {
79
+ type: Sequelize.DATE,
80
+ allowNull: false,
81
+ },
82
+ UpdatedById: {
83
+ type: Sequelize.STRING(30),
84
+ allowNull: false,
85
+ },
86
+ UpdatedAt: {
87
+ type: Sequelize.DATE,
88
+ allowNull: false,
89
+ },
90
+ });
91
+ },
92
+
93
+ async down(queryInterface, Sequelize) {
94
+ await queryInterface.dropTable('rental_Rental');
95
+ },
96
+ };