mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactor(nestjs): wip
This commit is contained in:
@@ -6,6 +6,9 @@ import { ExportableModel } from '@/modules/Export/decorators/ExportableModel.dec
|
||||
import { ImportableModel } from '@/modules/Import/decorators/Import.decorator';
|
||||
import { InjectModelMeta } from '@/modules/Tenancy/TenancyModels/decorators/InjectModelMeta.decorator';
|
||||
import { SaleEstimateMeta } from './SaleEstimate.meta';
|
||||
import { ItemEntry } from '@/modules/TransactionItemEntry/models/ItemEntry';
|
||||
import { Document } from '@/modules/ChromiumlyTenancy/models/Document';
|
||||
import { Customer } from '@/modules/Customers/models/Customer';
|
||||
|
||||
@ExportableModel()
|
||||
@ImportableModel()
|
||||
@@ -40,6 +43,10 @@ export class SaleEstimate extends TenantBaseModel {
|
||||
branchId?: number;
|
||||
warehouseId?: number;
|
||||
|
||||
public entries!: ItemEntry[];
|
||||
public attachments!: Document[];
|
||||
public customer!: Customer;
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
// import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
// import { ItemEntryTransformer } from '../Invoices/ItemEntryTransformer';
|
||||
// import { AttachmentTransformer } from '@/services/Attachments/AttachmentTransformer';
|
||||
|
||||
import { Transformer } from '@/modules/Transformer/Transformer';
|
||||
import { SaleEstimate } from '../models/SaleEstimate';
|
||||
import { ItemEntryTransformer } from '@/modules/TransactionItemEntry/ItemEntry.transformer';
|
||||
import { AttachmentTransformer } from '@/modules/Attachments/Attachment.transformer';
|
||||
|
||||
export class SaleEstimateTransfromer extends Transformer {
|
||||
/**
|
||||
@@ -106,9 +103,9 @@ export class SaleEstimateTransfromer extends Transformer {
|
||||
* @returns {}
|
||||
*/
|
||||
protected entries = (estimate: SaleEstimate) => {
|
||||
// return this.item(estimate.entries, new ItemEntryTransformer(), {
|
||||
// currencyCode: estimate.currencyCode,
|
||||
// });
|
||||
return this.item(estimate.entries, new ItemEntryTransformer(), {
|
||||
currencyCode: estimate.currencyCode,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -117,6 +114,6 @@ export class SaleEstimateTransfromer extends Transformer {
|
||||
* @returns
|
||||
*/
|
||||
protected attachments = (estimate: SaleEstimate) => {
|
||||
// return this.item(estimate.attachments, new AttachmentTransformer());
|
||||
return this.item(estimate.attachments, new AttachmentTransformer());
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user