-
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定義 #900
予算管理ページのapi定義 #900
Conversation
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.
簡単にコードレビューしました!
openapi/openapi.yaml
Outdated
application/json: | ||
schema: | ||
$ref: "#/components/schemas/division" | ||
required: false |
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.
他も同様
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.
@@ -767,6 +831,134 @@ paths: | |||
"200": | |||
description: yearで指定されたexpensesを取得 | |||
content: {} | |||
/festival_items: |
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.
PRはfinacial_itemsと書かれてましたがfestival_itemsが正しい方ですよね.。
正直どっちでもいいとは思いますけど。
openapi/openapi.yaml
Outdated
responses: | ||
"200": | ||
description: 作成されたdivisionが返ってくる | ||
content: {} |
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.
他も同様
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.
idも含めて返したいと思い、getで配列で返しているオブジェクトを返すようにしました
response修正
festivalItem: | ||
required: | ||
- name | ||
- divisionId | ||
- amount | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
example: 農ポリ | ||
divisionId: | ||
type: integer | ||
example: 1 | ||
amount: | ||
type: integer | ||
example: 10000 | ||
memo: | ||
type: string | ||
example: "" |
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.
パラメータ受け取って適宜バックエンドでトランザクション貼って複数のテーブルにインサートするイメージです
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.
なら良さそう!
@@ -1927,6 +2255,18 @@ components: | |||
remark: | |||
type: string | |||
example: "" | |||
total: |
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.
このレビューに関係ないので読み飛ばし可です。
これ別個でAPI生やして管理します?それとも各APIに組み込ますか?
totalの使い方まだピンと来てないマンです。
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.
api内で集計して、totalに整形して返すイメージです。
局、部門、物品で合計が必要になるので、レスポンスで返す共通の型を定義した感じです。
apiを生やす?ってのがピンときていないです
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.
totalって何回も算出されそうだからtotal用のAPI作ってもいいのかなって思ってだったんですけど、よく考えたらべつにAPI作る必要なさそうですね
あと私のgo.mod以下みたいになったんですけどなります?
|
自分も消えました |
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.
対応Issue
resolve #901
概要
/financial_records
/divisions
/festival_items
画面スクリーンショット等
URL
テスト項目
備考
apiは実装していないです。
figma
ER図