mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
refactor: reports to nestjs
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { isEmpty, sumBy } from 'lodash';
|
import { isEmpty, sumBy } from 'lodash';
|
||||||
import { ERRORS, MatchedTransactionPOJO } from './types';
|
import { ERRORS, MatchedTransactionPOJO } from './types';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { first, sumBy } from 'lodash';
|
import { first, sumBy } from 'lodash';
|
||||||
import { PromisePool } from '@supercharge/promise-pool';
|
import { PromisePool } from '@supercharge/promise-pool';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable global-require */
|
/* eslint-disable global-require */
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { Model } from 'objection';
|
import { Model } from 'objection';
|
||||||
// import TenantModel from 'models/TenantModel';
|
// import TenantModel from 'models/TenantModel';
|
||||||
// import ModelSettings from './ModelSetting';
|
// import ModelSettings from './ModelSetting';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { omit, sumBy } from 'lodash';
|
import { omit, sumBy } from 'lodash';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import * as composeAsync from 'async/compose';
|
import * as composeAsync from 'async/compose';
|
||||||
import { formatDateFields } from '@/utils/format-date-fields';
|
import { formatDateFields } from '@/utils/format-date-fields';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { ERRORS } from '../Bills.constants';
|
import { ERRORS } from '../Bills.constants';
|
||||||
import { BillsValidators } from './BillsValidators.service';
|
import { BillsValidators } from './BillsValidators.service';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { defaultTo, omit, isEmpty } from 'lodash';
|
import { defaultTo, omit, isEmpty } from 'lodash';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { TenancyContext } from '@/modules/Tenancy/TenancyContext.service';
|
import { TenancyContext } from '@/modules/Tenancy/TenancyContext.service';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { IFilterRole, IDynamicFilter } from './DynamicFilter.types';
|
import { IFilterRole, IDynamicFilter } from './DynamicFilter.types';
|
||||||
import { Parser } from '@/libs/logic-evaluation/Parser';
|
import { Parser } from '@/libs/logic-evaluation/Parser';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Model, raw } from 'objection';
|
import { Model, raw } from 'objection';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { ExpenseCategory } from './ExpenseCategory.model';
|
import { ExpenseCategory } from './ExpenseCategory.model';
|
||||||
import { Account } from '@/modules/Accounts/models/Account.model';
|
import { Account } from '@/modules/Accounts/models/Account.model';
|
||||||
import { TenantBaseModel } from '@/modules/System/models/TenantBaseModel';
|
import { TenantBaseModel } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { IDateRange, IFinancialDatePeriodsUnit } from '../types/Report.types';
|
import { IDateRange, IFinancialDatePeriodsUnit } from '../types/Report.types';
|
||||||
import { GConstructor } from '@/common/types/Constructor';
|
import { GConstructor } from '@/common/types/Constructor';
|
||||||
import { FinancialSheet } from './FinancialSheet';
|
import { FinancialSheet } from './FinancialSheet';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { ITableColumn, ITableColumnAccessor } from '../types/Table.types';
|
import { ITableColumn, ITableColumnAccessor } from '../types/Table.types';
|
||||||
import { IDateRange } from '../types/Report.types';
|
import { IDateRange } from '../types/Report.types';
|
||||||
import { Constructor, GConstructor } from '@/common/types/Constructor';
|
import { GConstructor } from '@/common/types/Constructor';
|
||||||
import { I18nService } from 'nestjs-i18n';
|
import { I18nService } from 'nestjs-i18n';
|
||||||
import { FinancialSheet } from './FinancialSheet';
|
import { FinancialSheet } from './FinancialSheet';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { ITableColumn, ITableColumnAccessor } from '../types/Table.types';
|
import { ITableColumn, ITableColumnAccessor } from '../types/Table.types';
|
||||||
import { IDateRange } from '../types/Report.types';
|
import { IDateRange } from '../types/Report.types';
|
||||||
import { GConstructor } from '@/common/types/Constructor';
|
import { GConstructor } from '@/common/types/Constructor';
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import { IARAgingSummaryQuery } from './ARAgingSummary.types';
|
import { IARAgingSummaryQuery } from './ARAgingSummary.types';
|
||||||
import { Get, Headers } from '@nestjs/common';
|
import { Controller, Get, Headers } from '@nestjs/common';
|
||||||
import { Query, Res } from '@nestjs/common';
|
import { Query, Res } from '@nestjs/common';
|
||||||
import { ARAgingSummaryApplication } from './ARAgingSummaryApplication';
|
import { ARAgingSummaryApplication } from './ARAgingSummaryApplication';
|
||||||
import { AcceptType } from '@/constants/accept-type';
|
import { AcceptType } from '@/constants/accept-type';
|
||||||
import { Response } from 'express';
|
import { Response } from 'express';
|
||||||
|
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||||
|
|
||||||
|
@Controller('reports/receivable-aging-summary')
|
||||||
|
@PublicRoute()
|
||||||
export class ARAgingSummaryController {
|
export class ARAgingSummaryController {
|
||||||
constructor(private readonly ARAgingSummaryApp: ARAgingSummaryApplication) {}
|
constructor(private readonly ARAgingSummaryApp: ARAgingSummaryApplication) {}
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,12 @@ import { AgingSummaryModule } from '../AgingSummary/AgingSummary.module';
|
|||||||
import { ARAgingSummaryRepository } from './ARAgingSummaryRepository';
|
import { ARAgingSummaryRepository } from './ARAgingSummaryRepository';
|
||||||
import { ARAgingSummaryApplication } from './ARAgingSummaryApplication';
|
import { ARAgingSummaryApplication } from './ARAgingSummaryApplication';
|
||||||
import { ARAgingSummaryController } from './ARAgingSummary.controller';
|
import { ARAgingSummaryController } from './ARAgingSummary.controller';
|
||||||
|
import { ARAgingSummaryMeta } from './ARAgingSummaryMeta';
|
||||||
|
import { FinancialSheetCommonModule } from '../../common/FinancialSheetCommon.module';
|
||||||
|
import { TenancyContext } from '@/modules/Tenancy/TenancyContext.service';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [AgingSummaryModule],
|
imports: [AgingSummaryModule, FinancialSheetCommonModule],
|
||||||
controllers: [ARAgingSummaryController],
|
controllers: [ARAgingSummaryController],
|
||||||
providers: [
|
providers: [
|
||||||
ARAgingSummaryTableInjectable,
|
ARAgingSummaryTableInjectable,
|
||||||
@@ -18,6 +21,8 @@ import { ARAgingSummaryController } from './ARAgingSummary.controller';
|
|||||||
ARAgingSummaryPdfInjectable,
|
ARAgingSummaryPdfInjectable,
|
||||||
ARAgingSummaryRepository,
|
ARAgingSummaryRepository,
|
||||||
ARAgingSummaryApplication,
|
ARAgingSummaryApplication,
|
||||||
|
ARAgingSummaryMeta,
|
||||||
|
TenancyContext,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class ARAgingSummaryModule {}
|
export class ARAgingSummaryModule {}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class ARAgingSummaryApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the A/R aging summary sheet.
|
* Retrieve the A/R aging summary sheet.
|
||||||
* @param {IAPAgingSummaryQuery} query
|
* @param {IARAgingSummaryQuery} query
|
||||||
*/
|
*/
|
||||||
public sheet(query: IARAgingSummaryQuery) {
|
public sheet(query: IARAgingSummaryQuery) {
|
||||||
return this.ARAgingSummarySheet.ARAgingSummary(query);
|
return this.ARAgingSummarySheet.ARAgingSummary(query);
|
||||||
@@ -24,7 +24,6 @@ export class ARAgingSummaryApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the A/R aging summary in table format.
|
* Retrieve the A/R aging summary in table format.
|
||||||
* @param {number} tenantId
|
|
||||||
* @param {IAPAgingSummaryQuery} query
|
* @param {IAPAgingSummaryQuery} query
|
||||||
*/
|
*/
|
||||||
public table(query: IARAgingSummaryQuery) {
|
public table(query: IARAgingSummaryQuery) {
|
||||||
@@ -33,7 +32,6 @@ export class ARAgingSummaryApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the A/R aging summary in XLSX format.
|
* Retrieve the A/R aging summary in XLSX format.
|
||||||
* @param {number} tenantId
|
|
||||||
* @param {IAPAgingSummaryQuery} query
|
* @param {IAPAgingSummaryQuery} query
|
||||||
*/
|
*/
|
||||||
public xlsx(query: IARAgingSummaryQuery) {
|
public xlsx(query: IARAgingSummaryQuery) {
|
||||||
@@ -42,7 +40,6 @@ export class ARAgingSummaryApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the A/R aging summary in CSV format.
|
* Retrieve the A/R aging summary in CSV format.
|
||||||
* @param {number} tenantId
|
|
||||||
* @param {IAPAgingSummaryQuery} query
|
* @param {IAPAgingSummaryQuery} query
|
||||||
*/
|
*/
|
||||||
public csv(query: IARAgingSummaryQuery) {
|
public csv(query: IARAgingSummaryQuery) {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import { Inject } from '@nestjs/common';
|
||||||
import { isEmpty, groupBy } from 'lodash';
|
import { isEmpty, groupBy } from 'lodash';
|
||||||
import { Customer } from '@/modules/Customers/models/Customer';
|
import { Customer } from '@/modules/Customers/models/Customer';
|
||||||
import { SaleInvoice } from '@/modules/SaleInvoices/models/SaleInvoice';
|
import { SaleInvoice } from '@/modules/SaleInvoices/models/SaleInvoice';
|
||||||
import { ModelObject } from 'objection';
|
import { ModelObject } from 'objection';
|
||||||
import { IARAgingSummaryQuery } from './ARAgingSummary.types';
|
import { IARAgingSummaryQuery } from './ARAgingSummary.types';
|
||||||
import { TenancyContext } from '@/modules/Tenancy/TenancyContext.service';
|
import { TenancyContext } from '@/modules/Tenancy/TenancyContext.service';
|
||||||
import { Inject } from '@nestjs/common';
|
|
||||||
|
|
||||||
export class ARAgingSummaryRepository {
|
export class ARAgingSummaryRepository {
|
||||||
@Inject(TenancyContext)
|
@Inject(TenancyContext)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
import * as moment from 'moment';
|
||||||
|
|
||||||
|
|
||||||
export const getARAgingSummaryDefaultQuery = () => {
|
export const getARAgingSummaryDefaultQuery = () => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as moment from 'moment';
|
|||||||
import { IAgingPeriod } from './AgingSummary.types';
|
import { IAgingPeriod } from './AgingSummary.types';
|
||||||
import { FinancialSheet } from '../../common/FinancialSheet';
|
import { FinancialSheet } from '../../common/FinancialSheet';
|
||||||
|
|
||||||
export abstract class AgingReport extends FinancialSheet {
|
export class AgingReport extends FinancialSheet {
|
||||||
/**
|
/**
|
||||||
* Retrieve the aging periods range.
|
* Retrieve the aging periods range.
|
||||||
* @param {string} asDay
|
* @param {string} asDay
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { AgingSummaryMeta } from './AgingSummaryMeta';
|
import { AgingSummaryMeta } from './AgingSummaryMeta';
|
||||||
|
import { FinancialSheetCommonModule } from '../../common/FinancialSheetCommon.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
|
imports: [FinancialSheetCommonModule],
|
||||||
exports: [AgingSummaryMeta],
|
exports: [AgingSummaryMeta],
|
||||||
providers: [AgingSummaryMeta],
|
providers: [AgingSummaryMeta],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { FinancialSheetMeta } from '../../common/FinancialSheetMeta';
|
import { FinancialSheetMeta } from '../../common/FinancialSheetMeta';
|
||||||
import { IAgingSummaryMeta, IAgingSummaryQuery } from './AgingSummary.types';
|
import { IAgingSummaryMeta, IAgingSummaryQuery } from './AgingSummary.types';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import {
|
import {
|
||||||
ICustomerBalanceSummaryMeta,
|
ICustomerBalanceSummaryMeta,
|
||||||
ICustomerBalanceSummaryQuery,
|
ICustomerBalanceSummaryQuery,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
import * as moment from 'moment';
|
||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
import {
|
import {
|
||||||
IGeneralLedgerMeta,
|
IGeneralLedgerMeta,
|
||||||
IGeneralLedgerSheetQuery,
|
IGeneralLedgerSheetQuery,
|
||||||
} from './GeneralLedger.types';
|
} from './GeneralLedger.types';
|
||||||
import moment from 'moment';
|
|
||||||
import { Injectable } from '@nestjs/common';
|
|
||||||
import { FinancialSheetMeta } from '../../common/FinancialSheetMeta';
|
import { FinancialSheetMeta } from '../../common/FinancialSheetMeta';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import {
|
import {
|
||||||
IGeneralLedgerSheetQuery,
|
IGeneralLedgerSheetQuery,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ModelObject, raw } from 'objection';
|
import { ModelObject, raw } from 'objection';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { IInventoryDetailsQuery } from './InventoryItemDetails.types';
|
import { IInventoryDetailsQuery } from './InventoryItemDetails.types';
|
||||||
import { Item } from '@/modules/Items/models/Item';
|
import { Item } from '@/modules/Items/models/Item';
|
||||||
import { InventoryTransaction } from '@/modules/InventoryCost/models/InventoryTransaction';
|
import { InventoryTransaction } from '@/modules/InventoryCost/models/InventoryTransaction';
|
||||||
|
|||||||
@@ -5,14 +5,23 @@ import { InventoryValuationMetaInjectable } from './InventoryValuationSheetMeta'
|
|||||||
import { InventoryValuationController } from './InventoryValuation.controller';
|
import { InventoryValuationController } from './InventoryValuation.controller';
|
||||||
import { InventoryValuationSheetService } from './InventoryValuationSheetService';
|
import { InventoryValuationSheetService } from './InventoryValuationSheetService';
|
||||||
import { InventoryValuationSheetApplication } from './InventoryValuationSheetApplication';
|
import { InventoryValuationSheetApplication } from './InventoryValuationSheetApplication';
|
||||||
|
import { FinancialSheetCommonModule } from '../../common/FinancialSheetCommon.module';
|
||||||
|
import { InventoryValuationSheetRepository } from './InventoryValuationSheetRepository';
|
||||||
|
import { InventoryValuationSheetExportable } from './InventoryValuationSheetExportable';
|
||||||
|
import { InventoryCostModule } from '@/modules/InventoryCost/InventoryCost.module';
|
||||||
|
import { TenancyContext } from '@/modules/Tenancy/TenancyContext.service';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
|
imports: [FinancialSheetCommonModule, InventoryCostModule],
|
||||||
providers: [
|
providers: [
|
||||||
InventoryValuationSheetPdf,
|
InventoryValuationSheetPdf,
|
||||||
InventoryValuationSheetTableInjectable,
|
InventoryValuationSheetTableInjectable,
|
||||||
InventoryValuationMetaInjectable,
|
InventoryValuationMetaInjectable,
|
||||||
InventoryValuationSheetService,
|
InventoryValuationSheetService,
|
||||||
InventoryValuationSheetApplication,
|
InventoryValuationSheetApplication,
|
||||||
|
InventoryValuationSheetRepository,
|
||||||
|
InventoryValuationSheetExportable,
|
||||||
|
TenancyContext
|
||||||
],
|
],
|
||||||
controllers: [InventoryValuationController],
|
controllers: [InventoryValuationController],
|
||||||
exports: [InventoryValuationSheetApplication],
|
exports: [InventoryValuationSheetApplication],
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import * as moment from 'moment';
|
||||||
|
|
||||||
export enum ROW_TYPE {
|
export enum ROW_TYPE {
|
||||||
ITEM = 'ITEM',
|
ITEM = 'ITEM',
|
||||||
TOTAL = 'TOTAL',
|
TOTAL = 'TOTAL',
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { FinancialSheetMeta } from '../../common/FinancialSheetMeta';
|
|
||||||
import { ISalesByItemsReportQuery, ISalesByItemsSheetMeta } from './SalesByItems.types';
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { I18nService } from 'nestjs-i18n';
|
import { FinancialSheetMeta } from '../../common/FinancialSheetMeta';
|
||||||
|
import {
|
||||||
|
ISalesByItemsReportQuery,
|
||||||
|
ISalesByItemsSheetMeta,
|
||||||
|
} from './SalesByItems.types';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SalesByItemsMeta {
|
export class SalesByItemsMeta {
|
||||||
constructor(
|
constructor(private financialSheetMeta: FinancialSheetMeta) {}
|
||||||
private financialSheetMeta: FinancialSheetMeta,
|
|
||||||
private i18n: I18nService,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the sales by items meta.
|
* Retrieve the sales by items meta.
|
||||||
* @returns {IBalanceSheetMeta}
|
* @returns {IBalanceSheetMeta}
|
||||||
*/
|
*/
|
||||||
public async meta(
|
public async meta(
|
||||||
query: ISalesByItemsReportQuery
|
query: ISalesByItemsReportQuery,
|
||||||
): Promise<ISalesByItemsSheetMeta> {
|
): Promise<ISalesByItemsSheetMeta> {
|
||||||
const commonMeta = await this.financialSheetMeta.meta();
|
const commonMeta = await this.financialSheetMeta.meta();
|
||||||
const formattedToDate = moment(query.toDate).format('YYYY/MM/DD');
|
const formattedToDate = moment(query.toDate).format('YYYY/MM/DD');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { ITransactionsByContactsContact } from './TransactionsByContact.types';
|
import { ITransactionsByContactsContact } from './TransactionsByContact.types';
|
||||||
import { ITableRow } from '../../types/Table.types';
|
import { ITableRow } from '../../types/Table.types';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import bluebird from 'bluebird';
|
import bluebird from 'bluebird';
|
||||||
import { deleteImportFile } from './_utils';
|
import { deleteImportFile } from './_utils';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Model } from 'objection';
|
import { Model } from 'objection';
|
||||||
import { castArray } from 'lodash';
|
import { castArray } from 'lodash';
|
||||||
import moment, { unitOfTime } from 'moment';
|
import * as moment from 'moment';
|
||||||
|
import { unitOfTime } from 'moment';
|
||||||
import { SaleInvoice } from '@/modules/SaleInvoices/models/SaleInvoice';
|
import { SaleInvoice } from '@/modules/SaleInvoices/models/SaleInvoice';
|
||||||
import { SaleReceipt } from '@/modules/SaleReceipts/models/SaleReceipt';
|
import { SaleReceipt } from '@/modules/SaleReceipts/models/SaleReceipt';
|
||||||
import { Item } from '@/modules/Items/models/Item';
|
import { Item } from '@/modules/Items/models/Item';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import * as moment from 'moment';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import moment from 'moment';
|
|
||||||
import { SaleEstimate } from '../models/SaleEstimate';
|
import { SaleEstimate } from '../models/SaleEstimate';
|
||||||
import { events } from '@/common/events/events';
|
import { events } from '@/common/events/events';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { Model } from 'objection';
|
import { Model } from 'objection';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { TenantBaseModel } from '@/modules/System/models/TenantBaseModel';
|
import { TenantBaseModel } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import {
|
import {
|
||||||
ISaleReceiptEventClosedPayload,
|
ISaleReceiptEventClosedPayload,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
|||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { sumBy, omit } from 'lodash';
|
import { sumBy, omit } from 'lodash';
|
||||||
import * as composeAsync from 'async/compose';
|
import * as composeAsync from 'async/compose';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { SaleReceiptIncrement } from './SaleReceiptIncrement.service';
|
import { SaleReceiptIncrement } from './SaleReceiptIncrement.service';
|
||||||
import { ItemsEntriesService } from '@/modules/Items/ItemsEntries.service';
|
import { ItemsEntriesService } from '@/modules/Items/ItemsEntries.service';
|
||||||
import { BranchTransactionDTOTransformer } from '@/modules/Branches/integrations/BranchTransactionDTOTransform';
|
import { BranchTransactionDTOTransformer } from '@/modules/Branches/integrations/BranchTransactionDTOTransform';
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import moment, { unitOfTime } from 'moment';
|
import * as moment from 'moment';
|
||||||
|
import { unitOfTime } from 'moment';
|
||||||
|
|
||||||
export class SubscriptionPeriod {
|
export class SubscriptionPeriod {
|
||||||
private start: Date;
|
private start: Date;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Model, mixin } from 'objection';
|
import { Model, mixin } from 'objection';
|
||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { SubscriptionPeriod } from '../SubscriptionPeriod';
|
import { SubscriptionPeriod } from '../SubscriptionPeriod';
|
||||||
import { SystemModel } from '@/modules/System/models/SystemModel';
|
import { SystemModel } from '@/modules/System/models/SystemModel';
|
||||||
import { SubscriptionPaymentStatus } from '@/interfaces/SubscriptionPlan';
|
import { SubscriptionPaymentStatus } from '@/interfaces/SubscriptionPlan';
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import moment, { MomentInput } from 'moment';
|
import * as moment from 'moment';
|
||||||
|
import { MomentInput } from 'moment';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { TransactionsLockingGroup } from '../types/TransactionsLocking.types';
|
import { TransactionsLockingGroup } from '../types/TransactionsLocking.types';
|
||||||
import { TransactionsLockingRepository } from '../TransactionsLockingRepository';
|
import { TransactionsLockingRepository } from '../TransactionsLockingRepository';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { ERRORS } from '../constants';
|
import { ERRORS } from '../constants';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { defaultTo, isEmpty } from 'lodash';
|
import { defaultTo, isEmpty } from 'lodash';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { IVendorEditDTO, IVendorNewDTO } from '../types/Vendors.types';
|
import { IVendorEditDTO, IVendorNewDTO } from '../types/Vendors.types';
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ export const transformToMapKeyValue = <T, K extends string | number>(
|
|||||||
collection: T[],
|
collection: T[],
|
||||||
key: keyof T,
|
key: keyof T,
|
||||||
): Map<K, T> => {
|
): Map<K, T> => {
|
||||||
|
// @ts-ignore
|
||||||
return new Map(collection.map((item) => [item[key], item]));
|
return new Map(collection.map((item) => [item[key], item]));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user