larvitorder
Version:
Generic order system
77 lines • 2.56 kB
TypeScript
import { LogInstance, Utils } from 'larvitutils';
import { Helpers } from './helpers';
import { OrderData } from './order';
export type matchDate = {
field: string;
value: string;
operation?: 'gt' | 'lt' | 'eq';
};
export type OrdersOptions = {
db: any;
log: LogInstance;
lUtils?: Utils;
helpers?: Helpers;
uuids?: string | string[];
matchDates?: matchDate[];
matchFieldDates?: matchDate[];
createdAfter?: string;
updatedAfter?: string;
matchFieldHasValue?: string[];
matchFieldHasNoValue?: string[];
q?: string;
matchAllFields?: Record<string, string | string[]>;
fieldNotEqualTo?: Record<string, string>;
fieldGreaterThanOrEqualTo?: Record<string, string | number>;
fieldLessThanOrEqualTo?: Record<string, string | number>;
matchAllRowFields?: Record<string, string | number>;
limit?: number | string;
offset?: number | string;
returnFields?: string[];
returnRowFields?: string[];
};
export declare class Orders {
private db;
private log;
private lUtils;
private helpers;
uuids?: string[];
matchDates?: matchDate[];
matchFieldDates?: matchDate[];
createdAfter?: string;
updatedAfter?: string;
matchFieldHasValue?: string[];
matchFieldHasNoValue?: string[];
q?: string;
matchAllFields?: Record<string, string | string[]>;
fieldNotEqualTo?: Record<string, string>;
fieldGreaterThanOrEqualTo?: Record<string, string | number>;
fieldLessThanOrEqualTo?: Record<string, string | number>;
matchAllRowFields?: Record<string, string | number>;
limit?: number | string;
offset?: number | string;
returnFields?: string[];
returnRowFields?: string[];
constructor(options?: OrdersOptions);
get(): Promise<{
orders: Record<string, OrderData>;
hits: number;
}>;
private getBasicOrders;
private concatSqlUuidsFilter;
private concatSqlCreatedAfterFilter;
private concatSqlUpdatedAfterFilter;
private concatSqlDateFilter;
private concatSqlFieldDateFilter;
private concatSqlQFilter;
private concatSqlMatchAllFilter;
private concatSqlFieldNotEqualToFilter;
private concatSqlFieldGreaterThanOrEqualToFilter;
private concatSqlFieldLessThanOrEqualToFilter;
private concatSqlFieldHasValue;
private concatSqlFieldHasNoValue;
private concatSqlMatchAllRowsFieldsFilter;
private concatSqlLimitAndOffset;
private getAndPopulateOrderFields;
private getAndPopulateOrderRows;
}
//# sourceMappingURL=orders.d.ts.map