Merge branch 'fix/dashboard-figures'

This commit is contained in:
DEls 2026-10-11 00:17:08 +02:00
commit 6e3e9ec27c
4 changed files with 3400 additions and 1 deletions

View file

@ -0,0 +1,53 @@
---
name: dn-inbox-review
description: Review Foreman's latest delivery-note inbox run. Spot-check what he prepared against the photos, move answered site questions on to Ready to post, apply site-confirmed receipt corrections, and write a short report. Never books.
---
# Delivery-note inbox review (after Foreman)
Foreman (MiniMax) works the inbox first: skill `foreman/skills/dn-inbox/SKILL.md`. His reports are in `foreman/runs/dn-inbox/<YYYY-MM-DD-HH-MM>.md`. You are the second, smaller check before the site manager pulls the trigger. Use the MegaDash MCP tools (`megadash-direct`, or the MEGADASH connector). Never write to PocketBase directly.
## 1. Read Foreman's latest report
- Open the newest file in `foreman/runs/dn-inbox/`. If it is older than this morning or says the run failed, say so at the top of your report and work the board directly (steps 2–4 still apply).
- Use its "For the reviewer" table as your checklist.
## 2. Spot-check what he prepared (Ready to post)
For every document Foreman moved to Ready to post (and anything else on `inbox_board` in `ready_to_post`):
1. `get_delivery_candidate`, then open the photo (`read_document`, `kind:"page"`). Look at it yourself, and zoom into the handwritten Quantity Delivered column.
2. For every saved allocation (`reconciliation_preview.allocations[]`), check:
- The quantity matches the photo, in the PO's unit (6 m lengths, kg → t, kits).
- The PO line is the right one.
- NIL lines are closed.
3. Check the money: `netTotal` against the slip's printed excl-VAT total, where it prints one. The difference must be explained by noted price differences (PO rate vs slip price). Check against `get_purchase_order_detail` that nothing goes over the PO.
4. Wrong → fix the line, re-run `process_delivery_candidate` and `prepare_delivery` with the right plan. Can't tell → `request_site_decision`. Write down what you changed and why.
- Low-confidence rows in Foreman's table get a full check, line by line.
- High-confidence rows: check at least the handwritten column and the total.
## 3. Waiting for site: answered questions
For each document whose site question has been answered (`get_delivery_candidate` → `checks` entry `site_decision` with `passed:true` and `detail.answer`):
- Apply the answer. Link the PO they named (`resolve_delivery_entities`), fix quantities or units, upload the PO if they said it's coming and it's now in the system, or set aside if they said so.
- If they approved an extra quantity over the PO, `prepare_delivery` with `acceptExcess:true` and a reason quoting their answer.
- Then `prepare_delivery`, so it lands in Ready to post. Check it as in step 2.
- An answer that confirms a **posted** receipt is wrong (e.g. Global Precast 61833: 65 pipes × 2.5 m = 162.5 m, not 65 m) → `reassign_receipt` with the expected current quantity and the site's answer as the reason.
- An answer you can't act on, or a vague one → ask a follow-up `request_site_decision`.
- Questions still open: leave them, and count them in your report.
## 4. Foreman's other findings
- "Posted receipts that look wrong": verify against the photo and PO. Fix with `reassign_receipt` only when the photo or a site answer proves it. Otherwise ask the site.
- Supplier duplicates: `merge_suppliers` only when the names, registration or VAT numbers show it's the same company. Otherwise list it for David.
- Flags for deletion: check the reason holds, and leave them for David.
## Rules
- **Never book**: no `post_delivery`, `post_delivery_line`, `correct_delivery_receipt`. The site manager presses Confirm delivery.
- Never accept an excess without a site answer that approves it.
- Never delete. Use `request_deletion` with a reason.
- Every write: a new UUID v4 `operationId` and a reason.
## Your report
Write it to `foreman/runs/dn-inbox-review/<YYYY-MM-DD-HH-MM>.md` and also give it as your final message:
- Line 1: `REVIEW: OK` (nothing needs David) or `REVIEW: ATTENTION (<n>)`.
- **Ready for the site manager**: per site, document, supplier, PO, total excl VAT, "checked". This is the list they confirm from.
- **What I changed**: tool, document, reason.
- **Where Foreman was wrong**: so his skill can be improved, with the exact mistake.
- **Waiting for site**: count per site and the oldest question's age.
- **Needs David**: anything that is a decision for him, e.g. a deletion, a supplier merge, a price dispute.

View file

@ -56,7 +56,8 @@
"Bash(rg -n \"isTerminalCandidate|terminal\" src/lib/dn-pipeline/run-staged.ts src/lib/dn-pipeline/*.ts)",
"Bash(rg -n \"export function assemblePages\" -A 40 src/lib/dn-pipeline/*.ts)",
"Bash(rg -rn \"function assemblePages\" src/lib/dn-pipeline/)",
"Bash(lsof -iTCP -sTCP:LISTEN -P)"
"Bash(lsof -iTCP -sTCP:LISTEN -P)",
"mcp__24e2ddd3-bc56-4f86-bbda-f6cee6e48fc3"
]
}
}

View file

@ -0,0 +1,541 @@
[
{
"id": "0dxf7gasj9yblk3",
"employee": "z1ajjeosy1fcuax",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.58
},
{
"id": "1y1zw2934xcoi5n",
"employee": "6ov7a4gowqtui0w",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "2chj3bifeiq4bos",
"employee": "vzcue8zo1hl1nm2",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.64
},
{
"id": "2u1a8t3nht03o8u",
"employee": "eqht5tjepskbeyu",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.6
},
{
"id": "4jokh5uj5qp7md1",
"employee": "w92svku22ix8n9w",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.61
},
{
"id": "54wzgvjac9n6t6z",
"employee": "vlq82srjghqkrgw",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.59
},
{
"id": "56uq9nquiryn4kf",
"employee": "5n8d1x02moc6qng",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.54
},
{
"id": "7rguzysa7bitar2",
"employee": "xlwcge6nso60u4x",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.61
},
{
"id": "8lvshig1o2205q0",
"employee": "yi9nro4rr704bww",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.59
},
{
"id": "8u4hv39sv5ekk9r",
"employee": "xctymea65zmg0xo",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.58
},
{
"id": "94m2u5fiygoqe9o",
"employee": "mutyb7mwfk9do4z",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 6.32
},
{
"id": "9ievoigojbe7axg",
"employee": "9j2e6ysbft6tcaf",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.57
},
{
"id": "9ugony2nc8dc2vf",
"employee": "1qexhgwdwk6gze9",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.06
},
{
"id": "a0qqxh52bjld3ok",
"employee": "vwzxj3iqejqn5ib",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.59
},
{
"id": "a4bcf0l155m44se",
"employee": "il45yjhs41zomcq",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.59
},
{
"id": "acrj5z8ezqd3yj9",
"employee": "5dvo4aziynga2pk",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.6
},
{
"id": "bur0gq5y34knv9e",
"employee": "dm88s6pumicpfxv",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.61
},
{
"id": "bvqw33as15mt486",
"employee": "h9f41kcvsr3l80v",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "d10b15f26mibg2t",
"employee": "okjfwf38ed79ytt",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.58
},
{
"id": "e7hvkgcu8okl208",
"employee": "5dvo4aziynga2pk",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "entbs6hph27a7y0",
"employee": "m8f3mhg12pmq2l4",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.54
},
{
"id": "eona0qh7bdmb0uf",
"employee": "6zwylrvzdclt379",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.58
},
{
"id": "fg6zkm9m04606nk",
"employee": "l9168xc8fy9teoa",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "fh60xh974ud9z36",
"employee": "vwzxj3iqejqn5ib",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.54
},
{
"id": "fhqfzmbaj31yvuk",
"employee": "m6l9e2l26ijh0dz",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.19
},
{
"id": "fknbf8j32vwcptz",
"employee": "vvyjq7a7wg84ehd",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.54
},
{
"id": "ftviq32p1rsztzm",
"employee": "viloukixvswlgqr",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.6
},
{
"id": "fxn1s2tteofj7as",
"employee": "6zwylrvzdclt379",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "g6y77nqnechwmeb",
"employee": "h9f41kcvsr3l80v",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.58
},
{
"id": "gaponwfyk2v5sk8",
"employee": "utydgttbpyg51ly",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.59
},
{
"id": "gtaqaebztxkzvv5",
"employee": "mhxifg6yrz2ulnj",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.58
},
{
"id": "hccr650sqfxhkyf",
"employee": "6r0vp4kdjztshnq",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "hnbiogc3z4dqqin",
"employee": "1qexhgwdwk6gze9",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.59
},
{
"id": "iwlmvjjb6b1qyr6",
"employee": "igljok9z0eckuwg",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.65
},
{
"id": "iy0qn9zmogro3ac",
"employee": "ovlqvj13ppcn85q",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.59
},
{
"id": "j5b8cuo9i7sk5jw",
"employee": "gh7cc8f34b2s6z5",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.6
},
{
"id": "jneaxvouhaxt9m5",
"employee": "3t2kq3b02o81kdm",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "joi3pgmm8yjkkp0",
"employee": "w92svku22ix8n9w",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.56
},
{
"id": "jstndkyp7tolw11",
"employee": "6ov7a4gowqtui0w",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.59
},
{
"id": "jsyvaqcgcl0d34c",
"employee": "dm88s6pumicpfxv",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.61
},
{
"id": "jzi9qymwlkfd4b7",
"employee": "kvunk8x55afl4hw",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "kc5jpv72b7038s6",
"employee": "eqht5tjepskbeyu",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.54
},
{
"id": "m22g5rzkfp0z69p",
"employee": "vlq82srjghqkrgw",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "m2o8dfauet7wkuy",
"employee": "tk93o8eiqcbgju2",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.59
},
{
"id": "mj0xhe5z133p97c",
"employee": "mutyb7mwfk9do4z",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.62
},
{
"id": "mt39ybycohzhix7",
"employee": "vvyjq7a7wg84ehd",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "mybeex62j2klppo",
"employee": "9j2e6ysbft6tcaf",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "nfb1lryowfmqfz7",
"employee": "gh6jzavdsihfhf0",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.62
},
{
"id": "o54kaxbmj0lk242",
"employee": "i5kq2q1rll6xk11",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.58
},
{
"id": "o6ufrqyb77jeoc7",
"employee": "mhxifg6yrz2ulnj",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "oe2n27e15u9b867",
"employee": "bnll5vjdmqw6dkv",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.62
},
{
"id": "pc1s1kwsbekce5h",
"employee": "yoiqbf150evz5cu",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.55
},
{
"id": "pg1ttbkeqijp24i",
"employee": "smtm7xlsn7b70bh",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.6
},
{
"id": "puuzjsha41ko6l4",
"employee": "veaomdkoc1ol8ne",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.57
},
{
"id": "qt58rnk8j8mqxbh",
"employee": "ketffi14j74n62a",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "rbbp1hpgc3mlmtp",
"employee": "e1f3v4x63vtcjsw",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.54
},
{
"id": "rjnsc82sd4rnuhi",
"employee": "urnfkdv8i7bvsgw",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.65
},
{
"id": "sfdilhlpx7blonx",
"employee": "yoiqbf150evz5cu",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.62
},
{
"id": "sic3pw7qa871z9d",
"employee": "09bx4bp64nq9hl1",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.55
},
{
"id": "spfqxe642f0bui1",
"employee": "il45yjhs41zomcq",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.6
},
{
"id": "tbr16wxjg0i6gur",
"employee": "5n8d1x02moc6qng",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.62
},
{
"id": "tdn6rlqaat2upyz",
"employee": "kvunk8x55afl4hw",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.62
},
{
"id": "thvk4opepadk9ya",
"employee": "yi9nro4rr704bww",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "ufver92az7jf7d5",
"employee": "bnll5vjdmqw6dkv",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.59
},
{
"id": "uitw6cqqdhk37cc",
"employee": "m6l9e2l26ijh0dz",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.54
},
{
"id": "vfit1gfjb3fjt7f",
"employee": "m8f3mhg12pmq2l4",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.62
},
{
"id": "vh5btz93cfrppxq",
"employee": "gh7cc8f34b2s6z5",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.55
},
{
"id": "vwgi33dksedoonr",
"employee": "b8s6lhgp6lvauoj",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.6
},
{
"id": "w9zwjezhxh4chtb",
"employee": "d2lnxuzhtisfbow",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.6
},
{
"id": "wjbibfl2y0muznf",
"employee": "zdjl9x4cxjvb6wl",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.56
},
{
"id": "ww3l28noz5v17l8",
"employee": "ovlqvj13ppcn85q",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.6
},
{
"id": "wyfi0mhet55x7md",
"employee": "d2lnxuzhtisfbow",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.54
},
{
"id": "x9qw3flib69bo94",
"employee": "c573n2bm7jn8pvm",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.61
},
{
"id": "xcupqovlrvib49j",
"employee": "i5kq2q1rll6xk11",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "xfyl5dcfq6cr8jo",
"employee": "l9168xc8fy9teoa",
"date_logged": "2026-10-09 00:00:00.000Z",
"work_date": "2026-10-09",
"hours_worked": 7.58
},
{
"id": "xvq7dit0q5ohntu",
"employee": "09bx4bp64nq9hl1",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.53
},
{
"id": "yiqc12jihv8dmfa",
"employee": "viloukixvswlgqr",
"date_logged": "2026-10-02 00:00:00.000Z",
"work_date": "2026-10-02",
"hours_worked": 7.68
}
]