feat: wip import resource

This commit is contained in:
Ahmed Bouhuolia
2024-03-13 02:14:25 +02:00
parent 4270d66928
commit daa1e3a6bd
13 changed files with 411 additions and 52 deletions

View File

@@ -1,13 +1,13 @@
import { IAccountCreateDTO } from '@/interfaces';
import { AccountsApplication } from '../Accounts/AccountsApplication';
import { AccountDTOSchema } from '../Accounts/CreateAccountDTOSchema';
import { Inject, Service } from 'typedi';
import { Knex } from 'knex';
import { IAccountCreateDTO } from '@/interfaces';
import { AccountsApplication } from '../Accounts/AccountsApplication';
import { CreateAccount } from '../Accounts/CreateAccount';
@Service()
export class AccountsImportable {
@Inject()
private accountsApp: AccountsApplication;
private createAccountService: CreateAccount;
/**
*
@@ -20,7 +20,11 @@ export class AccountsImportable {
createAccountDTO: IAccountCreateDTO,
trx?: Knex.Transaction
) {
return this.accountsApp.createAccount(tenantId, createAccountDTO, trx);
return this.createAccountService.createAccount(
tenantId,
createAccountDTO,
trx
);
}
/**
@@ -29,12 +33,15 @@ export class AccountsImportable {
* @returns
*/
public transform(data) {
return {
...data,
};
return { ...data };
}
mapAccountType(accountType: string) {
return 'Cash';
/**
*
* @param data
* @returns
*/
public preTransform(data) {
return { ...data };
}
}