Skip to content

feat: add slot lookup and write confirmations - #9

Open
axelpaul wants to merge 1 commit into
arnif:mainfrom
axelpaul:feat/delivery-slots-confirmation
Open

axelpaul wants to merge 1 commit into
arnif:mainfrom
axelpaul:feat/delivery-slots-confirmation

Conversation

@axelpaul

@axelpaul axelpaul commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds delivery and pickup availability lookup to the CLI, and makes all existing account-changing commands require an explicit confirmation flag.

New read-only commands

  • kronan addresses — list saved delivery addresses (the default is identified in the human-readable output).
  • kronan slots / kronan slots delivery — list live delivery slots for the default address and print the earliest available window first.
  • kronan slots --address-id N — query a specific saved address.
  • kronan slots pickup — print the next available pickup slot per Krónan store.
  • All three support --json for callers that need structured output.

Delivery availability is fetched through the authenticated public API using the saved address ID. Fully booked slots are filtered out; availabilityStatus: -1 is presented as available/unlimited capacity.

Confirmation gate for mutations

Existing commands that change the Krónan account now stop before making an API call unless --yes is supplied. This covers:

  • cart add/set/update/remove/clear;
  • product-list create/delete/add/remove/clear;
  • shopping-note add/update/remove/toggle/clear;
  • purchase-stat ignore/unignore; and
  • order-line delete, quantity reduction, and substitution changes.

Example: kronan cart add 02500188 2 --yes.

Cart --dry-run operations remain non-mutating and do not need confirmation.

Verification

  • bun run lint
  • bun run typecheck
  • bun test — 27 passing tests
  • Live authenticated smoke tests for delivery and pickup slot lookup

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