Skip to content

Conversation

@hikahana
Copy link
Collaborator

@hikahana hikahana commented Feb 11, 2025

対応Issue

resolve #0

概要

buy_reportのAPIを作成しました。
image

画面スクリーンショット等

  • URL
    スクリーンショット
    image

image

テスト項目

  • 動作確認
  • コードレビュー

備考

予算管理フロント作成から切ってます

@hikahana hikahana requested a review from Kubosaka February 11, 2025 07:07
@hikahana hikahana self-assigned this Feb 11, 2025
@hikahana hikahana changed the base branch from develop to feat/yama/913/create-mypage-front February 11, 2025 07:08
Copy link
Collaborator

@Kubosaka Kubosaka left a comment

Choose a reason for hiding this comment

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

動作良さげです
少しコメントしますた

return nil, err
}

getDs := selectBuyReportDetailsQuery.Where(goqu.Ex{"buy_statuses.buy_report_id": buyReportId})
Copy link
Collaborator

Choose a reason for hiding this comment

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

[imo]
これrepository内のメソッドとして定義して、usecaseから使って欲しいかも
1つの処置につき、1つのメソッドの方が綺麗な気がする
これに関しては意見欲しいかも

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

1つの処置につき、1つのメソッドの方が綺麗な気がする

これ非常に同感です。

作成されたdetailを返すまでがupdateかなと思って一つにしてました。
けどrepository内で処理を完結させる必要もないですし、いい感じに分けました。

[fix] redactor update method

Comment on lines 300 to 302
if err != nil {
return detail, errors.Wrapf(err, "cannot connect SQL")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

[ask]
これのエラーはcannot connect SQLじゃないよね?
取得したrowをdetailに渡すときのエラーだよね

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

そうですね。どっかのコピペして大本作ってたので修正抜けです。

@hikahana hikahana requested a review from Kubosaka February 17, 2025 05:09
return BuyReportDetail{}, err
}

row, err := bru.bRep.AllByPeriod(c, buyReportId)
Copy link
Collaborator

Choose a reason for hiding this comment

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

このmethod使ったらダメな気がします!
idからBuyReportDetailで取得するAPIはない気がするので、新しく実装する必要有りかも

// 年度に紐づいたdetailsの取得
func (brr *buyReportRepository) AllByPeriod(c context.Context, year string) (*sql.Rows, error) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

確かに、、、
AllByBuyReportIdのメソッド作成しました!

@hikahana hikahana requested a review from Kubosaka February 17, 2025 16:35
return brr.crud.Read(c, query)
}

func (brr *buyReportRepository) AllByBuyReportId(c context.Context, buyReportId string) (*sql.Row, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

細かいですが、ByIDならGet~使って欲しいかもです!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Base automatically changed from feat/yama/913/create-mypage-front to develop February 24, 2025 06:36
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 24, 2025

Deploying finansu with  Cloudflare Pages  Cloudflare Pages

Latest commit: 01f33e9
Status:🚫  Build failed.

View logs

@hikahana hikahana requested a review from Kubosaka February 24, 2025 08:15
Copy link
Collaborator

@Kubosaka Kubosaka left a comment

Choose a reason for hiding this comment

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

LGTM

@hikahana hikahana merged commit c52bdc9 into develop Feb 24, 2025
1 of 2 checks passed
@hikahana hikahana deleted the feat/hikahana/add-get-buy-report-details branch February 24, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants