@posx/core 5.5.88 → 5.5.90
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 +114 -3
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/package.publish.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1876,10 +1876,16 @@ declare module '@posx/core/types/config.type' {
|
|
|
1876
1876
|
export interface IAppConfig extends IAppCoreModel {
|
|
1877
1877
|
config: IConfig;
|
|
1878
1878
|
cache: ICache;
|
|
1879
|
+
storage: {
|
|
1880
|
+
pricing_lookup_keys: string[];
|
|
1881
|
+
};
|
|
1879
1882
|
}
|
|
1880
1883
|
export class AppConfig extends AppCoreModel implements IAppConfig {
|
|
1881
1884
|
config: Config;
|
|
1882
1885
|
cache: Cache;
|
|
1886
|
+
storage: {
|
|
1887
|
+
pricing_lookup_keys: any[];
|
|
1888
|
+
};
|
|
1883
1889
|
constructor();
|
|
1884
1890
|
}
|
|
1885
1891
|
export interface ICache {
|
|
@@ -2675,6 +2681,14 @@ declare module '@posx/core/types/invoice.type' {
|
|
|
2675
2681
|
is_duplicate: boolean;
|
|
2676
2682
|
/** The line item that this line item is duplicated from. */
|
|
2677
2683
|
duplicated_from_uid: string;
|
|
2684
|
+
/** Whether the line item is a combo. */
|
|
2685
|
+
is_combo: boolean;
|
|
2686
|
+
/** Whether the line item is a combo item. */
|
|
2687
|
+
is_combo_item: boolean;
|
|
2688
|
+
/** Combo group unique id. */
|
|
2689
|
+
combo_group_uid: string;
|
|
2690
|
+
/** Combo line unique id. */
|
|
2691
|
+
combo_line_uid: string;
|
|
2678
2692
|
/** Any modifiers applied to the line item. */
|
|
2679
2693
|
modifiers: IInvoiceCoreLine[];
|
|
2680
2694
|
/** Meta data for the line item */
|
|
@@ -2853,6 +2867,10 @@ declare module '@posx/core/types/invoice.type' {
|
|
|
2853
2867
|
up_size: boolean;
|
|
2854
2868
|
is_take_out: boolean;
|
|
2855
2869
|
is_duplicate: boolean;
|
|
2870
|
+
is_combo: boolean;
|
|
2871
|
+
is_combo_item: boolean;
|
|
2872
|
+
combo_group_uid: string;
|
|
2873
|
+
combo_line_uid: string;
|
|
2856
2874
|
modifiers: any[];
|
|
2857
2875
|
duplicated_from_uid: string;
|
|
2858
2876
|
sent: number;
|
|
@@ -3041,7 +3059,8 @@ declare module '@posx/core/types/misc.type' {
|
|
|
3041
3059
|
EmployeeRole = "emr_",
|
|
3042
3060
|
OrderDisplaySystem = "ods_",
|
|
3043
3061
|
Charge = "chr_",
|
|
3044
|
-
Price = "prc_"
|
|
3062
|
+
Price = "prc_",
|
|
3063
|
+
ComboGroup = "cbo_"
|
|
3045
3064
|
}
|
|
3046
3065
|
export enum ModelType {
|
|
3047
3066
|
Merchant = "mnt",
|
|
@@ -3867,7 +3886,7 @@ declare module '@posx/core/types/product.type' {
|
|
|
3867
3886
|
unit: number;
|
|
3868
3887
|
/**
|
|
3869
3888
|
* Number of items sold
|
|
3870
|
-
|
|
3889
|
+
* @ignore
|
|
3871
3890
|
*/
|
|
3872
3891
|
sold: number;
|
|
3873
3892
|
/**
|
|
@@ -3898,7 +3917,7 @@ declare module '@posx/core/types/product.type' {
|
|
|
3898
3917
|
likes: number;
|
|
3899
3918
|
/**
|
|
3900
3919
|
* Number of dislikes for the item
|
|
3901
|
-
|
|
3920
|
+
* @ignore
|
|
3902
3921
|
*/
|
|
3903
3922
|
dislikes: number;
|
|
3904
3923
|
/**
|
|
@@ -3953,6 +3972,10 @@ declare module '@posx/core/types/product.type' {
|
|
|
3953
3972
|
* if price editor will be opened by default when item is clicked
|
|
3954
3973
|
*/
|
|
3955
3974
|
open_price_editor: boolean;
|
|
3975
|
+
/**
|
|
3976
|
+
* Combo groups (only applicable when type is ProductType.Combo)
|
|
3977
|
+
*/
|
|
3978
|
+
combo_groups: IComboGroup[];
|
|
3956
3979
|
}
|
|
3957
3980
|
export class Item extends CoreItem implements IItem {
|
|
3958
3981
|
codename: string;
|
|
@@ -3989,6 +4012,7 @@ declare module '@posx/core/types/product.type' {
|
|
|
3989
4012
|
label_printers_uids: any[];
|
|
3990
4013
|
open_editor_panel: boolean;
|
|
3991
4014
|
open_price_editor: boolean;
|
|
4015
|
+
combo_groups: IComboGroup[];
|
|
3992
4016
|
constructor();
|
|
3993
4017
|
}
|
|
3994
4018
|
export interface IPrice extends IAppCoreModel {
|
|
@@ -4006,6 +4030,93 @@ declare module '@posx/core/types/product.type' {
|
|
|
4006
4030
|
amount: number;
|
|
4007
4031
|
constructor();
|
|
4008
4032
|
}
|
|
4033
|
+
/**
|
|
4034
|
+
* COMBO PRODUCT IMPLEMENTATION
|
|
4035
|
+
*
|
|
4036
|
+
* Combo products bundle multiple existing products together and sell them as a group,
|
|
4037
|
+
* usually at a discount. This implementation provides minimal impact on existing data structures.
|
|
4038
|
+
*
|
|
4039
|
+
* Usage:
|
|
4040
|
+
* 1. Create combo product with type = ProductType.Combo
|
|
4041
|
+
* 2. Define combo_groups array with component groups and available items
|
|
4042
|
+
* 3. Set combo discount (either amount or percentage)
|
|
4043
|
+
* 4. When adding to invoice, combo appears as single line with selections in combo_components
|
|
4044
|
+
*
|
|
4045
|
+
* Example:
|
|
4046
|
+
* ```
|
|
4047
|
+
* const combo: IItem = {
|
|
4048
|
+
* type: ProductType.Combo,
|
|
4049
|
+
* combo_groups: [
|
|
4050
|
+
* {
|
|
4051
|
+
* name: "Choose your main",
|
|
4052
|
+
* min_selections: 1,
|
|
4053
|
+
* max_selections: 1,
|
|
4054
|
+
* required: true,
|
|
4055
|
+
* items: [
|
|
4056
|
+
* { item_uid: 'burger_uid', is_default: true },
|
|
4057
|
+
* { item_uid: 'chicken_uid', price_override: 2.00 }
|
|
4058
|
+
* ]
|
|
4059
|
+
* },
|
|
4060
|
+
* {
|
|
4061
|
+
* name: "Pick a side",
|
|
4062
|
+
* min_selections: 1,
|
|
4063
|
+
* max_selections: 1,
|
|
4064
|
+
* required: true,
|
|
4065
|
+
* items: [
|
|
4066
|
+
* { item_uid: 'fries_uid', is_default: true },
|
|
4067
|
+
* { item_uid: 'onion_rings_uid', price_override: 1.50 }
|
|
4068
|
+
* ]
|
|
4069
|
+
* }
|
|
4070
|
+
* ],
|
|
4071
|
+
* combo_discount_percent: 15 // 15% discount
|
|
4072
|
+
* }
|
|
4073
|
+
* ```
|
|
4074
|
+
*/
|
|
4075
|
+
/**
|
|
4076
|
+
* Interface for individual items within a combo group
|
|
4077
|
+
*/
|
|
4078
|
+
export interface IComboGroupItem extends IAppModelSequence {
|
|
4079
|
+
/** Item unique id */
|
|
4080
|
+
item_uid: string;
|
|
4081
|
+
/** Combo item */
|
|
4082
|
+
combo_item: ICoreItem;
|
|
4083
|
+
/** Price of the item in combo */
|
|
4084
|
+
price: number;
|
|
4085
|
+
}
|
|
4086
|
+
/**
|
|
4087
|
+
* Interface for combo component groups (e.g., "Main Course", "Side", "Drink")
|
|
4088
|
+
*/
|
|
4089
|
+
export interface IComboGroup extends IAppModelSequence {
|
|
4090
|
+
/** Group unique id */
|
|
4091
|
+
uid: string;
|
|
4092
|
+
/** Group name (e.g., "Choose your main", "Pick a side") */
|
|
4093
|
+
name: string;
|
|
4094
|
+
/** Translations of the name */
|
|
4095
|
+
name_translations: Record<string, string>;
|
|
4096
|
+
/** Minimum selections required from this group */
|
|
4097
|
+
min_order: number;
|
|
4098
|
+
/** Maximum selections allowed from this group */
|
|
4099
|
+
max_order: number;
|
|
4100
|
+
/** Available items in this group */
|
|
4101
|
+
combo_items: IComboGroupItem[];
|
|
4102
|
+
}
|
|
4103
|
+
export class ComboGroupItem implements IComboGroupItem {
|
|
4104
|
+
item_uid: string;
|
|
4105
|
+
combo_item: CoreItem;
|
|
4106
|
+
price: number;
|
|
4107
|
+
sequence: number;
|
|
4108
|
+
constructor();
|
|
4109
|
+
}
|
|
4110
|
+
export class ComboGroup implements IComboGroup {
|
|
4111
|
+
uid: string;
|
|
4112
|
+
name: string;
|
|
4113
|
+
name_translations: Record<string, string>;
|
|
4114
|
+
min_order: number;
|
|
4115
|
+
max_order: number;
|
|
4116
|
+
combo_items: IComboGroupItem[];
|
|
4117
|
+
sequence: number;
|
|
4118
|
+
constructor();
|
|
4119
|
+
}
|
|
4009
4120
|
|
|
4010
4121
|
}
|
|
4011
4122
|
declare module '@posx/core/types/report.type' {
|