-
Notifications
You must be signed in to change notification settings - Fork 1
#649 캐리어 등 짐 여부 표시 #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
#649 캐리어 등 짐 여부 표시 #653
Conversation
There was a problem hiding this 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 adds carrier/luggage tracking functionality to room participants, allowing users to indicate whether they have luggage (캐리어) when participating in a taxi room. This helps other participants know who has luggage, which is useful for planning space in the taxi.
Key Changes:
- Added
hasCarrierboolean field to theParticipantschema with a default value offalse - Implemented two new API endpoints: POST
/carrier/toggleto update carrier status and GET/carrier/statusto query carrier status for all room participants - Updated data transformation layers to include
hasCarrierin room response objects
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/modules/stores/mongo.ts | Added hasCarrier field to participantSchema with type Boolean, required, default false |
| src/modules/populates/rooms.ts | Updated populate options, type definitions, and formatSettlement function to include hasCarrier field in participant data |
| src/routes/docs/schemas/roomsSchema.ts | Added Zod validation schemas for toggleCarrierHandler and carrierStatusHandler, plus corresponding TypeScript types |
| src/services/rooms.ts | Implemented toggleCarrierHandler to update participant carrier status and carrierStatusHandler to retrieve carrier status for all room participants |
| src/routes/rooms.ts | Registered the two new carrier-related routes with appropriate validation middleware |
| src/routes/docs/rooms.js | Added comprehensive OpenAPI documentation for both new endpoints including request/response schemas and error cases |
| test/services/rooms.ts | Added basic test cases for both handlers, updated existing tests to verify hasCarrier default value |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/routes/docs/rooms.js
Outdated
| nickname: { type: "string" }, | ||
| hasCarrier: { type: "boolean" }, | ||
| }, | ||
| required: ["userId", "nickname", "hasCarrier"], |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The required field lists "userId", "nickname", and "hasCarrier" but not "name". However, the implementation in carrierStatusHandler always returns the "name" field (line 884 of src/services/rooms.ts). Consider adding "name" to the required array for consistency with the actual API response, or make it optional in the properties documentation if it can be empty.
| required: ["userId", "nickname", "hasCarrier"], | |
| required: ["userId", "name", "nickname", "hasCarrier"], |
src/modules/stores/mongo.ts
Outdated
| default: "not-departed", | ||
| }, | ||
| readAt: { type: Date }, | ||
| hasCarrier: { type: Boolean, required: true, default: false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 기존에 생성된 데이터들은 hasCarrier 필드가 비어있을거라, required랑 default는 빼야할 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정했습니다!
src/routes/rooms.ts
Outdated
| router.get( | ||
| "/carrier/status", | ||
| validateQuery(roomsZod.carrierStatusHandler), | ||
| roomHandlers.carrierStatusHandler | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
캐리어 소지 여부를 별도 Endpoint로 반환하는 것보다는, infoHandler에서 그냥 같이 반환해 주는게 프론트엔드 쪽에서도 처리하기 편할 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
용혁님께서 엔드포인트 별도로 만들어달라고 하셔서 일단 이렇게 했는데 한번 다시 얘기해볼게요!
| }); | ||
| } | ||
|
|
||
| const isOver = getIsOver(roomObject, user._id.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 isOver를 이렇게 넣으면 안될텐데.. 확실하진 않아서 기존 코드랑 비교 한 번 부탁드립니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인해보고 수정하겠습니다 감사합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 제가 착각했던 것 같습니다! 태영님 짜주신대로 하는게 맞는 것 같아요, 죄송합니다! ㅠㅠ
| } | ||
|
|
||
| const isOver = getIsOver(roomObject, user._id.toString()); | ||
| return res.send(formatSettlement(roomObject, { isOver })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
캐리어 소지 여부가 변경되면 웹 소켓 등을 통해 프론트엔드에 알려줘도 좋을 것 같은데, 프론트 담당자 분이랑 논의 후 어떻게 할지 결정하시면 좋을 것 같습니다.
|
|
||
| // [Schedule] 스케줄러 시작 | ||
| registerSchedules(app); | ||
| //registerSchedules(app); (해커톤) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 해커톤 용도로 수정하고 남은건가요?
thxx132
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 프론트 완성되면 같이 머지하면 될 것 같아요
Summary
It closes #649