Skip to content

Feature: Project update model, list request and newest-first ordering - #143

Merged
rafaeljusto merged 2 commits into
mainfrom
feature/project-status-update
Sep 2, 2026
Merged

Feature: Project update model, list request and newest-first ordering#143
rafaeljusto merged 2 commits into
mainfrom
feature/project-status-update

Conversation

@rafaeljusto

Copy link
Copy Markdown
Contributor

Description

ProjectStatusUpdate and ProjectStatusUpdateList cover GET /projects/api/v3/projects/{projectId}/updates.json and its site-wide variant. The type carries "status" because ProjectUpdate is already the function that edits a project.

The constructor pins orderBy=date and orderMode=desc rather than inheriting the order: the published default is ascending while the endpoint answers newest-first, and the request type is new so nothing depends on either.

Project gains its update relationship, and both project responses have a projectUpdates sideload slot, so a project row can resolve its current update.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • Tests pass locally (go test -v ./...)
  • Added/updated tests for new functionality

Checklist

  • Code follows project style guidelines
  • Self-reviewed the code
  • Added necessary documentation
  • No new warnings or errors

ProjectStatusUpdate and ProjectStatusUpdateList cover
GET /projects/api/v3/projects/{projectId}/updates.json and its site-wide
variant. The type carries "status" because ProjectUpdate is already the
function that edits a project.

The constructor pins orderBy=date and orderMode=desc rather than inheriting
the order: the published default is ascending while the endpoint answers
newest-first, and the request type is new so nothing depends on either.

Project gains its update relationship and both project responses a
projectUpdates sideload slot, so a project row can resolve its current update.

color is a plain string, not twapi.HexColor, which rejects the empty value the
endpoint returns when the health is not set.
HexColor takes six digits with or without the leading "#" and always encodes
with it, so an endpoint that omits the sign no longer costs the whole response.
Allocation.Color uses it instead of a plain string. NewHexColor normalises the
same way, rather than storing "##rrggbb" for a caller that passes the form it
read off a design tool.

OptionalHexColor is that type plus the blank: it reads null, "" and a bare "#"
as unset, and encodes unset back as "", which keeps its declared string type
accurate for consumers deriving a schema from these models.
ProjectStatusUpdate.Color uses it — the endpoint reports no colour for a
project nobody has rated.

The custom field dropdown and rating options take it with omitempty, which
fixes both directions of an optional colour: a request that set none used to
send the bare "#" the endpoint rejects, and a choice stored without one comes
back as that same "#", which HexColor refused to decode.
@rafaeljusto
rafaeljusto requested a review from a team as a code owner September 2, 2026 18:51
@rafaeljusto
rafaeljusto merged commit 241f391 into main Sep 2, 2026
4 checks passed
@rafaeljusto
rafaeljusto deleted the feature/project-status-update branch September 2, 2026 19:10
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