feat: branding templates table

This commit is contained in:
Ahmed Bouhuolia
2024-09-11 21:16:21 +02:00
parent ef74e250f1
commit a7df23cebc
20 changed files with 418 additions and 16 deletions

View File

@@ -149,7 +149,7 @@ export default () => {
dashboard.use('/export', Container.get(ExportController).router());
dashboard.use('/attachments', Container.get(AttachmentsController).router());
dashboard.use(
'/pdf_templates',
'/pdf-templates',
Container.get(PdfTemplatesController).router()
);

View File

@@ -1,8 +1,7 @@
import { Transformer } from '@/lib/Transformer/Transformer';
import { getTransactionTypeLabel } from '@/utils/transactions-types';
export class GetPdfTemplatesTransformer extends Transformer {
// Empty transformer with no additional methods or attributes
/**
* Exclude attributes.
* @returns {string[]}
@@ -10,4 +9,20 @@ export class GetPdfTemplatesTransformer extends Transformer {
public excludeAttributes = (): string[] => {
return ['attributes'];
};
/**
* Includeded attributes.
* @returns {string[]}
*/
public includeAttributes = (): string[] => {
return ['createdAtFormatted', 'resourceFormatted'];
};
private createdAtFormatted = (template) => {
return this.formatDate(template.createdAt);
};
private resourceFormatted = (template) => {
return getTransactionTypeLabel(template.resource);
};
}