feat(reports): sync CLI to contract — inventory, attendees, sales/export filters#15
feat(reports): sync CLI to contract — inventory, attendees, sales/export filters#15LucasLeguizamo wants to merge 1 commit into
Conversation
…filters Regenerates the client from the current B2B contract and wires the shipped report capabilities: - `ft reports inventory` (--event, --event-date, --from, --to, --include-drafts, --group-by) — aggregate capacity/sold/reserved/available in a single call instead of per-sale fan-out. - `ft sales list` filters: --channel, --event, --event-date, --reference, --buyer, --from, --to. - `ft reports export buyers|attendees` filters: --status, --event, --event-date, --from, --to (attendees = one row per ticket). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by Qodofeat(reports): sync CLI to contract — inventory, attendees, sales/export filters
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Generated SDK not built
|
| import { | ||
| getReportsExportsAttendees, | ||
| getReportsExportsBuyers, | ||
| getReportsExportsSubscribers, | ||
| getReportsInventory, | ||
| getReportsSummary, | ||
| } from "../client/sdk.gen"; |
There was a problem hiding this comment.
1. Generated sdk not built 🐞 Bug ☼ Reliability
The CLI imports newly-required SDK functions (e.g. getReportsInventory/getReportsExportsAttendees) from ../client/sdk.gen, but src/client/ is generated-and-gitignored and the project’s build/typecheck scripts do not run the generator, so builds/typechecks will fail unless generation is performed beforehand.
Agent Prompt
### Issue description
The repository relies on generated OpenAPI client code under `src/client/` (gitignored), but `pnpm build` / `pnpm typecheck` do not run `pnpm generate` first. This PR adds additional SDK imports, increasing the chance of broken builds/typechecks when the generated client is missing or stale.
### Issue Context
- `openapi-ts.config.ts` generates to `src/client/`.
- `.gitignore` excludes `src/client/` from version control.
- `package.json` scripts do not ensure generation occurs before compilation.
### Fix
Pick one:
1) **Ensure generation runs automatically** by adding `prebuild`, `pretypecheck`, and (optionally) `pretest` scripts that run `pnpm generate`.
2) **Commit generated client code** by removing `src/client/` from `.gitignore` (if the repo policy allows committing generated artifacts).
### Fix Focus Areas
- package.json[26-37]
- .gitignore[1-6]
- openapi-ts.config.ts[1-9]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Superseded by #16. That PR is a strict superset of this one — it includes |
What
Syncs the CLI to the current B2B contract (
free-adminmain), surfacing report capabilities that shipped server-side but were not yet exposed byft.ft reports inventory— aggregatecapacity/sold/reserved/availableper event/date/ticket type in a single call (replaces per-sale fan-out). Flags:--event,--event-date,--from,--to,--include-drafts,--group-by ticketType|date|event.ft sales listfilters:--channel,--event,--event-date,--reference,--buyer,--from,--to.ft reports export buyers|attendeesfilters:--status,--event,--event-date,--from,--to.attendeesis one row per ticket;buyersone row per sale.How
openapi.jsonregenerated from the live contract;src/client/regenerated viaopenapi-ts. No hand-edits to generated code.Closes the CLI side of AppFreeticket/free-admin#165, #167, #168.
Test
pnpm typecheck,pnpm test,pnpm buildgreen;--helpverified for each new command/flag.🤖 Generated with Claude Code