@tomei/rental 0.11.4 → 0.12.2
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.
- package/.husky/commit-msg +0 -0
- package/.husky/pre-commit +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/src/components/agreement/agreement.d.ts +17 -17
- package/dist/src/components/agreement/agreement.js +49 -49
- package/dist/src/components/agreement/agreement.js.map +1 -1
- package/dist/src/components/agreement/agreement.repository.d.ts +8 -8
- package/dist/src/components/agreement/agreement.repository.js +66 -66
- package/dist/src/components/agreement/agreement.repository.js.map +1 -1
- package/dist/src/components/booking/booking.d.ts +46 -45
- package/dist/src/components/booking/booking.js +313 -271
- package/dist/src/components/booking/booking.js.map +1 -1
- package/dist/src/components/booking/booking.repository.d.ts +8 -8
- package/dist/src/components/booking/booking.repository.js +66 -66
- package/dist/src/components/booking/booking.repository.js.map +1 -1
- package/dist/src/components/joint-hirer/joint-hirer.d.ts +23 -23
- package/dist/src/components/joint-hirer/joint-hirer.js +105 -105
- package/dist/src/components/joint-hirer/joint-hirer.js.map +1 -1
- package/dist/src/components/joint-hirer/joint-hirer.repository.d.ts +8 -8
- package/dist/src/components/joint-hirer/joint-hirer.repository.js +66 -66
- package/dist/src/components/joint-hirer/joint-hirer.repository.js.map +1 -1
- package/dist/src/components/rental/rental.d.ts +59 -59
- package/dist/src/components/rental/rental.js +603 -603
- package/dist/src/components/rental/rental.js.map +1 -1
- package/dist/src/components/rental/rental.repository.d.ts +8 -8
- package/dist/src/components/rental/rental.repository.js +66 -66
- package/dist/src/components/rental/rental.repository.js.map +1 -1
- package/dist/src/components/rental-price/rental-price.d.ts +18 -18
- package/dist/src/components/rental-price/rental-price.js +78 -78
- package/dist/src/components/rental-price/rental-price.js.map +1 -1
- package/dist/src/components/rental-price/rental-price.repository.d.ts +8 -8
- package/dist/src/components/rental-price/rental-price.repository.js +66 -66
- package/dist/src/components/rental-price/rental-price.repository.js.map +1 -1
- package/dist/src/database.d.ts +4 -4
- package/dist/src/database.js +24 -25
- package/dist/src/database.js.map +1 -1
- package/dist/src/enum/account-type.enum.d.ts +4 -4
- package/dist/src/enum/account-type.enum.js +8 -8
- package/dist/src/enum/account-type.enum.js.map +1 -1
- package/dist/src/enum/aggrement-status.enum.d.ts +5 -5
- package/dist/src/enum/aggrement-status.enum.js +9 -9
- package/dist/src/enum/aggrement-status.enum.js.map +1 -1
- package/dist/src/enum/booking.enum.d.ts +5 -5
- package/dist/src/enum/booking.enum.js +9 -9
- package/dist/src/enum/booking.enum.js.map +1 -1
- package/dist/src/enum/index.d.ts +5 -5
- package/dist/src/enum/index.js +11 -11
- package/dist/src/enum/rental-status.enum.d.ts +9 -9
- package/dist/src/enum/rental-status.enum.js +13 -13
- package/dist/src/enum/rental-status.enum.js.map +1 -1
- package/dist/src/index.d.ts +15 -15
- package/dist/src/index.js +42 -42
- package/dist/src/interfaces/agreement-attr.interface.d.ts +7 -7
- package/dist/src/interfaces/agreement-attr.interface.js +2 -2
- package/dist/src/interfaces/booking-attr.interface.d.ts +18 -18
- package/dist/src/interfaces/booking-attr.interface.js +2 -2
- package/dist/src/interfaces/booking-find-all-search-attr.interface.d.ts +12 -12
- package/dist/src/interfaces/booking-find-all-search-attr.interface.js +2 -2
- package/dist/src/interfaces/index.d.ts +7 -7
- package/dist/src/interfaces/index.js +2 -2
- package/dist/src/interfaces/joint-hirer-attr.interface.d.ts +10 -10
- package/dist/src/interfaces/joint-hirer-attr.interface.js +2 -2
- package/dist/src/interfaces/rental-attr.interface.d.ts +24 -24
- package/dist/src/interfaces/rental-attr.interface.js +2 -2
- package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +10 -10
- package/dist/src/interfaces/rental-find-all-search-attr.interface.js +2 -2
- package/dist/src/interfaces/rental-price-attr.interface.d.ts +7 -7
- package/dist/src/interfaces/rental-price-attr.interface.js +2 -2
- package/dist/src/models/agreement.entity.d.ts +10 -10
- package/dist/src/models/agreement.entity.js +59 -59
- package/dist/src/models/agreement.entity.js.map +1 -1
- package/dist/src/models/booking.entity.d.ts +21 -21
- package/dist/src/models/booking.entity.js +127 -127
- package/dist/src/models/booking.entity.js.map +1 -1
- package/dist/src/models/index.d.ts +6 -6
- package/dist/src/models/index.js +13 -13
- package/dist/src/models/joint-hirer.entity.d.ts +13 -13
- package/dist/src/models/joint-hirer.entity.js +78 -78
- package/dist/src/models/joint-hirer.entity.js.map +1 -1
- package/dist/src/models/rental-price.entity.d.ts +8 -8
- package/dist/src/models/rental-price.entity.js +58 -58
- package/dist/src/models/rental-price.entity.js.map +1 -1
- package/dist/src/models/rental.entity.d.ts +29 -29
- package/dist/src/models/rental.entity.js +159 -159
- package/dist/src/models/rental.entity.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.mjs +37 -0
- package/migrations/booking-table-migration.js +1 -1
- package/migrations/joint-hirer-table-migration.js +1 -1
- package/migrations/rental-aggrement-table-migration.js +1 -1
- package/migrations/rental-price-table-migration.js +1 -1
- package/migrations/rental-table-migrations.js +1 -1
- package/package.json +33 -30
- package/src/components/booking/booking.ts +94 -1
- package/src/components/joint-hirer/joint-hirer.ts +1 -1
- package/src/components/rental/rental.ts +7 -10
- package/.eslintignore +0 -1
|
@@ -1,67 +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.BookingRepository = void 0;
|
|
13
|
-
const general_1 = require("@tomei/general");
|
|
14
|
-
const booking_entity_1 = require("../../models/booking.entity");
|
|
15
|
-
class BookingRepository extends general_1.RepositoryBase {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(booking_entity_1.BookingModel);
|
|
18
|
-
}
|
|
19
|
-
findByPk(id, transaction) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
try {
|
|
22
|
-
const result = yield booking_entity_1.BookingModel.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(BookingNo, dbTransaction) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
try {
|
|
35
|
-
const options = {
|
|
36
|
-
where: {
|
|
37
|
-
BookingNo: BookingNo,
|
|
38
|
-
},
|
|
39
|
-
transaction: dbTransaction,
|
|
40
|
-
};
|
|
41
|
-
yield booking_entity_1.BookingModel.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 Bookings;
|
|
52
|
-
if (options) {
|
|
53
|
-
Bookings = yield booking_entity_1.BookingModel.findAndCountAll(options);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
Bookings = yield booking_entity_1.BookingModel.findAndCountAll();
|
|
57
|
-
}
|
|
58
|
-
return Bookings;
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
throw new Error(`An Error occured when retriving : ${error.message}`);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.BookingRepository = BookingRepository;
|
|
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.BookingRepository = void 0;
|
|
13
|
+
const general_1 = require("@tomei/general");
|
|
14
|
+
const booking_entity_1 = require("../../models/booking.entity");
|
|
15
|
+
class BookingRepository extends general_1.RepositoryBase {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(booking_entity_1.BookingModel);
|
|
18
|
+
}
|
|
19
|
+
findByPk(id, transaction) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
try {
|
|
22
|
+
const result = yield booking_entity_1.BookingModel.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(BookingNo, dbTransaction) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const options = {
|
|
36
|
+
where: {
|
|
37
|
+
BookingNo: BookingNo,
|
|
38
|
+
},
|
|
39
|
+
transaction: dbTransaction,
|
|
40
|
+
};
|
|
41
|
+
yield booking_entity_1.BookingModel.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 Bookings;
|
|
52
|
+
if (options) {
|
|
53
|
+
Bookings = yield booking_entity_1.BookingModel.findAndCountAll(options);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
Bookings = yield booking_entity_1.BookingModel.findAndCountAll();
|
|
57
|
+
}
|
|
58
|
+
return Bookings;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new Error(`An Error occured when retriving : ${error.message}`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.BookingRepository = BookingRepository;
|
|
67
67
|
//# sourceMappingURL=booking.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking.repository.js","sourceRoot":"","sources":["../../../../src/components/booking/booking.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,gEAA2D;AAE3D,MAAa,iBACX,SAAQ,wBAA4B;IAGpC;QACE,KAAK,CAAC,6BAAY,CAAC,CAAC;IACtB,CAAC;IAEK,QAAQ,CAAC,EAAU,EAAE,WAAiB;;YAC1C,IAAI;
|
|
1
|
+
{"version":3,"file":"booking.repository.js","sourceRoot":"","sources":["../../../../src/components/booking/booking.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,gEAA2D;AAE3D,MAAa,iBACX,SAAQ,wBAA4B;IAGpC;QACE,KAAK,CAAC,6BAA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
|
-
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import { JointHirerRepository } from './joint-hirer.repository';
|
|
3
|
-
import { IJointHirerAttr } from '../../interfaces/joint-hirer-attr.interface';
|
|
4
|
-
import { LoginUser } from '@tomei/sso';
|
|
5
|
-
export declare class JointHirer extends ObjectBase {
|
|
6
|
-
ObjectId: string;
|
|
7
|
-
ObjectName: string;
|
|
8
|
-
ObjectType: string;
|
|
9
|
-
TableName: string;
|
|
10
|
-
RentalId: string;
|
|
11
|
-
CustomerId: string;
|
|
12
|
-
CustomerType: string;
|
|
13
|
-
CreatedById: string;
|
|
14
|
-
CreatedAt: Date;
|
|
15
|
-
UpdatedById: string;
|
|
16
|
-
UpdatedAt: Date;
|
|
17
|
-
get HirerId(): string;
|
|
18
|
-
set HirerId(value: string);
|
|
19
|
-
protected static _Repository: JointHirerRepository;
|
|
20
|
-
protected constructor(jointHirerAttr?: IJointHirerAttr);
|
|
21
|
-
static init(hirerId?: string, dbTransaction?: any): Promise<JointHirer>;
|
|
22
|
-
create(loginUser: LoginUser, dbTransaction?: any): Promise<this>;
|
|
23
|
-
}
|
|
1
|
+
import { ObjectBase } from '@tomei/general';
|
|
2
|
+
import { JointHirerRepository } from './joint-hirer.repository';
|
|
3
|
+
import { IJointHirerAttr } from '../../interfaces/joint-hirer-attr.interface';
|
|
4
|
+
import { LoginUser } from '@tomei/sso';
|
|
5
|
+
export declare class JointHirer extends ObjectBase {
|
|
6
|
+
ObjectId: string;
|
|
7
|
+
ObjectName: string;
|
|
8
|
+
ObjectType: string;
|
|
9
|
+
TableName: string;
|
|
10
|
+
RentalId: string;
|
|
11
|
+
CustomerId: string;
|
|
12
|
+
CustomerType: string;
|
|
13
|
+
CreatedById: string;
|
|
14
|
+
CreatedAt: Date;
|
|
15
|
+
UpdatedById: string;
|
|
16
|
+
UpdatedAt: Date;
|
|
17
|
+
get HirerId(): string;
|
|
18
|
+
set HirerId(value: string);
|
|
19
|
+
protected static _Repository: JointHirerRepository;
|
|
20
|
+
protected constructor(jointHirerAttr?: IJointHirerAttr);
|
|
21
|
+
static init(hirerId?: string, dbTransaction?: any): Promise<JointHirer>;
|
|
22
|
+
create(loginUser: LoginUser, dbTransaction?: any): Promise<this>;
|
|
23
|
+
}
|
|
@@ -1,106 +1,106 @@
|
|
|
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.JointHirer = void 0;
|
|
13
|
-
const general_1 = require("@tomei/general");
|
|
14
|
-
const joint_hirer_repository_1 = require("./joint-hirer.repository");
|
|
15
|
-
const config_1 = require("@tomei/config");
|
|
16
|
-
const activity_history_1 = require("@tomei/activity-history");
|
|
17
|
-
class JointHirer extends general_1.ObjectBase {
|
|
18
|
-
get HirerId() {
|
|
19
|
-
return this.ObjectId;
|
|
20
|
-
}
|
|
21
|
-
set HirerId(value) {
|
|
22
|
-
this.ObjectId = value;
|
|
23
|
-
}
|
|
24
|
-
constructor(jointHirerAttr) {
|
|
25
|
-
super();
|
|
26
|
-
this.ObjectType = 'JointHirer';
|
|
27
|
-
this.TableName = 'rental_JointHirer';
|
|
28
|
-
if (jointHirerAttr) {
|
|
29
|
-
this.HirerId = jointHirerAttr.HirerId;
|
|
30
|
-
this.RentalId = jointHirerAttr.RentalId;
|
|
31
|
-
this.CustomerId = jointHirerAttr.CustomerId;
|
|
32
|
-
this.CustomerType = jointHirerAttr.CustomerType;
|
|
33
|
-
this.CreatedById = jointHirerAttr.CreatedById;
|
|
34
|
-
this.CreatedAt = jointHirerAttr.CreatedAt;
|
|
35
|
-
this.UpdatedById = jointHirerAttr.UpdatedById;
|
|
36
|
-
this.UpdatedAt = jointHirerAttr.UpdatedAt;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
static init(hirerId, dbTransaction) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
try {
|
|
42
|
-
if (hirerId) {
|
|
43
|
-
const jr = yield JointHirer._Repository.findByPk(hirerId, dbTransaction);
|
|
44
|
-
if (jr) {
|
|
45
|
-
return new JointHirer(jr.get({ plain: true }));
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg01', 'JointHirer not found');
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return new JointHirer();
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
throw error;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
create(loginUser, dbTransaction) {
|
|
59
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
try {
|
|
61
|
-
const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
|
|
62
|
-
const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'JointHirer - Create');
|
|
63
|
-
if (!isPrivileged) {
|
|
64
|
-
throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg00', "You do not have 'JointHirer - Create' privilege.");
|
|
65
|
-
}
|
|
66
|
-
if (!this.RentalId || !this.CustomerId || !this.CustomerType) {
|
|
67
|
-
throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg03', 'RentalId, CustomerId and CustomerType are required.');
|
|
68
|
-
}
|
|
69
|
-
this.ObjectId = this.createId();
|
|
70
|
-
this.CreatedById = loginUser.ObjectId;
|
|
71
|
-
this.CreatedAt = new Date();
|
|
72
|
-
this.UpdatedById = loginUser.ObjectId;
|
|
73
|
-
this.UpdatedAt = new Date();
|
|
74
|
-
const entityValueAfter = {
|
|
75
|
-
HirerId: this.HirerId,
|
|
76
|
-
RentalId: this.RentalId,
|
|
77
|
-
CustomerId: this.CustomerId,
|
|
78
|
-
CustomerType: this.CustomerType,
|
|
79
|
-
CreatedById: this.CreatedById,
|
|
80
|
-
CreatedAt: this.CreatedAt,
|
|
81
|
-
UpdatedById: this.UpdatedById,
|
|
82
|
-
UpdatedAt: this.UpdatedAt,
|
|
83
|
-
};
|
|
84
|
-
yield JointHirer._Repository.create(entityValueAfter, {
|
|
85
|
-
transaction: dbTransaction,
|
|
86
|
-
});
|
|
87
|
-
const activity = new activity_history_1.Activity();
|
|
88
|
-
activity.ObjectId = this._createId();
|
|
89
|
-
activity.Action = activity_history_1.ActionEnum.
|
|
90
|
-
activity.Description = 'Add Joint Hirer';
|
|
91
|
-
activity.EntityId = this.ObjectId;
|
|
92
|
-
activity.EntityType = this.ObjectType;
|
|
93
|
-
activity.EntityValueBefore = JSON.stringify({});
|
|
94
|
-
activity.EntityValueAfter = JSON.stringify(entityValueAfter);
|
|
95
|
-
yield activity.create(loginUser.ObjectId, dbTransaction);
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
throw error;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.JointHirer = JointHirer;
|
|
105
|
-
JointHirer._Repository = new joint_hirer_repository_1.JointHirerRepository();
|
|
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.JointHirer = void 0;
|
|
13
|
+
const general_1 = require("@tomei/general");
|
|
14
|
+
const joint_hirer_repository_1 = require("./joint-hirer.repository");
|
|
15
|
+
const config_1 = require("@tomei/config");
|
|
16
|
+
const activity_history_1 = require("@tomei/activity-history");
|
|
17
|
+
class JointHirer extends general_1.ObjectBase {
|
|
18
|
+
get HirerId() {
|
|
19
|
+
return this.ObjectId;
|
|
20
|
+
}
|
|
21
|
+
set HirerId(value) {
|
|
22
|
+
this.ObjectId = value;
|
|
23
|
+
}
|
|
24
|
+
constructor(jointHirerAttr) {
|
|
25
|
+
super();
|
|
26
|
+
this.ObjectType = 'JointHirer';
|
|
27
|
+
this.TableName = 'rental_JointHirer';
|
|
28
|
+
if (jointHirerAttr) {
|
|
29
|
+
this.HirerId = jointHirerAttr.HirerId;
|
|
30
|
+
this.RentalId = jointHirerAttr.RentalId;
|
|
31
|
+
this.CustomerId = jointHirerAttr.CustomerId;
|
|
32
|
+
this.CustomerType = jointHirerAttr.CustomerType;
|
|
33
|
+
this.CreatedById = jointHirerAttr.CreatedById;
|
|
34
|
+
this.CreatedAt = jointHirerAttr.CreatedAt;
|
|
35
|
+
this.UpdatedById = jointHirerAttr.UpdatedById;
|
|
36
|
+
this.UpdatedAt = jointHirerAttr.UpdatedAt;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static init(hirerId, dbTransaction) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
if (hirerId) {
|
|
43
|
+
const jr = yield JointHirer._Repository.findByPk(hirerId, dbTransaction);
|
|
44
|
+
if (jr) {
|
|
45
|
+
return new JointHirer(jr.get({ plain: true }));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg01', 'JointHirer not found');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return new JointHirer();
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
create(loginUser, dbTransaction) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
try {
|
|
61
|
+
const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
|
|
62
|
+
const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'JointHirer - Create');
|
|
63
|
+
if (!isPrivileged) {
|
|
64
|
+
throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg00', "You do not have 'JointHirer - Create' privilege.");
|
|
65
|
+
}
|
|
66
|
+
if (!this.RentalId || !this.CustomerId || !this.CustomerType) {
|
|
67
|
+
throw new general_1.ClassError('JointHirer', 'JointHirerErrMsg03', 'RentalId, CustomerId and CustomerType are required.');
|
|
68
|
+
}
|
|
69
|
+
this.ObjectId = this.createId();
|
|
70
|
+
this.CreatedById = loginUser.ObjectId;
|
|
71
|
+
this.CreatedAt = new Date();
|
|
72
|
+
this.UpdatedById = loginUser.ObjectId;
|
|
73
|
+
this.UpdatedAt = new Date();
|
|
74
|
+
const entityValueAfter = {
|
|
75
|
+
HirerId: this.HirerId,
|
|
76
|
+
RentalId: this.RentalId,
|
|
77
|
+
CustomerId: this.CustomerId,
|
|
78
|
+
CustomerType: this.CustomerType,
|
|
79
|
+
CreatedById: this.CreatedById,
|
|
80
|
+
CreatedAt: this.CreatedAt,
|
|
81
|
+
UpdatedById: this.UpdatedById,
|
|
82
|
+
UpdatedAt: this.UpdatedAt,
|
|
83
|
+
};
|
|
84
|
+
yield JointHirer._Repository.create(entityValueAfter, {
|
|
85
|
+
transaction: dbTransaction,
|
|
86
|
+
});
|
|
87
|
+
const activity = new activity_history_1.Activity();
|
|
88
|
+
activity.ObjectId = this._createId();
|
|
89
|
+
activity.Action = activity_history_1.ActionEnum.CREATE;
|
|
90
|
+
activity.Description = 'Add Joint Hirer';
|
|
91
|
+
activity.EntityId = this.ObjectId;
|
|
92
|
+
activity.EntityType = this.ObjectType;
|
|
93
|
+
activity.EntityValueBefore = JSON.stringify({});
|
|
94
|
+
activity.EntityValueAfter = JSON.stringify(entityValueAfter);
|
|
95
|
+
yield activity.create(loginUser.ObjectId, dbTransaction);
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.JointHirer = JointHirer;
|
|
105
|
+
JointHirer._Repository = new joint_hirer_repository_1.JointHirerRepository();
|
|
106
106
|
//# sourceMappingURL=joint-hirer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joint-hirer.js","sourceRoot":"","sources":["../../../../src/components/joint-hirer/joint-hirer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwD;AACxD,qEAAgE;AAEhE,0CAAkD;AAElD,8DAA+D;AAE/D,MAAa,UAAW,SAAQ,oBAAU;IAaxC,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,CAAC,KAAa;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAID,YAAsB,cAAgC;QACpD,KAAK,EAAE,CAAC;QArBV,eAAU,GAAW,YAAY,CAAC;QAClC,cAAS,GAAW,mBAAmB,CAAC;QAqBtC,IAAI,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"joint-hirer.js","sourceRoot":"","sources":["../../../../src/components/joint-hirer/joint-hirer.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AAY,EAAE,IAAI,CAAC,YAAY;oBAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;iBAC1B,CAAC;gBAGF,MAAM,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,EAAE;oBACpD,WAAW,EAAE,aAAa;iBAC3B,CAAC,CAAC;gBAGH,MAAM,QAAQ,GAAG,IAAI,2BAAQ,EAAE,CAAC;gBAChC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;gBACrC,QAAQ,CAAC,MAAM,GAAG,6BAAU,CAAC,MAAM,CAAC;gBACpC,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC;gBACzC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAClC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;gBACtC,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBAChD,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBAE7D,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBAEzD,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;;AAhIH,gCAiIC;AA5GkB,sBAAW,GAAG,IAAI,6CAAoB,EAAE,AAA7B,CAA8B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import { JointHirerModel } from '../../models/joint-hirer.entity';
|
|
3
|
-
export declare class JointHirerRepository extends RepositoryBase<JointHirerModel> implements IRepositoryBase<JointHirerModel> {
|
|
4
|
-
constructor();
|
|
5
|
-
findByPk(id: string, transaction?: any): Promise<JointHirerModel | null>;
|
|
6
|
-
delete(hirerId: string, dbTransaction?: any): Promise<void>;
|
|
7
|
-
findAndCountAll(options?: any): Promise<any>;
|
|
8
|
-
}
|
|
1
|
+
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
+
import { JointHirerModel } from '../../models/joint-hirer.entity';
|
|
3
|
+
export declare class JointHirerRepository extends RepositoryBase<JointHirerModel> implements IRepositoryBase<JointHirerModel> {
|
|
4
|
+
constructor();
|
|
5
|
+
findByPk(id: string, transaction?: any): Promise<JointHirerModel | null>;
|
|
6
|
+
delete(hirerId: string, dbTransaction?: any): Promise<void>;
|
|
7
|
+
findAndCountAll(options?: any): Promise<any>;
|
|
8
|
+
}
|
|
@@ -1,67 +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.JointHirerRepository = void 0;
|
|
13
|
-
const general_1 = require("@tomei/general");
|
|
14
|
-
const joint_hirer_entity_1 = require("../../models/joint-hirer.entity");
|
|
15
|
-
class JointHirerRepository extends general_1.RepositoryBase {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(joint_hirer_entity_1.JointHirerModel);
|
|
18
|
-
}
|
|
19
|
-
findByPk(id, transaction) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
try {
|
|
22
|
-
const result = yield joint_hirer_entity_1.JointHirerModel.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(hirerId, dbTransaction) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
try {
|
|
35
|
-
const options = {
|
|
36
|
-
where: {
|
|
37
|
-
HirerId: hirerId,
|
|
38
|
-
},
|
|
39
|
-
transaction: dbTransaction,
|
|
40
|
-
};
|
|
41
|
-
yield joint_hirer_entity_1.JointHirerModel.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 jointHirers;
|
|
52
|
-
if (options) {
|
|
53
|
-
jointHirers = yield joint_hirer_entity_1.JointHirerModel.findAndCountAll(options);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
jointHirers = yield joint_hirer_entity_1.JointHirerModel.findAndCountAll();
|
|
57
|
-
}
|
|
58
|
-
return jointHirers;
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
throw new Error(`An Error occured when retriving : ${error.message}`);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.JointHirerRepository = JointHirerRepository;
|
|
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.JointHirerRepository = void 0;
|
|
13
|
+
const general_1 = require("@tomei/general");
|
|
14
|
+
const joint_hirer_entity_1 = require("../../models/joint-hirer.entity");
|
|
15
|
+
class JointHirerRepository extends general_1.RepositoryBase {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(joint_hirer_entity_1.JointHirerModel);
|
|
18
|
+
}
|
|
19
|
+
findByPk(id, transaction) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
try {
|
|
22
|
+
const result = yield joint_hirer_entity_1.JointHirerModel.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(hirerId, dbTransaction) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const options = {
|
|
36
|
+
where: {
|
|
37
|
+
HirerId: hirerId,
|
|
38
|
+
},
|
|
39
|
+
transaction: dbTransaction,
|
|
40
|
+
};
|
|
41
|
+
yield joint_hirer_entity_1.JointHirerModel.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 jointHirers;
|
|
52
|
+
if (options) {
|
|
53
|
+
jointHirers = yield joint_hirer_entity_1.JointHirerModel.findAndCountAll(options);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
jointHirers = yield joint_hirer_entity_1.JointHirerModel.findAndCountAll();
|
|
57
|
+
}
|
|
58
|
+
return jointHirers;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new Error(`An Error occured when retriving : ${error.message}`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.JointHirerRepository = JointHirerRepository;
|
|
67
67
|
//# sourceMappingURL=joint-hirer.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joint-hirer.repository.js","sourceRoot":"","sources":["../../../../src/components/joint-hirer/joint-hirer.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,wEAAkE;AAElE,MAAa,oBACX,SAAQ,wBAA+B;IAGvC;QACE,KAAK,CAAC,oCAAe,CAAC,CAAC;IACzB,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI;
|
|
1
|
+
{"version":3,"file":"joint-hirer.repository.js","sourceRoot":"","sources":["../../../../src/components/joint-hirer/joint-hirer.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,wEAAkE;AAElE,MAAa,oBACX,SAAQ,wBAA+B;IAGvC;QACE,KAAK,CAAC,oCAAe,CAAC,CAAC;IACzB,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,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