Skip to content

Add requeue and repin endpoints - #4

Merged
hugobessa merged 2 commits into
mainfrom
feat/requeue-and-repin
Nov 11, 2026
Merged

hugobessa merged 2 commits into
mainfrom
feat/requeue-and-repin

Conversation

@hugobessa

@hugobessa hugobessa commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Adds the requeue and repin endpoints. They follow openapi.yaml from vintasend-ts-api at tag v1.0.0-alpha10, which is copied here and is byte-identical.

  • POST /api/v1/notifications/{id}/requeue calls requeue_notification from vintasend 3.7.0 (Add requeue and repin to the notification service vintasend#41).
    • Body: optional { "sendAfter"?: string | null }.
    • If sendAfter is left out, the notification keeps its schedule. null means send now. A date without a time zone is read as UTC.
    • Anything other than an ISO-8601 string or null is a 400.
  • POST /api/v1/notifications/{id}/repin calls repin_notification.
    • Body: optional { "templateVersion"?: integer }. It must be a JSON integer >= 0.
    • -1, 1.5, "3", true and null are 400s, with no coercion.
    • 3.0 is accepted as 3, because the TS API can't tell those two apart either.
  • Both endpoints:
    • They return 200 { "data": Notification }, serialized like a list row.
    • Invalid input returns a 400 with details.issues.
    • NOT_FOUND returns a 404, and the other refusal reasons return a 409, with the core library's message.
    • Any other failure returns the generic 500, which never echoes the underlying error.
    • An empty body counts as no body. A non-empty body with a non-JSON media type is a 400.
  • README: the endpoint table and a new "Requeue and repin" section are updated.

Breaking?

No. The API change is additive, and wire names stay camelCase.

This calls service methods added in vintasend 3.7.0. vintasend 3.7.0 is now on PyPI. The last commit moves the vintasend pin to 3.7.0 and regenerates poetry.lock. This package's own version bump happens in the family release.

Checks

These ran against vintasend 3.7.0 from PyPI:

  • ruff check, ruff format --check and mypy are clean.
  • pytest: 236 passed. That includes the contract test, which checks every route against openapi.yaml.
  • tests/test_requeue_and_repin.py has a passing test for each declared status on both operations: 200, 400, 401, 403, 404, 409 and 500.

🤖 Generated with Claude Code

Add POST /api/v1/notifications/{id}/requeue and /repin, following
openapi.yaml from vintasend-ts-api v1.0.0-alpha10, which is copied here
byte-identical. Bodies are validated strictly (templateVersion must be a JSON
integer >= 0, sendAfter an ISO-8601 string or null), a refusal maps to 404 or
409, and any other failure is the generic 500.
@hugobessa
hugobessa merged commit 2b51f58 into main Nov 11, 2026
5 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