feat: wip UI upload attachments

This commit is contained in:
Ahmed Bouhuolia
2024-05-28 23:34:51 +02:00
parent fcd61c6159
commit cfdbcea9c0
49 changed files with 286 additions and 67 deletions

View File

@@ -1,6 +1,7 @@
import { IManualJournal } from '@/interfaces';
import { Transformer } from '@/lib/Transformer/Transformer';
import { formatNumber } from 'utils';
import { AttachmentTransformer } from '../Attachments/AttachmentTransformer';
export class ManualJournalTransfromer extends Transformer {
/**
@@ -8,7 +9,12 @@ export class ManualJournalTransfromer extends Transformer {
* @returns {Array}
*/
public includeAttributes = (): string[] => {
return ['formattedAmount', 'formattedDate', 'formattedPublishedAt'];
return [
'formattedAmount',
'formattedDate',
'formattedPublishedAt',
'attachments',
];
};
/**
@@ -39,4 +45,13 @@ export class ManualJournalTransfromer extends Transformer {
protected formattedPublishedAt = (manualJorunal: IManualJournal): string => {
return this.formatDate(manualJorunal.publishedAt);
};
/**
* Retrieves the manual journal attachments.
* @param {ISaleInvoice} invoice
* @returns
*/
protected attachments = (manualJorunal: IManualJournal) => {
return this.item(manualJorunal.attachments, new AttachmentTransformer());
};
}