mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
feat: recognize uncategorized transactions
This commit is contained in:
@@ -36,8 +36,12 @@ export class CreateBankRuleService {
|
||||
* Creates a new bank rule.
|
||||
* @param {number} tenantId
|
||||
* @param {ICreateBankRuleDTO} createRuleDTO
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
public createBankRule(tenantId: number, createRuleDTO: ICreateBankRuleDTO) {
|
||||
public createBankRule(
|
||||
tenantId: number,
|
||||
createRuleDTO: ICreateBankRuleDTO
|
||||
): Promise<void> {
|
||||
const { BankRule } = this.tenancy.models(tenantId);
|
||||
|
||||
const transformDTO = this.transformDTO(createRuleDTO);
|
||||
@@ -45,6 +49,7 @@ export class CreateBankRuleService {
|
||||
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
||||
// Triggers `onBankRuleCreating` event.
|
||||
await this.eventPublisher.emitAsync(events.bankRules.onCreating, {
|
||||
tenantId,
|
||||
createRuleDTO,
|
||||
trx,
|
||||
} as IBankRuleEventCreatingPayload);
|
||||
@@ -55,6 +60,7 @@ export class CreateBankRuleService {
|
||||
|
||||
// Triggers `onBankRuleCreated` event.
|
||||
await this.eventPublisher.emitAsync(events.bankRules.onCreated, {
|
||||
tenantId,
|
||||
createRuleDTO,
|
||||
trx,
|
||||
} as IBankRuleEventCreatedPayload);
|
||||
|
||||
Reference in New Issue
Block a user