From 350c25151370738d328a9319c2b05eaec31bb2b3 Mon Sep 17 00:00:00 2001 From: Howard Enos Date: Tue, 23 Jun 2026 15:54:23 -0700 Subject: [PATCH] sync: auto-sync from GURU-BEAST-ROG at 2026-06-23 15:54:03 Author: Mike Swanson Machine: GURU-BEAST-ROG Timestamp: 2026-06-23 15:54:03 --- .claude/memory/feedback_syncro_billing.md | 27 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.claude/memory/feedback_syncro_billing.md b/.claude/memory/feedback_syncro_billing.md index 48c2c3ff..8176b916 100644 --- a/.claude/memory/feedback_syncro_billing.md +++ b/.claude/memory/feedback_syncro_billing.md @@ -86,14 +86,29 @@ Always set `price_retail` explicitly — the rate doesn't auto-populate and the --- -## 8. Corrections preserve the ORIGINAL tech's attribution; ticket ownership is sticky +## 8. API key follows the BILLING TECH — always -**Labor lines:** when fixing a wrong line, preserve the **original tech's** `user_id` so their commission isn't lost. -- **Prefer `update_line_item` in place** — it preserves `user_id`. -- **If you must remove + re-add:** the new line defaults to the **API-key owner's** `user_id`. Explicitly set `user_id` to the original tech on `add_line_item`, or PUT-fix it afterward. -- Determine the original tech from `.ticket.user_id` and the line's `.user_id` BEFORE correcting; verify after. +**Attribution is determined by which API key you use**, not the requesting user. Every call (add_line_item, remove_line_item, comments) is logged as the owner of that key. -**Ticket ownership:** adding notes or labor does **NOT** change `.ticket.user_id`. Multiple techs routinely work the same ticket. Only change ticket ownership when explicitly asked. Status PUTs send only `status`; line edits use `update_line_item`; neither touches `user_id`. +**Rule (confirmed by Howard 2026-06-23):** use the tech's own API key whenever billing is attributed to a specific person: +- Bill for Howard → `msp-tools/syncro-howard.sops.yaml` → `credentials.credential` +- Bill for Mike → `msp-tools/syncro.sops.yaml` → `credentials.credential` + +```bash +# Howard's key +HOWARD_KEY=$(bash .claude/scripts/vault.sh get-field msp-tools/syncro-howard credentials.credential) +curl -s -X POST "...?api_key=${HOWARD_KEY}" ... + +# Mike's key (default / fallback) +MIKE_KEY=$(bash .claude/scripts/vault.sh get-field msp-tools/syncro credentials.credential) +curl -s -X PUT "...?api_key=${MIKE_KEY}" ... +``` + +Note: `add_line_item` and `remove_line_item` use `?api_key=` query param auth. The `Authorization: ` header also works for most endpoints but does NOT control attribution — `?api_key=` is the attribution mechanism. + +**Corrections:** if a line was added under the wrong key (wrong `user_id`), use `remove_line_item` then re-add with the correct tech's key. `update_line_item` does NOT change `user_id` even when you pass it explicitly. + +**Ticket ownership:** adding notes or labor does **NOT** change `.ticket.user_id`. Multiple techs routinely work the same ticket. Only change ticket ownership when explicitly asked. Tech user_id table → [[feedback_syncro_history]].