Repository navigation
feat(cli): destination dates + accommodation free-cancellation flags - #2
Merged
akoso merged 1 commit intoJun 13, 2026
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.
Surfaces two API fields the CLI didn't expose yet, and re-syncs the committed OpenAPI snapshot with the live production surface.
Feature 1 — destination dates
--start-date/--end-dateondestinations addandedit. AcceptsYYYY-MM-DD(normalized to UTC start-of-day ISO) or a full ISO date-time; maps to bodystartDate/endDate. Included inedit's "specify at least one of …" guard.mna trips show <trip> --json.Feature 2 — accommodation free-cancellation
--free-cancellation-untilonoptions addandedit(accommodation only; clear error otherwise), merged into the body asfreeCancellationUntil. Foroptions editit also makes--from-jsonoptional, so updating just the date needs no JSON file:OpenAPI sync
Regenerated
openapi.jsonfrom the live API. The server now declaresfreeCancellationUntil(+checkIn/checkOut/times) on the Create/Update accommodation DTOs — closing the contract gap so this flag is fully typed — and returnsCreateOptionResultV1Dto { key }on option creation. Structurally additive vs the previous snapshot (74 new leaf paths, 0 removed/changed).schema.tsis gitignored and regenerated from this snapshot by CI.Tests
normalizeToIsoDateTimeandapplyFreeCancellationunit-tested; command-level flag→body mapping tests in theclient.test.tsstyle.bun run typecheck,bun run lint,bun test(34 pass), andbun run buildall green.Note:
README.mdalso carries a small pre-existing install-doc note (bun run buildbeforebun link) that was already in the working tree.🤖 Generated with Claude Code