mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
refactor: wip to nestjs
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
// import { Inject, Injectable } from '@nestjs/common';
|
||||
// import { GetSaleInvoiceMailStateTransformer } from './GetSaleInvoiceMailState.transformer';
|
||||
// import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
||||
// import { SaleInvoice } from '../models/SaleInvoice';
|
||||
|
||||
// @Injectable()
|
||||
// export class GetSaleInvoiceMailState {
|
||||
// constructor(
|
||||
// private transformer: TransformerInjectable,
|
||||
// // private invoiceMail: SendSaleInvoiceMailCommon,
|
||||
|
||||
// @Inject(SaleInvoice.name)
|
||||
// private saleInvoiceModel: typeof SaleInvoice,
|
||||
// ) {}
|
||||
|
||||
// /**
|
||||
// * Retrieves the invoice mail state of the given sale invoice.
|
||||
// * Invoice mail state includes the mail options, branding attributes and the invoice details.
|
||||
// * @param {number} saleInvoiceId - Sale invoice id.
|
||||
// * @returns {Promise<SaleInvoiceMailState>}
|
||||
// */
|
||||
// async getInvoiceMailState(
|
||||
// saleInvoiceId: number,
|
||||
// ): Promise<SaleInvoiceMailState> {
|
||||
// const saleInvoice = await this.saleInvoiceModel
|
||||
// .query()
|
||||
// .findById(saleInvoiceId)
|
||||
// .withGraphFetched('customer')
|
||||
// .withGraphFetched('entries.item')
|
||||
// .withGraphFetched('pdfTemplate')
|
||||
// .throwIfNotFound();
|
||||
|
||||
// const mailOptions =
|
||||
// await this.invoiceMail.getInvoiceMailOptions(saleInvoiceId);
|
||||
|
||||
// // Transforms the sale invoice mail state.
|
||||
// const transformed = await this.transformer.transform(
|
||||
// saleInvoice,
|
||||
// new GetSaleInvoiceMailStateTransformer(),
|
||||
// {
|
||||
// mailOptions,
|
||||
// },
|
||||
// );
|
||||
// return transformed;
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user