@tomei/finance 0.3.8 → 0.3.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -8,6 +8,7 @@ import {
8
8
  import FinanceCustomerModel from '../models/customer.entity';
9
9
  import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
10
10
  import { FinanceCustomerRepository } from './finance-customer.repository';
11
+ import cuid from 'cuid';
11
12
 
12
13
  // const AccountSystemEntity = import('../account-system-entity').then(({AccountSystemEntity}) => AccountSystemEntity);
13
14
  export default abstract class FinanceCustomerBase
@@ -74,7 +75,7 @@ export default abstract class FinanceCustomerBase
74
75
  /*
75
76
  * Get the billing address for a person.
76
77
  **/
77
- abstract getBillingAddress(): Promise<IAddress>;
78
+ abstract getBillingAddress(params: any): Promise<IAddress>;
78
79
 
79
80
  init(person: LoginUserBase) {
80
81
  this.FullName = person.FullName;
@@ -86,20 +87,25 @@ export default abstract class FinanceCustomerBase
86
87
  }
87
88
 
88
89
  async save(
89
- customerId: string,
90
+ accSystemRefId: string,
90
91
  custSystemCode: string,
91
92
  custSystemRefId: string,
92
93
  dbTransaction?: any,
93
94
  ): Promise<FinanceCustomerModel> {
94
95
  this.CustSystemCode = custSystemCode;
95
96
  this.CustSystemRefId = custSystemRefId;
97
+ this.AccSystemRefId = accSystemRefId;
98
+ this.PostedToAccSystemYN = 'Y';
96
99
  const data = await FinanceCustomerBase._FinanceCustomerRepository.create(
97
100
  {
98
- CustomerId: customerId,
101
+ CompanyId: this.CompanyId,
102
+ CustomerId: cuid(),
99
103
  CustSystemCode: this.CustSystemCode,
100
104
  CustSystemRefId: this.CustSystemRefId,
105
+ AccSystemRefId: accSystemRefId,
106
+ PostedToAccSystemYN: this.PostedToAccSystemYN,
101
107
  },
102
- dbTransaction,
108
+ { transaction: dbTransaction },
103
109
  );
104
110
  return data;
105
111
  }
@@ -269,12 +269,12 @@ export default class FinanceCompany extends ObjectBase {
269
269
  }
270
270
 
271
271
  // Retrieve the type of accounting system, API Key, and API secret based on SysCode from the Config.ts
272
- const customerId = await this.AccountingSystem.createCustomer({
272
+ const accSystemRefId = await this.AccountingSystem.createCustomer({
273
273
  customer,
274
274
  });
275
275
 
276
276
  const newCustomer = await customer.save(
277
- customerId,
277
+ accSystemRefId,
278
278
  custSystemCode,
279
279
  custSystemRefId,
280
280
  dbTransaction,