@tomei/rental 0.16.1 → 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 (65) 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 +8 -8
  9. package/dist/src/components/agreement/agreement.js.map +1 -1
  10. package/dist/src/components/rental/rental.js +15 -15
  11. package/dist/tsconfig.tsbuildinfo +1 -1
  12. package/eslint.config.mjs +58 -58
  13. package/jest.config.js +10 -10
  14. package/migrations/booking-table-migration.js +79 -79
  15. package/migrations/hirer-signature-table-migration.js +64 -64
  16. package/migrations/joint-hirer-table-migration.js +52 -52
  17. package/migrations/rental-aggreement-history-migration.js +41 -41
  18. package/migrations/rental-aggrement-table-migration.js +30 -30
  19. package/migrations/rental-price-table-migration.js +32 -32
  20. package/migrations/rental-table-migrations.js +96 -96
  21. package/package.json +75 -75
  22. package/sonar-project.properties +12 -12
  23. package/src/components/agreement/agreement.repository.ts +54 -54
  24. package/src/components/agreement/agreement.ts +180 -180
  25. package/src/components/agreement-history/agreement-history.repository.ts +54 -54
  26. package/src/components/agreement-history/agreement-history.ts +57 -57
  27. package/src/components/booking/booking.repository.ts +51 -51
  28. package/src/components/booking/booking.ts +492 -492
  29. package/src/components/hirer-signature/hirer-signature.repository.ts +54 -54
  30. package/src/components/hirer-signature/hirer-signature.ts +140 -140
  31. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  32. package/src/components/joint-hirer/joint-hirer.ts +137 -137
  33. package/src/components/rental/rental.repository.ts +51 -51
  34. package/src/components/rental/rental.ts +1116 -1116
  35. package/src/components/rental-price/rental-price.repository.ts +54 -54
  36. package/src/components/rental-price/rental-price.ts +100 -100
  37. package/src/database.ts +31 -31
  38. package/src/enum/account-type.enum.ts +4 -4
  39. package/src/enum/booking.enum.ts +5 -5
  40. package/src/enum/hirer-signature-status.enum.ts +4 -4
  41. package/src/enum/hirer-type.enum.ts +4 -4
  42. package/src/enum/index.ts +15 -15
  43. package/src/enum/rental-status.enum.ts +39 -39
  44. package/src/index.ts +36 -36
  45. package/src/interfaces/agreement-attr.interface.ts +7 -7
  46. package/src/interfaces/agreement-history-attr.interface.ts +7 -7
  47. package/src/interfaces/booking-attr.interface.ts +19 -19
  48. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  49. package/src/interfaces/hirer-signature-attr.interface.ts +15 -15
  50. package/src/interfaces/index.ts +19 -19
  51. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  52. package/src/interfaces/rental-attr.interface.ts +25 -25
  53. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  54. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  55. package/src/interfaces/response-hirer-signature-attr.interface.ts +15 -15
  56. package/src/models/agreement-history.entity.ts +51 -51
  57. package/src/models/agreement.entity.ts +47 -47
  58. package/src/models/booking.entity.ts +105 -105
  59. package/src/models/hirer-signature.entity.ts +81 -81
  60. package/src/models/index.ts +17 -17
  61. package/src/models/joint-hirer.entity.ts +63 -63
  62. package/src/models/rental-price.entity.ts +38 -38
  63. package/src/models/rental.entity.ts +133 -133
  64. package/tsconfig.build.json +5 -5
  65. 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
+ };
@@ -1,64 +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
+ '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,41 +1,41 @@
1
- 'use strict';
2
-
3
- /** @type {import('sequelize-cli').Migration} */
4
- module.exports = {
5
- async up(queryInterface, Sequelize) {
6
- await queryInterface.createTable('rental_AgreementHistory', {
7
- HistoryId: {
8
- type: Sequelize.INTEGER,
9
- allowNull: false,
10
- primaryKey: true,
11
- autoIncrement: true,
12
- },
13
- MediaId: {
14
- type: Sequelize.STRING(30),
15
- allowNull: false,
16
- },
17
- ActivityCompleted: {
18
- type: Sequelize.STRING(200),
19
- allowNull: false,
20
- },
21
- AgreementNo: {
22
- type: Sequelize.STRING(30),
23
- allowNull: false,
24
- references: {
25
- model: 'rental_Agreement',
26
- key: 'AgreementNo',
27
- },
28
- onUpdate: 'CASCADE',
29
- onDelete: 'CASCADE',
30
- },
31
- CreatedAt: {
32
- type: Sequelize.DATE,
33
- allowNull: false,
34
- },
35
- });
36
- },
37
-
38
- async down(queryInterface, Sequelize) {
39
- await queryInterface.dropTable('rental_AgreementHistory');
40
- },
41
- };
1
+ 'use strict';
2
+
3
+ /** @type {import('sequelize-cli').Migration} */
4
+ module.exports = {
5
+ async up(queryInterface, Sequelize) {
6
+ await queryInterface.createTable('rental_AgreementHistory', {
7
+ HistoryId: {
8
+ type: Sequelize.INTEGER,
9
+ allowNull: false,
10
+ primaryKey: true,
11
+ autoIncrement: true,
12
+ },
13
+ MediaId: {
14
+ type: Sequelize.STRING(30),
15
+ allowNull: false,
16
+ },
17
+ ActivityCompleted: {
18
+ type: Sequelize.STRING(200),
19
+ allowNull: false,
20
+ },
21
+ AgreementNo: {
22
+ type: Sequelize.STRING(30),
23
+ allowNull: false,
24
+ references: {
25
+ model: 'rental_Agreement',
26
+ key: 'AgreementNo',
27
+ },
28
+ onUpdate: 'CASCADE',
29
+ onDelete: 'CASCADE',
30
+ },
31
+ CreatedAt: {
32
+ type: Sequelize.DATE,
33
+ allowNull: false,
34
+ },
35
+ });
36
+ },
37
+
38
+ async down(queryInterface, Sequelize) {
39
+ await queryInterface.dropTable('rental_AgreementHistory');
40
+ },
41
+ };
@@ -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
+ };