@posx/core 5.5.300 → 5.5.302

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -222,7 +222,6 @@ declare module '@posx/core/helpers/string.helpers' {
222
222
 
223
223
  }
224
224
  declare module '@posx/core/index' {
225
- export * from '@posx/core/types/auto.query.type';
226
225
  export * from '@posx/core/types/wyo.customer.type';
227
226
  export * from '@posx/core/types/wyo.coupon.type';
228
227
  export * from '@posx/core/types/shift.type';
@@ -251,7 +250,6 @@ declare module '@posx/core/index' {
251
250
  export * from '@posx/core/types/ods.type';
252
251
  export * from '@posx/core/types/csv.type';
253
252
  export { createCSVExport, importFromCSV } from '@posx/core/utils/csv.utils';
254
- export * from '@posx/core/utils/autoquery.utils';
255
253
  export * from '@posx/core/libs/electron.socket';
256
254
  export * from '@posx/core/types/condition.type';
257
255
  export * from '@posx/core/types/merchant.type';
@@ -684,10 +682,9 @@ declare module '@posx/core/services/app.service' {
684
682
  import { IAppCoreModel } from '@posx/core/types/abstract.type';
685
683
  import { IAppReport, IReportData, IReportRequest, ReportData } from '@posx/core/types/report.type';
686
684
  import { IPrintCommand } from '@posx/core/libs/escpos.printer';
687
- import { QueryBuilder } from '@posx/core/utils/autoquery.utils';
688
- import { QueryResponse } from '@posx/core/types/auto.query.type';
689
685
  import { IStorage } from '@posx/core/types/storage.type';
690
686
  import { IMenu } from '@posx/core/types/menu.type';
687
+ import { QueryBuilder, QueryResponse } from '@litepos/autoquery';
691
688
  export type IEmployeeRoleService = IAppRemoteService<IEmployeeRole> & IAppRemoteService<IEmployeeRole>;
692
689
  export type INoteService = IAppRemoteService<INote>;
693
690
  export type INoteGroupService = IAppRemoteService<INoteGroup>;
@@ -1270,13 +1267,12 @@ declare module '@posx/core/services/invoice.service' {
1270
1267
  import Dexie from 'dexie';
1271
1268
  import { SwitchInvoiceOptions, PayInvoiceOptions, VoidInvoiceOptions, UpdateInvoiceOptions } from '@posx/core/types/invoice.type';
1272
1269
  import { ITill } from '@posx/core/types/shift.type';
1273
- import { QueryResponse } from '@posx/core/types/auto.query.type';
1274
1270
  import { IChangePaymentMethodOption } from '@posx/core/types/payment.type';
1275
1271
  import { PrinterService } from '@posx/core/services/printer.service';
1276
1272
  import { IPrintJob, IPrinter, PrintJob, PrinterType } from '@posx/core/types/printer.type';
1277
1273
  import { IEmployee } from '@posx/core/types/employee.type';
1278
- import { QueryBuilder } from '@posx/core/utils/autoquery.utils';
1279
1274
  import { ICouponItemized } from '@posx/core/types/wyo.coupon.type';
1275
+ import { QueryBuilder, QueryResponse } from '@litepos/autoquery';
1280
1276
  export interface IInvoiceBaseService extends IAppRemoteService<IInvoice> {
1281
1277
  calculate(invoice: IInvoice, appConfig: IAppConfig, disableRounding?: boolean): IInvoice;
1282
1278
  calculateLines(invoice: IInvoice): void;
@@ -1452,9 +1448,10 @@ declare module '@posx/core/services/invoice.service' {
1452
1448
  * @param invoice - The invoice to decrease the item quantity in.
1453
1449
  * @param line - The invoice line to decrease the item quantity in.
1454
1450
  * @param quantity - The quantity of the item to decrease.
1451
+ * @param skipDeletedLines - Whether to skip the deleted lines, default is false.
1455
1452
  * @returns The updated invoice.
1456
1453
  */
1457
- minusLineQuantity(invoice: IInvoice, line: IInvoiceLine, quantity: number): IInvoice;
1454
+ minusLineQuantity(invoice: IInvoice, line: IInvoiceLine, quantity: number, skipDeletedLines?: boolean): IInvoice;
1458
1455
  /**
1459
1456
  * Increases the quantity of an item in an invoice line.
1460
1457
  * @param invoice - The invoice to increase the item quantity in.
@@ -1560,8 +1557,10 @@ declare module '@posx/core/services/invoice.service' {
1560
1557
  * And use minusLineQuantity to remove main combo.
1561
1558
  * @param invoice the invoice
1562
1559
  * @param comboLineUid The combo's line uid
1560
+ * @param skipDeletedLines - Whether to skip the deleted lines, default is false.
1561
+ * @returns The deleted lines.
1563
1562
  */
1564
- removeAllComboItems(Invoice: IInvoice, comboLineUid: string): IInvoiceLine[];
1563
+ removeAllComboItems(Invoice: IInvoice, comboLineUid: string, skipDeletedLines?: boolean): IInvoiceLine[];
1565
1564
  /**
1566
1565
  * Duplicates a combo line and all its associated combo items from an invoice
1567
1566
  * @param invoice - The invoice containing the combo to duplicate
@@ -2207,156 +2206,6 @@ declare module '@posx/core/types/abstract.type' {
2207
2206
  export type IAppBase = Omit<IAppBaseModel, "id_in_server" | "_timestamp">;
2208
2207
  export type IAppExtra = Omit<IAppExtraModel, "id_in_server" | "_timestamp">;
2209
2208
 
2210
- }
2211
- declare module '@posx/core/types/auto.query.type' {
2212
- /**
2213
- * The IBaseParams interface provides a structure for query parameters commonly used
2214
- * in API requests to manipulate the presentation and organization of returned data.
2215
- *
2216
- * @property {string} [skip] - The number of records to skip before starting to collect the response set.
2217
- * @property {string} [take] - The limit on the number of records to return in the response set.
2218
- * @property {string} [format] - The desired format of the response (e.g., 'json', 'xml').
2219
- * @property {string} [include] - A way to include data from related tables/entities.
2220
- * @property {string} [jsconfig] - JavaScript configuration for client-side handling of the response.
2221
- * @property {string} [orderBy] - A parameter to specify the field to order the results by in ascending order.
2222
- * @property {string} [orderByDesc] - A parameter to specify the field to order the results by in descending order.
2223
- */
2224
- export interface IBaseParams {
2225
- skip?: number;
2226
- take?: number;
2227
- format?: string;
2228
- include?: string;
2229
- jsconfig?: string;
2230
- orderBy?: string;
2231
- orderByDesc?: string;
2232
- }
2233
- export interface IInvoiceParams extends IBaseParams {
2234
- RefIdContains?: string;
2235
- GrandTotal?: number;
2236
- StatusContains?: string;
2237
- PaidAtAfter?: string;
2238
- PaidAtBefore?: string;
2239
- PaidAtStartsWith?: string;
2240
- }
2241
- export interface IInvoicesQuery {
2242
- params: IInvoiceParams;
2243
- }
2244
- export class InvoicesQuery implements IInvoicesQuery {
2245
- params: {
2246
- format: string;
2247
- Include: string;
2248
- jsconfig: string;
2249
- };
2250
- constructor(params: IInvoiceParams);
2251
- }
2252
- export interface IQueryResponse<T> {
2253
- offset?: number;
2254
- total?: number;
2255
- results?: T[];
2256
- meta?: {
2257
- [index: string]: string;
2258
- };
2259
- responseStatus?: ResponseStatus;
2260
- }
2261
- export interface ResponseStatus {
2262
- errorCode?: string;
2263
- message?: string;
2264
- stackTrace?: string;
2265
- errors?: ValidationError[];
2266
- }
2267
- export interface ValidationError {
2268
- errorCode?: string;
2269
- fieldName?: string;
2270
- message?: string;
2271
- }
2272
- export class QueryResponse<T> {
2273
- offset?: number;
2274
- total?: number;
2275
- results?: T[];
2276
- meta?: {
2277
- [index: string]: string;
2278
- };
2279
- responseStatus?: ResponseStatus;
2280
- }
2281
- export enum SortOrder {
2282
- Asc = "asc",
2283
- Desc = "desc"
2284
- }
2285
- export type EnumToString<T> = T extends string ? string : T;
2286
- export type QueryableType<T> = {
2287
- [K in keyof T]: T[K] extends Date ? Date : T[K] extends number ? number : EnumToString<T[K]>;
2288
- };
2289
- export type Operator<T> = T extends number ? keyof typeof NumericOperators | keyof typeof NullOperators : T extends Date ? keyof typeof DateOperators | keyof typeof NullOperators : T extends string ? keyof typeof StringOperators | keyof typeof ArrayOperators | keyof typeof NullOperators : string extends T ? keyof typeof StringOperators | keyof typeof ArrayOperators | keyof typeof NullOperators : keyof typeof NullOperators;
2290
- export type OperatorValueMap<T = any> = {
2291
- [K in Operator<T>]: T extends Date ? (K extends keyof typeof DateOperators ? DateOperatorValueMap[K] : K extends keyof typeof NullOperators ? boolean : never) : T extends number ? (K extends keyof typeof NumericOperators ? number : K extends keyof typeof NullOperators ? boolean : never) : T extends string ? (K extends keyof typeof StringOperators ? string : K extends keyof typeof ArrayOperators ? string[] : K extends keyof typeof NullOperators ? boolean : never) : string extends T ? (K extends keyof typeof StringOperators ? string : K extends keyof typeof ArrayOperators ? string[] : K extends keyof typeof NullOperators ? boolean : never) : K extends keyof typeof NullOperators ? boolean : never;
2292
- };
2293
- export enum NumericOperators {
2294
- '>' = 0,
2295
- '>=' = 1,
2296
- '<' = 2,
2297
- '<=' = 3,
2298
- '=' = 4,
2299
- 'GreaterThan' = 5,
2300
- 'GreaterThanOrEqualTo' = 6,
2301
- 'LessThan' = 7,
2302
- 'LessThanOrEqualTo' = 8,
2303
- 'EqualTo' = 9,
2304
- 'NotEqualTo' = 10
2305
- }
2306
- export enum StringOperators {
2307
- 'Contains' = 0,
2308
- 'NotContains' = 1,
2309
- 'StartsWith' = 2,
2310
- 'EndsWith' = 3,
2311
- "Like" = 4
2312
- }
2313
- export enum ArrayOperators {
2314
- 'In' = 0,
2315
- 'NotIn' = 1
2316
- }
2317
- export enum NullOperators {
2318
- 'IsNull' = 0,
2319
- 'IsNotNull' = 1
2320
- }
2321
- export enum MonthOperator {
2322
- WithinAMonth = "Contains"
2323
- }
2324
- export enum DayOperator {
2325
- At = "StartsWith"
2326
- }
2327
- export enum DateOperators {
2328
- 'GreaterThan' = 0,
2329
- 'GreaterThanOrEqualTo' = 1,
2330
- 'LessThan' = 2,
2331
- 'LessThanOrEqualTo' = 3,
2332
- 'Between' = 4,
2333
- 'StartsWith' = 5,
2334
- 'Contains' = 6
2335
- }
2336
- export type DateOperatorValueMap = {
2337
- 'GreaterThan': string;
2338
- 'GreaterThanOrEqualTo': string;
2339
- 'LessThan': string;
2340
- 'LessThanOrEqualTo': string;
2341
- 'Between': [string, string];
2342
- 'StartsWith': string;
2343
- 'Contains': MonthValues;
2344
- };
2345
- export enum MonthValues {
2346
- Jan = "-01-",
2347
- Feb = "-02-",
2348
- Mar = "-03-",
2349
- Apr = "-04-",
2350
- May = "-05-",
2351
- Jun = "-06-",
2352
- Jul = "-07-",
2353
- Aug = "-08-",
2354
- Sep = "-09-",
2355
- Oct = "-10-",
2356
- Nov = "-11-",
2357
- Dec = "-12-"
2358
- }
2359
-
2360
2209
  }
2361
2210
  declare module '@posx/core/types/condition.type' {
2362
2211
  export enum Condition {
@@ -5583,25 +5432,6 @@ declare module '@posx/core/types/wyo.customer.type' {
5583
5432
  constructor();
5584
5433
  }
5585
5434
 
5586
- }
5587
- declare module '@posx/core/utils/autoquery.utils' {
5588
- import { Operator, OperatorValueMap, QueryableType, SortOrder } from '@posx/core/types/auto.query.type';
5589
- export class QueryBuilder<T> {
5590
- private params;
5591
- addParam<K extends keyof T, O extends Operator<QueryableType<T>[K]>>(property: K, operator: O, value: OperatorValueMap<QueryableType<T>[K]>[O]): this;
5592
- addRawParam(key: string, value: string): this;
5593
- includeTotal(flag: boolean): this;
5594
- skip(skip: number): this;
5595
- take(take: number): this;
5596
- sortBy<K extends keyof T>(property: K, orderBy: SortOrder): this;
5597
- jsconfig(param: string): this;
5598
- /** @internal */
5599
- _build(): Record<string, string>;
5600
- }
5601
- export type QueryEtcParams = {
5602
- search_keywords?: string;
5603
- };
5604
-
5605
5435
  }
5606
5436
  declare module '@posx/core/utils/csv.utils' {
5607
5437
  import { ICategory, IItem } from '@posx/core/types/product.type';