Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
00dd72d
docs: add quantitative assets PRD
DonKoko Feb 17, 2026
b227952
docs: rename Consumable to Quantity-tracked in PRD
DonKoko Feb 18, 2026
c46d5eb
Merge branch 'main' into feat-quantities
DonKoko Feb 18, 2026
32fdb94
Merge branch 'main' into feat-quantities
DonKoko Feb 19, 2026
aa1c398
Merge branch 'main' into feat-quantities
DonKoko Feb 26, 2026
60b2021
Merge branch 'main' into feat-quantities
DonKoko Mar 19, 2026
0fb6e5f
Merge branch 'main' into feat-quantities
DonKoko Mar 30, 2026
6325686
feat: add quantity-tracked assets foundation (Phase 1)
DonKoko Mar 31, 2026
b11e227
fix: phase 1 UI refinements based on testing feedback
DonKoko Apr 1, 2026
30a7134
Merge branch 'main' into feat-quantities
DonKoko Apr 1, 2026
0e0f10a
fix: address PR review feedback for phase 1
DonKoko Apr 1, 2026
965895c
feat: add advanced index filters, columns, and inline creation
DonKoko Apr 1, 2026
aea1bc1
fix: address second round of PR review feedback
DonKoko Apr 1, 2026
01a6f56
Merge branch 'main' into feat-quantities
DonKoko Apr 1, 2026
dcc3bd9
fix: address third round of PR review feedback
DonKoko Apr 1, 2026
e742962
feat: phase 2 — quantity-aware custody, consumption, and stock manage…
DonKoko Apr 3, 2026
1c1ff9d
feat: add custody quantity migration and individual asset trigger
DonKoko Apr 6, 2026
4409f26
docs: add session context file for cross-device continuity
DonKoko Apr 6, 2026
46d6d97
Merge branch 'main' into feat-quantities
DonKoko Apr 6, 2026
5af0d79
fix: phase 2 testing — UX fixes, audit notes, and validation
DonKoko Apr 6, 2026
314366a
fix: quantity-aware status badge, security fixes, and bulk ops
DonKoko Apr 7, 2026
81be8ca
Merge branch 'main' into feat-quantities
DonKoko Apr 8, 2026
bf5c43f
fix: update bulk assign custody test mock return value
DonKoko Apr 8, 2026
77a95ee
fix: address CodeRabbit review — security, atomicity, and perf
DonKoko Apr 8, 2026
f239713
fix: address Copilot review feedback
DonKoko Apr 8, 2026
bb0e0dc
fix: guard release-custody route, remove duplicated logic,
DonKoko Apr 8, 2026
15911b0
feat: migrate _AssetToBooking to explicit BookingAsset
DonKoko Apr 9, 2026
1201b00
feat(bookings): quantity-tracked booking support (Phase 3b)
DonKoko Apr 14, 2026
ba5ca14
Merge remote-tracking branch 'origin/main' into feat-quantities
DonKoko Apr 15, 2026
13eed84
feat(bookings): quantity-aware UX polish, notes, and fixes (Phase 3b)
DonKoko Apr 16, 2026
60bfebe
feat(bookings): quantity-aware check-in (Phase 3c)
DonKoko Apr 17, 2026
9f7642b
fix(bookings): close TOCTOU races and validate inputs in qty-tracked …
DonKoko Apr 17, 2026
1fd4ad5
test(bookings): repair phase 3c scaffolding and add qty-tracked unit …
DonKoko Apr 17, 2026
e92dfd5
feat(bookings): port audit expected-list UX to partial check-in drawer
DonKoko Apr 21, 2026
e5cbd75
feat(bookings): book-by-model — reserve N × AssetModel, scan-to-assig…
DonKoko Apr 21, 2026
fc41289
docs(bookings): testing checklists for phases 3b–3d + roadmap refresh
DonKoko Apr 22, 2026
782b53e
fix(bookings): model picker uses DynamicSelect with availability hints
DonKoko Apr 22, 2026
f19f8ed
fix(bookings): phase 3d book-by-model UX fixes and inline model-reque…
DonKoko Apr 22, 2026
c1596f2
feat(bookings): fulfil-and-checkout scanner + audit-trail for model r…
DonKoko Apr 24, 2026
1a5a12f
refactor(bookings): merge model-request rows into Assets & Kits list
DonKoko Apr 24, 2026
a613f42
Merge branch 'main' into feat-quantities
DonKoko Apr 28, 2026
a64d8c2
chore: merge main (feat-reporting PR #2495) into feat-quantities
DonKoko Apr 29, 2026
a71d8fa
docs(context): catch up CLAUDE-CONTEXT.md through Phase 3d-Polish + m…
DonKoko Apr 29, 2026
12f2e82
fix: port main's reports + scripts to Phase-3a / Phase-2 schema
DonKoko Apr 29, 2026
c4316b0
chore(reports): clear all lint warnings + use modern React `act` import
DonKoko Apr 29, 2026
e97bb85
feat(reports): wire feat-quantities flows into existing ActivityEvent…
DonKoko Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .claude/rules/use-badge-colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Use BADGE_COLORS constants for badge styling instead of hardcoding hex values
globs: ["apps/webapp/**/*.tsx", "apps/webapp/**/*.ts"]
---

Always use `BADGE_COLORS` from `~/utils/badge-colors` when styling
Badge components. Never hardcode hex color values inline.

```typescript
// ❌ Bad
<Badge color="#E1F5FE" withDot={false}>
<span style={{ color: "#01579B" }}>Label</span>
</Badge>

// ✅ Good
<Badge
color={BADGE_COLORS.blue.bg}
textColor={BADGE_COLORS.blue.text}
withDot={false}
>
Label
</Badge>
```
3 changes: 2 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"mcp__sentry__find_organizations",
"mcp__sentry__find_projects",
"mcp__sentry__get_issue_details",
"mcp__sentry__search_issues"
"mcp__sentry__search_issues",
"mcp__supabase-local__execute_sql"
],
"deny": [
"Read(**/.env)",
Expand Down
612 changes: 612 additions & 0 deletions CLAUDE-CONTEXT.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ export async function createUserNote(args: CreateUserNoteArgs) { ... }
- Place shared helpers near the code that uses them, or in a shared utils file
if used across multiple modules

### TypeScript Strictness

- **Never use `any` as a shortcut.** The `any` type should only be used when it genuinely makes sense (e.g., wrapping third-party APIs with unknown shapes). Using `any` because it's "easier" or "less work" to figure out the proper type is not acceptable. Always find or define the correct type — use `unknown` with type narrowing if the shape is truly dynamic.

### Key Business Features

- **Asset Management**: CRUD operations, QR code generation, image processing
Expand Down
546 changes: 546 additions & 0 deletions TESTING-CHECKIN-DRAWER-REFACTOR.md

Large diffs are not rendered by default.

136 changes: 136 additions & 0 deletions TESTING-PHASE-3B.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Phase 3b Manual Testing Checklist

## Prerequisites

- At least 2 QUANTITY_TRACKED assets (e.g., "Pens" with 100 units, "Cables" with 100 units)
- At least 2 INDIVIDUAL assets (e.g., "Hilti Rotary Hammer", "Bomag Roller")
- One qty-tracked asset with partial custody (e.g., 50 of 100 in custody)
- One qty-tracked asset fully in custody (0 available)

---

## 1. Manage Assets — Adding qty-tracked assets to a booking

- [x] Create a new booking (set dates, custodian)
- [x] Open "Manage Assets"
- [x] Qty-tracked assets show blue badge: "Qty tracked · N available"
- [x] Fully-allocated qty assets (0 available) do NOT appear in the list
- [x] Partially-allocated qty assets show correct available count in badge
- [x] Selecting a qty-tracked asset shows inline quantity picker
- [x] Quantity picker defaults to 1
- [x] Quantity picker max is clamped to available (not total)
- [x] Quantity picker shows "/ N" where N is available quantity
- [x] INDIVIDUAL assets show normal status badge (no quantity picker)
- [x] Can select a mix of INDIVIDUAL + QUANTITY_TRACKED assets
- [x] Confirm saves correctly

## 2. Manage Assets — Editing quantities

- [x] Re-open "Manage Assets" on a booking with qty-tracked assets
- [x] Existing qty-tracked assets show their previously saved quantity (not default 1)
- [x] Changing the quantity and saving updates correctly
- [x] Changing quantity triggers unsaved-changes alert if navigating away

## 3. Booking Overview — Quantity display

- [x] Booking overview shows qty-tracked assets with "x N" next to title
- [x] INDIVIDUAL assets do NOT show "x 1"
- [x] Sidebar asset list shows quantity for qty-tracked assets
- [x] Asset count in header reflects correct number of items (not units)

## 4. Multiple bookings on same qty asset

- [x] Create Booking A with 30 units of "Pens" (100 available)
- [x] Create Booking B — "Pens" should show 70 available (100 - 30 reserved)
- [x] Add 50 units to Booking B — should work (30 + 50 = 80 < 100)
- [x] Try adding 80 units to a third booking — should show only 20 available

## 5. Booking with custody interaction

- [x] Assign 40 units of "Pens" to custody
- [x] Create a booking — "Pens" should show 60 available (100 - 40 custody)
- [x] Reserve 30 in a booking, then create another booking — shows 30 available (100 - 40 custody - 30 reserved)

## 6. Reserve flow

- [x] Reserve the booking (set status to Reserved)
- [x] Booking reserves successfully with qty-tracked assets
- [x] No false conflict errors for qty-tracked assets

## 7. Checkout flow

- [x] Check out the booking
- [x] If all quantities are still available → checkout succeeds
- [x] INDIVIDUAL assets get status CHECKED_OUT
- [x] QUANTITY_TRACKED assets — verify no status change on the asset itself

### Checkout with reduced availability

- [x] Create a booking with 50 "Pens", reserve it
- [x] Before checkout: assign 60 units of "Pens" to custody (so only 40 available now)
- [x] Try to checkout — should get error: "requested 50, only 40 available"
- [x] Go to manage-assets, reduce to 40, checkout again — should succeed

## 8. Check-in flow

- [x] Check in the booking (full check-in)
- [x] INDIVIDUAL assets get status reset to AVAILABLE
- [x] Booking completes successfully

### Partial check-in

- [x] Create booking with mix of INDIVIDUAL + QUANTITY_TRACKED assets
- [x] Check out the booking
- [x] Partial check-in: check in only the INDIVIDUAL asset
- [x] Remaining qty-tracked asset stays in booking
- [x] Complete check-in with the qty-tracked asset
- [x] Booking completes

## 9. Email notifications

- [x] Reserve a booking with qty-tracked assets
- [x] Check email — qty-tracked assets should show "x N" (e.g., "Pens x 30")
- [x] INDIVIDUAL assets show normally (no "x 1")

## 10. PDF generation

- [x] Generate PDF for a booking with qty-tracked assets
- [x] PDF should have a "Qty" column
- [x] Qty-tracked assets show their booked quantity
- [x] INDIVIDUAL assets show 1

## 11. Regression — INDIVIDUAL assets

- [x] Full booking flow with ONLY individual assets works as before
- [x] Create → add assets → reserve → checkout → checkin
- [x] No quantity picker shown for individual assets
- [x] Status badges work correctly
- [x] Conflict detection works (overlapping bookings still blocked)

## 12. Dashboard

- [x] Home page booking widgets show correct asset counts
- [x] Active/upcoming/overdue booking cards display properly

## 13. Calendar

- [x] Calendar shows bookings with qty-tracked assets
- [x] No errors or visual glitches

## 14. Booking duplication

- [x] Duplicate a booking that has qty-tracked assets
- [x] New booking should have the same assets with same quantities

## 15. CSV export

- [x] Export bookings to CSV
- [x] Qty-tracked assets show correctly in export data

---

## Issues Found

| # | Description | Severity | Status |
| --- | ----------- | -------- | ------ |
| | | | |
Loading
Loading