Skip to content

feat: add isLive search query to create batch - #35

Merged
DionPotkamp merged 7 commits into
mainfrom
feat/allow-to-create-live-batch
Jun 24, 2026
Merged

DionPotkamp merged 7 commits into
mainfrom
feat/allow-to-create-live-batch

Conversation

@DionPotkamp

@DionPotkamp DionPotkamp commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

When not using an API key (OAuth), it was not possible to create a live batch.

Adding the isLive search query allows for this.

image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added optional isLive support when creating orders and batches, allowing control of live mode status for newly created items.
    • When not provided, isLive defaults to false.
    • Live mode is now sent via the request query parameters while keeping existing request body behavior unchanged.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds optional isLive fields to order and batch creation inputs, expands the handler request type to include params, and passes isLive as query params in order- and batch-related POST requests.

Changes

isLive query parameter for Order and Batch APIs

Layer / File(s) Summary
Request handler params support
src/PrintOne.ts
RequestHandler's HttpHandler type now includes a params field alongside headers, typed as Record<string, string | number | boolean>.
Order creation with isLive
src/models/Order.ts, src/PrintOne.ts
CreateOrder adds optional isLive, and createOrder sends isLive ?? false as POST params.
Batch creation with isLive
src/models/Batch.ts, src/PrintOne.ts
CreateBatch adds optional isLive, createBatch sends isLive ?? false as POST params, and Batch.createOrder sends isLive derived from isBillable.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I tucked a tiny flag in the ordering lane,
so batches and orders can whisper "live" by name.
Through params it hops, neat and bright,
a boolean bunny in query-string light.
Carrot cheers for this compact delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add isLive search query to create batch' accurately describes the main change: adding the isLive query parameter to batch creation endpoints.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/allow-to-create-live-batch

Comment @coderabbitai help to get the list of available commands.

@DionPotkamp
DionPotkamp requested a review from a team June 16, 2026 13:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/models/Batch.ts`:
- Line 31: The isLive field in the CreateBatchOrder type definition is
misleading because it is never used in the Batch.createOrder method (around
lines 155-159), which ignores the passed isLive value and instead derives the
query parameter from this.isBillable. Remove the isLive field from the
CreateBatchOrder type to eliminate this unused parameter and prevent callers
from believing they can control the order's live status. If orders within a
batch should be able to override the batch's billing status, alternatively
update the createOrder method to use the isLive parameter with the batch's
isBillable as a fallback (order.isLive ?? this.isBillable) instead of always
using this.isBillable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1c55d7f5-8cc3-410c-beaa-2588c9b2098a

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8e0da and f27947a.

📒 Files selected for processing (3)
  • src/PrintOne.ts
  • src/models/Batch.ts
  • src/models/Order.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/PrintOne.ts

Comment thread src/models/Batch.ts Outdated
Comment thread src/PrintOne.ts Outdated
Comment thread src/models/Batch.ts
Comment thread test/Batch.spec.ts Outdated
@DionPotkamp
DionPotkamp requested a review from PaulRill00 June 23, 2026 14:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/PrintOne.ts`:
- Line 63: The RequestHandler type in PrintOne.ts is too narrow because params
are typed as Record<string, string> even though callers pass boolean query
values like isLive from Batch and PrintOne. Update the RequestHandler params
signature to accept the actual query value shape used across the codebase, and
make sure any related handler implementations and usages of params in PrintOne
align with the broader type.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 86bd55a5-dc9b-41f0-a259-c83719b1a077

📥 Commits

Reviewing files that changed from the base of the PR and between 8dba170 and 0617ada.

📒 Files selected for processing (2)
  • src/PrintOne.ts
  • src/models/Batch.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/models/Batch.ts

Comment thread src/PrintOne.ts Outdated
@DionPotkamp
DionPotkamp merged commit 7bfe3e6 into main Jun 24, 2026
1 of 2 checks passed
@DionPotkamp
DionPotkamp deleted the feat/allow-to-create-live-batch branch June 24, 2026 12:48
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.

2 participants