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

ユーザーがプロジェクトに寄付したあと、MatchedFund テーブルを生成・更新するようにする #19

Closed
tkgshn opened this issue Apr 17, 2024 · 6 comments
Assignees

Comments

@tkgshn
Copy link
Collaborator

tkgshn commented Apr 17, 2024

概要

DBのMatchedFundtableは、あるプロジェクトが「どれだけの資金をマッチングプールから上乗せして受け取るか」のデータを含んでいます。
しかし、これはDB Tableとしては存在していますが、現在は新しいデータは作られず動いていません。

そこで、まずはMatchedFundtableを正常に動くようにしたいです。「期待する動作」を参照してください。

このコードが重要な理由・目的

この上乗せ金額が存在して初めて、「あなたの寄付がどれだけの上乗せ金額をプロジェクトに呼び込むことになるか( #27 )」や『あなたの寄付にいくら上乗せされたか( #28 )』を計算することができます。

MatchedFundtableについて

  • id: ランダム
  • matchingRoundId: そのプロジェクトはどのMatching Roundと紐づいているか
  • grantId: プロジェクトのid
  • amount: 上乗せされている額
  • denomination: JPYに固定
  • amountUsd: これもめんどくさいのでamountと同じ概念にする
  • payoutAt: いつ支払われるか?あまりわかっていない

期待する動作

  • あるプロジェクトが初めて寄付を受け取った時、そのプロジェクトidや、そのプロジェクトが該当するmatchingRoundIdを持ってデータが新規作成される
  • すでにテーブル内にあるデータと、同じmatchingRoundIdを持つデータが入ったときに、QFメカニズムで計算する上乗せ金額を再計算し、その値がamountに更新される
@Naokiakazawa Naokiakazawa self-assigned this Apr 17, 2024
@tkgshn
Copy link
Collaborator Author

tkgshn commented Apr 18, 2024

https://scrapbox.io/tkgshn-private/Web2_QFのDBの関係性を確認する
DBとの関係性を書いてみたので、参考程度に

@tkgshn
Copy link
Collaborator Author

tkgshn commented Apr 18, 2024

QFの計算があっているというよりかは、あるプロジェクト(これはどこかのmatching poolに属しているもの)に寄付したときに画像のように上乗せが計算されない.

image

@tkgshn
Copy link
Collaborator Author

tkgshn commented Apr 18, 2024

どこのデータカラムが関わってるのか調べる

@tkgshn
Copy link
Collaborator Author

tkgshn commented Apr 18, 2024

image
できた。下記ログを参照。

https://scrapbox.io/tkgshn-private/Web2_QFのDBの関係性を確認する

@tkgshn
Copy link
Collaborator Author

tkgshn commented May 1, 2024

寄付後に表示される上乗せ金額と、
マイページで寄付活動を見た時に表示されている上乗せ金額の齟齬がありすぎる

@tkgshn tkgshn changed the title QFの計算が合っているのか確認 MatchedFund テーブルに入力されている額(マッチングプールからの上乗せ金額)が正しいか確認する May 2, 2024
@tkgshn tkgshn changed the title MatchedFund テーブルに入力されている額(マッチングプールからの上乗せ金額)が正しいか確認する ユーザーがプロジェクトに寄付したあと、MatchedFund テーブルを生成・更新するようにする May 3, 2024
@tkgshn
Copy link
Collaborator Author

tkgshn commented May 11, 2024

07a95ac
これでエラーは解消した

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

No branches or pull requests

2 participants