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

feat:試合表の生成後のエントリーを受け付けないように変更 #551

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

speak-mentaiko
Copy link
Contributor

close #366

Copy link

cloudflare-workers-and-pages bot commented Oct 21, 2024

Deploying kcmsx with  Cloudflare Pages  Cloudflare Pages

Latest commit: 92239f2
Status: ✅  Deploy successful!
Preview URL: https://0f43bbff.kcmsx.pages.dev
Branch Preview URL: https://feat-366-no-entry-after-gene.kcmsx.pages.dev

View logs

Copy link
Member

@laminne laminne left a comment

Choose a reason for hiding this comment

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

試合が存在する時にチーム登録 or チーム削除も同様の処理(とテスト)を書いて欲しいです

@@ -15,6 +19,11 @@ export class EntryService {
*/
async enter(teamID: TeamID): Promise<Result.Result<Error, Team>> {
const teamRes = await this.teamRepository.findByID(teamID);
const matchRes = await this.preMatch.findAllPreMatch();

if (!Result.isErr(matchRes)) {
Copy link
Member

Choose a reason for hiding this comment

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

ここはResult.isOkを使うべき

  • 試合があるのにエラーが起きない場合もあるはずなので、ここは帰ってきた件数をみるべきだと思う
    あとcancelとenterで処理一緒なので共通化して欲しい

Copy link
Member

Choose a reason for hiding this comment

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

試合が存在する時にエントリー or エントリー解除できないことをテストして欲しいです

const matchRes = await this.preMatch.findAllPreMatch();

if (!Result.isErr(matchRes)) {
return Result.err(new Error('Cannot enter now'));
Copy link
Contributor

Choose a reason for hiding this comment

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

キャンセルなのでCannot cancel entry nowなどにするべきです。また、共通化するならmodify entryなどでもいいでしょう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

feat: 試合表生成後のエントリー・エントリーの削除を禁止する
3 participants