@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
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- ## SSO Config
1
+ ## Package Template
2
2
 
3
3
  ### How to use
4
- - run `npm i @tomei/config`
5
- - create a `component-config` folder in the root of your project
6
- - create a `component-name.json` file in the `component-config` folder. This file will contain the configuration for your component. you want to use the `component-name` as the name of the file. For example, if your component is called `my-component`, then the file name should be `my-component.json`
4
+ - run `npm i`
5
+ - create a `components` folder in the root of your project
6
+
7
7
 
8
8
 
@@ -0,0 +1,34 @@
1
+ import { RentalStatusEnum } from '../../enum/rental-status.enum';
2
+ import { LoginUser } from '@tomei/sso';
3
+ import { RentalPrice } from '../rental-price/rental-price';
4
+ export declare class Rental {
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
+ CancelRemarks: string;
14
+ TerminateRemarks: string;
15
+ AgreementNo: string;
16
+ private _Status;
17
+ private _EscheatmentYN;
18
+ private _CreatedById;
19
+ private _CreatedAt;
20
+ private _UpdatedById;
21
+ private _UpdatedAt;
22
+ private static _Repo;
23
+ get Status(): RentalStatusEnum;
24
+ get EscheatmentYN(): string;
25
+ get CreatedById(): string;
26
+ get CreatedAt(): Date;
27
+ get UpdatedById(): string;
28
+ get UpdatedAt(): Date;
29
+ private constructor();
30
+ static init(dbTransaction?: any, rentalId?: string): Promise<Rental>;
31
+ create(rentalPrice: RentalPrice, loginUser: LoginUser, dbTransaction?: any): Promise<this>;
32
+ isItemAvailable(itemId: string, itemType: string, startDateTime: Date, endDateTime: Date, dbTransaction?: any): Promise<boolean>;
33
+ static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, row?: number, search?: any): Promise<any>;
34
+ }
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Rental = void 0;
13
+ const rental_repository_1 = require("./rental.repository");
14
+ const general_1 = require("@tomei/general");
15
+ const config_1 = require("@tomei/config");
16
+ const cuid = require("cuid");
17
+ const sequelize_1 = require("sequelize");
18
+ const activity_history_1 = require("@tomei/activity-history");
19
+ class Rental {
20
+ get Status() {
21
+ return this._Status;
22
+ }
23
+ get EscheatmentYN() {
24
+ return this._EscheatmentYN;
25
+ }
26
+ get CreatedById() {
27
+ return this._CreatedById;
28
+ }
29
+ get CreatedAt() {
30
+ return this._CreatedAt;
31
+ }
32
+ get UpdatedById() {
33
+ return this._UpdatedById;
34
+ }
35
+ get UpdatedAt() {
36
+ return this._UpdatedAt;
37
+ }
38
+ constructor(rentalAttr) {
39
+ this._EscheatmentYN = 'N';
40
+ if (rentalAttr) {
41
+ this.RentalId = rentalAttr.RentalId;
42
+ this.CustomerId = rentalAttr.CustomerId;
43
+ this.CustomerType = rentalAttr.CustomerType;
44
+ this.ItemId = rentalAttr.ItemId;
45
+ this.ItemType = rentalAttr.ItemType;
46
+ this.PriceId = rentalAttr.PriceId;
47
+ this.StartDateTime = rentalAttr.StartDateTime;
48
+ this.EndDateTime = rentalAttr.EndDateTime;
49
+ this.CancelRemarks = rentalAttr.CancelRemarks;
50
+ this.TerminateRemarks = rentalAttr.TerminateRemarks;
51
+ this.AgreementNo = rentalAttr.AgreementNo;
52
+ this._Status = rentalAttr.Status;
53
+ this._EscheatmentYN = rentalAttr.EscheatmentYN;
54
+ this._CreatedById = rentalAttr.CreatedById;
55
+ this._CreatedAt = rentalAttr.CreatedAt;
56
+ this._UpdatedById = rentalAttr.UpdatedById;
57
+ this._UpdatedAt = rentalAttr.UpdatedAt;
58
+ }
59
+ }
60
+ static init(dbTransaction, rentalId) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ try {
63
+ if (rentalId) {
64
+ const rental = yield Rental._Repo.findByPk(rentalId, dbTransaction);
65
+ if (rental) {
66
+ return new Rental(rental);
67
+ }
68
+ else {
69
+ throw new general_1.ClassError('Rental', 'RentalErrMsg', 'Rental Not Found');
70
+ }
71
+ }
72
+ return new Rental();
73
+ }
74
+ catch (error) {
75
+ throw new general_1.ClassError('Rental', 'RentalErrMsg', 'Failed To Initialize Price');
76
+ }
77
+ });
78
+ }
79
+ create(rentalPrice, loginUser, dbTransaction) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ try {
82
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
83
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Rental - Create');
84
+ if (!isPrivileged) {
85
+ throw new general_1.ClassError('RentalPrice', 'RentalPriceErrMsg', 'You do not have the privilege.');
86
+ }
87
+ const isItemAvailable = yield this.isItemAvailable(this.ItemId, this.ItemType, this.StartDateTime, this.EndDateTime, dbTransaction);
88
+ if (!isItemAvailable) {
89
+ throw new general_1.ClassError('Rental', 'RentalErrMsg02', 'Rental Item is not available at current date.');
90
+ }
91
+ yield rentalPrice.create(loginUser, dbTransaction);
92
+ this.PriceId = rentalPrice.PriceId;
93
+ this.RentalId = cuid();
94
+ this._CreatedById = loginUser.ObjectId;
95
+ this._UpdatedById = loginUser.ObjectId;
96
+ this._CreatedAt = new Date();
97
+ this._UpdatedAt = new Date();
98
+ const data = {
99
+ RentalId: this.RentalId,
100
+ CustomerId: this.CustomerId,
101
+ CustomerType: this.CustomerType,
102
+ ItemId: this.ItemId,
103
+ ItemType: this.ItemType,
104
+ PriceId: this.PriceId,
105
+ StartDateTime: this.StartDateTime,
106
+ EndDateTime: this.EndDateTime,
107
+ CancelRemarks: this.CancelRemarks,
108
+ TerminateRemarks: this.TerminateRemarks,
109
+ AgreementNo: this.AgreementNo,
110
+ Status: this.Status,
111
+ EscheatmentYN: this.EscheatmentYN,
112
+ CreatedById: this.CreatedById,
113
+ CreatedAt: this.CreatedAt,
114
+ UpdatedById: this.UpdatedById,
115
+ UpdatedAt: this.UpdatedAt,
116
+ };
117
+ yield Rental._Repo.create(data, dbTransaction);
118
+ const activity = new activity_history_1.Activity();
119
+ activity.ActivityId = cuid();
120
+ activity.Action = activity_history_1.ActionEnum.ADD;
121
+ activity.Description = 'Add Rental';
122
+ activity.EntityType = 'Rental';
123
+ activity.EntityId = this.RentalId;
124
+ activity.EntityValueBefore = JSON.stringify({});
125
+ activity.EntityValueAfter = JSON.stringify(data);
126
+ yield activity.create(loginUser, dbTransaction);
127
+ return this;
128
+ }
129
+ catch (error) {
130
+ throw new general_1.ClassError('RentalPrice', 'RentalPriceErrMsg', 'Failed To Create RentalPrice');
131
+ }
132
+ });
133
+ }
134
+ isItemAvailable(itemId, itemType, startDateTime, endDateTime, dbTransaction) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ try {
137
+ const item = yield Rental._Repo.findOne({
138
+ where: {
139
+ ItemId: itemId,
140
+ ItemType: itemType,
141
+ StartDateTime: {
142
+ [sequelize_1.Op.lte]: endDateTime,
143
+ },
144
+ EndDateTime: {
145
+ [sequelize_1.Op.gte]: startDateTime,
146
+ },
147
+ },
148
+ transaction: dbTransaction,
149
+ });
150
+ if (item) {
151
+ return false;
152
+ }
153
+ else {
154
+ return true;
155
+ }
156
+ }
157
+ catch (error) {
158
+ throw error;
159
+ }
160
+ });
161
+ }
162
+ static findAll(loginUser, dbTransaction, page, row, search) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ try {
165
+ const systemCode = yield config_1.ApplicationConfig.getComponentConfigValue('system-code');
166
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Rental - View');
167
+ if (!isPrivileged) {
168
+ throw new general_1.ClassError('Rental', 'RentalErrMsg', 'You do not have the privilege.');
169
+ }
170
+ const queryObj = {};
171
+ let options = {
172
+ transaction: dbTransaction,
173
+ };
174
+ if (page && row) {
175
+ options = Object.assign(Object.assign({}, options), { limit: row, offset: row * (page - 1), order: [['CreatedAt', 'DESC']] });
176
+ }
177
+ if (search) {
178
+ Object.entries(search).forEach(([key, value]) => {
179
+ queryObj[key] = {
180
+ [sequelize_1.Op.substring]: value,
181
+ };
182
+ });
183
+ options = Object.assign(Object.assign({}, options), { where: queryObj });
184
+ }
185
+ return yield Rental._Repo.findAndCountAll(options);
186
+ }
187
+ catch (err) {
188
+ throw err;
189
+ }
190
+ });
191
+ }
192
+ }
193
+ exports.Rental = Rental;
194
+ Rental._Repo = new rental_repository_1.RentalRepository();
195
+ //# sourceMappingURL=rental.js.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AAE,KAAK;yBACtB,CAAC;oBACJ,CAAC,CAAC,CAAC;oBAEH,OAAO,mCACF,OAAO,KACV,KAAK,EAAE,QAAQ,GAChB,CAAC;iBACH;gBAED,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;aACpD;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,GAAG,CAAC;aACX;QACH,CAAC;KAAA;;AAxQH,wBAyQC;AAvPgB,YAAK,GAAG,IAAI,oCAAgB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
+ import { RentalModel } from '../../models/rental.entity';
3
+ export declare class RentalRepository extends RepositoryBase<RentalModel> implements IRepositoryBase<RentalModel> {
4
+ constructor();
5
+ findByPk(id: string, transaction?: any): Promise<RentalModel | null>;
6
+ delete(RentalId: string, dbTransaction?: any): Promise<void>;
7
+ findAndCountAll(options?: any): Promise<any>;
8
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RentalRepository = void 0;
13
+ const general_1 = require("@tomei/general");
14
+ const rental_entity_1 = require("../../models/rental.entity");
15
+ class RentalRepository extends general_1.RepositoryBase {
16
+ constructor() {
17
+ super(rental_entity_1.RentalModel);
18
+ }
19
+ findByPk(id, transaction) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const result = yield rental_entity_1.RentalModel.findByPk(id, {
23
+ transaction: transaction,
24
+ });
25
+ return result;
26
+ }
27
+ catch (error) {
28
+ throw new Error(`An Error occured when fetching : ${error.message}`);
29
+ }
30
+ });
31
+ }
32
+ delete(RentalId, dbTransaction) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ try {
35
+ const options = {
36
+ where: {
37
+ RentalId: RentalId,
38
+ },
39
+ transaction: dbTransaction,
40
+ };
41
+ yield rental_entity_1.RentalModel.destroy(options);
42
+ }
43
+ catch (error) {
44
+ throw new Error(`An Error occured when delete : ${error.message}`);
45
+ }
46
+ });
47
+ }
48
+ findAndCountAll(options) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ try {
51
+ let Rentals;
52
+ if (options) {
53
+ Rentals = yield rental_entity_1.RentalModel.findAndCountAll(options);
54
+ }
55
+ else {
56
+ Rentals = yield rental_entity_1.RentalModel.findAndCountAll();
57
+ }
58
+ return Rentals;
59
+ }
60
+ catch (error) {
61
+ throw new Error(`An Error occured when retriving : ${error.message}`);
62
+ }
63
+ });
64
+ }
65
+ }
66
+ exports.RentalRepository = RentalRepository;
67
+ //# sourceMappingURL=rental.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental.repository.js","sourceRoot":"","sources":["../../../../src/components/rental/rental.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,8DAAyD;AAEzD,MAAa,gBACX,SAAQ,wBAA2B;IAGnC;QACE,KAAK,CAAC,2BAAW,CAAC,CAAC;IACrB,CAAC;IAEK,QAAQ,CAAC,EAAU,EAAE,WAAiB;;YAC1C,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,2BAAW,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAC5C,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACtE;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,QAAgB,EAAE,aAAmB;;YAChD,IAAI;gBACF,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,QAAQ,EAAE,QAAQ;qBACnB;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,2BAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aACpC;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACpE;QACH,CAAC;KAAA;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI;gBACF,IAAI,OAAY,CAAC;gBACjB,IAAI,OAAO,EAAE;oBACX,OAAO,GAAG,MAAM,2BAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;iBACtD;qBAAM;oBACL,OAAO,GAAG,MAAM,2BAAW,CAAC,eAAe,EAAE,CAAC;iBAC/C;gBACD,OAAO,OAAO,CAAC;aAChB;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACvE;QACH,CAAC;KAAA;CACF;AA/CD,4CA+CC"}
@@ -0,0 +1,12 @@
1
+ import { LoginUser } from '@tomei/sso';
2
+ export declare class RentalPrice {
3
+ PriceId: string;
4
+ RetailPrice: number;
5
+ Currency: string;
6
+ PromoCode: string;
7
+ Remarks: string;
8
+ private static _Repo;
9
+ private constructor();
10
+ static init(dbTransaction?: any, priceId?: string): Promise<RentalPrice>;
11
+ create(loginUser: LoginUser, dbTransaction?: any): Promise<this>;
12
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RentalPrice = void 0;
13
+ const general_1 = require("@tomei/general");
14
+ const rental_price_repository_1 = require("./rental-price.repository");
15
+ const config_1 = require("@tomei/config");
16
+ const cuid = require("cuid");
17
+ class RentalPrice {
18
+ constructor(rentalPriceAttr) {
19
+ if (rentalPriceAttr) {
20
+ this.PriceId = rentalPriceAttr.PriceId;
21
+ this.RetailPrice = rentalPriceAttr.RetailPrice;
22
+ this.Currency = rentalPriceAttr.Currency;
23
+ this.PromoCode = rentalPriceAttr.PromoCode;
24
+ this.Remarks = rentalPriceAttr.Remarks;
25
+ }
26
+ }
27
+ static init(dbTransaction, priceId) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ try {
30
+ if (priceId) {
31
+ const rentalPrice = yield RentalPrice._Repo.findByPk(priceId, dbTransaction);
32
+ if (rentalPrice) {
33
+ return new RentalPrice(rentalPrice);
34
+ }
35
+ else {
36
+ throw new general_1.ClassError('RentalPrice', 'RentalPriceErrMsg', 'RentalPrice Not Found');
37
+ }
38
+ }
39
+ return new RentalPrice();
40
+ }
41
+ catch (error) {
42
+ throw new general_1.ClassError('RentalPrice', 'RentalPriceErrMsg', 'Failed To Initialize RentalPrice');
43
+ }
44
+ });
45
+ }
46
+ create(loginUser, dbTransaction) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ try {
49
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
50
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Rental - Create');
51
+ if (!isPrivileged) {
52
+ throw new general_1.ClassError('RentalPrice', 'RentalPriceErrMsg', 'You do not have the privilege.');
53
+ }
54
+ this.PriceId = cuid();
55
+ yield RentalPrice._Repo.create({
56
+ PriceId: this.PriceId,
57
+ RetailPrice: this.RetailPrice,
58
+ Currency: this.Currency,
59
+ PromoCode: this.PromoCode,
60
+ Remarks: this.Remarks,
61
+ }, dbTransaction);
62
+ return this;
63
+ }
64
+ catch (error) {
65
+ throw error;
66
+ }
67
+ });
68
+ }
69
+ }
70
+ exports.RentalPrice = RentalPrice;
71
+ RentalPrice._Repo = new rental_price_repository_1.RentalPriceRepository();
72
+ //# sourceMappingURL=rental-price.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental-price.js","sourceRoot":"","sources":["../../../../src/components/rental-price/rental-price.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA4C;AAC5C,uEAAkE;AAGlE,0CAAkD;AAClD,6BAA6B;AAE7B,MAAa,WAAW;IAStB,YAAoB,eAAkC;QACpD,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC;YACvC,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;YAC/C,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;YACzC,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC;YAC3C,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC;SACxC;IACH,CAAC;IAEM,MAAM,CAAO,IAAI,CAAC,aAAmB,EAAE,OAAgB;;YAC5D,IAAI;gBACF,IAAI,OAAO,EAAE;oBACX,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,QAAQ,CAClD,OAAO,EACP,aAAa,CACd,CAAC;oBACF,IAAI,WAAW,EAAE;wBACf,OAAO,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;qBACrC;yBAAM;wBACL,MAAM,IAAI,oBAAU,CAClB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,CACxB,CAAC;qBACH;iBACF;gBACD,OAAO,IAAI,WAAW,EAAE,CAAC;aAC1B;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,oBAAU,CAClB,aAAa,EACb,mBAAmB,EACnB,kCAAkC,CACnC,CAAC;aACH;QACH,CAAC;KAAA;IAEY,MAAM,CAAC,SAAoB,EAAE,aAAmB;;YAC3D,IAAI;gBACF,MAAM,UAAU,GACd,0BAAiB,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC;gBAC3D,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,eAAe,CAClD,UAAU,EACV,iBAAiB,CAClB,CAAC;gBAEF,IAAI,CAAC,YAAY,EAAE;oBACjB,MAAM,IAAI,oBAAU,CAClB,aAAa,EACb,mBAAmB,EACnB,gCAAgC,CACjC,CAAC;iBACH;gBAED,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;gBAEtB,MAAM,WAAW,CAAC,KAAK,CAAC,MAAM,CAC5B;oBACE,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,OAAO,EAAE,IAAI,CAAC,OAAO;iBACtB,EACD,aAAa,CACd,CAAC;gBAEF,OAAO,IAAI,CAAC;aACb;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;;AAhFH,kCAiFC;AA1EgB,iBAAK,GAAG,IAAI,+CAAqB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
+ import { RentalPriceModel } from '../../models/rental-price.entity';
3
+ export declare class RentalPriceRepository extends RepositoryBase<RentalPriceModel> implements IRepositoryBase<RentalPriceModel> {
4
+ constructor();
5
+ findByPk(id: string, transaction?: any): Promise<RentalPriceModel | null>;
6
+ delete(RentalPriceId: string, dbTransaction?: any): Promise<void>;
7
+ findAndCountAll(options?: any): Promise<any>;
8
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RentalPriceRepository = void 0;
13
+ const general_1 = require("@tomei/general");
14
+ const rental_price_entity_1 = require("../../models/rental-price.entity");
15
+ class RentalPriceRepository extends general_1.RepositoryBase {
16
+ constructor() {
17
+ super(rental_price_entity_1.RentalPriceModel);
18
+ }
19
+ findByPk(id, transaction) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const result = yield rental_price_entity_1.RentalPriceModel.findByPk(id, {
23
+ transaction: transaction,
24
+ });
25
+ return result;
26
+ }
27
+ catch (error) {
28
+ throw new Error(`An Error occured when fetching : ${error.message}`);
29
+ }
30
+ });
31
+ }
32
+ delete(RentalPriceId, dbTransaction) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ try {
35
+ const options = {
36
+ where: {
37
+ RentalPriceId: RentalPriceId,
38
+ },
39
+ transaction: dbTransaction,
40
+ };
41
+ yield rental_price_entity_1.RentalPriceModel.destroy(options);
42
+ }
43
+ catch (error) {
44
+ throw new Error(`An Error occured when delete : ${error.message}`);
45
+ }
46
+ });
47
+ }
48
+ findAndCountAll(options) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ try {
51
+ let RentalPrices;
52
+ if (options) {
53
+ RentalPrices = yield rental_price_entity_1.RentalPriceModel.findAndCountAll(options);
54
+ }
55
+ else {
56
+ RentalPrices = yield rental_price_entity_1.RentalPriceModel.findAndCountAll();
57
+ }
58
+ return RentalPrices;
59
+ }
60
+ catch (error) {
61
+ throw new Error(`An Error occured when retriving : ${error.message}`);
62
+ }
63
+ });
64
+ }
65
+ }
66
+ exports.RentalPriceRepository = RentalPriceRepository;
67
+ //# sourceMappingURL=rental-price.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental-price.repository.js","sourceRoot":"","sources":["../../../../src/components/rental-price/rental-price.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,0EAAoE;AAEpE,MAAa,qBACX,SAAQ,wBAAgC;IAGxC;QACE,KAAK,CAAC,sCAAgB,CAAC,CAAC;IAC1B,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,sCAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;oBACjD,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACtE;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,aAAqB,EAAE,aAAmB;;YACrD,IAAI;gBACF,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,aAAa,EAAE,aAAa;qBAC7B;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,sCAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aACzC;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACpE;QACH,CAAC;KAAA;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI;gBACF,IAAI,YAAiB,CAAC;gBACtB,IAAI,OAAO,EAAE;oBACX,YAAY,GAAG,MAAM,sCAAgB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;iBAChE;qBAAM;oBACL,YAAY,GAAG,MAAM,sCAAgB,CAAC,eAAe,EAAE,CAAC;iBACzD;gBACD,OAAO,YAAY,CAAC;aACrB;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACvE;QACH,CAAC;KAAA;CACF;AAlDD,sDAkDC"}
@@ -0,0 +1,2 @@
1
+ import { RentalStatusEnum } from './rental-status.enum';
2
+ export { RentalStatusEnum };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RentalStatusEnum = void 0;
4
+ const rental_status_enum_1 = require("./rental-status.enum");
5
+ Object.defineProperty(exports, "RentalStatusEnum", { enumerable: true, get: function () { return rental_status_enum_1.RentalStatusEnum; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":";;;AAAA,6DAAwD;AAE/C,iGAFA,qCAAgB,OAEA"}
@@ -0,0 +1,6 @@
1
+ export declare enum RentalStatusEnum {
2
+ ACTIVE = "Active",
3
+ SUSPENDED = "Suspended",
4
+ CANCELLED = "Cancelled",
5
+ TERMINATED = "Terminated"
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RentalStatusEnum = void 0;
4
+ var RentalStatusEnum;
5
+ (function (RentalStatusEnum) {
6
+ RentalStatusEnum["ACTIVE"] = "Active";
7
+ RentalStatusEnum["SUSPENDED"] = "Suspended";
8
+ RentalStatusEnum["CANCELLED"] = "Cancelled";
9
+ RentalStatusEnum["TERMINATED"] = "Terminated";
10
+ })(RentalStatusEnum = exports.RentalStatusEnum || (exports.RentalStatusEnum = {}));
11
+ //# sourceMappingURL=rental-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental-status.enum.js","sourceRoot":"","sources":["../../../src/enum/rental-status.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,6CAAyB,CAAA;AAC3B,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B"}
@@ -1 +1,9 @@
1
+ import { RentalPriceRepository } from './components/rental-price/rental-price.repository';
2
+ import { RentalRepository } from './components/rental/rental.repository';
3
+ import { Rental } from './components/rental/rental';
4
+ import { RentalPrice } from './components/rental-price/rental-price';
1
5
  export * as rentalDb from './database';
6
+ export * from './interfaces';
7
+ export * from './models';
8
+ export * from './enum';
9
+ export { Rental, RentalPrice, RentalRepository, RentalPriceRepository };
package/dist/src/index.js CHANGED
@@ -1,5 +1,30 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rentalDb = void 0;
17
+ exports.RentalPriceRepository = exports.RentalRepository = exports.RentalPrice = exports.Rental = exports.rentalDb = void 0;
18
+ const rental_price_repository_1 = require("./components/rental-price/rental-price.repository");
19
+ Object.defineProperty(exports, "RentalPriceRepository", { enumerable: true, get: function () { return rental_price_repository_1.RentalPriceRepository; } });
20
+ const rental_repository_1 = require("./components/rental/rental.repository");
21
+ Object.defineProperty(exports, "RentalRepository", { enumerable: true, get: function () { return rental_repository_1.RentalRepository; } });
22
+ const rental_1 = require("./components/rental/rental");
23
+ Object.defineProperty(exports, "Rental", { enumerable: true, get: function () { return rental_1.Rental; } });
24
+ const rental_price_1 = require("./components/rental-price/rental-price");
25
+ Object.defineProperty(exports, "RentalPrice", { enumerable: true, get: function () { return rental_price_1.RentalPrice; } });
4
26
  exports.rentalDb = require("./database");
27
+ __exportStar(require("./interfaces"), exports);
28
+ __exportStar(require("./models"), exports);
29
+ __exportStar(require("./enum"), exports);
5
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+FAA0F;AAS1C,sGATvC,+CAAqB,OASuC;AARrE,6EAAyE;AAQ3C,iGARrB,oCAAgB,OAQqB;AAP9C,uDAAoD;AAO3C,uFAPA,eAAM,OAOA;AANf,yEAAqE;AAMpD,4FANR,0BAAW,OAMQ;AAL5B,yCAAuC;AACvC,+CAA6B;AAC7B,2CAAyB;AACzB,yCAAuB"}
@@ -0,0 +1,3 @@
1
+ import { IRentalAttr } from './rental-attr.interface';
2
+ import { IRentalPriceAttr } from './rental-price-attr.interface';
3
+ export { IRentalAttr, IRentalPriceAttr };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { RentalStatusEnum } from '../enum/rental-status.enum';
2
+ export interface IRentalAttr {
3
+ RentalId: string;
4
+ CustomerId: string;
5
+ CustomerType: string;
6
+ ItemId: string;
7
+ ItemType: string;
8
+ PriceId: string;
9
+ StartDateTime: Date;
10
+ EndDateTime: Date;
11
+ CancelRemarks: string;
12
+ TerminateRemarks: string;
13
+ AgreementNo: string;
14
+ Status: RentalStatusEnum;
15
+ EscheatmentYN: string;
16
+ CreatedById: string;
17
+ CreatedAt: Date;
18
+ UpdatedById: string;
19
+ UpdatedAt: Date;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=rental-attr.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rental-attr.interface.js","sourceRoot":"","sources":["../../../src/interfaces/rental-attr.interface.ts"],"names":[],"mappings":""}