Skip to content

fix: restore destination dates + free-cancellation flags lost by a stacked merge - #5

Merged
akoso merged 1 commit into
mainfrom
restore/destination-dates-and-free-cancellation
Jul 29, 2026
Merged

akoso merged 1 commit into
mainfrom
restore/destination-dates-and-free-cancellation

Conversation

@akoso

@akoso akoso commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Recovers commit 069ecbc — reviewed and approved in #2, but never actually delivered to main. Cherry-picked cleanly onto current main, unmodified, original authorship preserved.

What happened

#2 was a stacked PR: its base was fix/cli-from-json-and-login-bugs (the branch of #1), not main. #1 merged into main first (9a43adc), and #2 then merged into that already-merged branch. The merge commit exists, GitHub shows #2 as MERGED, and the feature commit is nonetheless not an ancestor of main:

$ git merge-base --is-ancestor 069ecbc origin/main   # → false

#3's skill docs did reach main (rebased, as 450e70e), so the documentation for this feature landed while the feature itself did not.

Why this matters now — it's a release blocker

skills/mna/SKILL.md and skills/mna/references/cli-and-schemas.md on main today instruct Claude to run:

mna destinations add <trip> <var> --place "…" --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD>
mna options edit … --free-cancellation-until <date>

None of those flags exist on main. citty does not reject unknown flags, so the dates are silently dropped — the write returns 2xx and the trip is quietly missing its dates. That's precisely the silent-drop failure the skill's own "verify-after-write" section warns about, and the skill is shipped inside the npm tarball, so it would go out with the first release.

This also explains a second symptom: the committed openapi.json snapshot has been lagging production. 069ecbc re-synced it, and that re-sync was lost with it.

What the commit contains

  • --start-date / --end-date on destinations add and edit, accepting YYYY-MM-DD or a full ISO date-time, normalized to UTC start-of-day and mapped to startDate / endDate.
  • --free-cancellation-until on options add / edit (accommodation only, with a clear error otherwise). For options edit it also makes --from-json optional, so updating just the date no longer needs a JSON file.
  • Shared helpers util/dates.ts and commands/options/free-cancellation.ts, both unit-tested, plus command-level flag→body mapping tests.
  • Re-syncs openapi.json with the live production surface.

Verification

bun install       ✓
bun run codegen   ✓
bun run typecheck ✓  clean
bun run lint      ✓  92 files, 0 errors
bun test          ✓  34 pass / 0 fail  (was 22 on main)

Confirmed the flags are now real (destinations add --help shows --start-date / --end-date; options edit --help shows --free-cancellation-until and an optional --from-json), and that after this commit the committed snapshot regenerates byte-identical to production — the drift is gone.

Relationship to #4

Independent. #4 is the @mantacode/mna-cli rebrand and packaging prep and deliberately touches no source. Either can merge first; there are no overlapping files. Merging both before the first tag is what makes the shipped skill honest.

Surfaces two API fields the CLI didn't expose, and re-syncs the committed
OpenAPI snapshot with the live production surface.

- Destination dates: `--start-date` / `--end-date` on `destinations add` and
  `edit`, accepting YYYY-MM-DD (normalized to UTC start-of-day ISO) or a full
  ISO date-time. Mapped to body `startDate` / `endDate`; included in edit's
  "specify at least one of …" guard.
- Accommodation free-cancellation: `--free-cancellation-until` on `options add`
  and `edit` (accommodation only; clear error otherwise), merged into the body
  as `freeCancellationUntil`. For `options edit` it also makes `--from-json`
  optional, so updating just the date no longer needs a JSON file.
- Shared helpers: `normalizeToIsoDateTime` (util/dates) and `applyFreeCancellation`
  (commands/options), both unit-tested; plus command-level flag→body mapping
  tests in the client.test.ts style.
- Regenerated openapi.json snapshot from the live API: the server now declares
  `freeCancellationUntil` (+ checkIn/checkOut/times) on Create/Update
  accommodation DTOs (closing the contract gap) and returns CreateOptionResultV1Dto
  on option creation. Purely additive vs the previous snapshot.

Known caveat (backend, out of scope here): PATCH destination start/end-date
persistence — the CLI sends the fields correctly; end-to-end persistence depends
on the server update handler. Verify with `mna trips show <trip> --json`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@akoso
akoso merged commit 4198ed5 into main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant