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

[スキーマ案1] assigneeをorderが持つ #137

Closed
wants to merge 1 commit into from

Conversation

toririm
Copy link
Member

@toririm toririm commented Sep 20, 2024

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

orderのitemsとindexが一致するようにassignee配列を持つ

下記の例では

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

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

{
  id: "...",
  orderId: 104,
  createdAt: ...,
  servedAt: null,
  items: [
    {
      id: "...",
      name: "だいだいブレンド",
      price: 300,
      type: "hot"
    },
    {
      id: "...",
      name: "ひんやりだいだい",
      price: 300,
      type: "ice"
    },
    {
      id: "...",
      name: "だいだいオレ",
      price: 400,
      type: "ore"
    }
  ],
  assignee: [null, "3", "てけと"],
  total: 1000,
  orderReady: false
}

メリット

  • item に不要な情報を持たせなくてよい

デメリット

  • index がズレる実装ミスをしたときに怖い

Copy link
Contributor

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

https://cafeore-2024--pr137-proposal-assign-sche-apq7p0uj.web.app

(expires Fri, 27 Sep 2024 18:32:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b62dcde668e26b6280dd8317f3f875013f6f22f5

@toririm toririm requested a review from Astalum September 20, 2024 18:35
@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:46
@toririm toririm closed this Sep 23, 2024
@toririm toririm deleted the proposal/assign-schema-1 branch September 23, 2024 14:17
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.

カップ別指名に対応するためのスキーマ変更
1 participant