Skip to content

Conversation

@taeyeongyoo
Copy link
Contributor

Summary

It closes #649

  • Do something...

Copy link

Copilot AI left a 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 hasCarrier boolean field to the Participant schema with a default value of false
  • Implemented two new API endpoints: POST /carrier/toggle to update carrier status and GET /carrier/status to query carrier status for all room participants
  • Updated data transformation layers to include hasCarrier in 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.

nickname: { type: "string" },
hasCarrier: { type: "boolean" },
},
required: ["userId", "nickname", "hasCarrier"],
Copy link

Copilot AI Nov 18, 2025

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.

Suggested change
required: ["userId", "nickname", "hasCarrier"],
required: ["userId", "name", "nickname", "hasCarrier"],

Copilot uses AI. Check for mistakes.
@kmc7468 kmc7468 changed the title 캐리어 등 짐 여부 표시 #649 캐리어 등 짐 여부 표시 Nov 18, 2025
default: "not-departed",
},
readAt: { type: Date },
hasCarrier: { type: Boolean, required: true, default: false },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 기존에 생성된 데이터들은 hasCarrier 필드가 비어있을거라, required랑 default는 빼야할 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니다!

Comment on lines 102 to 106
router.get(
"/carrier/status",
validateQuery(roomsZod.carrierStatusHandler),
roomHandlers.carrierStatusHandler
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

캐리어 소지 여부를 별도 Endpoint로 반환하는 것보다는, infoHandler에서 그냥 같이 반환해 주는게 프론트엔드 쪽에서도 처리하기 편할 것 같아요

Copy link
Contributor Author

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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 isOver를 이렇게 넣으면 안될텐데.. 확실하진 않아서 기존 코드랑 비교 한 번 부탁드립니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인해보고 수정하겠습니다 감사합니다!

Copy link
Member

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 }));
Copy link
Member

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); (해커톤)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 해커톤 용도로 수정하고 남은건가요?

Copy link
Contributor

@thxx132 thxx132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 프론트 완성되면 같이 머지하면 될 것 같아요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

캐리어 등 짐 여부 표시

4 participants