Skip to content
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

✨ [Feature] Announcement 생성하기 API #862

Closed
2 tasks
yhames opened this issue Jul 1, 2024 · 0 comments · Fixed by #885
Closed
2 tasks

✨ [Feature] Announcement 생성하기 API #862

yhames opened this issue Jul 1, 2024 · 0 comments · Fixed by #885
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@yhames
Copy link
Contributor

yhames commented Jul 1, 2024

Description

Announcement 생성하기 API

Request

URI

POST /agenda/announcement?agenda_id={agenda_id}

Request body

{
		"title": string, // 50자 제한 
		"contents": String, // 1000자 제한
}

Response

Status code

  • 200 - 대회 공지사항 생성 성공
  • 400 - title 혹은 content가 없습니다.
  • 401 - 대회의 개최자가 아닙니다.
  • 404 - 대회가 존재하지 않습니다.

Response body

{}

Todo

  • Announcement 생성하기 API
  • Announcement 생성시 Slack 알림 기능

ETC

GWT

Feature: 대회 공지사항 생성

	Scenario: 대회 공지사항을 생성합니다.
		Given agenda가 생성되어 있습니다.
		And 개최자가 로그인되어 있습니다.
		And agenda_id를 쿼리 파라미터 받습니다.
		And 공지사항의 title과 content를 request body로 받습니다.
		When 대회 announcement를 생성합니다.
		Then 대회 announcement가 생성되고, 200 코드를 받환합니다.
		
	Scenario: title이 없는 공지사항을 생성합니다.
		Given agenda가 생성되어 있습니다.
		And 개최자가 로그인되어 있습니다.
		And agenda_id를 쿼리 파라미터 받습니다.
		And 공지사항의 content만 request body로 받습니다.
		When 대회 announcement를 생성합니다.
		Then 400 오류 코드를 반환합니다.
		
	Scenario: title이 빈 문자열인 공지사항을 생성합니다.
		Given agenda가 생성되어 있습니다.
		And 개최자가 로그인되어 있습니다.
		And agenda_id를 쿼리 파라미터 받습니다.
		And 빈 문자열인 title과 content를 request body로 받습니다.
		When 대회 announcement를 생성합니다.
		Then 400 오류 코드를 반환합니다.

	Scenario: content이 없는 공지사항을 생성합니다.
		Given agenda가 생성되어 있습니다.
		And 개최자가 로그인되어 있습니다.
		And agenda_id를 쿼리 파라미터 받습니다.
		And 공지사항의 title만 request body로 받습니다.
		When 대회 announcement를 생성합니다.
		Then 400 오류 코드를 반환합니다.

	Scenario: content이 빈 문자열 공지사항을 생성합니다.
		Given agenda가 생성되어 있습니다.
		And 개최자가 로그인되어 있습니다.
		And agenda_id를 쿼리 파라미터 받습니다.
		And title과 빈 문자열인 content를 request body로 받습니다.
		When 대회 announcement를 생성합니다.
		Then 400 오류 코드를 반환합니다.
		
	Scenario: 개최자가 아닌 유저가 대회 공지사항을 생성합니다.
		Given agenda가 생성되어 있습니다.
		And 개최자가 아닌 유저가 로그인되어 있습니다.
		And agenda_id를 쿼리 파라미터 받습니다.
		And 공지사항의 title과 content를 request body로 받습니다.
		When 대회 announcement를 생성합니다.
		Then 401 오류 코드를 반환합니다.

	Scenario: 유효하지 않은 agenda에 공지사항을 생성합니다.
		Given 유효하지 않은 agenda_id를 쿼리 파라미터 받습니다.
		And 공지사항의 title과 content를 request body로 받습니다.
		When 대회 announcement를 생성합니다.
		Then 404 오류 코드를 반환합니다.
@yhames yhames added the enhancement New feature or request label Jul 1, 2024
@yhames yhames self-assigned this Jul 1, 2024
@yhames yhames added this to the 7th Sprint 1 milestone Jul 1, 2024
@yhames yhames linked a pull request Jul 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant