@tomei/rental 0.1.2 → 0.2.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 (57) hide show
  1. package/README.md +4 -4
  2. package/dist/src/components/rental/rental.d.ts +34 -0
  3. package/dist/src/components/rental/rental.js +195 -0
  4. package/dist/src/components/rental/rental.js.map +1 -0
  5. package/dist/src/components/rental/rental.repository.d.ts +8 -0
  6. package/dist/src/components/rental/rental.repository.js +67 -0
  7. package/dist/src/components/rental/rental.repository.js.map +1 -0
  8. package/dist/src/components/rental-price/rental-price.d.ts +12 -0
  9. package/dist/src/components/rental-price/rental-price.js +72 -0
  10. package/dist/src/components/rental-price/rental-price.js.map +1 -0
  11. package/dist/src/components/rental-price/rental-price.repository.d.ts +8 -0
  12. package/dist/src/components/rental-price/rental-price.repository.js +67 -0
  13. package/dist/src/components/rental-price/rental-price.repository.js.map +1 -0
  14. package/dist/src/enum/index.d.ts +2 -0
  15. package/dist/src/enum/index.js +6 -0
  16. package/dist/src/enum/index.js.map +1 -0
  17. package/dist/src/enum/rental-status.enum.d.ts +6 -0
  18. package/dist/src/enum/rental-status.enum.js +11 -0
  19. package/dist/src/enum/rental-status.enum.js.map +1 -0
  20. package/dist/src/index.d.ts +8 -0
  21. package/dist/src/index.js +26 -1
  22. package/dist/src/index.js.map +1 -1
  23. package/dist/src/interfaces/index.d.ts +3 -0
  24. package/dist/src/interfaces/index.js +3 -0
  25. package/dist/src/interfaces/index.js.map +1 -0
  26. package/dist/src/interfaces/rental-attr.interface.d.ts +20 -0
  27. package/dist/src/interfaces/rental-attr.interface.js +3 -0
  28. package/dist/src/interfaces/rental-attr.interface.js.map +1 -0
  29. package/dist/src/interfaces/rental-price-attr.interface.d.ts +7 -0
  30. package/dist/src/interfaces/rental-price-attr.interface.js +3 -0
  31. package/dist/src/interfaces/rental-price-attr.interface.js.map +1 -0
  32. package/dist/src/models/index.d.ts +3 -0
  33. package/dist/src/models/index.js +8 -0
  34. package/dist/src/models/index.js.map +1 -0
  35. package/dist/src/models/rental-price.entity.d.ts +8 -0
  36. package/dist/src/models/rental-price.entity.js +59 -0
  37. package/dist/src/models/rental-price.entity.js.map +1 -0
  38. package/dist/src/models/rental.entity.d.ts +23 -0
  39. package/dist/src/models/rental.entity.js +139 -0
  40. package/dist/src/models/rental.entity.js.map +1 -0
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/migrations/rental-price-table-migration.js +32 -0
  43. package/migrations/rental-table-migrations.js +84 -0
  44. package/package.json +6 -2
  45. package/src/components/rental/rental.repository.ts +51 -0
  46. package/src/components/rental/rental.ts +277 -0
  47. package/src/components/rental-price/rental-price.repository.ts +54 -0
  48. package/src/components/rental-price/rental-price.ts +89 -0
  49. package/src/enum/index.ts +3 -0
  50. package/src/enum/rental-status.enum.ts +6 -0
  51. package/src/index.ts +9 -0
  52. package/src/interfaces/index.ts +4 -0
  53. package/src/interfaces/rental-attr.interface.ts +21 -0
  54. package/src/interfaces/rental-price-attr.interface.ts +7 -0
  55. package/src/models/index.ts +4 -0
  56. package/src/models/rental-price.entity.ts +38 -0
  57. package/src/models/rental.entity.ts +114 -0
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=rental-price-attr.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental-price-attr.interface.js","sourceRoot":"","sources":["../../../src/interfaces/rental-price-attr.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { RentalModel } from './rental.entity';
2
+ import { RentalPriceModel } from './rental-price.entity';
3
+ export { RentalModel, RentalPriceModel };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RentalPriceModel = exports.RentalModel = void 0;
4
+ const rental_entity_1 = require("./rental.entity");
5
+ Object.defineProperty(exports, "RentalModel", { enumerable: true, get: function () { return rental_entity_1.RentalModel; } });
6
+ const rental_price_entity_1 = require("./rental-price.entity");
7
+ Object.defineProperty(exports, "RentalPriceModel", { enumerable: true, get: function () { return rental_price_entity_1.RentalPriceModel; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAGrC,4FAHA,2BAAW,OAGA;AAFpB,+DAAyD;AAEnC,iGAFb,sCAAgB,OAEa"}
@@ -0,0 +1,8 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ export declare class RentalPriceModel extends Model {
3
+ PriceId: string;
4
+ RetailPrice: number;
5
+ Currency: string;
6
+ PromoCode: string;
7
+ Remarks: string;
8
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RentalPriceModel = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ let RentalPriceModel = class RentalPriceModel extends sequelize_typescript_1.Model {
15
+ };
16
+ __decorate([
17
+ (0, sequelize_typescript_1.Column)({
18
+ primaryKey: true,
19
+ allowNull: false,
20
+ type: sequelize_typescript_1.DataType.STRING(30),
21
+ }),
22
+ __metadata("design:type", String)
23
+ ], RentalPriceModel.prototype, "PriceId", void 0);
24
+ __decorate([
25
+ (0, sequelize_typescript_1.Column)({
26
+ allowNull: false,
27
+ type: sequelize_typescript_1.DataType.DECIMAL(10, 2),
28
+ }),
29
+ __metadata("design:type", Number)
30
+ ], RentalPriceModel.prototype, "RetailPrice", void 0);
31
+ __decorate([
32
+ (0, sequelize_typescript_1.Column)({
33
+ allowNull: false,
34
+ type: sequelize_typescript_1.DataType.CHAR(3),
35
+ }),
36
+ __metadata("design:type", String)
37
+ ], RentalPriceModel.prototype, "Currency", void 0);
38
+ __decorate([
39
+ (0, sequelize_typescript_1.Column)({
40
+ type: sequelize_typescript_1.DataType.STRING(10),
41
+ }),
42
+ __metadata("design:type", String)
43
+ ], RentalPriceModel.prototype, "PromoCode", void 0);
44
+ __decorate([
45
+ (0, sequelize_typescript_1.Column)({
46
+ type: sequelize_typescript_1.DataType.STRING(3000),
47
+ }),
48
+ __metadata("design:type", String)
49
+ ], RentalPriceModel.prototype, "Remarks", void 0);
50
+ RentalPriceModel = __decorate([
51
+ (0, sequelize_typescript_1.Table)({
52
+ tableName: 'rental_Price',
53
+ timestamps: false,
54
+ createdAt: false,
55
+ updatedAt: false,
56
+ })
57
+ ], RentalPriceModel);
58
+ exports.RentalPriceModel = RentalPriceModel;
59
+ //# sourceMappingURL=rental-price.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental-price.entity.js","sourceRoot":"","sources":["../../../src/models/rental-price.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAsE;AAQ/D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,4BAAK;CA6B1C,CAAA;AA5BC;IAAC,IAAA,6BAAM,EAAC;QACN,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;KAC1B,CAAC;;iDACc;AAEhB;IAAC,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;KAC9B,CAAC;;qDACkB;AAEpB;IAAC,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;KACvB,CAAC;;kDACe;AAEjB;IAAC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;KAC1B,CAAC;;mDACgB;AAElB;IAAC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;KAC5B,CAAC;;iDACc;AA5BL,gBAAgB;IAN5B,IAAA,4BAAK,EAAC;QACL,SAAS,EAAE,cAAc;QACzB,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,KAAK;KACjB,CAAC;GACW,gBAAgB,CA6B5B;AA7BY,4CAAgB"}
@@ -0,0 +1,23 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ import { RentalPriceModel } from './rental-price.entity';
3
+ import { RentalStatusEnum } from '../enum/rental-status.enum';
4
+ export declare class RentalModel extends Model {
5
+ RentalId: string;
6
+ CustomerId: string;
7
+ CustomerType: string;
8
+ ItemId: string;
9
+ ItemType: string;
10
+ PriceId: string;
11
+ StartDateTime: Date;
12
+ EndDateTime: Date;
13
+ Status: RentalStatusEnum;
14
+ CancelRemarks: string;
15
+ TerminateRemarks: string;
16
+ EscheatmentYN: string;
17
+ AgreementNo: string;
18
+ CreatedById: string;
19
+ CreatedAt: Date;
20
+ UpdatedById: string;
21
+ UpdatedAt: Date;
22
+ RentalPrice: RentalPriceModel;
23
+ }
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RentalModel = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ const rental_price_entity_1 = require("./rental-price.entity");
15
+ const rental_status_enum_1 = require("../enum/rental-status.enum");
16
+ let RentalModel = class RentalModel extends sequelize_typescript_1.Model {
17
+ };
18
+ __decorate([
19
+ (0, sequelize_typescript_1.Column)({
20
+ primaryKey: true,
21
+ allowNull: false,
22
+ type: sequelize_typescript_1.DataType.STRING(30),
23
+ }),
24
+ __metadata("design:type", String)
25
+ ], RentalModel.prototype, "RentalId", void 0);
26
+ __decorate([
27
+ (0, sequelize_typescript_1.Column)({
28
+ allowNull: false,
29
+ type: sequelize_typescript_1.DataType.STRING(30),
30
+ }),
31
+ __metadata("design:type", String)
32
+ ], RentalModel.prototype, "CustomerId", void 0);
33
+ __decorate([
34
+ (0, sequelize_typescript_1.Column)({
35
+ allowNull: false,
36
+ type: sequelize_typescript_1.DataType.STRING(30),
37
+ }),
38
+ __metadata("design:type", String)
39
+ ], RentalModel.prototype, "CustomerType", void 0);
40
+ __decorate([
41
+ (0, sequelize_typescript_1.Column)({
42
+ allowNull: false,
43
+ type: sequelize_typescript_1.DataType.STRING(30),
44
+ }),
45
+ __metadata("design:type", String)
46
+ ], RentalModel.prototype, "ItemId", void 0);
47
+ __decorate([
48
+ (0, sequelize_typescript_1.Column)({
49
+ allowNull: false,
50
+ type: sequelize_typescript_1.DataType.STRING(30),
51
+ }),
52
+ __metadata("design:type", String)
53
+ ], RentalModel.prototype, "ItemType", void 0);
54
+ __decorate([
55
+ (0, sequelize_typescript_1.ForeignKey)(() => rental_price_entity_1.RentalPriceModel),
56
+ (0, sequelize_typescript_1.Column)({
57
+ allowNull: false,
58
+ type: sequelize_typescript_1.DataType.STRING(30),
59
+ }),
60
+ __metadata("design:type", String)
61
+ ], RentalModel.prototype, "PriceId", void 0);
62
+ __decorate([
63
+ (0, sequelize_typescript_1.Column)({
64
+ allowNull: false,
65
+ type: sequelize_typescript_1.DataType.DATE,
66
+ }),
67
+ __metadata("design:type", Date)
68
+ ], RentalModel.prototype, "StartDateTime", void 0);
69
+ __decorate([
70
+ (0, sequelize_typescript_1.Column)({
71
+ allowNull: false,
72
+ type: sequelize_typescript_1.DataType.DATE,
73
+ }),
74
+ __metadata("design:type", Date)
75
+ ], RentalModel.prototype, "EndDateTime", void 0);
76
+ __decorate([
77
+ (0, sequelize_typescript_1.Column)({
78
+ allowNull: false,
79
+ type: sequelize_typescript_1.DataType.STRING(20),
80
+ }),
81
+ __metadata("design:type", String)
82
+ ], RentalModel.prototype, "Status", void 0);
83
+ __decorate([
84
+ (0, sequelize_typescript_1.Column)({
85
+ type: sequelize_typescript_1.DataType.STRING(3000),
86
+ }),
87
+ __metadata("design:type", String)
88
+ ], RentalModel.prototype, "CancelRemarks", void 0);
89
+ __decorate([
90
+ (0, sequelize_typescript_1.Column)({
91
+ type: sequelize_typescript_1.DataType.STRING(3000),
92
+ }),
93
+ __metadata("design:type", String)
94
+ ], RentalModel.prototype, "TerminateRemarks", void 0);
95
+ __decorate([
96
+ (0, sequelize_typescript_1.Column)({
97
+ type: sequelize_typescript_1.DataType.CHAR(1),
98
+ }),
99
+ __metadata("design:type", String)
100
+ ], RentalModel.prototype, "EscheatmentYN", void 0);
101
+ __decorate([
102
+ (0, sequelize_typescript_1.Column)({
103
+ type: sequelize_typescript_1.DataType.STRING(30),
104
+ }),
105
+ __metadata("design:type", String)
106
+ ], RentalModel.prototype, "AgreementNo", void 0);
107
+ __decorate([
108
+ (0, sequelize_typescript_1.Column)({
109
+ allowNull: false,
110
+ type: sequelize_typescript_1.DataType.STRING(30),
111
+ }),
112
+ __metadata("design:type", String)
113
+ ], RentalModel.prototype, "CreatedById", void 0);
114
+ __decorate([
115
+ sequelize_typescript_1.CreatedAt,
116
+ __metadata("design:type", Date)
117
+ ], RentalModel.prototype, "CreatedAt", void 0);
118
+ __decorate([
119
+ (0, sequelize_typescript_1.Column)({
120
+ allowNull: false,
121
+ type: sequelize_typescript_1.DataType.STRING(30),
122
+ }),
123
+ __metadata("design:type", String)
124
+ ], RentalModel.prototype, "UpdatedById", void 0);
125
+ __decorate([
126
+ sequelize_typescript_1.UpdatedAt,
127
+ __metadata("design:type", Date)
128
+ ], RentalModel.prototype, "UpdatedAt", void 0);
129
+ __decorate([
130
+ (0, sequelize_typescript_1.BelongsTo)(() => rental_price_entity_1.RentalPriceModel),
131
+ __metadata("design:type", rental_price_entity_1.RentalPriceModel)
132
+ ], RentalModel.prototype, "RentalPrice", void 0);
133
+ RentalModel = __decorate([
134
+ (0, sequelize_typescript_1.Table)({
135
+ tableName: 'rental_Rental',
136
+ })
137
+ ], RentalModel);
138
+ exports.RentalModel = RentalModel;
139
+ //# sourceMappingURL=rental.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental.entity.js","sourceRoot":"","sources":["../../../src/models/rental.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAS8B;AAC9B,+DAAyD;AACzD,mEAA8D;AAKvD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,4BAAK;CAiGrC,CAAA;AAhGC;IAAC,IAAA,6BAAM,EAAC;QACN,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,M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