Skip to content

feat: add set-linking-limit support endpoint and CLI command#3067

Draft
Sneagan wants to merge 4 commits into
masterfrom
support/set-linking-limit
Draft

feat: add set-linking-limit support endpoint and CLI command#3067
Sneagan wants to merge 4 commits into
masterfrom
support/set-linking-limit

Conversation

@Sneagan

@Sneagan Sneagan commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a support operator endpoint and CLI command to set the per-order TLV2 credential batch limit (max_active_batches_tlv2_creds), enabling operators to increase the linked device cap for individual orders.

Backend:

  • PATCH /v1/orders/{orderID}/credentials/batches/limit (supportMwr)
  • SetMaxActiveBatches repo method on order_items
  • SetLinkingLimit service method (validates paid + TLV2, runs in tx)
  • SetLinkingLimitReq model type

CLI:

  • bat-go skus set-linking-limit with --order-id or --email lookup, --max, optional --item-id, --private-key, and subscriptions service flags when using email; shows current limit/active count before confirming

Type of Change

  • Product feature
  • Bug fix
  • Performance improvement
  • Refactor
  • Other

Tested Environments

  • Development
  • Staging
  • Production

Before Requesting Review

  • Does your code build cleanly without any errors or warnings?
  • Have you used auto closing keywords?
  • Have you added tests for new functionality?
  • Have validated query efficiency for new database queries?
  • Have documented new functionality in README or in comments?
  • Have you squashed all intermediate commits?
  • Is there a clear title that explains what the PR does?
  • Have you used intuitive function, variable and other naming?
  • Have you requested security and/or privacy review if needed
  • Have you performed a self review of this PR?

Manual Test Plan

Adds a support operator endpoint and CLI command to set the per-order
TLV2 credential batch limit (max_active_batches_tlv2_creds), enabling
operators to increase the linked device cap for individual orders.

Backend:
- PATCH /v1/orders/{orderID}/credentials/batches/limit (supportMwr)
- SetMaxActiveBatches repo method on order_items
- SetLinkingLimit service method (validates paid + TLV2, runs in tx)
- SetLinkingLimitReq model type

CLI:
- `bat-go skus set-linking-limit` with --order-id or --email lookup,
  --max, optional --item-id, --private-key, and subscriptions service
  flags when using email; shows current limit/active count before
  confirming
@Sneagan Sneagan force-pushed the support/set-linking-limit branch from 7b3552c to a165d76 Compare April 16, 2026 18:09
Sneagan added 3 commits April 16, 2026 14:20
Adds PATCH /v1/orders/{orderID}/credentials/items/{itemID}/batches/limit
to set max_active_batches_tlv2_creds on a TLV2 order item. Protected by
supportMwr (ed25519 signed requests).

Adds bat-go skus set-linking-limit CLI command. When --item-id is omitted
the command fetches the order's TLV2 items and auto-selects if there is
one, or presents a numbered prompt if there are several. --item-id skips
the lookup entirely for operators who already know the UUID.
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