@posx/core 5.5.258 → 5.5.260

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/CLAUDE.md ADDED
@@ -0,0 +1,13 @@
1
+ # Claude AI Development Guidelines
2
+
3
+ ## Best Practices for AI-Assisted Development
4
+
5
+ 1. **在开始编码前先充分讨论和规划架构,确保理解用户的真实需求和使用场景,避免过度设计。**
6
+
7
+ 2. **不要急于提交代码,应该等待用户明确指示后再进行 commit 和 push 操作。**
8
+
9
+ 3. **优先选择简洁的实现方式(如函数导出而非类),并删除冗余的中间层方法以保持代码清晰。**
10
+
11
+ ---
12
+
13
+ *This file contains guidelines learned from AI-human collaboration to improve development efficiency and code quality.*
package/build/index.d.ts CHANGED
@@ -249,6 +249,8 @@ declare module '@posx/core/index' {
249
249
  export * from '@posx/core/libs/escpos.printer';
250
250
  export * from '@posx/core/services/ods.service';
251
251
  export * from '@posx/core/types/ods.type';
252
+ export * from '@posx/core/types/csv.type';
253
+ export { createCSVExport, importFromCSV } from '@posx/core/utils/csv.utils';
252
254
  export * from '@posx/core/utils/autoquery.utils';
253
255
  export * from '@posx/core/libs/electron.socket';
254
256
  export * from '@posx/core/types/condition.type';
@@ -2076,6 +2078,10 @@ declare module '@posx/core/test/services/report/modifier-sales-report-test/modif
2076
2078
  declare module '@posx/core/test/services/tax/tax-exempt-test/tax-exempt.test' {
2077
2079
  export {};
2078
2080
 
2081
+ }
2082
+ declare module '@posx/core/test/utils/csv-test/csv-export-import.test' {
2083
+ export {};
2084
+
2079
2085
  }
2080
2086
  declare module '@posx/core/test/utils/query-builder-test/query-builder.test' {
2081
2087
  export {};
@@ -2951,6 +2957,41 @@ declare module '@posx/core/types/config.type' {
2951
2957
  constructor();
2952
2958
  }
2953
2959
 
2960
+ }
2961
+ declare module '@posx/core/types/csv.type' {
2962
+ /**
2963
+ * Interface for CSV export rows
2964
+ *
2965
+ * CSV Structure:
2966
+ * Type,Name,SKU,Price
2967
+ * category,Beverages,,
2968
+ * product,Americano,AME001,4.00
2969
+ * product,Espresso,ESP001,3.50
2970
+ * modifier_category,Extras,,
2971
+ * modifier,Extra Sugar,SUGAR001,0.50
2972
+ * modifier,Extra Milk,MILK001,1.00
2973
+ * category,Food,,
2974
+ * product,Burger,BUR001,12.00
2975
+ */
2976
+ export interface IExportRow {
2977
+ /**
2978
+ * Type of the row: category, product, modifier_category, or modifier
2979
+ */
2980
+ type: 'category' | 'product' | 'modifier_category' | 'modifier';
2981
+ /**
2982
+ * Name of the category, product, or modifier
2983
+ */
2984
+ name: string;
2985
+ /**
2986
+ * SKU (Stock Keeping Unit) - only for products and modifiers
2987
+ */
2988
+ sku?: string;
2989
+ /**
2990
+ * Price - only for products and modifiers
2991
+ */
2992
+ price?: number;
2993
+ }
2994
+
2954
2995
  }
2955
2996
  declare module '@posx/core/types/employee.type' {
2956
2997
  import { AppCoreModel, IAppCoreModel } from '@posx/core/types/abstract.type';
@@ -4593,6 +4634,8 @@ declare module '@posx/core/types/product.type' {
4593
4634
  is_internal: boolean;
4594
4635
  is_delisted: boolean;
4595
4636
  uid: string;
4637
+ modifiers?: Array<ICoreItem>;
4638
+ modifier_categories?: Array<ICoreCategory>;
4596
4639
  kitchen_printers_uids: any[];
4597
4640
  order_printers_uids: any[];
4598
4641
  label_printers_uids: any[];
@@ -5451,6 +5494,27 @@ declare module '@posx/core/utils/autoquery.utils' {
5451
5494
  search_keywords?: string;
5452
5495
  };
5453
5496
 
5497
+ }
5498
+ declare module '@posx/core/utils/csv.utils' {
5499
+ import { ICategory, IItem } from '@posx/core/types/product.type';
5500
+ /**
5501
+ * Create CSV export blob from categories and products
5502
+ * @param categories Array of categories
5503
+ * @param products Array of products (products contain modifiers and modifier_categories)
5504
+ * @param filename Optional filename (default: 'export.csv')
5505
+ * @returns Blob object for download
5506
+ */
5507
+ export function createCSVExport(categories: ICategory[], products: IItem[], filename?: string): Blob;
5508
+ /**
5509
+ * Import categories and products from CSV file
5510
+ * @param file CSV file to import
5511
+ * @returns Promise with categories and products arrays (products include modifiers and modifier_categories)
5512
+ */
5513
+ export function importFromCSV(file: File): Promise<{
5514
+ categories: ICategory[];
5515
+ products: IItem[];
5516
+ }>;
5517
+
5454
5518
  }
5455
5519
  declare module '@posx/core/utils/http.utils' {
5456
5520
  /**