Repository navigation
feat(work-logs): expose team_id / teamId - #10
Merged
Merged
Conversation
Work logs now carry a real team association. `core.work_logs.team_id` landed in UNI-Construct migration 339; before it, team attribution was a `[team:slug]` prefix inside the free-text description, which meant it could not be indexed, joined, or filtered, and it corrupted the text a human reads. Four additions, no behaviour change: - `WorkLog.team_id` the row as the API returns it - `ListWorkLogsParams.teamId` filter a listing to one team - `CreateWorkLogParams.teamId` set it on create - `UpdateWorkLogParams.teamId` nullable, so a caller can clear it Nullable throughout: a log need not belong to a team, and the column is ON DELETE SET NULL so removing a team does not destroy work history. Needed by Scaffald/SaaS#425. Without it, callers type-error on the field the API already accepts.
thinkclay
added a commit
to Scaffald/SaaS
that referenced
this pull request
Jul 30, 2026
Scaffald/sdk#10 is merged, so packages/sdk moves 28edf5fcd..f8127382a. This is what makes #425 portable: the dist here was previously rebuilt from an unmerged local branch, so the field type-checked on this machine and nowhere else. Verified after the bump that dogfood-log.ts, phase2-seed.ts and scf-core all type-check against the merged commit rather than a local build. Note the built declarations put these types in the shared dist/prerequisites-*.d.ts chunk and re-export them, so grepping dist/index.d.ts for a new field finds nothing — that is tsup splitting, not a missing type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work logs now carry a real team association.
core.work_logs.team_idlanded in UNI-Construct migration 339; before it, team attribution was a[team:slug]prefix inside the free-text description — unindexable, unjoinable, and it corrupted the text a human reads.Changes
Four type additions, no behaviour change:
WorkLogteam_id: string | null— the row as the API returns itListWorkLogsParamsteamId?: string— filter a listing to one teamCreateWorkLogParamsteamId?: string | nullUpdateWorkLogParamsteamId?: string | null— null clears the associationNullable throughout: a log need not belong to a team, and the column is
ON DELETE SET NULLso removing a team doesn't destroy work history.Why now
Needed by Unicorn/UNI-Construct#425, where the server side is already deployed. The API accepts and returns the field today, so without these types callers type-error on something that works at runtime.
Verified against the live endpoint: a log created with
teamIdpersists it, andGET /v1/work-logs?teamId=…narrowed a 28-log listing to the 10 belonging to that team with a single distinctteam_id.Notes
No CHANGELOG entry — the file stops at
0.3.0(Feb 2026) while releases are at v1.12.0, so it isn't maintained and a lone entry would be misleading. Happy to add one if you'd rather restart it.After merge, UNI-Construct needs a submodule pointer bump to pick this up; its
distis currently rebuilt locally.