Phase 4 part 1: the full Stripe sync, and margins per product

Customers, invoices with all their lines (both of Stripe's line shapes),
credit notes, refunds (with their customer) and products: a backfill,
then the Events API every hour, and a new backfill when events have
expired. Metrics page with sync status. Gross margin per product: a
default (60%) and overrides, with names from Stripe's products or the
invoice lines. Schemas 18 and 19.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 09:24:32 -07:00
co-authored by Claude Opus 5.5
parent 07c4491f48
commit 2c242d8c94
15 changed files with 1167 additions and 6 deletions
+20 -3
View File
@@ -399,19 +399,36 @@ Throughout, also notice:
- [ ] With a Bing Webmaster API key saved, Bing's weekly numbers, searches
and crawl issues appear.
## 8. Search
## 8. Metrics
### Stripe sync
- [ ] With the Stripe key's read access widened (Customers, Invoices, Credit
notes, Charges and Refunds, Events), Metrics → *Sync now* reads your
whole history the first time and says so.
- [ ] The counts of customers, invoices, credit notes and refunds match
Stripe's dashboard (draft invoices aren't counted).
- [ ] A later *Sync now* applies only the changes since the last one; a
payment or refund made in Stripe shows up within the hour.
- [ ] The currencies listed are the ones you bill in.
- [ ] *Gross margin by product* lists your Stripe products by name, with
what each billed over the last 12 months (compare one with Stripe's
reports). Setting a margin and saving keeps it; an empty box shows
the default.
## 9. Search
- [ ] Searching for an inventory entry, a fetched item, a post, a prospect
(company or person) or a signal finds it, with a link to where it is.
## 9. Agents (MCP)
## 10. Agents (MCP)
- [ ] `supermarket token` prints a token.
- [ ] Claude Code (`claude mcp list`) shows Supermarket connected, and can
list prospects or the CRM queue through it.
- [ ] Hermes uses the Supermarket and Core MCP tools in its CRM job.
## 10. Data and safety
## 11. Data and safety
- [ ] `~/.local/share/supermarket/secrets.json` is readable only by you
(`ls -l`), and no key is ever shown in the app after saving.