Repository navigation
fix: restore destination dates + free-cancellation flags lost by a stacked merge - #5
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recovers commit
069ecbc— reviewed and approved in #2, but never actually delivered tomain. Cherry-picked cleanly onto currentmain, 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), notmain. #1 merged intomainfirst (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 ofmain:#3's skill docs did reach
main(rebased, as450e70e), 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.mdandskills/mna/references/cli-and-schemas.mdonmaintoday instruct Claude to run: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.jsonsnapshot has been lagging production.069ecbcre-synced it, and that re-sync was lost with it.What the commit contains
--start-date/--end-dateondestinations addandedit, acceptingYYYY-MM-DDor a full ISO date-time, normalized to UTC start-of-day and mapped tostartDate/endDate.--free-cancellation-untilonoptions add/edit(accommodation only, with a clear error otherwise). Foroptions editit also makes--from-jsonoptional, so updating just the date no longer needs a JSON file.util/dates.tsandcommands/options/free-cancellation.ts, both unit-tested, plus command-level flag→body mapping tests.openapi.jsonwith the live production surface.Verification
Confirmed the flags are now real (
destinations add --helpshows--start-date/--end-date;options edit --helpshows--free-cancellation-untiland 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-clirebrand 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.