-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 엔티티 - 프로젝트 참여요청 엔티티 추가 - 프로젝트 엔티티에 프로젝트 참여요청 프로퍼티 추가 - 레포지토리에서 DB에 프로젝트 참여요청 생성 메서드 추가 - 서비스에서 프로젝트 참여요청 생성 메서드 추가 - 컨트롤러에서 프로젝트 참여요청 제출 메서드 추가 - 프로젝트 참여요청 E2E 테스트 추가 - 성공 상황 - 인증실패 상황 - 유효하지 않은 프로젝트 링크 상황 - 이미 회원인 유저가 요청한 상황 - 이미 참여요청한 유저가 다시 참여요청한 상황
- Loading branch information
1 parent
c346071
commit 73356e0
Showing
9 changed files
with
309 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IsNotEmpty, IsUUID } from 'class-validator'; | ||
|
||
export class ProjectJoinRequestRequestDto { | ||
@IsNotEmpty() | ||
@IsUUID(4, { message: 'not uuid' }) | ||
inviteLinkId: string; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { | ||
Column, | ||
CreateDateColumn, | ||
Entity, | ||
JoinColumn, | ||
ManyToOne, | ||
PrimaryGeneratedColumn, | ||
Unique, | ||
UpdateDateColumn, | ||
} from 'typeorm'; | ||
import { Project } from './project.entity'; | ||
import { Member } from 'src/member/entity/member.entity'; | ||
|
||
@Entity() | ||
@Unique('PROJECT_JOIN_REQUEST_UQ_PROJECT_ID_AND_MEMBER_ID', [ | ||
'projectId', | ||
'memberId', | ||
]) | ||
export class ProjectJoinRequest { | ||
@PrimaryGeneratedColumn('increment', { type: 'int' }) | ||
id: number; | ||
|
||
@ManyToOne(() => Project, (project) => project.joinRequestList, { | ||
nullable: false, | ||
onDelete: 'CASCADE', | ||
}) | ||
@Column({ type: 'int', name: 'project_id' }) | ||
projectId: number; | ||
|
||
@JoinColumn({ name: 'project_id' }) | ||
project: Project; | ||
|
||
@ManyToOne(() => Member) | ||
@Column({ type: 'int', name: 'member_id' }) | ||
memberId: number; | ||
|
||
@ManyToOne(() => Member, (member) => member.id, { | ||
nullable: false, | ||
onDelete: 'CASCADE', | ||
}) | ||
@JoinColumn({ name: 'member_id' }) | ||
member: Member; | ||
|
||
@CreateDateColumn({ type: 'timestamp' }) | ||
created_at: Date; | ||
|
||
@UpdateDateColumn({ type: 'timestamp' }) | ||
updated_at: Date; | ||
|
||
static of(projectId: number, memberId: number) { | ||
const projectJoinRequest = new ProjectJoinRequest(); | ||
projectJoinRequest.projectId = projectId; | ||
projectJoinRequest.memberId = memberId; | ||
return projectJoinRequest; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.