@tomei/finance 0.3.29 → 0.3.30
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/dist/finance-company/finance-company.d.ts +5 -0
- package/dist/finance-company/finance-company.js +60 -18
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/models/payment-method.entity.d.ts +3 -0
- package/dist/models/payment-method.entity.js +18 -1
- package/dist/models/payment-method.entity.js.map +1 -1
- package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +1 -0
- package/dist/payment-method/payment-method.d.ts +2 -2
- package/dist/payment-method/payment-method.js +16 -6
- package/dist/payment-method/payment-method.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/finance-payment-method-migration.js +10 -0
- package/package.json +1 -1
- package/src/finance-company/finance-company.ts +1156 -1081
- package/src/models/payment-method.entity.ts +25 -2
- package/src/payment-method/interfaces/payment-method-attr.interface.ts +1 -0
- package/src/payment-method/payment-method.ts +13 -6
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ForeignKey,
|
|
4
|
+
BelongsTo,
|
|
5
|
+
Column,
|
|
6
|
+
DataType,
|
|
7
|
+
HasMany,
|
|
8
|
+
Model,
|
|
9
|
+
Table,
|
|
10
|
+
} from 'sequelize-typescript';
|
|
3
11
|
import PaymentMethodTypeModel from './payment-method-type.entity';
|
|
12
|
+
import FinanceCompanyModel from './finance-company.entity';
|
|
4
13
|
|
|
5
14
|
@Table({
|
|
6
15
|
tableName: 'finance_PaymentMethod',
|
|
@@ -16,13 +25,27 @@ export default class PaymentMethodModel extends Model {
|
|
|
16
25
|
})
|
|
17
26
|
MethodId: string;
|
|
18
27
|
|
|
19
|
-
@ApiProperty({ example: '
|
|
28
|
+
@ApiProperty({ example: 'cash' })
|
|
20
29
|
@Column({
|
|
21
30
|
allowNull: false,
|
|
22
31
|
type: DataType.STRING(100),
|
|
23
32
|
})
|
|
24
33
|
Name: string;
|
|
25
34
|
|
|
35
|
+
@ApiProperty({
|
|
36
|
+
example: 'EZC',
|
|
37
|
+
description: 'CompanyId',
|
|
38
|
+
})
|
|
39
|
+
@ForeignKey(() => FinanceCompanyModel)
|
|
40
|
+
@Column({
|
|
41
|
+
allowNull: false,
|
|
42
|
+
type: DataType.STRING(30),
|
|
43
|
+
})
|
|
44
|
+
CompanyId: string;
|
|
45
|
+
|
|
26
46
|
@HasMany(() => PaymentMethodTypeModel)
|
|
27
47
|
PaymentMethodType: PaymentMethodTypeModel[];
|
|
48
|
+
|
|
49
|
+
@BelongsTo(() => FinanceCompanyModel)
|
|
50
|
+
FinanceCompany: FinanceCompanyModel;
|
|
28
51
|
}
|
|
@@ -5,8 +5,8 @@ import { PaymentMethodTypeRepository } from '../payment-method-type/payment-meth
|
|
|
5
5
|
|
|
6
6
|
export default class PaymentMethod extends ObjectBase {
|
|
7
7
|
MethodId = 'New';
|
|
8
|
-
CompanyId = '';
|
|
9
8
|
Name = '';
|
|
9
|
+
CompanyId = '';
|
|
10
10
|
|
|
11
11
|
private static _RepositoryBase = new PaymentMethodRepository();
|
|
12
12
|
private static _PaymentMethodTypeRepository =
|
|
@@ -87,10 +87,17 @@ export default class PaymentMethod extends ObjectBase {
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
async newPaymentMethodType(
|
|
91
|
+
paymentMethodTypePayload,
|
|
92
|
+
): Promise<PaymentMethodType[]> {
|
|
93
|
+
const paymentMethodType = new PaymentMethodType();
|
|
94
|
+
await PaymentMethod._PaymentMethodTypeRepository.create({
|
|
95
|
+
...paymentMethodTypePayload,
|
|
96
|
+
AccountNo: paymentMethodType.AccountNo,
|
|
97
|
+
ProcessingFeeRate: paymentMethodType.ProcessingFeeRate,
|
|
98
|
+
ProcessingFeeAccountNo: paymentMethodType.ProcessingFeeAccountNo,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return await this.PaymentMethodTypes;
|
|
95
102
|
}
|
|
96
103
|
}
|