feat(api): wire Nest API to @worksight/common types and fixtures (#17) - #24
Closed
kuyacarlo wants to merge 1 commit into
Closed
feat(api): wire Nest API to @worksight/common types and fixtures (#17)#24kuyacarlo wants to merge 1 commit into
kuyacarlo wants to merge 1 commit into
Conversation
Serve users/teams/tasks/activities endpoints from the shared @worksight/common contract instead of placeholder responses, so web and API agree on payload shapes. - users module returns EmployeeProfile/Team fixtures; new tasks module returns Assignment/Activity fixtures, all typed from common - fix api build emitting nothing (inherited noEmit) and switch to CJS emit resolved against the built common dist; add tsconfig.build.json - fix common dist being unloadable ESM (directory imports) via tsc-alias --resolve-full-paths in the build script - fix BaseLookup.filter() constructing subclasses with the wrong argument order, which broke every chained lookup/getById - fix department stats matching against array-valued departments - add jest specs for both services; add node/jest globals to eslint Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks
Contributor
Author
|
Rolled up into #27 ( |
Contributor
Author
|
Rolled into #27 (merged to canary). Closing child PR. |
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.
Closes #17. Parent: #14.
Summary
@worksight/commoncontract:GET /users,/users/:id,/users/stats,/teams,/teams/:idreturnEmployeeProfile/Teamfixtures; new tasks module servesGET /tasks(with?employee_id=filter),/tasks/:id,/tasks/stats/:employeeId, and/activitiesasAssignment/Activity. The placeholderuserscontroller (hardcoded junk strings) is gone.apps/api/tsconfig.jsoninheritednoEmit: truefrom the root, sonest buildproduced an emptydist/andstart:prodcould never work. Now emits CommonJS, resolves@worksight/commonagainst its builtdist(matching runtime), and a newtsconfig.build.jsonkeeps specs out ofdist/.@worksight/common's dist being unloadable by Node:tscemitted ESM with extensionless directory imports (export * from './data'). The build now runstsc-alias --resolve-full-paths(already a devDependency).BaseLookup.filter()reconstructing subclasses asnew Cls(schema, entries)while subclasses take(entries)— every chained filter/getById/stat silently returned garbage (e.g./users/:id404'd for real ids). Also fixed department stats matching a string against the array-valueddepartmentfield.UsersService/TasksServiceasserting responses equal the shared fixtures; added node + jest globals to the root eslint config (API lint previously failed onprocess is not definedat baseline).Verification (all run locally, Node v22.22.2)
Runtime smoke test (
PORT=3123 node apps/api/dist/main.js):Remaining gaps
app.module.ts.EmployeeProfileSchema.parsewould fail even though TS shapes match.pnpm --filter @worksight/common buildfirst when run directly (turbo's^buildhandles this in pipeline runs).Handoff doc updated:
docs/handoffs/2026-07-25-wire-api-common.md.Made with Cursor