feat: Uploading company logo

This commit is contained in:
Ahmed Bouhuolia
2024-09-24 20:28:19 +02:00
parent d16c57b63b
commit 37fd4a1fdb
20 changed files with 404 additions and 171 deletions

View File

@@ -1,12 +1,17 @@
import { Knex } from 'knex';
import { Inject, Service } from 'typedi';
import HasTenancyService from '../Tenancy/TenancyService';
import { GetPdfTemplateTransformer } from './GetPdfTemplateTransformer';
import { TransformerInjectable } from '@/lib/Transformer/TransformerInjectable';
@Service()
export class GetPdfTemplate {
@Inject()
private tenancy: HasTenancyService;
@Inject()
private transformer: TransformerInjectable
/**
* Retrieves a pdf template by its ID.
* @param {number} tenantId - The ID of the tenant.
@@ -24,6 +29,10 @@ export class GetPdfTemplate {
.findById(templateId)
.throwIfNotFound();
return template;
return this.transformer.transform(
tenantId,
template,
new GetPdfTemplateTransformer()
);
}
}