Skip to content

use dto and domain models for tiers + positions#187

Open
TheJolman wants to merge 23 commits intomainfrom
feat/finish-board-models
Open

use dto and domain models for tiers + positions#187
TheJolman wants to merge 23 commits intomainfrom
feat/finish-board-models

Conversation

@TheJolman
Copy link
Copy Markdown
Collaborator

@TheJolman TheJolman commented Apr 24, 2026

mb for big PR, underestimated it

all routes tested at least once

  • ranamed oid to officer_id everywhere for clarity

this is an api-only change, will address CLI in next PR

closes #179
progress for #156

@TheJolman TheJolman requested review from Copilot and removed request for GaballaGit and sidvasu April 24, 2026 02:26
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

godoc reference preview ready ✨
Go Documentation

@TheJolman TheJolman marked this pull request as draft April 24, 2026 02:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates the Board “tiers” and “positions” API to use DTO + domain models end-to-end, and renames the position identifier from oid to officer_id across the DB schema, sqlc queries/models, service layer, handlers, and swagger artifacts.

Changes:

  • Rename position.oidposition.officer_id (migration, queries, sqlc models, DTO/domain/store mappers).
  • Refactor BoardService/BoardHandler tier + position flows to return/accept domain.* internally and dto.* at the API boundary.
  • Update routes and swagger docs to reflect tier param rename (:id:tier) and DTO-based schemas.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
sql/queries/board.sql Updates position queries to use officer_id instead of oid.
sql/migrations/000003_create_officers.up.sql Renames the position PK/FK column to officer_id.
internal/dto/tier.go Adjusts tier DTO update payload shape.
internal/dto/position.go Renames OidOfficerID, adds delete DTO, aligns tier type to int64.
internal/domain/position.go Renames OidOfficerID, adds domain delete model, changes tier type to int64.
internal/domain/officer.go Removes UUID from update model.
internal/api/store/dbmodels/models.go Renames dbmodel Position field to OfficerID.
internal/api/store/dbmodels/board.sql.go sqlc-generated updates for officer_id columns/params.
internal/api/store/board_mapper.go Updates tier/position domain↔db mappings to match renamed fields/types.
internal/api/services/board.go Board service now returns domain models for tiers/positions.
internal/api/routes/v1.go Renames tiers path param :id:tier.
internal/api/handlers/board.go Handlers updated to bind DTOs and (partially) return DTOs; swagger annotations updated.
internal/api/docs/swagger.yaml Replaces dbmodels schemas with dto schemas and updates tiers path param name.
internal/api/docs/swagger.json Same as swagger.yaml (JSON form).
internal/api/docs/docs.go Same as swagger.yaml (embedded template).
fixtures/*.json Updates fixture payloads to match DTO JSON (strings instead of sql.Null* objects, officer_id rename).

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

Comment thread internal/api/docs/docs.go
Comment thread internal/api/store/board_mapper.go Outdated
Comment thread internal/api/services/board.go Outdated
Comment thread internal/api/services/board.go Outdated
Comment thread internal/api/handlers/board.go Outdated
Comment thread internal/api/docs/swagger.yaml Outdated
Comment thread sql/queries/board.sql
Comment on lines +73 to 76
officer_id = ?;

-- NOTE: Had to declare above table as :one, may need to change later to :many

Comment thread internal/api/services/board.go Outdated
Comment thread internal/api/handlers/board.go
Comment thread internal/api/docs/swagger.json
@TheJolman TheJolman force-pushed the feat/finish-board-models branch from 5cdf6c2 to ea309e6 Compare April 24, 2026 03:02
@TheJolman TheJolman marked this pull request as ready for review April 24, 2026 03:09
@TheJolman TheJolman requested a review from GaballaGit April 27, 2026 14:49
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.

Implement Officer DTOs

2 participants