@classytic/pos 0.5.0 → 0.6.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0] — 2026-09-04
4
+
5
+ ### Added
6
+
7
+ - `ShiftRepository.findActiveByBranch(organizationId)` — returns all active shifts for a branch (dashboard "registers open now" widget); routed through `findAll` so the tenant plugin injects and casts `organizationId`
8
+
9
+ ### Changed — peer floors raised to current
10
+
11
+ - `@classytic/mongokit` `>=3.33.0` → **`>=3.36.0`**
12
+ - `@classytic/primitives` `>=0.23.0` → **`>=0.26.4`**
13
+ - `@classytic/repo-core` `>=0.24.0` → **`>=0.26.0`**
14
+
3
15
  ## [0.5.0] — 2026-08-26
4
16
 
5
17
  ### Fixed — CRITICAL: cash drawer identified by kind, not by code spelling
@@ -239,6 +239,12 @@ declare class ShiftRepository extends Repository<IShift> {
239
239
  * host-side shim carry its own `isValid` dance).
240
240
  */
241
241
  getActiveShift(ctx: PosContext, registerId?: string): Promise<ShiftDocument | null>;
242
+ /**
243
+ * Every active shift for ONE branch — the "/status" dashboard widget
244
+ * ("registers open now"). Routed through `findAll` so the tenant plugin
245
+ * injects and CASTS `organizationId`, same reasoning as `getActiveShift`.
246
+ */
247
+ findActiveByBranch(organizationId: string): Promise<ShiftDocument[]>;
242
248
  /**
243
249
  * Lean, DELIBERATELY UNSCOPED read by `_id`.
244
250
  *
@@ -459,6 +459,18 @@ var ShiftRepository = class extends Repository {
459
459
  }))[0] ?? null;
460
460
  }
461
461
  /**
462
+ * Every active shift for ONE branch — the "/status" dashboard widget
463
+ * ("registers open now"). Routed through `findAll` so the tenant plugin
464
+ * injects and CASTS `organizationId`, same reasoning as `getActiveShift`.
465
+ */
466
+ async findActiveByBranch(organizationId) {
467
+ return await this.findAll({ state: { $in: [...ACTIVE_SHIFT_STATES] } }, {
468
+ organizationId,
469
+ select: "_id state registerId openingCashierId openedAt blindClosedAt salesCount salesTotal",
470
+ lean: true
471
+ });
472
+ }
473
+ /**
462
474
  * Lean, DELIBERATELY UNSCOPED read by `_id`.
463
475
  *
464
476
  * Exists so a host can distinguish "shift does not exist" (404) from "shift
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/pos",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Multi-vertical POS / register-session kernel for MongoDB — shift lifecycle, cash-drawer reconciliation, payment-method breakdown, variance detection, FSM. Works for retail, restaurant, clinic, service-booking, car-wash and any vertical with a 'shift opens, shift closes, money is reconciled' workflow.",
5
5
  "author": "Classytic",
6
6
  "type": "module",
@@ -71,18 +71,18 @@
71
71
  "release": "npm run push -- main && npm run release:tag && npm publish"
72
72
  },
73
73
  "peerDependencies": {
74
- "@classytic/mongokit": ">=3.33.0",
75
- "@classytic/primitives": ">=0.23.0",
76
- "@classytic/repo-core": ">=0.24.0",
74
+ "@classytic/mongokit": ">=3.36.0",
75
+ "@classytic/primitives": ">=0.26.4",
76
+ "@classytic/repo-core": ">=0.26.0",
77
77
  "@classytic/validation": ">=0.2.0",
78
78
  "mongoose": ">=9.4.1",
79
79
  "zod": ">=4.0.0"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@classytic/dev-tools": "^0.2.0",
83
- "@classytic/mongokit": "^3.33.0",
84
- "@classytic/primitives": ">=0.23.0",
85
- "@classytic/repo-core": ">=0.24.0",
83
+ "@classytic/mongokit": "^3.36.0",
84
+ "@classytic/primitives": ">=0.26.4",
85
+ "@classytic/repo-core": ">=0.26.0",
86
86
  "@classytic/validation": ">=0.4.0",
87
87
  "@types/node": "^25.5.0",
88
88
  "@vitest/coverage-v8": "^3.2.4",