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

[スキーマ案2] assignee を item が持つ #138

Merged
merged 7 commits into from
Sep 23, 2024

Conversation

toririm
Copy link
Member

@toririm toririm commented Sep 20, 2024

close #139
close #141

カップ別指名を実現するためのスキーマ変更案2

orderの中に含まれる個々のitemがassigneeプロパティを持つ

下記の例では

  • ひんやりだいだいを"3"番ドリッパー
  • だいだいオレをてけとさん

が担当することを示している。

{
  id: "...",
  orderId: 104,
  createdAt: ...,
  servedAt: null,
  items: [
    {
      id: "...",
      name: "だいだいブレンド",
      price: 300,
      type: "hot",
      assignee: null
    },
    {
      id: "...",
      name: "ひんやりだいだい",
      price: 300,
      type: "ice",
      assignee: "3"
    },
    {
      id: "...",
      name: "だいだいオレ",
      price: 400,
      type: "ore",
      assignee: "てけと"
    }
  ],
  total: 1000,
  orderReady: false,
  description: "この人OBらしいよ~。全然名前知らんかったけど(笑)"
}

メリット

  • assignee と item を確実に結びつけることができる

デメリット

  • item が場面によっては不要な情報を持つ
    • ref: このケースでは、アイテムの新規作成時も assignee を null として扱う

Copy link
Contributor

github-actions bot commented Sep 20, 2024

Visit the preview URL for this PR (updated for commit 41fea1b):

https://cafeore-2024--pr138-proposal-assign-sche-6s1c5yy9.web.app

(expires Mon, 30 Sep 2024 13:27:02 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b62dcde668e26b6280dd8317f3f875013f6f22f5

@toririm toririm requested a review from Astalum September 20, 2024 18:42
@toririm toririm marked this pull request as draft September 20, 2024 18:43
@toririm toririm linked an issue Sep 20, 2024 that may be closed by this pull request
@toririm toririm requested a review from takum1-me September 20, 2024 18:47
Copy link
Collaborator

@Lailai0477 Lailai0477 left a comment

Choose a reason for hiding this comment

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

こっちの方がLGTM

@toririm toririm marked this pull request as ready for review September 23, 2024 12:56
@toririm toririm merged commit c98e9d3 into main Sep 23, 2024
7 checks passed
@toririm toririm deleted the proposal/assign-schema-2 branch September 23, 2024 13:30
@takum1-me
Copy link
Collaborator

自分もこっちの方が好き、指名の入力方法ってもう実装してある?

@toririm
Copy link
Member Author

toririm commented Sep 25, 2024

@takum1-me

にて実装予定。まだです。

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