[GH-ISSUE #326] Parity: Offer Codes CRUD and custom codes #99

Closed
opened 2026-02-26 21:33:22 +03:00 by kerem · 3 comments
Owner

Originally created by @rudrankriyam on GitHub (Jan 30, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/326

Overview

Complete Offer Codes CLI coverage: subscription offer code CRUD, custom codes CRUD, and prices endpoints.

Scope (OpenAPI resources)

  • subscriptionOfferCodes get/create/update
  • subscriptionOfferCodeCustomCodes get/create/update
  • subscriptionOfferCodeOneTimeUseCodes update
  • subscriptionOfferCodes/{id}/prices

Proposed CLI

Top-level group:

  • asc offer-codes ...

New/expanded subcommands:

  • offer-codes get|create|update --offer-code-id ID
  • offer-codes custom-codes list|get|create|update --offer-code-id ID
  • offer-codes prices list --offer-code-id ID

Examples:

  • asc offer-codes create --subscription-id SUB_ID --name "SPRING"
  • asc offer-codes custom-codes create --offer-code-id CODE_ID --code "SPRING2026"
  • asc offer-codes prices list --offer-code-id CODE_ID

Flag patterns

Common:

  • --offer-code-id, --subscription-id, --output, --pretty, --limit, --next, --paginate

Output

  • JSON minified by default
  • --pretty for JSON
  • --output table/markdown for list commands

Detailed TODO

  • Add client methods for offer code get/create/update
  • Add client methods for custom codes CRUD
  • Add client method for offer code prices list
  • Implement CLI subcommands listed above
  • Add cmdtests + HTTP client tests (mocked)

Acceptance criteria

  • Offer code CRUD works
  • Custom code CRUD works
  • Prices list works
  • Pagination/--next validation works

Tests

  • Flag validation tests
  • HTTP client tests for list/get/create/update
  • Output tests for list commands

Implementation notes

  • Add client methods in internal/asc/client_offer_codes.go
  • Add CLI commands in internal/cli/offercodes
  • Follow patterns from existing offer code list/generate commands
Originally created by @rudrankriyam on GitHub (Jan 30, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/326 # Overview Complete Offer Codes CLI coverage: subscription offer code CRUD, custom codes CRUD, and prices endpoints. # Scope (OpenAPI resources) - `subscriptionOfferCodes` get/create/update - `subscriptionOfferCodeCustomCodes` get/create/update - `subscriptionOfferCodeOneTimeUseCodes` update - `subscriptionOfferCodes/{id}/prices` # Proposed CLI Top-level group: - `asc offer-codes ...` New/expanded subcommands: - `offer-codes get|create|update --offer-code-id ID` - `offer-codes custom-codes list|get|create|update --offer-code-id ID` - `offer-codes prices list --offer-code-id ID` Examples: - `asc offer-codes create --subscription-id SUB_ID --name "SPRING"` - `asc offer-codes custom-codes create --offer-code-id CODE_ID --code "SPRING2026"` - `asc offer-codes prices list --offer-code-id CODE_ID` # Flag patterns Common: - `--offer-code-id`, `--subscription-id`, `--output`, `--pretty`, `--limit`, `--next`, `--paginate` # Output - JSON minified by default - `--pretty` for JSON - `--output table/markdown` for list commands # Detailed TODO - [ ] Add client methods for offer code get/create/update - [ ] Add client methods for custom codes CRUD - [ ] Add client method for offer code prices list - [ ] Implement CLI subcommands listed above - [ ] Add cmdtests + HTTP client tests (mocked) # Acceptance criteria - [ ] Offer code CRUD works - [ ] Custom code CRUD works - [ ] Prices list works - [ ] Pagination/`--next` validation works # Tests - Flag validation tests - HTTP client tests for list/get/create/update - Output tests for list commands # Implementation notes - Add client methods in `internal/asc/client_offer_codes.go` - Add CLI commands in `internal/cli/offercodes` - Follow patterns from existing offer code list/generate commands
kerem closed this issue 2026-02-26 21:33:22 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Jan 30, 2026):

@cursor Please implement per issue description. No live credentials; use mocked tests. Run make build/lint/test and open a PR when green. Keep JSON-first output and explicit flags; no interactive prompts.

<!-- gh-comment-id:3826000612 --> @rudrankriyam commented on GitHub (Jan 30, 2026): @cursor Please implement per issue description. No live credentials; use mocked tests. Run make build/lint/test and open a PR when green. Keep JSON-first output and explicit flags; no interactive prompts.
Author
Owner

@cursor[bot] commented on GitHub (Jan 30, 2026):

Summary:

  • I added subscription offer-code CRUD, custom-code CRUD, and offer-code prices list support across the ASC client/types, CLI subcommands (offer-codes, offer-codes custom-codes, offer-codes prices), and table/markdown output for the new list responses.
  • I added mocked HTTP client tests, CLI validation cmdtests, and output formatting tests for the new resources.

Tests:

  • make build
  • make lint
  • make test
  • Video walkthrough of targeted tests: /opt/cursor/artifacts/offer_codes_cli_tests/recording_demo.mp4 (runs go test ./internal/asc -run OfferCode and go test ./internal/cli/cmdtest -run OfferCodesValidationErrors and shows both passing).

PR note: I pushed the branch (cursor/offer-codes-cli-coverage-1166) but did not open a PR because this environment forbids creating PRs directly.

View PR
Open in Cursor Open in Web

<!-- gh-comment-id:3826000916 --> @cursor[bot] commented on GitHub (Jan 30, 2026): Summary: - I added subscription offer-code CRUD, custom-code CRUD, and offer-code prices list support across the ASC client/types, CLI subcommands (`offer-codes`, `offer-codes custom-codes`, `offer-codes prices`), and table/markdown output for the new list responses. - I added mocked HTTP client tests, CLI validation cmdtests, and output formatting tests for the new resources. Tests: - `make build` - `make lint` - `make test` - Video walkthrough of targeted tests: /opt/cursor/artifacts/offer_codes_cli_tests/recording_demo.mp4 (runs `go test ./internal/asc -run OfferCode` and `go test ./internal/cli/cmdtest -run OfferCodesValidationErrors` and shows both passing). PR note: I pushed the branch (`cursor/offer-codes-cli-coverage-1166`) but did not open a PR because this environment forbids creating PRs directly. <a href="https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/347"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-pr-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-pr-light.png"><img alt="View PR" width="86" height="28" src="https://cursor.com/assets/images/view-pr-light.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-14674fd1-cd45-4a12-b40d-487f7a0c2704"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-14674fd1-cd45-4a12-b40d-487f7a0c2704"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>
Author
Owner

@rudrankriyam commented on GitHub (Jan 31, 2026):

Closed by PR #347: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/347

<!-- gh-comment-id:3828195847 --> @rudrankriyam commented on GitHub (Jan 31, 2026): Closed by PR #347: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/347
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#99
No description provided.