Skip to content

Add budget state and extension error codes, charged amount to response#20

Merged
amavashev merged 1 commit intomainfrom
claude/verify-yaml-protocol-changes-7k4lE
Mar 24, 2026
Merged

Add budget state and extension error codes, charged amount to response#20
amavashev merged 1 commit intomainfrom
claude/verify-yaml-protocol-changes-7k4lE

Conversation

@amavashev
Copy link
Contributor

Summary

This PR extends the error handling and API response models to support additional budget states and reservation extension limits.

Key Changes

  • New Error Codes: Added three new error codes to the ErrorCode enum:

    • BUDGET_FROZEN: Indicates a budget is frozen and cannot be used
    • BUDGET_CLOSED: Indicates a budget is closed and cannot be used
    • MAX_EXTENSIONS_EXCEEDED: Indicates that the maximum number of reservation extensions has been exceeded
  • Enhanced EventCreateResponse: Added optional charged field to EventCreateResponse model to return the amount charged in the response, providing better visibility into transaction details

Implementation Details

  • The new error codes follow the existing naming convention and are positioned logically within the enum (budget-related codes grouped together, extension-related code with other reservation codes)
  • The charged field is optional (Amount | None = None) to maintain backward compatibility with existing response handling
  • The field is positioned before balances in the response model for logical grouping of financial information

https://claude.ai/code/session_012kUr8m7T1SXfLgXh5GKSE2

…for v0.1.24

Add BUDGET_FROZEN, BUDGET_CLOSED, MAX_EXTENSIONS_EXCEEDED to ErrorCode enum.
Add optional charged field to EventCreateResponse (present when ALLOW_IF_AVAILABLE caps actual).
@amavashev amavashev merged commit 4353ed4 into main Mar 24, 2026
3 checks passed
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