@tomei/rental 0.1.2 → 0.2.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 (88) hide show
  1. package/.commitlintrc.json +22 -22
  2. package/.eslintrc +16 -16
  3. package/.eslintrc.js +35 -35
  4. package/.husky/commit-msg +15 -15
  5. package/.husky/pre-commit +7 -7
  6. package/.prettierrc +4 -4
  7. package/Jenkinsfile +57 -57
  8. package/README.md +8 -8
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +17 -17
  11. package/dist/index.js.map +1 -1
  12. package/dist/jest.config.d.ts +2 -0
  13. package/dist/jest.config.js +11 -0
  14. package/dist/jest.config.js.map +1 -0
  15. package/dist/migrations/rental-price-table-migration.d.ts +2 -0
  16. package/dist/migrations/rental-price-table-migration.js +43 -0
  17. package/dist/migrations/rental-price-table-migration.js.map +1 -0
  18. package/dist/migrations/rental-table-migrations.d.ts +2 -0
  19. package/dist/migrations/rental-table-migrations.js +95 -0
  20. package/dist/migrations/rental-table-migrations.js.map +1 -0
  21. package/dist/src/components/rental/rental.d.ts +35 -0
  22. package/dist/src/components/rental/rental.js +209 -0
  23. package/dist/src/components/rental/rental.js.map +1 -0
  24. package/dist/src/components/rental/rental.repository.d.ts +8 -0
  25. package/dist/src/components/rental/rental.repository.js +67 -0
  26. package/dist/src/components/rental/rental.repository.js.map +1 -0
  27. package/dist/src/components/rental-price/rental-price.d.ts +12 -0
  28. package/dist/src/components/rental-price/rental-price.js +72 -0
  29. package/dist/src/components/rental-price/rental-price.js.map +1 -0
  30. package/dist/src/components/rental-price/rental-price.repository.d.ts +8 -0
  31. package/dist/src/components/rental-price/rental-price.repository.js +67 -0
  32. package/dist/src/components/rental-price/rental-price.repository.js.map +1 -0
  33. package/dist/src/database.d.ts +4 -4
  34. package/dist/src/database.js +14 -14
  35. package/dist/src/enum/index.d.ts +2 -0
  36. package/dist/src/enum/index.js +6 -0
  37. package/dist/src/enum/index.js.map +1 -0
  38. package/dist/src/enum/rental-status.enum.d.ts +6 -0
  39. package/dist/src/enum/rental-status.enum.js +11 -0
  40. package/dist/src/enum/rental-status.enum.js.map +1 -0
  41. package/dist/src/index.d.ts +9 -1
  42. package/dist/src/index.js +30 -4
  43. package/dist/src/index.js.map +1 -1
  44. package/dist/src/interfaces/index.d.ts +4 -0
  45. package/dist/src/interfaces/index.js +3 -0
  46. package/dist/src/interfaces/index.js.map +1 -0
  47. package/dist/src/interfaces/rental-attr.interface.d.ts +20 -0
  48. package/dist/src/interfaces/rental-attr.interface.js +3 -0
  49. package/dist/src/interfaces/rental-attr.interface.js.map +1 -0
  50. package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +7 -0
  51. package/dist/src/interfaces/rental-find-all-search-attr.interface.js +3 -0
  52. package/dist/src/interfaces/rental-find-all-search-attr.interface.js.map +1 -0
  53. package/dist/src/interfaces/rental-price-attr.interface.d.ts +7 -0
  54. package/dist/src/interfaces/rental-price-attr.interface.js +3 -0
  55. package/dist/src/interfaces/rental-price-attr.interface.js.map +1 -0
  56. package/dist/src/models/index.d.ts +3 -0
  57. package/dist/src/models/index.js +8 -0
  58. package/dist/src/models/index.js.map +1 -0
  59. package/dist/src/models/rental-price.entity.d.ts +8 -0
  60. package/dist/src/models/rental-price.entity.js +59 -0
  61. package/dist/src/models/rental-price.entity.js.map +1 -0
  62. package/dist/src/models/rental.entity.d.ts +23 -0
  63. package/dist/src/models/rental.entity.js +139 -0
  64. package/dist/src/models/rental.entity.js.map +1 -0
  65. package/dist/tsconfig.tsbuildinfo +1 -1
  66. package/index.ts +1 -2
  67. package/jest.config.js +10 -10
  68. package/migrations/rental-price-table-migration.js +32 -0
  69. package/migrations/rental-table-migrations.js +84 -0
  70. package/package.json +71 -67
  71. package/src/components/rental/rental.repository.ts +51 -0
  72. package/src/components/rental/rental.ts +289 -0
  73. package/src/components/rental-price/rental-price.repository.ts +54 -0
  74. package/src/components/rental-price/rental-price.ts +89 -0
  75. package/src/database.ts +15 -15
  76. package/src/enum/index.ts +3 -0
  77. package/src/enum/rental-status.enum.ts +6 -0
  78. package/src/index.ts +16 -1
  79. package/src/interfaces/index.ts +5 -0
  80. package/src/interfaces/rental-attr.interface.ts +21 -0
  81. package/src/interfaces/rental-find-all-search-attr.interface.ts +8 -0
  82. package/src/interfaces/rental-price-attr.interface.ts +7 -0
  83. package/src/models/index.ts +4 -0
  84. package/src/models/rental-price.entity.ts +38 -0
  85. package/src/models/rental.entity.ts +114 -0
  86. package/tsconfig.build.json +5 -5
  87. package/tsconfig.json +23 -23
  88. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,21 @@
1
+ import { RentalStatusEnum } from '../enum/rental-status.enum';
2
+
3
+ export interface IRentalAttr {
4
+ RentalId: string;
5
+ CustomerId: string;
6
+ CustomerType: string;
7
+ ItemId: string;
8
+ ItemType: string;
9
+ PriceId: string;
10
+ StartDateTime: Date;
11
+ EndDateTime: Date;
12
+ CancelRemarks: string;
13
+ TerminateRemarks: string;
14
+ AgreementNo: string;
15
+ Status: RentalStatusEnum;
16
+ EscheatmentYN: string;
17
+ CreatedById: string;
18
+ CreatedAt: Date;
19
+ UpdatedById: string;
20
+ UpdatedAt: Date;
21
+ }
@@ -0,0 +1,8 @@
1
+ import { RentalStatusEnum } from '../enum/rental-status.enum';
2
+
3
+ export interface IRentalFindAllSearchAttr {
4
+ Status?: RentalStatusEnum;
5
+ BoxNo?: string;
6
+ StartDateTime?: Date;
7
+ EndDateTime?: Date;
8
+ }
@@ -0,0 +1,7 @@
1
+ export interface IRentalPriceAttr {
2
+ PriceId: string;
3
+ RetailPrice: number;
4
+ Currency: string;
5
+ PromoCode: string;
6
+ Remarks: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { RentalModel } from './rental.entity';
2
+ import { RentalPriceModel } from './rental-price.entity';
3
+
4
+ export { RentalModel, RentalPriceModel };
@@ -0,0 +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
+ }
@@ -0,0 +1,114 @@
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 { RentalStatusEnum } from '../enum/rental-status.enum';
13
+
14
+ @Table({
15
+ tableName: 'rental_Rental',
16
+ })
17
+ export class RentalModel extends Model {
18
+ @Column({
19
+ primaryKey: true,
20
+ allowNull: false,
21
+ type: DataType.STRING(30),
22
+ })
23
+ RentalId: 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
+ StartDateTime: Date;
61
+
62
+ @Column({
63
+ allowNull: false,
64
+ type: DataType.DATE,
65
+ })
66
+ EndDateTime: Date;
67
+
68
+ @Column({
69
+ allowNull: false,
70
+ type: DataType.STRING(20),
71
+ })
72
+ Status: RentalStatusEnum;
73
+
74
+ @Column({
75
+ type: DataType.STRING(3000),
76
+ })
77
+ CancelRemarks: string;
78
+
79
+ @Column({
80
+ type: DataType.STRING(3000),
81
+ })
82
+ TerminateRemarks: string;
83
+
84
+ @Column({
85
+ type: DataType.CHAR(1),
86
+ })
87
+ EscheatmentYN: string;
88
+
89
+ @Column({
90
+ type: DataType.STRING(30),
91
+ })
92
+ AgreementNo: string;
93
+
94
+ @Column({
95
+ allowNull: false,
96
+ type: DataType.STRING(30),
97
+ })
98
+ CreatedById: string;
99
+
100
+ @CreatedAt
101
+ CreatedAt: Date;
102
+
103
+ @Column({
104
+ allowNull: false,
105
+ type: DataType.STRING(30),
106
+ })
107
+ UpdatedById: string;
108
+
109
+ @UpdatedAt
110
+ UpdatedAt: Date;
111
+
112
+ @BelongsTo(() => RentalPriceModel)
113
+ RentalPrice: RentalPriceModel;
114
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": ["**/*.ts"],
4
- "exclude": ["node_modules", "__tests__", "dist", "**/*spec.ts"]
5
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["**/*.ts"],
4
+ "exclude": ["node_modules", "__tests__", "dist", "**/*spec.ts"]
5
+ }
6
6
 
package/tsconfig.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "removeComments": true,
6
- "emitDecoratorMetadata": true,
7
- "experimentalDecorators": true,
8
- "allowSyntheticDefaultImports": true,
9
- "moduleResolution": "node",
10
- "target": "es6",
11
- "sourceMap": true,
12
- "outDir": "./dist",
13
- "baseUrl": "./src",
14
- "rootDir": "./",
15
- "incremental": true,
16
- "skipLibCheck": true,
17
- "noImplicitAny": false,
18
- "strictBindCallApply": false,
19
- "forceConsistentCasingInFileNames": false,
20
- "noFallthroughCasesInSwitch": false,
21
- "strictNullChecks": true,
22
- },
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "declaration": true,
5
+ "removeComments": true,
6
+ "emitDecoratorMetadata": true,
7
+ "experimentalDecorators": true,
8
+ "allowSyntheticDefaultImports": true,
9
+ "moduleResolution": "node",
10
+ "target": "es6",
11
+ "sourceMap": true,
12
+ "outDir": "dist",
13
+ "baseUrl": "./src",
14
+ "rootDir": "./",
15
+ "incremental": true,
16
+ "skipLibCheck": true,
17
+ "noImplicitAny": false,
18
+ "strictBindCallApply": false,
19
+ "forceConsistentCasingInFileNames": false,
20
+ "noFallthroughCasesInSwitch": false,
21
+ "strictNullChecks": true
22
+ },
23
+ }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":[],"fileInfos":[],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"module":1,"noFallthroughCasesInSwitch":false,"noImplicitAny":false,"outDir":"./","removeComments":true,"rootDir":"./","skipLibCheck":true,"sourceMap":true,"strictBindCallApply":false,"strictNullChecks":true,"target":2},"referencedMap":[],"exportedModulesMap":[]},"version":"4.9.5"}