Merge pull request #636 from bigcapitalhq/expand-export-page-size

fix: Expand the resources export page size limitation
This commit is contained in:
Ahmed Bouhuolia
2024-08-29 14:23:48 +02:00
committed by GitHub
13 changed files with 30 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { AccountsApplication } from './AccountsApplication'; import { AccountsApplication } from './AccountsApplication';
import { Exportable } from '../Export/Exportable'; import { Exportable } from '../Export/Exportable';
import { IAccountsFilter, IAccountsStructureType } from '@/interfaces'; import { IAccountsFilter, IAccountsStructureType } from '@/interfaces';
import { EXPORT_SIZE_LIMIT } from '../Export/constants';
@Service() @Service()
export class AccountsExportable extends Exportable { export class AccountsExportable extends Exportable {
@@ -20,7 +21,7 @@ export class AccountsExportable extends Exportable {
inactiveMode: false, inactiveMode: false,
...query, ...query,
structure: IAccountsStructureType.Flat, structure: IAccountsStructureType.Flat,
pageSize: 12000, pageSize: EXPORT_SIZE_LIMIT,
page: 1, page: 1,
} as IAccountsFilter; } as IAccountsFilter;

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { IItemsFilter } from '@/interfaces'; import { IItemsFilter } from '@/interfaces';
import { CustomersApplication } from './CustomersApplication'; import { CustomersApplication } from './CustomersApplication';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class CustomersExportable extends Exportable { export class CustomersExportable extends Exportable {
@@ -17,9 +18,9 @@ export class CustomersExportable extends Exportable {
const parsedQuery = { const parsedQuery = {
sortOrder: 'DESC', sortOrder: 'DESC',
columnSortBy: 'created_at', columnSortBy: 'created_at',
page: 1,
...query, ...query,
pageSize: 12, page: 1,
pageSize: EXPORT_SIZE_LIMIT,
} as IItemsFilter; } as IItemsFilter;
return this.customersApplication return this.customersApplication

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { IItemsFilter } from '@/interfaces'; import { IItemsFilter } from '@/interfaces';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { VendorsApplication } from './VendorsApplication'; import { VendorsApplication } from './VendorsApplication';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class VendorsExportable extends Exportable { export class VendorsExportable extends Exportable {
@@ -17,9 +18,9 @@ export class VendorsExportable extends Exportable {
const parsedQuery = { const parsedQuery = {
sortOrder: 'DESC', sortOrder: 'DESC',
columnSortBy: 'created_at', columnSortBy: 'created_at',
page: 1,
...query, ...query,
pageSize: 12, page: 1,
pageSize: EXPORT_SIZE_LIMIT,
} as IItemsFilter; } as IItemsFilter;
return this.vendorsApplication return this.vendorsApplication

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { Exportable } from '../Export/Exportable'; import { Exportable } from '../Export/Exportable';
import { IExpensesFilter } from '@/interfaces'; import { IExpensesFilter } from '@/interfaces';
import { ExpensesApplication } from './ExpensesApplication'; import { ExpensesApplication } from './ExpensesApplication';
import { EXPORT_SIZE_LIMIT } from '../Export/constants';
@Service() @Service()
export class ExpensesExportable extends Exportable { export class ExpensesExportable extends Exportable {
@@ -19,7 +20,7 @@ export class ExpensesExportable extends Exportable {
columnSortBy: 'created_at', columnSortBy: 'created_at',
...query, ...query,
page: 1, page: 1,
pageSize: 12000, pageSize: EXPORT_SIZE_LIMIT,
} as IExpensesFilter; } as IExpensesFilter;
return this.expensesApplication return this.expensesApplication

View File

@@ -0,0 +1 @@
export const EXPORT_SIZE_LIMIT = 9999999;

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { Exportable } from '../Export/Exportable'; import { Exportable } from '../Export/Exportable';
import { IItemsFilter } from '@/interfaces'; import { IItemsFilter } from '@/interfaces';
import { ItemsApplication } from './ItemsApplication'; import { ItemsApplication } from './ItemsApplication';
import { EXPORT_SIZE_LIMIT } from '../Export/constants';
@Service() @Service()
export class ItemsExportable extends Exportable { export class ItemsExportable extends Exportable {
@@ -19,7 +20,7 @@ export class ItemsExportable extends Exportable {
columnSortBy: 'created_at', columnSortBy: 'created_at',
page: 1, page: 1,
...query, ...query,
pageSize: 12, pageSize: EXPORT_SIZE_LIMIT,
} as IItemsFilter; } as IItemsFilter;
return this.itemsApplication return this.itemsApplication

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { IManualJournalsFilter } from '@/interfaces'; import { IManualJournalsFilter } from '@/interfaces';
import { Exportable } from '../Export/Exportable'; import { Exportable } from '../Export/Exportable';
import { ManualJournalsApplication } from './ManualJournalsApplication'; import { ManualJournalsApplication } from './ManualJournalsApplication';
import { EXPORT_SIZE_LIMIT } from '../Export/constants';
@Service() @Service()
export class ManualJournalsExportable extends Exportable { export class ManualJournalsExportable extends Exportable {
@@ -19,7 +20,7 @@ export class ManualJournalsExportable extends Exportable {
columnSortBy: 'created_at', columnSortBy: 'created_at',
...query, ...query,
page: 1, page: 1,
pageSize: 12000, pageSize: EXPORT_SIZE_LIMIT,
} as IManualJournalsFilter; } as IManualJournalsFilter;
return this.manualJournalsApplication return this.manualJournalsApplication

View File

@@ -1,6 +1,7 @@
import { Inject, Service } from 'typedi'; import { Inject, Service } from 'typedi';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { BillPaymentsApplication } from './BillPaymentsApplication'; import { BillPaymentsApplication } from './BillPaymentsApplication';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class BillPaymentExportable extends Exportable { export class BillPaymentExportable extends Exportable {
@@ -14,11 +15,11 @@ export class BillPaymentExportable extends Exportable {
*/ */
public exportable(tenantId: number, query: any) { public exportable(tenantId: number, query: any) {
const parsedQuery = { const parsedQuery = {
page: 1,
pageSize: 12,
...query,
sortOrder: 'desc', sortOrder: 'desc',
columnSortBy: 'created_at', columnSortBy: 'created_at',
...query,
page: 1,
pageSize: EXPORT_SIZE_LIMIT,
} as any; } as any;
return this.billPaymentsApplication return this.billPaymentsApplication

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { IBillsFilter } from '@/interfaces'; import { IBillsFilter } from '@/interfaces';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { BillsApplication } from './BillsApplication'; import { BillsApplication } from './BillsApplication';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class BillsExportable extends Exportable { export class BillsExportable extends Exportable {
@@ -19,7 +20,7 @@ export class BillsExportable extends Exportable {
columnSortBy: 'created_at', columnSortBy: 'created_at',
...query, ...query,
page: 1, page: 1,
pageSize: 12000, pageSize: EXPORT_SIZE_LIMIT,
} as IBillsFilter; } as IBillsFilter;
return this.billsApplication return this.billsApplication

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { ISalesInvoicesFilter } from '@/interfaces'; import { ISalesInvoicesFilter } from '@/interfaces';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { SaleEstimatesApplication } from './SaleEstimatesApplication'; import { SaleEstimatesApplication } from './SaleEstimatesApplication';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class SaleEstimatesExportable extends Exportable { export class SaleEstimatesExportable extends Exportable {
@@ -19,7 +20,7 @@ export class SaleEstimatesExportable extends Exportable {
columnSortBy: 'created_at', columnSortBy: 'created_at',
...query, ...query,
page: 1, page: 1,
pageSize: 12000, pageSize: EXPORT_SIZE_LIMIT,
} as ISalesInvoicesFilter; } as ISalesInvoicesFilter;
return this.saleEstimatesApplication return this.saleEstimatesApplication

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { ISalesInvoicesFilter } from '@/interfaces'; import { ISalesInvoicesFilter } from '@/interfaces';
import { SaleInvoiceApplication } from './SaleInvoicesApplication'; import { SaleInvoiceApplication } from './SaleInvoicesApplication';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class SaleInvoicesExportable extends Exportable { export class SaleInvoicesExportable extends Exportable {
@@ -19,7 +20,7 @@ export class SaleInvoicesExportable extends Exportable {
columnSortBy: 'created_at', columnSortBy: 'created_at',
...query, ...query,
page: 1, page: 1,
pageSize: 120000, pageSize: EXPORT_SIZE_LIMIT,
} as ISalesInvoicesFilter; } as ISalesInvoicesFilter;
return this.saleInvoicesApplication return this.saleInvoicesApplication

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { IAccountsStructureType, IPaymentsReceivedFilter } from '@/interfaces'; import { IAccountsStructureType, IPaymentsReceivedFilter } from '@/interfaces';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { PaymentReceivesApplication } from './PaymentReceivedApplication'; import { PaymentReceivesApplication } from './PaymentReceivedApplication';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class PaymentsReceivedExportable extends Exportable { export class PaymentsReceivedExportable extends Exportable {
@@ -21,6 +22,8 @@ export class PaymentsReceivedExportable extends Exportable {
inactiveMode: false, inactiveMode: false,
...query, ...query,
structure: IAccountsStructureType.Flat, structure: IAccountsStructureType.Flat,
page: 1,
pageSize: EXPORT_SIZE_LIMIT,
} as IPaymentsReceivedFilter; } as IPaymentsReceivedFilter;
return this.paymentReceivedApp return this.paymentReceivedApp

View File

@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
import { ISalesReceiptsFilter } from '@/interfaces'; import { ISalesReceiptsFilter } from '@/interfaces';
import { Exportable } from '@/services/Export/Exportable'; import { Exportable } from '@/services/Export/Exportable';
import { SaleReceiptApplication } from './SaleReceiptApplication'; import { SaleReceiptApplication } from './SaleReceiptApplication';
import { EXPORT_SIZE_LIMIT } from '@/services/Export/constants';
@Service() @Service()
export class SaleReceiptsExportable extends Exportable { export class SaleReceiptsExportable extends Exportable {
@@ -19,7 +20,7 @@ export class SaleReceiptsExportable extends Exportable {
columnSortBy: 'created_at', columnSortBy: 'created_at',
...query, ...query,
page: 1, page: 1,
pageSize: 12, pageSize: EXPORT_SIZE_LIMIT,
} as ISalesReceiptsFilter; } as ISalesReceiptsFilter;
return this.saleReceiptsApp return this.saleReceiptsApp