feat(user) map embedded users as compact users in comments, ratings, tags and meal plan shares (spec 003) #60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "003-compact-user-in-embedded-dtos"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec 003: docs/features/003-compact-user-in-embedded-dtos.md (recipe-platform#22). Plan: docs/plans/003-compact-user-in-embedded-dtos.md. Contract PR: recipe-platform#46.
What was implemented
contract.ref→0f2e4006995362d60686ce328c1edbb292188ed3CommentModel,RatingModel,TagModel,MealPlanShareModel: embedded user is aCompactUserModel; JSDoc updated there and inCompactUserModel,UserDisplayModelCommentMapper,RatingMapper,TagMapper,MealPlanShareMappermap the embedded user throughcompactUserMapper; nothing else in the mapping bodies changed. After the review,mapDtoToModelinCommentMapperandRatingMapperalso got a method JSDoctoEqualtest on the whole mapped user, and a new "drops email and role if the backend still sends them" test in each of the four filesMealPlanRestResource.tssaveMealPlanSharecorrected, no code changedocs/architecture.mdNo component, hook, context, route or DTO file changed. No type error appeared outside the files the plan names.
Deviations from the plan
None.
Judgment calls
API_BASEconstant in the four test files. None of them had one; each got the same documented constant thatCompactUserMapper.test.tsuses, instead of the literal URL.TagMapper.test.tsfixture. Theuserconstant moved from inside one test to the top of itsdescribeblock, because the new "drops email and role" test needs it too.RatingMapper.test.tsfixture. Keeps the user namebob; the first name isBobrather than the plan's exampleAnna.architecture.mdare one commit; the comment fix is a third; the JSDoc from the review is a fourth.Verification
npm run build: passes.npm run lint: 0 errors, 2 warnings, both insrc/contexts/MealPlanDayProvider.tsx, which this branch does not touch.npm run test: 39 files, 403 tests, all pass.UserModel,userMapperorUserDtoleft in the four models and four mappers;userMapperonly inUserMapper.ts./verify-ui), logged in as theadmintest account (recipe detail also asuser, see below), against the local backend on its003-compact-user-in-embedded-dtosbranch. All five viewports per screen (desktop 1920x1080, tablet 1280x800 and 800x1280, phone 400x890 and 890x400); no console errors.usertest account (desktop viewport): the same, without edit or delete controls. A temporary comment by the test admin showed initials "CP" and "Claude Playwright-Admin"; it was deleted afterwards.usertest account and changing its permission both showed avatar initials and "Claude Playwright-User" afterwards. The plan was deleted afterwards.id, userName, firstName, lastName, avatarUrlfor embedded users, noemailorrole.Review (
review-implementation)No blocking findings. Three minor ones:
mapDtoToModelinCommentMapperandRatingMapperhad no method JSDoc: fixed.CompactUserMapper.test.tscovers the mapping, andgetUserDisplayNameis untouched.Still open:
prorole was not checked; nothing in the change depends on the role, and tag management is admin-only.contract_pinstays red until recipe-platform#46 is merged, then it has to be re-run.🤖 Generated with Claude Code
WIP: feat(user) map embedded users as compact users in comments, ratings, tags and meal plan shares (spec 003)to feat(user) map embedded users as compact users in comments, ratings, tags and meal plan shares (spec 003)