-
Notifications
You must be signed in to change notification settings - Fork 1
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
[予算管理]局APIの作成 #907
[予算管理]局APIの作成 #907
Conversation
parameters: | ||
- name: year | ||
in: query | ||
description: year | ||
schema: | ||
type: integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
クエリパラメータでyearを追加しました
全件取得もできるようにrequiredはつけていないです
@@ -35,3 +35,6 @@ yarn-error.log* | |||
|
|||
# typescript | |||
*.tsbuildinfo | |||
|
|||
# genereated | |||
/src/generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
生成したコードがgithub actionsのworkflowで整形されると差分が大きくなるので、自動生成分はignoreに入れました
goqu.COALESCE(goqu.SUM("item_budgets.amount"), 0).As("budget"), | ||
goqu.COALESCE(goqu.SUM("buy_reports.amount"), 0).As("expense"), | ||
goqu.COALESCE(goqu.L("SUM(item_budgets.amount) - SUM(buy_reports.amount)"), 0).As("balance")). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
データがNULLの時に0にしたいため、COALESCEを使いました
} | ||
|
||
type FinancialRecordUseCase interface { | ||
GetFinancialRecords(context.Context) (generated.FinancialRecordDetails, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[imo]
何回も呼ばれるから一番下とかにgenerated省略したのて定義したい派閥です。
type FinancialRecordDetails = generated.FinancialRecordDetails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かに👍
型名省略
c context.Context, | ||
) (generated.FinancialRecordDetails, error) { | ||
var financialRecordDetails generated.FinancialRecordDetails | ||
var financialRecordList []generated.FinancialRecordWithBalance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
financialRecordBalances
かfinancialRecords
とかでも伝わりそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return &financialRecordUseCase{rep} | ||
} | ||
|
||
type FinancialRecordDetails = generated.FinancialRecordDetails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[imo]
個人的ですが一番上か一番下に置いた方が好き。直さなくても〇。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そのほうが読みやすくなるからですか?
これはマージして次から一番下にします
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
resolve #903
概要
year
作成したAPI
year
で指定した年度のデータを全件取得画面スクリーンショット等
テスト項目
備考