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

@@ -2,6 +2,7 @@ import { Transformer } from '@/lib/Transformer/Transformer';
import { formatNumber } from 'utils';
import { ItemEntryTransformer } from '../Sales/Invoices/ItemEntryTransformer';
import { ICreditNote } from '@/interfaces';
import { AttachmentTransformer } from '../Attachments/AttachmentTransformer';
export class CreditNoteTransformer extends Transformer {
/**
@@ -16,6 +17,7 @@ export class CreditNoteTransformer extends Transformer {
'formattedCreditsUsed',
'formattedSubtotal',
'entries',
'attachments',
];
};
@@ -80,4 +82,13 @@ export class CreditNoteTransformer extends Transformer {
currencyCode: credit.currencyCode,
});
};
/**
* Retrieves the credit note attachments.
* @param {ISaleInvoice} invoice
* @returns
*/
protected attachments = (creditNote) => {
return this.item(creditNote.attachments, new AttachmentTransformer());
};
}