feat(server): add Query DTOs for consistent filtering across modules
- Add GetBillsQuery.dto.ts, GetCreditNotesQuery.dto.ts, GetExpensesQuery.dto.ts - Add GetItemCategoriesQuery.dto.ts, GetManualJournalsQuery.dto.ts - Add GetPaymentsReceivedQuery.dto.ts, GetSaleEstimatesQuery.dto.ts - Add GetSaleInvoicesQuery.dto.ts, GetSaleReceiptsQuery.dto.ts, GetVendorCreditsQuery.dto.ts - Update DynamicFilterQuery.dto.ts with enhanced filter options - Refactor controllers and services to use new Query DTOs - Update SDK schema and sale-estimates types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,8 @@ import { CreateBill } from './commands/CreateBill.service';
|
|||||||
import { EditBillService } from './commands/EditBill.service';
|
import { EditBillService } from './commands/EditBill.service';
|
||||||
import { GetBill } from './queries/GetBill';
|
import { GetBill } from './queries/GetBill';
|
||||||
import { DeleteBill } from './commands/DeleteBill.service';
|
import { DeleteBill } from './commands/DeleteBill.service';
|
||||||
import { IBillDTO, IBillEditDTO, IBillsFilter } from './Bills.types';
|
import { IBillDTO, IBillEditDTO } from './Bills.types';
|
||||||
|
import { GetBillsQueryDto } from './dtos/GetBillsQuery.dto';
|
||||||
import { GetDueBills } from './queries/GetDueBills.service';
|
import { GetDueBills } from './queries/GetDueBills.service';
|
||||||
import { OpenBillService } from './commands/OpenBill.service';
|
import { OpenBillService } from './commands/OpenBill.service';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
@@ -78,9 +79,9 @@ export class BillsApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve bills data table list.
|
* Retrieve bills data table list.
|
||||||
* @param {IBillsFilter} billsFilter -
|
* @param {GetBillsQueryDto} filterDTO -
|
||||||
*/
|
*/
|
||||||
public getBills(filterDTO: Partial<IBillsFilter>) {
|
public getBills(filterDTO: GetBillsQueryDto) {
|
||||||
return this.getBillsService.getBills(filterDTO);
|
return this.getBillsService.getBills(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import {
|
|||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { BillsApplication } from './Bills.application';
|
import { BillsApplication } from './Bills.application';
|
||||||
import { IBillsFilter } from './Bills.types';
|
|
||||||
import { CreateBillDto, EditBillDto } from './dtos/Bill.dto';
|
import { CreateBillDto, EditBillDto } from './dtos/Bill.dto';
|
||||||
|
import { GetBillsQueryDto } from './dtos/GetBillsQuery.dto';
|
||||||
import { BillResponseDto } from './dtos/BillResponse.dto';
|
import { BillResponseDto } from './dtos/BillResponse.dto';
|
||||||
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
||||||
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||||
@@ -141,7 +141,7 @@ export class BillsController {
|
|||||||
type: Number,
|
type: Number,
|
||||||
description: 'The bill id',
|
description: 'The bill id',
|
||||||
})
|
})
|
||||||
getBills(@Query() filterDTO: Partial<IBillsFilter>) {
|
getBills(@Query() filterDTO: GetBillsQueryDto) {
|
||||||
return this.billsApplication.getBills(filterDTO);
|
return this.billsApplication.getBills(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetBillsQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -5,7 +5,7 @@ import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service
|
|||||||
import { Bill } from '../models/Bill';
|
import { Bill } from '../models/Bill';
|
||||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||||
import { BillTransformer } from './Bill.transformer';
|
import { BillTransformer } from './Bill.transformer';
|
||||||
import { IBillsFilter } from '../Bills.types';
|
import { GetBillsQueryDto } from '../dtos/GetBillsQuery.dto';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -19,10 +19,10 @@ export class GetBillsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve bills data table list.
|
* Retrieve bills data table list.
|
||||||
* @param {IBillsFilter} billsFilter -
|
* @param {GetBillsQueryDto} filterDTO -
|
||||||
*/
|
*/
|
||||||
public async getBills(filterDTO: Partial<IBillsFilter>): Promise<{
|
public async getBills(filterDTO: GetBillsQueryDto): Promise<{
|
||||||
bills: Bill;
|
data: Bill[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
filterMeta: IFilterMeta;
|
filterMeta: IFilterMeta;
|
||||||
}> {
|
}> {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { DeleteCreditNoteService } from './commands/DeleteCreditNote.service';
|
|||||||
import { EditCreditNoteService } from './commands/EditCreditNote.service';
|
import { EditCreditNoteService } from './commands/EditCreditNote.service';
|
||||||
import { OpenCreditNoteService } from './commands/OpenCreditNote.service';
|
import { OpenCreditNoteService } from './commands/OpenCreditNote.service';
|
||||||
import { GetCreditNotePdf } from './queries/GetCreditNotePdf.serivce';
|
import { GetCreditNotePdf } from './queries/GetCreditNotePdf.serivce';
|
||||||
import { ICreditNotesQueryDTO } from './types/CreditNotes.types';
|
|
||||||
import { GetCreditNotesService } from './queries/GetCreditNotes.service';
|
import { GetCreditNotesService } from './queries/GetCreditNotes.service';
|
||||||
import { CreateCreditNoteDto, EditCreditNoteDto } from './dtos/CreditNote.dto';
|
import { CreateCreditNoteDto, EditCreditNoteDto } from './dtos/CreditNote.dto';
|
||||||
|
import { GetCreditNotesQueryDto } from './dtos/GetCreditNotesQuery.dto';
|
||||||
import { GetCreditNoteState } from './queries/GetCreditNoteState.service';
|
import { GetCreditNoteState } from './queries/GetCreditNoteState.service';
|
||||||
import { GetCreditNoteService } from './queries/GetCreditNote.service';
|
import { GetCreditNoteService } from './queries/GetCreditNote.service';
|
||||||
import { BulkDeleteCreditNotesService } from './BulkDeleteCreditNotes.service';
|
import { BulkDeleteCreditNotesService } from './BulkDeleteCreditNotes.service';
|
||||||
@@ -78,10 +78,10 @@ export class CreditNoteApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the credit notes list.
|
* Retrieves the credit notes list.
|
||||||
* @param {ICreditNotesQueryDTO} creditNotesQuery
|
* @param {GetCreditNotesQueryDto} creditNotesQuery
|
||||||
* @returns {Promise<GetCreditNotesResponse>}
|
* @returns {Promise<GetCreditNotesResponse>}
|
||||||
*/
|
*/
|
||||||
getCreditNotes(creditNotesQuery: ICreditNotesQueryDTO) {
|
getCreditNotes(creditNotesQuery: GetCreditNotesQueryDto) {
|
||||||
return this.getCreditNotesService.getCreditNotesList(creditNotesQuery);
|
return this.getCreditNotesService.getCreditNotesList(creditNotesQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import {
|
|||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CreditNoteApplication } from './CreditNoteApplication.service';
|
import { CreditNoteApplication } from './CreditNoteApplication.service';
|
||||||
import { ICreditNotesQueryDTO } from './types/CreditNotes.types';
|
|
||||||
import { CreateCreditNoteDto, EditCreditNoteDto } from './dtos/CreditNote.dto';
|
import { CreateCreditNoteDto, EditCreditNoteDto } from './dtos/CreditNote.dto';
|
||||||
|
import { GetCreditNotesQueryDto } from './dtos/GetCreditNotesQuery.dto';
|
||||||
import { CreditNoteResponseDto } from './dtos/CreditNoteResponse.dto';
|
import { CreditNoteResponseDto } from './dtos/CreditNoteResponse.dto';
|
||||||
import { CreditNoteStateResponseDto } from './dtos/CreditNoteStateResponse.dto';
|
import { CreditNoteStateResponseDto } from './dtos/CreditNoteStateResponse.dto';
|
||||||
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
||||||
@@ -126,7 +126,7 @@ export class CreditNotesController {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
getCreditNotes(@Query() creditNotesQuery: ICreditNotesQueryDTO) {
|
getCreditNotes(@Query() creditNotesQuery: GetCreditNotesQueryDto) {
|
||||||
return this.creditNoteApplication.getCreditNotes(creditNotesQuery);
|
return this.creditNoteApplication.getCreditNotes(creditNotesQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetCreditNotesQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -2,10 +2,8 @@ import { Inject, Injectable } from '@nestjs/common';
|
|||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import {
|
import { GetCreditNotesResponse } from '../types/CreditNotes.types';
|
||||||
GetCreditNotesResponse,
|
import { GetCreditNotesQueryDto } from '../dtos/GetCreditNotesQuery.dto';
|
||||||
ICreditNotesQueryDTO,
|
|
||||||
} from '../types/CreditNotes.types';
|
|
||||||
import { CreditNote } from '../models/CreditNote';
|
import { CreditNote } from '../models/CreditNote';
|
||||||
import { CreditNoteTransformer } from './CreditNoteTransformer';
|
import { CreditNoteTransformer } from './CreditNoteTransformer';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
@@ -32,10 +30,10 @@ export class GetCreditNotesService {
|
|||||||
/**
|
/**
|
||||||
* Retrieves the paginated and filterable credit notes list.
|
* Retrieves the paginated and filterable credit notes list.
|
||||||
* @param {number} tenantId -
|
* @param {number} tenantId -
|
||||||
* @param {ICreditNotesQueryDTO} creditNotesQuery -
|
* @param {GetCreditNotesQueryDto} creditNotesQuery -
|
||||||
*/
|
*/
|
||||||
public async getCreditNotesList(
|
public async getCreditNotesList(
|
||||||
filterDto: ICreditNotesQueryDTO,
|
filterDto: GetCreditNotesQueryDto,
|
||||||
): Promise<GetCreditNotesResponse> {
|
): Promise<GetCreditNotesResponse> {
|
||||||
const _filterDto = {
|
const _filterDto = {
|
||||||
sortOrder: 'desc',
|
sortOrder: 'desc',
|
||||||
|
|||||||
@@ -1,33 +1,46 @@
|
|||||||
import { ToNumber } from '@/common/decorators/Validators';
|
import { ToNumber } from '@/common/decorators/Validators';
|
||||||
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||||
import { IsArray, IsOptional, IsString } from 'class-validator';
|
import { IsArray, IsOptional, IsString } from 'class-validator';
|
||||||
import { IFilterRole, ISortOrder } from '../DynamicFilter/DynamicFilter.types';
|
import { IFilterRole, ISortOrder } from '../DynamicFilter/DynamicFilter.types';
|
||||||
|
|
||||||
export class DynamicFilterQueryDto {
|
export class DynamicFilterQueryDto {
|
||||||
|
@ApiPropertyOptional({ description: 'Custom view ID', type: Number })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@ToNumber()
|
@ToNumber()
|
||||||
customViewId?: number;
|
customViewId?: number;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ description: 'Filter roles', type: Array })
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
filterRoles?: IFilterRole[];
|
filterRoles?: IFilterRole[];
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ description: 'Column to sort by', type: String })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
columnSortBy: string;
|
columnSortBy: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ description: 'Sort order (asc/desc)', type: String })
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
sortOrder: ISortOrder;
|
sortOrder: ISortOrder;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({
|
||||||
|
description: 'Stringified filter roles',
|
||||||
|
type: String,
|
||||||
|
})
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
stringifiedFilterRoles?: string;
|
stringifiedFilterRoles?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ description: 'Search keyword', type: String })
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
searchKeyword?: string;
|
searchKeyword?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ description: 'View slug', type: String })
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
viewSlug?: string;
|
viewSlug?: string;
|
||||||
|
|
||||||
|
filterQuery?: (query: any) => void;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ExpensesApplication } from './ExpensesApplication.service';
|
import { ExpensesApplication } from './ExpensesApplication.service';
|
||||||
import { IExpensesFilter } from './Expenses.types';
|
import { GetExpensesQueryDto } from './dtos/GetExpensesQuery.dto';
|
||||||
import {
|
import {
|
||||||
ApiExtraModels,
|
ApiExtraModels,
|
||||||
ApiOperation,
|
ApiOperation,
|
||||||
@@ -151,7 +151,7 @@ export class ExpensesController {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
public getExpenses(@Query() filterDTO: IExpensesFilter) {
|
public getExpenses(@Query() filterDTO: GetExpensesQueryDto) {
|
||||||
return this.expensesApplication.getExpenses(filterDTO);
|
return this.expensesApplication.getExpenses(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { GetExpenseService } from './queries/GetExpense.service';
|
|||||||
import { IExpensesFilter } from './interfaces/Expenses.interface';
|
import { IExpensesFilter } from './interfaces/Expenses.interface';
|
||||||
import { GetExpensesService } from './queries/GetExpenses.service';
|
import { GetExpensesService } from './queries/GetExpenses.service';
|
||||||
import { CreateExpenseDto, EditExpenseDto } from './dtos/Expense.dto';
|
import { CreateExpenseDto, EditExpenseDto } from './dtos/Expense.dto';
|
||||||
|
import { GetExpensesQueryDto } from './dtos/GetExpensesQuery.dto';
|
||||||
import { BulkDeleteExpensesService } from './BulkDeleteExpenses.service';
|
import { BulkDeleteExpensesService } from './BulkDeleteExpenses.service';
|
||||||
import { ValidateBulkDeleteExpensesService } from './ValidateBulkDeleteExpenses.service';
|
import { ValidateBulkDeleteExpensesService } from './ValidateBulkDeleteExpenses.service';
|
||||||
|
|
||||||
@@ -95,9 +96,9 @@ export class ExpensesApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve expenses paginated list.
|
* Retrieve expenses paginated list.
|
||||||
* @param {IExpensesFilter} expensesFilter
|
* @param {GetExpensesQueryDto} filterDTO
|
||||||
*/
|
*/
|
||||||
public getExpenses(filterDTO: Partial<IExpensesFilter>) {
|
public getExpenses(filterDTO: GetExpensesQueryDto) {
|
||||||
return this.getExpensesService.getExpensesList(filterDTO);
|
return this.getExpensesService.getExpensesList(filterDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import { Exportable } from '../Export/Exportable';
|
|||||||
import { ExpensesApplication } from './ExpensesApplication.service';
|
import { ExpensesApplication } from './ExpensesApplication.service';
|
||||||
import { EXPORT_SIZE_LIMIT } from '../Export/constants';
|
import { EXPORT_SIZE_LIMIT } from '../Export/constants';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { IExpensesFilter } from './Expenses.types';
|
|
||||||
import { ExportableService } from '../Export/decorators/ExportableModel.decorator';
|
import { ExportableService } from '../Export/decorators/ExportableModel.decorator';
|
||||||
import { Expense } from './models/Expense.model';
|
import { Expense } from './models/Expense.model';
|
||||||
|
import { GetExpensesQueryDto } from './dtos/GetExpensesQuery.dto';
|
||||||
|
import { ISortOrder } from '@/modules/DynamicListing/DynamicFilter/DynamicFilter.types';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ExportableService({ name: Expense.name })
|
@ExportableService({ name: Expense.name })
|
||||||
@@ -17,20 +18,20 @@ export class ExpensesExportable extends Exportable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the accounts data to exportable sheet.
|
* Retrieves the accounts data to exportable sheet.
|
||||||
* @param {IExpensesFilter}
|
* @param {GetExpensesQueryDto} query
|
||||||
*/
|
*/
|
||||||
public exportable(query: IExpensesFilter) {
|
public exportable(query: GetExpensesQueryDto) {
|
||||||
const filterQuery = (query) => {
|
const filterQuery = (query) => {
|
||||||
query.withGraphFetched('branch');
|
query.withGraphFetched('branch');
|
||||||
};
|
};
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
sortOrder: 'desc',
|
sortOrder: 'desc' as ISortOrder,
|
||||||
columnSortBy: 'created_at',
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: EXPORT_SIZE_LIMIT,
|
pageSize: EXPORT_SIZE_LIMIT,
|
||||||
filterQuery,
|
filterQuery,
|
||||||
} as IExpensesFilter;
|
} as GetExpensesQueryDto;
|
||||||
|
|
||||||
return this.expensesApplication
|
return this.expensesApplication
|
||||||
.getExpenses(parsedQuery)
|
.getExpenses(parsedQuery)
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetExpensesQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -3,7 +3,8 @@ import { ExpenseTransfromer } from './Expense.transformer';
|
|||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { IExpensesFilter, IPaginationMeta } from '../Expenses.types';
|
import { IPaginationMeta } from '../Expenses.types';
|
||||||
|
import { GetExpensesQueryDto } from '../dtos/GetExpensesQuery.dto';
|
||||||
import { Expense } from '../models/Expense.model';
|
import { Expense } from '../models/Expense.model';
|
||||||
import { IFilterMeta } from '@/interfaces/Model';
|
import { IFilterMeta } from '@/interfaces/Model';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
@@ -20,11 +21,11 @@ export class GetExpensesService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve expenses paginated list.
|
* Retrieve expenses paginated list.
|
||||||
* @param {IExpensesFilter} expensesFilter
|
* @param {GetExpensesQueryDto} filterDTO
|
||||||
* @return {IExpense[]}
|
* @return {IExpense[]}
|
||||||
*/
|
*/
|
||||||
public async getExpensesList(filterDto: Partial<IExpensesFilter>): Promise<{
|
public async getExpensesList(filterDTO: GetExpensesQueryDto): Promise<{
|
||||||
expenses: Expense[];
|
data: Expense[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
filterMeta: IFilterMeta;
|
filterMeta: IFilterMeta;
|
||||||
}> {
|
}> {
|
||||||
@@ -33,7 +34,7 @@ export class GetExpensesService {
|
|||||||
columnSortBy: 'created_at',
|
columnSortBy: 'created_at',
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 12,
|
pageSize: 12,
|
||||||
...filterDto,
|
...filterDTO,
|
||||||
};
|
};
|
||||||
// Parses list filter DTO.
|
// Parses list filter DTO.
|
||||||
const filter = this.parseListFilterDTO(_filterDto);
|
const filter = this.parseListFilterDTO(_filterDto);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import {
|
import {
|
||||||
IItemCategoriesFilter,
|
|
||||||
IItemCategoryOTD,
|
IItemCategoryOTD,
|
||||||
} from './ItemCategory.interfaces';
|
} from './ItemCategory.interfaces';
|
||||||
|
import { GetItemCategoriesQueryDto } from './dtos/GetItemCategoriesQuery.dto';
|
||||||
import { CreateItemCategoryService } from './commands/CreateItemCategory.service';
|
import { CreateItemCategoryService } from './commands/CreateItemCategory.service';
|
||||||
import { DeleteItemCategoryService } from './commands/DeleteItemCategory.service';
|
import { DeleteItemCategoryService } from './commands/DeleteItemCategory.service';
|
||||||
import { EditItemCategoryService } from './commands/EditItemCategory.service';
|
import { EditItemCategoryService } from './commands/EditItemCategory.service';
|
||||||
@@ -75,10 +75,10 @@ export class ItemCategoryApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the item categories list.
|
* Retrieves the item categories list.
|
||||||
* @param {IItemCategoriesFilter} filterDTO - The item categories filter DTO.
|
* @param {GetItemCategoriesQueryDto} filterDTO - The item categories filter DTO.
|
||||||
* @returns {Promise<GetItemCategoriesResponse>}
|
* @returns {Promise<GetItemCategoriesResponse>}
|
||||||
*/
|
*/
|
||||||
public getItemCategories(filterDTO: Partial<IItemCategoriesFilter>) {
|
public getItemCategories(filterDTO: GetItemCategoriesQueryDto) {
|
||||||
return this.getItemCategoriesService.getItemCategories(filterDTO);
|
return this.getItemCategoriesService.getItemCategories(filterDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,7 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ItemCategoryApplication } from './ItemCategory.application';
|
import { ItemCategoryApplication } from './ItemCategory.application';
|
||||||
import {
|
import { GetItemCategoriesResponse } from './ItemCategory.interfaces';
|
||||||
GetItemCategoriesResponse,
|
|
||||||
IItemCategoriesFilter,
|
|
||||||
} from './ItemCategory.interfaces';
|
|
||||||
import {
|
import {
|
||||||
ApiExtraModels,
|
ApiExtraModels,
|
||||||
ApiOperation,
|
ApiOperation,
|
||||||
@@ -24,6 +21,7 @@ import {
|
|||||||
CreateItemCategoryDto,
|
CreateItemCategoryDto,
|
||||||
EditItemCategoryDto,
|
EditItemCategoryDto,
|
||||||
} from './dtos/ItemCategory.dto';
|
} from './dtos/ItemCategory.dto';
|
||||||
|
import { GetItemCategoriesQueryDto } from './dtos/GetItemCategoriesQuery.dto';
|
||||||
import { ItemCategoryResponseDto } from './dtos/ItemCategoryResponse.dto';
|
import { ItemCategoryResponseDto } from './dtos/ItemCategoryResponse.dto';
|
||||||
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ export class ItemCategoryController {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
async getItemCategories(
|
async getItemCategories(
|
||||||
@Query() filterDTO: Partial<IItemCategoriesFilter>,
|
@Query() filterDTO: GetItemCategoriesQueryDto,
|
||||||
): Promise<GetItemCategoriesResponse> {
|
): Promise<GetItemCategoriesResponse> {
|
||||||
return this.itemCategoryApplication.getItemCategories(filterDTO);
|
return this.itemCategoryApplication.getItemCategories(filterDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetItemCategoriesQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -2,10 +2,8 @@ import * as R from 'ramda';
|
|||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import { ItemCategory } from '../models/ItemCategory.model';
|
import { ItemCategory } from '../models/ItemCategory.model';
|
||||||
import { Inject } from '@nestjs/common';
|
import { Inject } from '@nestjs/common';
|
||||||
import {
|
import { GetItemCategoriesResponse } from '../ItemCategory.interfaces';
|
||||||
GetItemCategoriesResponse,
|
import { GetItemCategoriesQueryDto } from '../dtos/GetItemCategoriesQuery.dto';
|
||||||
IItemCategoriesFilter,
|
|
||||||
} from '../ItemCategory.interfaces';
|
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
import { ISortOrder } from '@/modules/DynamicListing/DynamicFilter/DynamicFilter.types';
|
import { ISortOrder } from '@/modules/DynamicListing/DynamicFilter/DynamicFilter.types';
|
||||||
|
|
||||||
@@ -31,11 +29,11 @@ export class GetItemCategoriesService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve item categories list.
|
* Retrieve item categories list.
|
||||||
* @param {IItemCategoriesFilter} filterDTO
|
* @param {GetItemCategoriesQueryDto} filterDTO
|
||||||
* @returns {Promise<GetItemCategoriesResponse>}
|
* @returns {Promise<GetItemCategoriesResponse>}
|
||||||
*/
|
*/
|
||||||
public async getItemCategories(
|
public async getItemCategories(
|
||||||
filterDto: Partial<IItemCategoriesFilter>,
|
filterDto: GetItemCategoriesQueryDto,
|
||||||
): Promise<GetItemCategoriesResponse> {
|
): Promise<GetItemCategoriesResponse> {
|
||||||
const _filterDto = {
|
const _filterDto = {
|
||||||
sortOrder: ISortOrder.ASC,
|
sortOrder: ISortOrder.ASC,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
CreateManualJournalDto,
|
CreateManualJournalDto,
|
||||||
EditManualJournalDto,
|
EditManualJournalDto,
|
||||||
} from './dtos/ManualJournal.dto';
|
} from './dtos/ManualJournal.dto';
|
||||||
import { IManualJournalsFilter } from './types/ManualJournals.types';
|
import { GetManualJournalsQueryDto } from './dtos/GetManualJournalsQuery.dto';
|
||||||
import { ManualJournalResponseDto } from './dtos/ManualJournalResponse.dto';
|
import { ManualJournalResponseDto } from './dtos/ManualJournalResponse.dto';
|
||||||
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||||
import {
|
import {
|
||||||
@@ -194,7 +194,7 @@ export class ManualJournalsController {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ApiResponse({ status: 404, description: 'The manual journal not found.' })
|
@ApiResponse({ status: 404, description: 'The manual journal not found.' })
|
||||||
public getManualJournals(@Query() filterDto: Partial<IManualJournalsFilter>) {
|
public getManualJournals(@Query() filterDto: GetManualJournalsQueryDto) {
|
||||||
return this.manualJournalsApplication.getManualJournals(filterDto);
|
return this.manualJournalsApplication.getManualJournals(filterDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import { EditManualJournal } from './commands/EditManualJournal.service';
|
|||||||
import { PublishManualJournal } from './commands/PublishManualJournal.service';
|
import { PublishManualJournal } from './commands/PublishManualJournal.service';
|
||||||
import { GetManualJournal } from './queries/GetManualJournal.service';
|
import { GetManualJournal } from './queries/GetManualJournal.service';
|
||||||
import { DeleteManualJournalService } from './commands/DeleteManualJournal.service';
|
import { DeleteManualJournalService } from './commands/DeleteManualJournal.service';
|
||||||
import { IManualJournalsFilter } from './types/ManualJournals.types';
|
|
||||||
import {
|
import {
|
||||||
CreateManualJournalDto,
|
CreateManualJournalDto,
|
||||||
EditManualJournalDto,
|
EditManualJournalDto,
|
||||||
} from './dtos/ManualJournal.dto';
|
} from './dtos/ManualJournal.dto';
|
||||||
|
import { GetManualJournalsQueryDto } from './dtos/GetManualJournalsQuery.dto';
|
||||||
import { GetManualJournals } from './queries/GetManualJournals.service';
|
import { GetManualJournals } from './queries/GetManualJournals.service';
|
||||||
import { BulkDeleteManualJournalsService } from './BulkDeleteManualJournals.service';
|
import { BulkDeleteManualJournalsService } from './BulkDeleteManualJournals.service';
|
||||||
import { ValidateBulkDeleteManualJournalsService } from './ValidateBulkDeleteManualJournals.service';
|
import { ValidateBulkDeleteManualJournalsService } from './ValidateBulkDeleteManualJournals.service';
|
||||||
@@ -105,9 +105,9 @@ export class ManualJournalsApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the paginated manual journals.
|
* Retrieves the paginated manual journals.
|
||||||
* @param {IManualJournalsFilter} filterDTO
|
* @param {GetManualJournalsQueryDto} filterDTO
|
||||||
*/
|
*/
|
||||||
public getManualJournals = (filterDTO: Partial<IManualJournalsFilter>) => {
|
public getManualJournals = (filterDTO: GetManualJournalsQueryDto) => {
|
||||||
return this.getManualJournalsService.getManualJournals(filterDTO);
|
return this.getManualJournalsService.getManualJournals(filterDTO);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetManualJournalsQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -5,7 +5,7 @@ import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectab
|
|||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import { ManualJournal } from '../models/ManualJournal';
|
import { ManualJournal } from '../models/ManualJournal';
|
||||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||||
import { IManualJournalsFilter } from '../types/ManualJournals.types';
|
import { GetManualJournalsQueryDto } from '../dtos/GetManualJournalsQuery.dto';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -28,10 +28,10 @@ export class GetManualJournals {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve manual journals datatable list.
|
* Retrieve manual journals datatable list.
|
||||||
* @param {IManualJournalsFilter} filter -
|
* @param {GetManualJournalsQueryDto} filter -
|
||||||
*/
|
*/
|
||||||
public getManualJournals = async (
|
public getManualJournals = async (
|
||||||
filterDTO: Partial<IManualJournalsFilter>,
|
filterDTO: GetManualJournalsQueryDto,
|
||||||
): Promise<{
|
): Promise<{
|
||||||
manualJournals: ManualJournal[];
|
manualJournals: ManualJournal[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import {
|
import { PaymentReceiveMailOptsDTO } from './types/PaymentReceived.types';
|
||||||
IPaymentsReceivedFilter,
|
import { GetPaymentsReceivedQueryDto } from './dtos/GetPaymentsReceivedQuery.dto';
|
||||||
PaymentReceiveMailOptsDTO,
|
|
||||||
} from './types/PaymentReceived.types';
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { CreatePaymentReceivedService } from './commands/CreatePaymentReceived.serivce';
|
import { CreatePaymentReceivedService } from './commands/CreatePaymentReceived.serivce';
|
||||||
import { EditPaymentReceivedService } from './commands/EditPaymentReceived.service';
|
import { EditPaymentReceivedService } from './commands/EditPaymentReceived.service';
|
||||||
@@ -103,11 +101,11 @@ export class PaymentReceivesApplication {
|
|||||||
/**
|
/**
|
||||||
* Retrieve payment receives paginated and filterable.
|
* Retrieve payment receives paginated and filterable.
|
||||||
* @param {number} tenantId
|
* @param {number} tenantId
|
||||||
* @param {IPaymentsReceivedFilter} filterDTO
|
* @param {GetPaymentsReceivedQueryDto} filterDTO
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
public async getPaymentsReceived(
|
public async getPaymentsReceived(
|
||||||
filterDTO: Partial<IPaymentsReceivedFilter>,
|
filterDTO: GetPaymentsReceivedQueryDto,
|
||||||
) {
|
) {
|
||||||
return this.getPaymentsReceivedService.getPaymentReceives(filterDTO);
|
return this.getPaymentsReceivedService.getPaymentReceives(filterDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { PaymentReceivesApplication } from './PaymentReceived.application';
|
import { PaymentReceivesApplication } from './PaymentReceived.application';
|
||||||
import {
|
import {
|
||||||
IPaymentsReceivedFilter,
|
|
||||||
PaymentReceiveMailOptsDTO,
|
PaymentReceiveMailOptsDTO,
|
||||||
} from './types/PaymentReceived.types';
|
} from './types/PaymentReceived.types';
|
||||||
|
import { GetPaymentsReceivedQueryDto } from './dtos/GetPaymentsReceivedQuery.dto';
|
||||||
import {
|
import {
|
||||||
CreatePaymentReceivedDto,
|
CreatePaymentReceivedDto,
|
||||||
EditPaymentReceivedDto,
|
EditPaymentReceivedDto,
|
||||||
@@ -156,7 +156,7 @@ export class PaymentReceivesController {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
public getPaymentsReceived(
|
public getPaymentsReceived(
|
||||||
@Query() filterDTO: Partial<IPaymentsReceivedFilter>,
|
@Query() filterDTO: GetPaymentsReceivedQueryDto,
|
||||||
) {
|
) {
|
||||||
return this.paymentReceivesApplication.getPaymentsReceived(filterDTO);
|
return this.paymentReceivesApplication.getPaymentsReceived(filterDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetPaymentsReceivedQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -5,7 +5,7 @@ import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectab
|
|||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import { PaymentReceived } from '../models/PaymentReceived';
|
import { PaymentReceived } from '../models/PaymentReceived';
|
||||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||||
import { IPaymentsReceivedFilter } from '../types/PaymentReceived.types';
|
import { GetPaymentsReceivedQueryDto } from '../dtos/GetPaymentsReceivedQuery.dto';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -22,10 +22,10 @@ export class GetPaymentsReceivedService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve payment receives paginated and filterable list.
|
* Retrieve payment receives paginated and filterable list.
|
||||||
* @param {IPaymentsReceivedFilter} filterDTO
|
* @param {GetPaymentsReceivedQueryDto} filterDTO
|
||||||
*/
|
*/
|
||||||
public async getPaymentReceives(
|
public async getPaymentReceives(
|
||||||
filterDTO: Partial<IPaymentsReceivedFilter>,
|
filterDTO: GetPaymentsReceivedQueryDto,
|
||||||
): Promise<{
|
): Promise<{
|
||||||
paymentReceives: PaymentReceived[];
|
paymentReceives: PaymentReceived[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
|
|||||||
@@ -22,10 +22,7 @@ import {
|
|||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { SaleEstimatesApplication } from './SaleEstimates.application';
|
import { SaleEstimatesApplication } from './SaleEstimates.application';
|
||||||
import {
|
import { SaleEstimateMailOptionsDTO } from './types/SaleEstimates.types';
|
||||||
ISalesEstimatesFilter,
|
|
||||||
SaleEstimateMailOptionsDTO,
|
|
||||||
} from './types/SaleEstimates.types';
|
|
||||||
import { SaleEstimate } from './models/SaleEstimate';
|
import { SaleEstimate } from './models/SaleEstimate';
|
||||||
import {
|
import {
|
||||||
CreateSaleEstimateDto,
|
CreateSaleEstimateDto,
|
||||||
@@ -34,6 +31,7 @@ import {
|
|||||||
import { AcceptType } from '@/constants/accept-type';
|
import { AcceptType } from '@/constants/accept-type';
|
||||||
import { Response } from 'express';
|
import { Response } from 'express';
|
||||||
import { SaleEstimateResponseDto } from './dtos/SaleEstimateResponse.dto';
|
import { SaleEstimateResponseDto } from './dtos/SaleEstimateResponse.dto';
|
||||||
|
import { GetSaleEstimatesQueryDto } from './dtos/GetSaleEstimatesQuery.dto';
|
||||||
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
||||||
import { SaleEstiamteStateResponseDto } from './dtos/SaleEstimateStateResponse.dto';
|
import { SaleEstiamteStateResponseDto } from './dtos/SaleEstimateStateResponse.dto';
|
||||||
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||||
@@ -198,7 +196,7 @@ export class SaleEstimatesController {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
public getSaleEstimates(@Query() filterDTO: ISalesEstimatesFilter) {
|
public getSaleEstimates(@Query() filterDTO: GetSaleEstimatesQueryDto) {
|
||||||
return this.saleEstimatesApplication.getSaleEstimates(filterDTO);
|
return this.saleEstimatesApplication.getSaleEstimates(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetSaleEstimatesQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -12,10 +12,10 @@ import { GetSaleInvoiceState } from './queries/GetSaleInvoiceState.service';
|
|||||||
import { GetSaleInvoiceMailState } from './queries/GetSaleInvoiceMailState.service';
|
import { GetSaleInvoiceMailState } from './queries/GetSaleInvoiceMailState.service';
|
||||||
import {
|
import {
|
||||||
ISaleInvoiceWriteoffDTO,
|
ISaleInvoiceWriteoffDTO,
|
||||||
ISalesInvoicesFilter,
|
|
||||||
SaleInvoiceMailState,
|
SaleInvoiceMailState,
|
||||||
SendInvoiceMailDTO,
|
SendInvoiceMailDTO,
|
||||||
} from './SaleInvoice.types';
|
} from './SaleInvoice.types';
|
||||||
|
import { GetSaleInvoicesQueryDto } from './dtos/GetSaleInvoicesQuery.dto';
|
||||||
import { GetSaleInvoicesService } from './queries/GetSaleInvoices';
|
import { GetSaleInvoicesService } from './queries/GetSaleInvoices';
|
||||||
import { SendSaleInvoiceMail } from './commands/SendSaleInvoiceMail';
|
import { SendSaleInvoiceMail } from './commands/SendSaleInvoiceMail';
|
||||||
import {
|
import {
|
||||||
@@ -112,7 +112,7 @@ export class SaleInvoiceApplication {
|
|||||||
* @param {ISalesInvoicesFilter} filterDTO
|
* @param {ISalesInvoicesFilter} filterDTO
|
||||||
* @returns {Promise<{ salesInvoices: SaleInvoice[]; pagination: IPaginationMeta; filterMeta: IFilterMeta; }>}
|
* @returns {Promise<{ salesInvoices: SaleInvoice[]; pagination: IPaginationMeta; filterMeta: IFilterMeta; }>}
|
||||||
*/
|
*/
|
||||||
public getSaleInvoices(filterDTO: Partial<ISalesInvoicesFilter>) {
|
public getSaleInvoices(filterDTO: GetSaleInvoicesQueryDto) {
|
||||||
return this.getSaleInvoicesService.getSaleInvoices(filterDTO);
|
return this.getSaleInvoicesService.getSaleInvoices(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import {
|
import {
|
||||||
ISaleInvoiceWriteoffDTO,
|
ISaleInvoiceWriteoffDTO,
|
||||||
ISalesInvoicesFilter,
|
|
||||||
SaleInvoiceMailState,
|
SaleInvoiceMailState,
|
||||||
SendInvoiceMailDTO,
|
SendInvoiceMailDTO,
|
||||||
} from './SaleInvoice.types';
|
} from './SaleInvoice.types';
|
||||||
@@ -34,6 +33,7 @@ import {
|
|||||||
CreateSaleInvoiceDto,
|
CreateSaleInvoiceDto,
|
||||||
EditSaleInvoiceDto,
|
EditSaleInvoiceDto,
|
||||||
} from './dtos/SaleInvoice.dto';
|
} from './dtos/SaleInvoice.dto';
|
||||||
|
import { GetSaleInvoicesQueryDto } from './dtos/GetSaleInvoicesQuery.dto';
|
||||||
import { AcceptType } from '@/constants/accept-type';
|
import { AcceptType } from '@/constants/accept-type';
|
||||||
import { SaleInvoiceResponseDto } from './dtos/SaleInvoiceResponse.dto';
|
import { SaleInvoiceResponseDto } from './dtos/SaleInvoiceResponse.dto';
|
||||||
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
||||||
@@ -262,7 +262,7 @@ export class SaleInvoicesController {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
getSaleInvoices(@Query() filterDTO: Partial<ISalesInvoicesFilter>) {
|
getSaleInvoices(@Query() filterDTO: GetSaleInvoicesQueryDto) {
|
||||||
return this.saleInvoiceApplication.getSaleInvoices(filterDTO);
|
return this.saleInvoiceApplication.getSaleInvoices(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetSaleInvoicesQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -6,7 +6,7 @@ import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectab
|
|||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||||
import { SaleInvoice } from '../models/SaleInvoice';
|
import { SaleInvoice } from '../models/SaleInvoice';
|
||||||
import { ISalesInvoicesFilter } from '../SaleInvoice.types';
|
import { GetSaleInvoicesQueryDto } from '../dtos/GetSaleInvoicesQuery.dto';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -21,11 +21,11 @@ export class GetSaleInvoicesService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sales invoices filterable and paginated list.
|
* Retrieve sales invoices filterable and paginated list.
|
||||||
* @param {ISalesInvoicesFilter} filterDTO -
|
* @param {GetSaleInvoicesQueryDto} filterDTO -
|
||||||
* @returns {Promise<{ salesInvoices: SaleInvoice[]; pagination: IPaginationMeta; filterMeta: IFilterMeta; }>}
|
* @returns {Promise<{ data: SaleInvoice[]; pagination: IPaginationMeta; filterMeta: IFilterMeta; }>}
|
||||||
*/
|
*/
|
||||||
public async getSaleInvoices(
|
public async getSaleInvoices(
|
||||||
filterDTO: Partial<ISalesInvoicesFilter>,
|
filterDTO: GetSaleInvoicesQueryDto,
|
||||||
): Promise<{
|
): Promise<{
|
||||||
salesInvoices: SaleInvoice[];
|
salesInvoices: SaleInvoice[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import { GetSaleReceipt } from './queries/GetSaleReceipt.service';
|
|||||||
import { EditSaleReceipt } from './commands/EditSaleReceipt.service';
|
import { EditSaleReceipt } from './commands/EditSaleReceipt.service';
|
||||||
import {
|
import {
|
||||||
ISaleReceiptState,
|
ISaleReceiptState,
|
||||||
ISalesReceiptsFilter,
|
|
||||||
SaleReceiptMailOpts,
|
SaleReceiptMailOpts,
|
||||||
SaleReceiptMailOptsDTO,
|
SaleReceiptMailOptsDTO,
|
||||||
} from './types/SaleReceipts.types';
|
} from './types/SaleReceipts.types';
|
||||||
|
import { GetSaleReceiptsQueryDto } from './dtos/GetSaleReceiptsQuery.dto';
|
||||||
import { GetSaleReceiptsService } from './queries/GetSaleReceipts.service';
|
import { GetSaleReceiptsService } from './queries/GetSaleReceipts.service';
|
||||||
import { SaleReceipt } from './models/SaleReceipt';
|
import { SaleReceipt } from './models/SaleReceipt';
|
||||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||||
@@ -115,10 +115,10 @@ export class SaleReceiptApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sales receipts paginated and filterable list.
|
* Retrieve sales receipts paginated and filterable list.
|
||||||
* @param {ISalesReceiptsFilter} filterDTO
|
* @param {GetSaleReceiptsQueryDto} filterDTO
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
public async getSaleReceipts(filterDTO: ISalesReceiptsFilter): Promise<{
|
public async getSaleReceipts(filterDTO: GetSaleReceiptsQueryDto): Promise<{
|
||||||
data: SaleReceipt[];
|
data: SaleReceipt[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
filterMeta: IFilterMeta;
|
filterMeta: IFilterMeta;
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import {
|
|||||||
CreateSaleReceiptDto,
|
CreateSaleReceiptDto,
|
||||||
EditSaleReceiptDto,
|
EditSaleReceiptDto,
|
||||||
} from './dtos/SaleReceipt.dto';
|
} from './dtos/SaleReceipt.dto';
|
||||||
|
import { GetSaleReceiptsQueryDto } from './dtos/GetSaleReceiptsQuery.dto';
|
||||||
import {
|
import {
|
||||||
ISalesReceiptsFilter,
|
|
||||||
SaleReceiptMailOptsDTO,
|
SaleReceiptMailOptsDTO,
|
||||||
} from './types/SaleReceipts.types';
|
} from './types/SaleReceipts.types';
|
||||||
import { AcceptType } from '@/constants/accept-type';
|
import { AcceptType } from '@/constants/accept-type';
|
||||||
@@ -206,7 +206,7 @@ export class SaleReceiptsController {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
getSaleReceipts(@Query() filterDTO: Partial<ISalesReceiptsFilter>) {
|
getSaleReceipts(@Query() filterDTO: GetSaleReceiptsQueryDto) {
|
||||||
return this.saleReceiptApplication.getSaleReceipts(filterDTO);
|
return this.saleReceiptApplication.getSaleReceipts(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { Exportable } from '@/modules/Export/Exportable';
|
import { Exportable } from '@/modules/Export/Exportable';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { SaleReceiptApplication } from '../SaleReceiptApplication.service';
|
import { SaleReceiptApplication } from '../SaleReceiptApplication.service';
|
||||||
import { ISalesReceiptsFilter } from '../types/SaleReceipts.types';
|
|
||||||
import { EXPORT_SIZE_LIMIT } from '@/modules/Export/constants';
|
import { EXPORT_SIZE_LIMIT } from '@/modules/Export/constants';
|
||||||
|
import { GetSaleReceiptsQueryDto } from '../dtos/GetSaleReceiptsQuery.dto';
|
||||||
|
import { ISortOrder } from '@/modules/DynamicListing/DynamicFilter/DynamicFilter.types';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SaleReceiptsExportable extends Exportable {
|
export class SaleReceiptsExportable extends Exportable {
|
||||||
@@ -12,21 +13,21 @@ export class SaleReceiptsExportable extends Exportable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the accounts data to exportable sheet.
|
* Retrieves the accounts data to exportable sheet.
|
||||||
* @param {ISalesReceiptsFilter} query -
|
* @param {GetSaleReceiptsQueryDto} query -
|
||||||
*/
|
*/
|
||||||
public exportable(query: ISalesReceiptsFilter) {
|
public exportable(query: GetSaleReceiptsQueryDto) {
|
||||||
const filterQuery = (query) => {
|
const filterQuery = (query) => {
|
||||||
query.withGraphFetched('branch');
|
query.withGraphFetched('branch');
|
||||||
query.withGraphFetched('warehouse');
|
query.withGraphFetched('warehouse');
|
||||||
};
|
};
|
||||||
const parsedQuery = {
|
const parsedQuery = {
|
||||||
sortOrder: 'desc',
|
sortOrder: 'desc' as ISortOrder,
|
||||||
columnSortBy: 'created_at',
|
columnSortBy: 'created_at',
|
||||||
...query,
|
...query,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: EXPORT_SIZE_LIMIT,
|
pageSize: EXPORT_SIZE_LIMIT,
|
||||||
filterQuery,
|
filterQuery,
|
||||||
} as ISalesReceiptsFilter;
|
} as GetSaleReceiptsQueryDto;
|
||||||
|
|
||||||
return this.saleReceiptsApp
|
return this.saleReceiptsApp
|
||||||
.getSaleReceipts(parsedQuery)
|
.getSaleReceipts(parsedQuery)
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetSaleReceiptsQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -4,7 +4,7 @@ import { SaleReceiptTransformer } from './SaleReceiptTransformer';
|
|||||||
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||||
import { ISalesReceiptsFilter } from '../types/SaleReceipts.types';
|
import { GetSaleReceiptsQueryDto } from '../dtos/GetSaleReceiptsQuery.dto';
|
||||||
import { SaleReceipt } from '../models/SaleReceipt';
|
import { SaleReceipt } from '../models/SaleReceipt';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|
||||||
@@ -23,9 +23,9 @@ export class GetSaleReceiptsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sales receipts paginated and filterable list.
|
* Retrieve sales receipts paginated and filterable list.
|
||||||
* @param {ISalesReceiptsFilter} salesReceiptsFilter - Sales receipts filter.
|
* @param {GetSaleReceiptsQueryDto} filterDTO - Sales receipts filter.
|
||||||
*/
|
*/
|
||||||
public async getSaleReceipts(filterDTO: ISalesReceiptsFilter): Promise<{
|
public async getSaleReceipts(filterDTO: GetSaleReceiptsQueryDto): Promise<{
|
||||||
data: SaleReceipt[];
|
data: SaleReceipt[];
|
||||||
pagination: IPaginationMeta;
|
pagination: IPaginationMeta;
|
||||||
filterMeta: IFilterMeta;
|
filterMeta: IFilterMeta;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { VendorCreditsApplicationService } from './VendorCreditsApplication.service';
|
import { VendorCreditsApplicationService } from './VendorCreditsApplication.service';
|
||||||
import { IVendorCreditsQueryDTO } from './types/VendorCredit.types';
|
import { GetVendorCreditsQueryDto } from './dtos/GetVendorCreditsQuery.dto';
|
||||||
import {
|
import {
|
||||||
ApiExtraModels,
|
ApiExtraModels,
|
||||||
ApiOperation,
|
ApiOperation,
|
||||||
@@ -98,7 +98,7 @@ export class VendorCreditsController {
|
|||||||
@Get()
|
@Get()
|
||||||
@RequirePermission(VendorCreditAction.View, AbilitySubject.VendorCredit)
|
@RequirePermission(VendorCreditAction.View, AbilitySubject.VendorCredit)
|
||||||
@ApiOperation({ summary: 'Retrieves the vendor credits.' })
|
@ApiOperation({ summary: 'Retrieves the vendor credits.' })
|
||||||
async getVendorCredits(@Query() filterDTO: IVendorCreditsQueryDTO) {
|
async getVendorCredits(@Query() filterDTO: GetVendorCreditsQueryDto) {
|
||||||
return this.vendorCreditsApplication.getVendorCredits(filterDTO);
|
return this.vendorCreditsApplication.getVendorCredits(filterDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import { EditVendorCreditService } from './commands/EditVendorCredit.service';
|
|||||||
import { GetVendorCreditService } from './queries/GetVendorCredit.service';
|
import { GetVendorCreditService } from './queries/GetVendorCredit.service';
|
||||||
import {
|
import {
|
||||||
IVendorCreditEditDTO,
|
IVendorCreditEditDTO,
|
||||||
IVendorCreditsQueryDTO,
|
|
||||||
} from './types/VendorCredit.types';
|
} from './types/VendorCredit.types';
|
||||||
import { IVendorCreditCreateDTO } from './types/VendorCredit.types';
|
import { IVendorCreditCreateDTO } from './types/VendorCredit.types';
|
||||||
|
import { GetVendorCreditsQueryDto } from './dtos/GetVendorCreditsQuery.dto';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { OpenVendorCreditService } from './commands/OpenVendorCredit.service';
|
import { OpenVendorCreditService } from './commands/OpenVendorCredit.service';
|
||||||
import { GetVendorCreditsService } from './queries/GetVendorCredits.service';
|
import { GetVendorCreditsService } from './queries/GetVendorCredits.service';
|
||||||
@@ -95,10 +95,10 @@ export class VendorCreditsApplicationService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the paginated filterable vendor credits list.
|
* Retrieves the paginated filterable vendor credits list.
|
||||||
* @param {IVendorCreditsQueryDTO} query
|
* @param {GetVendorCreditsQueryDto} query
|
||||||
* @returns {}
|
* @returns {}
|
||||||
*/
|
*/
|
||||||
getVendorCredits(query: IVendorCreditsQueryDTO) {
|
getVendorCredits(query: GetVendorCreditsQueryDto) {
|
||||||
return this.getVendorCreditsService.getVendorCredits(query);
|
return this.getVendorCreditsService.getVendorCredits(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { DynamicFilterQueryDto } from '@/modules/DynamicListing/dtos/DynamicFilterQuery.dto';
|
||||||
|
|
||||||
|
export class GetVendorCreditsQueryDto extends DynamicFilterQueryDto {}
|
||||||
@@ -4,7 +4,7 @@ import { VendorCreditTransformer } from './VendorCreditTransformer';
|
|||||||
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
import { DynamicListService } from '@/modules/DynamicListing/DynamicList.service';
|
||||||
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectable.service';
|
||||||
import { VendorCredit } from '../models/VendorCredit';
|
import { VendorCredit } from '../models/VendorCredit';
|
||||||
import { IVendorCreditsQueryDTO } from '../types/VendorCredit.types';
|
import { GetVendorCreditsQueryDto } from '../dtos/GetVendorCreditsQuery.dto';
|
||||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -19,19 +19,19 @@ export class GetVendorCreditsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the sale invoice list filter DTO.
|
* Parses the sale invoice list filter DTO.
|
||||||
* @param {IVendorCreditsQueryDTO} filterDTO
|
* @param {GetVendorCreditsQueryDto} filterDTO
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
private parseListFilterDTO = (filterDTO: IVendorCreditsQueryDTO) => {
|
private parseListFilterDTO = (filterDTO: GetVendorCreditsQueryDto) => {
|
||||||
return R.compose(this.dynamicListService.parseStringifiedFilter)(filterDTO);
|
return R.compose(this.dynamicListService.parseStringifiedFilter)(filterDTO);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the vendor credits list.
|
* Retrieve the vendor credits list.
|
||||||
* @param {IVendorCreditsQueryDTO} vendorCreditQuery -
|
* @param {GetVendorCreditsQueryDto} vendorCreditQuery -
|
||||||
*/
|
*/
|
||||||
public getVendorCredits = async (
|
public getVendorCredits = async (
|
||||||
vendorCreditQuery: IVendorCreditsQueryDTO,
|
vendorCreditQuery: GetVendorCreditsQueryDto,
|
||||||
) => {
|
) => {
|
||||||
const filterDto = {
|
const filterDto = {
|
||||||
sortOrder: 'desc',
|
sortOrder: 'desc',
|
||||||
@@ -58,7 +58,7 @@ export class GetVendorCreditsService {
|
|||||||
// Gives ability to inject custom query to filter results.
|
// Gives ability to inject custom query to filter results.
|
||||||
filterDto?.filterQuery && filterDto?.filterQuery(builder);
|
filterDto?.filterQuery && filterDto?.filterQuery(builder);
|
||||||
})
|
})
|
||||||
.pagination(filter.page - 1, filter.pageSize);
|
.pagination(filterDto.page - 1, filterDto.pageSize);
|
||||||
|
|
||||||
// Transformes the vendor credits models to POJO.
|
// Transformes the vendor credits models to POJO.
|
||||||
const vendorCredits = await this.transformer.transform(
|
const vendorCredits = await this.transformer.transform(
|
||||||
|
|||||||
+933
-70
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
import type { ApiFetcher } from './fetch-utils';
|
import type { ApiFetcher } from './fetch-utils';
|
||||||
import { paths } from './schema';
|
import { paths } from './schema';
|
||||||
import { OpForPath, OpRequestBody, OpResponseBody } from './utils';
|
import { OpForPath, OpQueryParams, OpRequestBody, OpResponseBody } from './utils';
|
||||||
|
|
||||||
export const SALE_ESTIMATES_ROUTES = {
|
export const SALE_ESTIMATES_ROUTES = {
|
||||||
LIST: '/api/sale-estimates',
|
LIST: '/api/sale-estimates',
|
||||||
@@ -20,10 +20,14 @@ export type SaleEstimatesListResponse = OpResponseBody<OpForPath<typeof SALE_EST
|
|||||||
export type SaleEstimate = OpResponseBody<OpForPath<typeof SALE_ESTIMATES_ROUTES.BY_ID, 'get'>>;
|
export type SaleEstimate = OpResponseBody<OpForPath<typeof SALE_ESTIMATES_ROUTES.BY_ID, 'get'>>;
|
||||||
export type CreateSaleEstimateBody = OpRequestBody<OpForPath<typeof SALE_ESTIMATES_ROUTES.LIST, 'post'>>;
|
export type CreateSaleEstimateBody = OpRequestBody<OpForPath<typeof SALE_ESTIMATES_ROUTES.LIST, 'post'>>;
|
||||||
export type EditSaleEstimateBody = OpRequestBody<OpForPath<typeof SALE_ESTIMATES_ROUTES.BY_ID, 'put'>>;
|
export type EditSaleEstimateBody = OpRequestBody<OpForPath<typeof SALE_ESTIMATES_ROUTES.BY_ID, 'put'>>;
|
||||||
|
export type GetSaleEstimatesQuery = OpQueryParams<OpForPath<typeof SALE_ESTIMATES_ROUTES.LIST, 'get'>>;
|
||||||
|
|
||||||
export async function fetchSaleEstimates(fetcher: ApiFetcher): Promise<SaleEstimatesListResponse> {
|
export async function fetchSaleEstimates(
|
||||||
|
fetcher: ApiFetcher,
|
||||||
|
query?: GetSaleEstimatesQuery
|
||||||
|
): Promise<SaleEstimatesListResponse> {
|
||||||
const get = fetcher.path(SALE_ESTIMATES_ROUTES.LIST).method('get').create();
|
const get = fetcher.path(SALE_ESTIMATES_ROUTES.LIST).method('get').create();
|
||||||
const { data } = await get({});
|
const { data } = await get(query || {});
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+272
-26
@@ -4643,6 +4643,23 @@ export interface paths {
|
|||||||
patch: operations["ContactsController_inactivateContact"];
|
patch: operations["ContactsController_inactivateContact"];
|
||||||
trace?: never;
|
trace?: never;
|
||||||
};
|
};
|
||||||
|
"/api/exchange-rates/latest": {
|
||||||
|
parameters: {
|
||||||
|
query?: never;
|
||||||
|
header?: never;
|
||||||
|
path?: never;
|
||||||
|
cookie?: never;
|
||||||
|
};
|
||||||
|
/** Get the latest exchange rate */
|
||||||
|
get: operations["ExchangeRatesController_getLatestExchangeRate"];
|
||||||
|
put?: never;
|
||||||
|
post?: never;
|
||||||
|
delete?: never;
|
||||||
|
options?: never;
|
||||||
|
head?: never;
|
||||||
|
patch?: never;
|
||||||
|
trace?: never;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
export type webhooks = Record<string, never>;
|
export type webhooks = Record<string, never>;
|
||||||
export interface components {
|
export interface components {
|
||||||
@@ -14155,6 +14172,23 @@ export interface components {
|
|||||||
*/
|
*/
|
||||||
password: string;
|
password: string;
|
||||||
};
|
};
|
||||||
|
ExchangeRateLatestResponseDto: {
|
||||||
|
/**
|
||||||
|
* @description The base currency code
|
||||||
|
* @example USD
|
||||||
|
*/
|
||||||
|
baseCurrency: string;
|
||||||
|
/**
|
||||||
|
* @description The target currency code
|
||||||
|
* @example EUR
|
||||||
|
*/
|
||||||
|
toCurrency: string;
|
||||||
|
/**
|
||||||
|
* @description The exchange rate value
|
||||||
|
* @example 0.85
|
||||||
|
*/
|
||||||
|
exchangeRate: number;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
responses: never;
|
responses: never;
|
||||||
parameters: never;
|
parameters: never;
|
||||||
@@ -14444,26 +14478,26 @@ export interface operations {
|
|||||||
ItemsController_getItems: {
|
ItemsController_getItems: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: {
|
query?: {
|
||||||
|
/** @description Custom view ID for filtering */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Array of filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column sort direction */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order direction */
|
||||||
|
sortOrder?: "DESC" | "ASC";
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug for filtering */
|
||||||
|
viewSlug?: string;
|
||||||
/** @description Filter for inactive items */
|
/** @description Filter for inactive items */
|
||||||
inactiveMode?: boolean;
|
inactiveMode?: boolean;
|
||||||
/** @description Number of items per page */
|
/** @description Number of items per page */
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
/** @description Page number for pagination */
|
/** @description Page number for pagination */
|
||||||
page?: number;
|
page?: number;
|
||||||
/** @description View slug for filtering */
|
|
||||||
viewSlug?: string;
|
|
||||||
/** @description Search keyword */
|
|
||||||
searchKeyword?: string;
|
|
||||||
/** @description Stringified filter roles */
|
|
||||||
stringifiedFilterRoles?: string;
|
|
||||||
/** @description Sort order direction */
|
|
||||||
sortOrder?: "DESC" | "ASC";
|
|
||||||
/** @description Column sort direction */
|
|
||||||
columnSortBy?: string;
|
|
||||||
/** @description Array of filter roles */
|
|
||||||
filterRoles?: string[];
|
|
||||||
/** @description Custom view ID for filtering */
|
|
||||||
customViewId?: number;
|
|
||||||
};
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
@@ -15918,7 +15952,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
SaleInvoicesController_getSaleInvoices: {
|
SaleInvoicesController_getSaleInvoices: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -17030,7 +17079,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
PaymentReceivesController_getPaymentsReceived: {
|
PaymentReceivesController_getPaymentsReceived: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -17675,7 +17739,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
ItemCategoryController_getItemCategories: {
|
ItemCategoryController_getItemCategories: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -17861,7 +17940,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
ExpensesController_getExpenses: {
|
ExpensesController_getExpenses: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -18285,7 +18379,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
CustomersController_getCustomers: {
|
CustomersController_getCustomers: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -18426,7 +18535,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
VendorsController_getVendors: {
|
VendorsController_getVendors: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -18690,7 +18814,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
SaleEstimatesController_getSaleEstimates: {
|
SaleEstimatesController_getSaleEstimates: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -19099,7 +19238,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
SaleReceiptsController_getSaleReceipts: {
|
SaleReceiptsController_getSaleReceipts: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -19397,7 +19551,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
BillsController_getBills: {
|
BillsController_getBills: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -19770,7 +19939,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
ManualJournalsController_getManualJournals: {
|
ManualJournalsController_getManualJournals: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -19973,7 +20157,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
CreditNotesController_getCreditNotes: {
|
CreditNotesController_getCreditNotes: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -20580,7 +20779,22 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
VendorCreditsController_getVendorCredits: {
|
VendorCreditsController_getVendorCredits: {
|
||||||
parameters: {
|
parameters: {
|
||||||
query?: never;
|
query?: {
|
||||||
|
/** @description Custom view ID */
|
||||||
|
customViewId?: number;
|
||||||
|
/** @description Filter roles */
|
||||||
|
filterRoles?: string[];
|
||||||
|
/** @description Column to sort by */
|
||||||
|
columnSortBy?: string;
|
||||||
|
/** @description Sort order (asc/desc) */
|
||||||
|
sortOrder?: string;
|
||||||
|
/** @description Stringified filter roles */
|
||||||
|
stringifiedFilterRoles?: string;
|
||||||
|
/** @description Search keyword */
|
||||||
|
searchKeyword?: string;
|
||||||
|
/** @description View slug */
|
||||||
|
viewSlug?: string;
|
||||||
|
};
|
||||||
header: {
|
header: {
|
||||||
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
/** @description Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token. */
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
@@ -28771,4 +28985,36 @@ export interface operations {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
ExchangeRatesController_getLatestExchangeRate: {
|
||||||
|
parameters: {
|
||||||
|
query?: {
|
||||||
|
/** @description Source currency code (ISO 4217) */
|
||||||
|
from_currency?: string;
|
||||||
|
/** @description Target currency code (ISO 4217) */
|
||||||
|
to_currency?: string;
|
||||||
|
};
|
||||||
|
header?: never;
|
||||||
|
path?: never;
|
||||||
|
cookie?: never;
|
||||||
|
};
|
||||||
|
requestBody?: never;
|
||||||
|
responses: {
|
||||||
|
/** @description Successfully retrieved exchange rate */
|
||||||
|
200: {
|
||||||
|
headers: {
|
||||||
|
[name: string]: unknown;
|
||||||
|
};
|
||||||
|
content: {
|
||||||
|
"application/json": components["schemas"]["ExchangeRateLatestResponseDto"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/** @description Invalid currency code or service error */
|
||||||
|
400: {
|
||||||
|
headers: {
|
||||||
|
[name: string]: unknown;
|
||||||
|
};
|
||||||
|
content?: never;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user