[EUM-1] feat: 정모 생성 API 구현#181
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd30c75228
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ALTER TABLE "Meeting" ADD COLUMN "capacity" INTEGER NOT NULL, | ||
| ADD COLUMN "cost" VARCHAR(50), | ||
| ADD COLUMN "introText" VARCHAR(200) NOT NULL, |
There was a problem hiding this comment.
Backfill existing rows before adding NOT NULL columns
This migration adds capacity and introText as NOT NULL without defaults, so it will fail on any environment where Meeting already has rows because PostgreSQL cannot populate existing records for new required columns automatically. That makes deployment-blocking migration errors likely outside empty dev databases; add a backfill/default step (or a two-phase migration) before enforcing NOT NULL.
Useful? React with 👍 / 👎.
| if (!dto.spot) violations.push('spot'); | ||
| if (!Number.isInteger(dto.capacity) || dto.capacity <= 0) | ||
| violations.push('capacity'); | ||
| if (dto.cost !== undefined && dto.cost.length > 50) violations.push('cost'); |
There was a problem hiding this comment.
Guard nullable
cost before accessing .length
The API schema explicitly marks cost as nullable, but this validator checks dto.cost !== undefined and then reads dto.cost.length; when a client sends "cost": null, this throws a runtime TypeError instead of returning MEETING_VALIDATION_FAILED, causing a 500 path for a documented input shape. Treat null like an omitted value (or validate type first) before using .length.
Useful? React with 👍 / 👎.
eschoi04
left a comment
There was a problem hiding this comment.
meeting.repository.ts에 유니크(필요하다면)추가하면 될 것 같습니다! 고생하셨습니당
이슈 번호
close #180
주요 변경사항
POST /api/v1/clubs/:clubId/meetings)Club.hostId === userId)만 생성 가능name,introText,date,spot,capacity,cost?,joinPolicymeetingId,attendeeCount(=0),isRegular,createdAt포함introText(VarChar 200),capacity(Int),cost(VarChar 50?),joinPolicy(MeetingJoinPolicy)date타입 변경:DateTime → VarChar 100(자연어 입력 허용, 예 "매주 목요일 저녁 19시")MeetingJoinPolicy { AUTO, APPROVAL_REQUIRED }CLUB-001(NOT_FOUND),CLUB-002(FORBIDDEN_NOT_HOST),MEETING-001(VALIDATION_FAILED)
테스트 결과 (스크린샷)
참고 및 개선사항
date를 자연어 String으로만 받기 때문에 backend에서 D-day 계산이 어렵습니다. 관련해서 논의 후 요구사항을 확정해야할 것 같습니다!