Skip to content

feat(contract): v1 1.55.0 + admin 1.9.0 — ft admin settlements, CRM and courtesy requests - #58

Merged
lu-ochenty merged 5 commits into
mainfrom
feat/contract-sync-v1-1.55-admin-1.9
Nov 23, 2026
Merged

lu-ochenty merged 5 commits into
mainfrom
feat/contract-sync-v1-1.55-admin-1.9

Conversation

@LucasLeguizamo

@LucasLeguizamo LucasLeguizamo commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Syncs the CLI with the current free-admin contracts: v1 1.43.0 → 1.55.0 and admin 1.8.0 → 1.9.0. It also brings in the feat/admin-crm branch, which was never merged (ft admin crm commands and FT_ADMIN_TOKEN authentication).

Dependency: the admin 1.9.0 contract (/api/admin/settlements* and the new /api/admin/crm/* routes) comes from AppFreeticket/free-admin#1298, not merged yet. Merge this PR after that one; until then those commands return 404 in production.

What changes

Admin 1.9.0 (SUPER_ADMIN)

Command Operation
ft admin settlements list [--status] [--organization] [--all] GET /settlements
ft admin settlements get <id> GET /settlements/{id}
ft admin settlements upload <pdf> --organization <id> POST /settlements/files
ft admin settlements create --data [--pdf] POST /settlements (manual/auto)
ft admin settlements regenerate <id> POST /settlements/{id}/regenerate
ft admin settlements attach <id> POST /settlements/{id}/proofs
ft admin settlements send <id> POST /settlements/{id}/send (confirm: true)
ft admin settlements mark-paid <id> --proof … POST /settlements/{id}/mark-paid (confirm: true)
ft admin settlements delete <id> DELETE /settlements/{id} (confirm: true)
ft admin crm suppressions list|add|remove GET/POST/DELETE /crm/suppressions (remove sends confirm: true)
ft admin crm test-send --data POST /crm/test-send (confirm: true)
ft admin crm organizations [query] GET /crm/organizations
ft admin crm people search <query> [--scope] POST /crm/people/search

Every settlement write, suppressions remove and test-send shows its target and asks for confirmation; without a TTY they refuse unless --yes is passed. The CLI never retries a write. PDFs are checked locally (3 MB, %PDF header) before upload. Named errors (DUPLICATE_SETTLEMENT, AMOUNT_MISMATCH, INVALID_STATE, CONFIRMATION_REQUIRED, SEND_FAILED, RATE_LIMITED…) print the next step. The README notes that get/list cover event settlements only and that the organizer email on send/mark-paid is best-effort.

v1 1.55.0

  • ft courtesy-requests create --data → POST /courtesy-requests (enterprise service key).
  • ft settlements list --kind EVENT|MEMBERSHIP and a kind column (v1 1.54).

Fix: in ft admin, users list --workspace and audit-log list --actor were silently ignored because the value was read under the query name (workspaceId, actorId) instead of the flag name.

Deliberately out of scope: the 21 new /customer/* operations (community, live chat, newsletter). They need a buyer session (X-Customer-Session), and the CLI implements no /customer/* or /public/* route: it is the B2B surface. For the same reason the nullable ticketCode in buyer/public tickets affects no command. The MCP covers those routes.

Flow diagram

flowchart LR
  A[ft admin settlements send/mark-paid/delete] --> B[GET /settlements/id: show]
  B --> C{--yes or TTY confirmation}
  C -- no --> D[Exit 1 without writing]
  C -- yes --> E[POST/DELETE with confirm: true]
Loading

How to test

pnpm install && pnpm generate
pnpm lint && pnpm typecheck && pnpm test && pnpm build
node dist/index.js admin settlements --help
node dist/index.js admin crm --help
# without a TTY and without --yes, it refuses before calling:
FT_ADMIN_TOKEN=x node dist/index.js admin settlements delete stl_1 < /dev/null

New tests: src/commands/admin-settlements.test.ts, cases in admin-crm.test.ts, destructive-confirm.test.ts (8 new writes refused without --yes) and program.test.ts. 175/175 passing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fo7cm88pv5nC6H9aXKtwc1

LucasLeguizamo and others added 4 commits November 23, 2026 13:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fo7cm88pv5nC6H9aXKtwc1
Adds ft admin settlements (list, get, upload, create, regenerate, attach,
send, mark-paid, delete), the remaining ft admin crm commands, ft
courtesy-requests create and ft settlements list --kind. Fixes admin list
filters that read the query name instead of the flag name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fo7cm88pv5nC6H9aXKtwc1
@LucasLeguizamo LucasLeguizamo added enhancement New feature or request contract-sync El contrato de free-admin cambió; falta sincronizar labels Nov 23, 2026
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

…-paid email is best-effort

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fo7cm88pv5nC6H9aXKtwc1
@LucasLeguizamo
LucasLeguizamo force-pushed the feat/contract-sync-v1-1.55-admin-1.9 branch from 58c97a0 to b906a2b Compare November 23, 2026 19:45
@LucasLeguizamo LucasLeguizamo changed the title feat(contract): v1 1.55.0 + admin 1.9.0 — ft admin settlements, CRM y cortesías feat(contract): v1 1.55.0 + admin 1.9.0 — ft admin settlements, CRM and courtesy requests Nov 23, 2026
@lu-ochenty
lu-ochenty merged commit bdd58da into main Nov 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contract-sync El contrato de free-admin cambió; falta sincronizar enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants