Skip to content

Add PATCH endpoints for tiers and networks - #32

Merged
kurtnordstrom merged 3 commits into
mainfrom
edit-tiers-networks
Jul 15, 2026
Merged

Add PATCH endpoints for tiers and networks#32
kurtnordstrom merged 3 commits into
mainfrom
edit-tiers-networks

Conversation

@kurtnordstrom

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI 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.

Pull request overview

This PR adds partial-update (PATCH) support for tiers and networks, including new OpenAPI schema/types, handlers, DB queries, and integration tests to validate update semantics and authorization.

Changes:

  • Add PATCH /tiers/{id} and PATCH /networks/{id} endpoints with corresponding OpenAPI TierPatch / NetworkPatch request bodies.
  • Implement transactional update handlers that lock the target row (...FOR UPDATE) and apply validated updates via new SQLC queries.
  • Add integration tests + API fixtures covering success, validation failures (nulls/invalid enums), not-found, and auth enforcement.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/tiers.go Implements UpdateTier PATCH handler with validation, row locking, and DB update.
api/networks.go Implements UpdateNetwork PATCH handler with validation, row locking, and DB update.
query.sql Adds UpdateTier / UpdateNetwork updates and Get*ForUpdate queries for row locking.
db/query.sql.go Regenerates SQLC output for new update and FOR UPDATE queries.
api.yaml Defines PATCH operations and patch schemas for tiers/networks.
api/directory.gen.go Regenerates server/types to include PATCH routes, request/response types, and patch models/enums.
descriptors/ModuleDescriptor-template.json Registers PATCH endpoints in the module descriptor.
test/tiers_test.go Adds integration cases for tier PATCH behavior and permissions.
test/networks_test.go Adds integration cases for network PATCH behavior and permissions.
test/apifixtures/*patch*.json Adds request/refetch fixtures used by new PATCH test cases.
Files not reviewed (2)
  • api/directory.gen.go: Generated file
  • db/query.sql.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/tiers.go Outdated
Comment thread api/networks.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kurtnordstrom
kurtnordstrom marked this pull request as ready for review July 15, 2026 20:10
@kurtnordstrom
kurtnordstrom merged commit db95022 into main Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants