refactor(nestjs): Implement users module

This commit is contained in:
Ahmed Bouhuolia
2025-05-20 17:55:58 +02:00
parent ce058b9416
commit 99fe5a6b0d
48 changed files with 1823 additions and 207 deletions

View File

@@ -0,0 +1,24 @@
import { OnEvent } from '@nestjs/event-emitter';
import { Injectable } from '@nestjs/common';
import { events } from '@/common/events/events';
import { MutateBaseCurrencyAccounts } from '../MutateBaseCurrencyAccounts';
@Injectable()
export class MutateBaseCurrencyAccountsSubscriber {
constructor(
public readonly mutateBaseCurrencyAccounts: MutateBaseCurrencyAccounts,
) {}
/**
* Updates the all accounts currency once the base currency
* of the organization is mutated.
*/
@OnEvent(events.organization.baseCurrencyUpdated)
async updateAccountsCurrencyOnBaseCurrencyMutated({
organizationDTO,
}) {
await this.mutateBaseCurrencyAccounts.mutateAllAccountsCurrency(
organizationDTO.baseCurrency
);
};
}