mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
refactor: import resource module to nestjs
This commit is contained in:
@@ -3,8 +3,11 @@ import { TransformerInjectable } from '@/modules/Transformer/TransformerInjectab
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import * as R from 'ramda';
|
||||
import { Customer } from '../models/Customer';
|
||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||
import { CustomerTransfromer } from './CustomerTransformer';
|
||||
import {
|
||||
GetCustomersResponse,
|
||||
ICustomersFilter,
|
||||
} from '../types/Customers.types';
|
||||
|
||||
@Injectable()
|
||||
export class GetCustomers {
|
||||
@@ -26,12 +29,11 @@ export class GetCustomers {
|
||||
/**
|
||||
* Retrieve customers paginated list.
|
||||
* @param {ICustomersFilter} filter - Cusotmers filter.
|
||||
* @returns {Promise<GetCustomersResponse>}
|
||||
*/
|
||||
public async getCustomersList(filterDTO: ICustomersFilter): Promise<{
|
||||
customers: Customer[];
|
||||
pagination: IPaginationMeta;
|
||||
filterMeta: IFilterMeta;
|
||||
}> {
|
||||
public async getCustomersList(
|
||||
filterDTO: ICustomersFilter,
|
||||
): Promise<GetCustomersResponse> {
|
||||
// Parses customers list filter DTO.
|
||||
const filter = this.parseCustomersListFilterDTO(filterDTO);
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Knex } from 'knex';
|
||||
import { Customer } from '../models/Customer';
|
||||
import { IContactAddressDTO } from '@/modules/Contacts/types/Contacts.types';
|
||||
import { IDynamicListFilter } from '@/modules/DynamicListing/DynamicFilter/DynamicFilter.types';
|
||||
import { IFilterMeta, IPaginationMeta } from '@/interfaces/Model';
|
||||
|
||||
// Customer Interfaces.
|
||||
// ----------------------------------
|
||||
@@ -47,12 +49,17 @@ export interface ICustomerEditDTO extends IContactAddressDTO {
|
||||
active?: boolean;
|
||||
}
|
||||
|
||||
// export interface ICustomersFilter extends IDynamicListFilter {
|
||||
// stringifiedFilterRoles?: string;
|
||||
// page?: number;
|
||||
// pageSize?: number;
|
||||
// }
|
||||
export interface ICustomersFilter extends IDynamicListFilter {
|
||||
stringifiedFilterRoles?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface GetCustomersResponse {
|
||||
customers: Customer[];
|
||||
pagination: IPaginationMeta;
|
||||
filterMeta: IFilterMeta;
|
||||
}
|
||||
// Customer Events.
|
||||
// ----------------------------------
|
||||
export interface ICustomerEventCreatedPayload {
|
||||
|
||||
Reference in New Issue
Block a user