@tomei/finance 0.6.6 → 0.6.7
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/package.json
CHANGED
|
@@ -17,33 +17,49 @@ export default class PaymentMethod extends ObjectBase {
|
|
|
17
17
|
private _DbTransaction: any;
|
|
18
18
|
private _PaymentMethodTypes = [];
|
|
19
19
|
|
|
20
|
-
constructor(
|
|
20
|
+
constructor(
|
|
21
|
+
dbTransaction?: any,
|
|
22
|
+
methodId?: string,
|
|
23
|
+
companyId?: string,
|
|
24
|
+
name?: string,
|
|
25
|
+
) {
|
|
21
26
|
super();
|
|
22
27
|
if (dbTransaction) {
|
|
23
28
|
this._DbTransaction = dbTransaction;
|
|
24
29
|
}
|
|
25
30
|
if (methodId) {
|
|
26
31
|
this.MethodId = methodId;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
}
|
|
33
|
+
if (companyId) {
|
|
34
|
+
this.CompanyId = companyId;
|
|
35
|
+
}
|
|
36
|
+
if (name) {
|
|
37
|
+
this.Name = name;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static async initPaymentMethod(dbTransaction?: any, methodId?: string) {
|
|
42
|
+
if (methodId) {
|
|
43
|
+
const methodData = await PaymentMethod._RepositoryBase.findOne({
|
|
44
|
+
where: {
|
|
45
|
+
MethodId: methodId,
|
|
46
|
+
},
|
|
47
|
+
transaction: dbTransaction,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (methodData) {
|
|
51
|
+
new PaymentMethod(
|
|
52
|
+
dbTransaction,
|
|
53
|
+
methodData.MethodId,
|
|
54
|
+
methodData.CompanyId,
|
|
55
|
+
methodData.Name,
|
|
56
|
+
);
|
|
57
|
+
} else {
|
|
58
|
+
throw new RecordNotFoundError(
|
|
59
|
+
'PaymentMethodErrMsg',
|
|
60
|
+
'No record found.',
|
|
61
|
+
);
|
|
62
|
+
}
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
65
|
|