@tomei/rental 0.12.4 → 0.13.1

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 +5 -1
  9. package/dist/src/components/agreement/agreement.js +59 -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 +148 -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
package/eslint.config.mjs CHANGED
@@ -1,58 +1,58 @@
1
- import eslintPlugin from "@typescript-eslint/eslint-plugin";
2
- import parser from "@typescript-eslint/parser";
3
- import importPlugin from 'eslint-plugin-import'
4
- import path from 'path';
5
- import { fileURLToPath } from 'url';
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
-
10
- export default [
11
- {
12
- languageOptions: {
13
- parser: parser,
14
- ecmaVersion: "latest", // Allows modern ECMAScript features
15
- sourceType: "module", // Allows for the use of imports
16
- parserOptions: {
17
- tsconfigRootDir: __dirname,
18
- project: './tsconfig.json'
19
- },
20
- },
21
- plugins: {
22
- "@typescript-eslint": eslintPlugin,
23
- import: importPlugin
24
- },
25
- rules: {
26
- "no-console": "off",
27
- "@typescript-eslint/no-explicit-any": "off",
28
- "@typescript-eslint/no-var-requires": "off",
29
- "@typescript-eslint/explicit-module-boundary-types": "off",
30
- "import/prefer-default-export": "off",
31
- "@typescript-eslint/no-unused-vars": "warn",
32
- "no-useless-catch": "off",
33
- "@typescript-eslint/no-non-null-assertion": "off",
34
- "@typescript-eslint/no-empty-function": "off",
35
- "@typescript-eslint/no-empty-interface": "off",
36
- "@typescript-eslint/no-inferrable-types": "off",
37
- "@typescript-eslint/no-namespace": "off",
38
- "@typescript-eslint/no-use-before-define": "off",
39
- "@typescript-eslint/no-unsafe-assignment": "off",
40
- "@typescript-eslint/no-unsafe-call": "off",
41
- "@typescript-eslint/no-unsafe-member-access": "off",
42
- "@typescript-eslint/no-unsafe-return": "off",
43
- "@typescript-eslint/restrict-template-expressions": "off",
44
- "no-useless-escape": "off",
45
- "import/no-relative-parent-imports": "error", // Enforce relative imports only
46
- "import/no-absolute-path": "error", // Block absolute imports outside aliases
47
- "import/no-unresolved": ["error", { commonjs: true }],
48
- },
49
- settings: {
50
- "import/resolver": {
51
- typescript: {
52
- alwaysTryTypes: true,
53
- }
54
- }
55
- },
56
- ignores: ["node_modules", "dist/**/*", "eslint.config.mjs"],
57
- },
58
- ];
1
+ import eslintPlugin from "@typescript-eslint/eslint-plugin";
2
+ import parser from "@typescript-eslint/parser";
3
+ import importPlugin from 'eslint-plugin-import'
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ export default [
11
+ {
12
+ languageOptions: {
13
+ parser: parser,
14
+ ecmaVersion: "latest", // Allows modern ECMAScript features
15
+ sourceType: "module", // Allows for the use of imports
16
+ parserOptions: {
17
+ tsconfigRootDir: __dirname,
18
+ project: './tsconfig.json'
19
+ },
20
+ },
21
+ plugins: {
22
+ "@typescript-eslint": eslintPlugin,
23
+ import: importPlugin
24
+ },
25
+ rules: {
26
+ "no-console": "off",
27
+ "@typescript-eslint/no-explicit-any": "off",
28
+ "@typescript-eslint/no-var-requires": "off",
29
+ "@typescript-eslint/explicit-module-boundary-types": "off",
30
+ "import/prefer-default-export": "off",
31
+ "@typescript-eslint/no-unused-vars": "warn",
32
+ "no-useless-catch": "off",
33
+ "@typescript-eslint/no-non-null-assertion": "off",
34
+ "@typescript-eslint/no-empty-function": "off",
35
+ "@typescript-eslint/no-empty-interface": "off",
36
+ "@typescript-eslint/no-inferrable-types": "off",
37
+ "@typescript-eslint/no-namespace": "off",
38
+ "@typescript-eslint/no-use-before-define": "off",
39
+ "@typescript-eslint/no-unsafe-assignment": "off",
40
+ "@typescript-eslint/no-unsafe-call": "off",
41
+ "@typescript-eslint/no-unsafe-member-access": "off",
42
+ "@typescript-eslint/no-unsafe-return": "off",
43
+ "@typescript-eslint/restrict-template-expressions": "off",
44
+ "no-useless-escape": "off",
45
+ "import/no-relative-parent-imports": "error", // Enforce relative imports only
46
+ "import/no-absolute-path": "error", // Block absolute imports outside aliases
47
+ "import/no-unresolved": ["error", { commonjs: true }],
48
+ },
49
+ settings: {
50
+ "import/resolver": {
51
+ typescript: {
52
+ alwaysTryTypes: true,
53
+ }
54
+ }
55
+ },
56
+ ignores: ["node_modules", "dist/**/*", "eslint.config.mjs"],
57
+ },
58
+ ];
package/jest.config.js CHANGED
@@ -1,11 +1,11 @@
1
- /** @type {import('ts-jest').JestConfigWithTsJest} */
2
- module.exports = {
3
- clearMocks: true,
4
- preset: 'ts-jest',
5
- testTimeout: 20000,
6
- coverageDirectory: "coverage",
7
- testEnvironment: 'node',
8
- "modulePathIgnorePatterns": [
9
- "<rootDir>/dist"
10
- ],
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
+ module.exports = {
3
+ clearMocks: true,
4
+ preset: 'ts-jest',
5
+ testTimeout: 20000,
6
+ coverageDirectory: "coverage",
7
+ testEnvironment: 'node',
8
+ "modulePathIgnorePatterns": [
9
+ "<rootDir>/dist"
10
+ ],
11
11
  };
@@ -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) {
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) {
77
+ await queryInterface.dropTable('booking_Booking');
78
+ },
79
+ };
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ /** @type {import('sequelize-cli').Migration} */
4
+ module.exports = {
5
+ async up(queryInterface, Sequelize) {
6
+ await queryInterface.createTable('rental_HirerSignature', {
7
+ HirerSignatureId: {
8
+ type: Sequelize.STRING(30),
9
+ allowNull: false,
10
+ primaryKey: true,
11
+ },
12
+ AgreementNo: {
13
+ type: Sequelize.STRING(30),
14
+ allowNull: false,
15
+ references: {
16
+ model: 'rental_Agreement',
17
+ key: 'AgreementNo',
18
+ },
19
+ onUpdate: 'CASCADE',
20
+ onDelete: 'CASCADE',
21
+ },
22
+ HirerType: {
23
+ type: Sequelize.STRING(10),
24
+ allowNull: false,
25
+ },
26
+ CustomerId: {
27
+ type: Sequelize.STRING(30),
28
+ allowNull: false,
29
+ },
30
+ CustomerType: {
31
+ type: Sequelize.STRING(30),
32
+ allowNull: false,
33
+ },
34
+ SignatureStatus: {
35
+ type: Sequelize.STRING(10),
36
+ allowNull: false,
37
+ },
38
+ SignedAt: {
39
+ type: Sequelize.DATE,
40
+ allowNull: false,
41
+ },
42
+ CreatedById: {
43
+ type: Sequelize.STRING(30),
44
+ allowNull: false,
45
+ },
46
+ CreatedAt: {
47
+ type: Sequelize.DATE,
48
+ allowNull: false,
49
+ },
50
+ UpdatedById: {
51
+ type: Sequelize.STRING(30),
52
+ allowNull: false,
53
+ },
54
+ UpdatedAt: {
55
+ type: Sequelize.DATE,
56
+ allowNull: false,
57
+ },
58
+ });
59
+ },
60
+
61
+ async down(queryInterface) {
62
+ await queryInterface.dropTable('rental_HirerSignature');
63
+ },
64
+ };
@@ -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) {
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) {
50
+ await queryInterface.dropTable('rental_JointHirer');
51
+ },
52
+ };
@@ -1,30 +1,30 @@
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
- DateSigned: {
17
- type: Sequelize.DATE,
18
- allowNull: true,
19
- },
20
- MediaId: {
21
- type: Sequelize.STRING(30),
22
- allowNull: true,
23
- },
24
- });
25
- },
26
-
27
- async down(queryInterface) {
28
- await queryInterface.dropTable('rental_Agreement');
29
- },
30
- };
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
+ DateSigned: {
17
+ type: Sequelize.DATE,
18
+ allowNull: true,
19
+ },
20
+ MediaId: {
21
+ type: Sequelize.STRING(30),
22
+ allowNull: true,
23
+ },
24
+ });
25
+ },
26
+
27
+ async down(queryInterface) {
28
+ await queryInterface.dropTable('rental_Agreement');
29
+ },
30
+ };
@@ -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) {
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) {
30
+ await queryInterface.dropTable('rental_Price');
31
+ },
32
+ };