feeef 0.7.2 → 0.7.4

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.
@@ -520,6 +520,46 @@ export interface PaymentIntegration {
520
520
  defaultMethod?: string;
521
521
  metadata?: Record<string, any>;
522
522
  }
523
+ /**
524
+ * Orders dispatch strategy for assigning orders to confirmers.
525
+ * Discriminated union by `type` (freezed convention with unionKey: 'type').
526
+ * Values match Dart constructor names.
527
+ */
528
+ export type OrdersDispatchStrategy = {
529
+ type: 'firstUpdate';
530
+ } | {
531
+ type: 'random';
532
+ } | {
533
+ type: 'weightedRandom';
534
+ weights?: Record<string, number>;
535
+ } | {
536
+ type: 'roundRobin';
537
+ lastAssignedConfirmerId?: string;
538
+ sortBy?: string;
539
+ } | {
540
+ type: 'manualOnly';
541
+ } | {
542
+ type: 'priority';
543
+ confirmerIds: string[];
544
+ };
545
+ /**
546
+ * Dispatcher integration configuration.
547
+ * Controls how new orders are assigned to confirmers.
548
+ */
549
+ export interface DispatcherIntegration {
550
+ active: boolean;
551
+ strategy?: OrdersDispatchStrategy | null;
552
+ metadata?: Record<string, any>;
553
+ }
554
+ /**
555
+ * Confirmer-specific permissions (in StoreMember.metadata).
556
+ */
557
+ export interface ConfermerPermissions {
558
+ canSeeAllOrders?: boolean;
559
+ canAssignOrder?: boolean;
560
+ canReAssignOrder?: boolean;
561
+ metadata?: Record<string, any>;
562
+ }
523
563
  export interface StoreIntegrations {
524
564
  [key: string]: any;
525
565
  metadata?: Record<string, any>;
@@ -544,6 +584,7 @@ export interface StoreIntegrations {
544
584
  zimou?: ZimouIntegration;
545
585
  zrexpress?: ZrexpressIntegration;
546
586
  security?: SecurityIntegration;
587
+ dispatcher?: DispatcherIntegration;
547
588
  }
548
589
  export declare enum StoreSubscriptionStatus {
549
590
  active = "active",
@@ -206,6 +206,7 @@ export declare class CartService extends NotifiableService {
206
206
  * @param shippingType - The shipping type enum.
207
207
  * @returns The corresponding shipping price type.
208
208
  */
209
+ /** Maps order ShippingType to shipping price key. store = pickup (from store), pickup = desk (from relay/desk). */
209
210
  private mapShippingTypeToPriceType;
210
211
  /**
211
212
  * Resolves shipping price using the priority chain.
@@ -232,8 +233,9 @@ export declare class CartService extends NotifiableService {
232
233
  *
233
234
  * Note: Shipping prices must be loaded and set via setShippingPrice() for the new system to work.
234
235
  * If shipping prices are not loaded, the method falls back to the legacy system.
236
+ * In the new system: price key "desk" → ShippingType.pickup, price key "pickup" → ShippingType.store.
235
237
  *
236
- * @returns An array of available shipping types.
238
+ * @returns An array of available shipping types. With prices e.g. { desk: 550, home: 800, pickup: null }, returns [home, pickup].
237
239
  */
238
240
  getAvailableShippingTypes(): ShippingType[];
239
241
  /**
@@ -1,17 +1,27 @@
1
1
  /**
2
- * Converts a Dart color (0xffXXXXXX) to a CSS-compatible number (0xXXXXXXFF).
2
+ * Converts a Dart color (AARRGGBB — alpha in high byte) to a CSS-compatible number (RRGGBBAA).
3
+ * Flutter/Dart uses 32-bit color with alpha first; CSS and the editor use alpha last.
3
4
  *
4
- * @param dartColor - The Dart color represented as a 32-bit integer (0xffXXXXXX).
5
- * @returns A number representing the color in CSS format (0xXXXXXXFF).
5
+ * @param dartColor - The Dart color as a 32-bit integer (AARRGGBB).
6
+ * @returns A number in CSS format (0xRRGGBBAA).
6
7
  */
7
8
  export declare const convertDartColorToCssNumber: (dartColor: number) => number;
8
9
  /**
9
- * Converts a CSS color (0xXXXXXXFF) to HSL format.
10
+ * Converts a CSS color number (0xRRGGBBAA) to an HSL component string "h, s%, l%".
10
11
  *
11
- * @param cssColor - The CSS color represented as a 32-bit integer (0xXXXXXXFF).
12
- * @returns An object with HSL values {h, s, l}.
12
+ * @param cssColor - The CSS color as a 32-bit integer (0xRRGGBBAA).
13
+ * @returns A string suitable for hsl(): e.g. "120, 50%, 50%".
13
14
  */
14
15
  export declare const cssColorToHslString: (cssColor: number) => string;
16
+ /**
17
+ * Converts a Dart color (AARRGGBB) from props to a CSS color string for inline styles.
18
+ * Use this for any color prop that comes from the Flutter dashboard (e.g. backgroundColor, color).
19
+ * Raw number must not be used in style — CSS expects a string and byte order differs (Dart: alpha first; CSS: alpha last).
20
+ *
21
+ * @param dartColor - Color from props (Dart AARRGGBB format), or undefined/null.
22
+ * @returns A CSS color string (e.g. "hsl(120, 50%, 50%)") or empty string if no color.
23
+ */
24
+ export declare const dartColorToCssColor: (dartColor: number | null | undefined) => string;
15
25
  /**
16
26
  * Trims and attempts to fix the phone number by:
17
27
  * - Removing all non-numeric characters
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "feeef",
3
3
  "description": "feeef sdk for javascript",
4
- "version": "0.7.2",
4
+ "version": "0.7.4",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
7
7
  "files": [