mirror of
https://github.com/thekiwismarthome/shopping-list-manager.git
synced 2026-05-01 11:46:30 +00:00
feat: Add barcode_type field to the Card model and its WebSocket handlers for creation and updates.
This commit is contained in:
@@ -103,6 +103,7 @@ class LoyaltyCard:
|
||||
name: str
|
||||
number: str
|
||||
barcode: str = ""
|
||||
barcode_type: str = "barcode" # "barcode" or "qrcode"
|
||||
logo: str = ""
|
||||
notes: str = ""
|
||||
color: str = "#9fa8da"
|
||||
|
||||
@@ -1094,6 +1094,7 @@ async def websocket_get_loyalty_cards(
|
||||
vol.Required("name"): str,
|
||||
vol.Required("number"): str,
|
||||
vol.Optional("barcode", default=""): str,
|
||||
vol.Optional("barcode_type", default="barcode"): str,
|
||||
vol.Optional("logo", default=""): str,
|
||||
vol.Optional("notes", default=""): str,
|
||||
vol.Optional("color", default="#9fa8da"): str,
|
||||
@@ -1115,6 +1116,7 @@ async def websocket_add_loyalty_card(
|
||||
name=msg["name"],
|
||||
number=msg["number"],
|
||||
barcode=msg.get("barcode", ""),
|
||||
barcode_type=msg.get("barcode_type", "barcode"),
|
||||
logo=msg.get("logo", ""),
|
||||
notes=msg.get("notes", ""),
|
||||
color=msg.get("color", "#9fa8da"),
|
||||
@@ -1128,6 +1130,7 @@ async def websocket_add_loyalty_card(
|
||||
vol.Optional("name"): str,
|
||||
vol.Optional("number"): str,
|
||||
vol.Optional("barcode"): str,
|
||||
vol.Optional("barcode_type"): str,
|
||||
vol.Optional("logo"): str,
|
||||
vol.Optional("notes"): str,
|
||||
vol.Optional("color"): str,
|
||||
|
||||
Reference in New Issue
Block a user