aboutsummaryrefslogtreecommitdiff
path: root/poker/models.py
diff options
context:
space:
mode:
authorPaul Harrison <paul@harrison.sh>2022-11-18 13:10:08 +0000
committerPaul Harrison <paul@harrison.sh>2022-12-15 16:02:14 +0000
commitadb149e8585d3753d7db0294237ad155123e2587 (patch)
treed0e0b756417d1124c8eedad9961fb4bf382a42a6 /poker/models.py
parent5efd77728dd5a1c6a2fb5070b981ad4d028c3fe1 (diff)
feat: Implement card and hand domain models
Diffstat (limited to 'poker/models.py')
-rw-r--r--poker/models.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/poker/models.py b/poker/models.py
new file mode 100644
index 0000000..e62df17
--- /dev/null
+++ b/poker/models.py
@@ -0,0 +1,16 @@
+from pydantic import BaseModel, Field
+
+from poker.constants import Suit, Value
+
+
+class Card(BaseModel):
+ """Card domain model class."""
+
+ suit: Suit
+ value: Value
+
+
+class Hand(BaseModel):
+ """Hand domain model class."""
+
+ cards: list[Card] = Field(..., min_length=5, max_length=5)