@tomei/finance 0.6.6 → 0.6.8
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.
|
@@ -9,7 +9,8 @@ export default class PaymentMethod extends ObjectBase {
|
|
|
9
9
|
private static _PaymentMethodTypeRepository;
|
|
10
10
|
private _DbTransaction;
|
|
11
11
|
private _PaymentMethodTypes;
|
|
12
|
-
constructor(dbTransaction?: any, methodId?: string);
|
|
12
|
+
constructor(dbTransaction?: any, methodId?: string, companyId?: string, name?: string);
|
|
13
|
+
static initPaymentMethod(dbTransaction?: any, methodId?: string): Promise<PaymentMethod>;
|
|
13
14
|
get ObjectId(): string;
|
|
14
15
|
get ObjectName(): string;
|
|
15
16
|
get TableName(): string;
|
|
@@ -15,7 +15,7 @@ const payment_method_repository_1 = require("./payment-method.repository");
|
|
|
15
15
|
const payment_method_type_1 = require("../payment-method-type/payment-method-type");
|
|
16
16
|
const payment_method_type_repository_1 = require("../payment-method-type/payment-method-type.repository");
|
|
17
17
|
class PaymentMethod extends general_1.ObjectBase {
|
|
18
|
-
constructor(dbTransaction, methodId) {
|
|
18
|
+
constructor(dbTransaction, methodId, companyId, name) {
|
|
19
19
|
super();
|
|
20
20
|
this.MethodId = 'New';
|
|
21
21
|
this.Name = '';
|
|
@@ -26,25 +26,37 @@ class PaymentMethod extends general_1.ObjectBase {
|
|
|
26
26
|
}
|
|
27
27
|
if (methodId) {
|
|
28
28
|
this.MethodId = methodId;
|
|
29
|
-
PaymentMethod._RepositoryBase
|
|
30
|
-
.findOne({
|
|
31
|
-
where: {
|
|
32
|
-
MethodId: methodId,
|
|
33
|
-
},
|
|
34
|
-
transaction: dbTransaction,
|
|
35
|
-
})
|
|
36
|
-
.then((methodData) => {
|
|
37
|
-
if (methodData) {
|
|
38
|
-
this.Name = methodData.Name;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
throw new record_not_found_error_1.RecordNotFoundError('PaymentMethodErrMsg', 'No record found.');
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
.catch((err) => {
|
|
45
|
-
console.log('Payment method constructor err: ', err);
|
|
46
|
-
});
|
|
47
29
|
}
|
|
30
|
+
if (companyId) {
|
|
31
|
+
this.CompanyId = companyId;
|
|
32
|
+
}
|
|
33
|
+
if (name) {
|
|
34
|
+
this.Name = name;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
static initPaymentMethod(dbTransaction, methodId) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
if (methodId) {
|
|
41
|
+
const methodData = yield PaymentMethod._RepositoryBase.findOne({
|
|
42
|
+
where: {
|
|
43
|
+
MethodId: methodId,
|
|
44
|
+
},
|
|
45
|
+
transaction: dbTransaction,
|
|
46
|
+
});
|
|
47
|
+
if (methodData) {
|
|
48
|
+
return new PaymentMethod(dbTransaction, methodData.MethodId, methodData.CompanyId, methodData.Name);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
throw new record_not_found_error_1.RecordNotFoundError('PaymentMethodErrMsg', 'No record found.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return new PaymentMethod(dbTransaction);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
error;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
48
60
|
}
|
|
49
61
|
get ObjectId() {
|
|
50
62
|
return this.MethodId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-method.js","sourceRoot":"","sources":["../../src/payment-method/payment-method.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4CAA4C;AAC5C,wGAAkG;AAClG,2EAAsE;AACtE,oFAA2E;AAC3E,0GAAoG;AAGpG,MAAqB,aAAc,SAAQ,oBAAU;IAYnD,
|
|
1
|
+
{"version":3,"file":"payment-method.js","sourceRoot":"","sources":["../../src/payment-method/payment-method.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4CAA4C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