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
|
name: str
|
||||||
number: str
|
number: str
|
||||||
barcode: str = ""
|
barcode: str = ""
|
||||||
|
barcode_type: str = "barcode" # "barcode" or "qrcode"
|
||||||
logo: str = ""
|
logo: str = ""
|
||||||
notes: str = ""
|
notes: str = ""
|
||||||
color: str = "#9fa8da"
|
color: str = "#9fa8da"
|
||||||
|
|||||||
@@ -1094,6 +1094,7 @@ async def websocket_get_loyalty_cards(
|
|||||||
vol.Required("name"): str,
|
vol.Required("name"): str,
|
||||||
vol.Required("number"): str,
|
vol.Required("number"): str,
|
||||||
vol.Optional("barcode", default=""): str,
|
vol.Optional("barcode", default=""): str,
|
||||||
|
vol.Optional("barcode_type", default="barcode"): str,
|
||||||
vol.Optional("logo", default=""): str,
|
vol.Optional("logo", default=""): str,
|
||||||
vol.Optional("notes", default=""): str,
|
vol.Optional("notes", default=""): str,
|
||||||
vol.Optional("color", default="#9fa8da"): str,
|
vol.Optional("color", default="#9fa8da"): str,
|
||||||
@@ -1115,6 +1116,7 @@ async def websocket_add_loyalty_card(
|
|||||||
name=msg["name"],
|
name=msg["name"],
|
||||||
number=msg["number"],
|
number=msg["number"],
|
||||||
barcode=msg.get("barcode", ""),
|
barcode=msg.get("barcode", ""),
|
||||||
|
barcode_type=msg.get("barcode_type", "barcode"),
|
||||||
logo=msg.get("logo", ""),
|
logo=msg.get("logo", ""),
|
||||||
notes=msg.get("notes", ""),
|
notes=msg.get("notes", ""),
|
||||||
color=msg.get("color", "#9fa8da"),
|
color=msg.get("color", "#9fa8da"),
|
||||||
@@ -1128,6 +1130,7 @@ async def websocket_add_loyalty_card(
|
|||||||
vol.Optional("name"): str,
|
vol.Optional("name"): str,
|
||||||
vol.Optional("number"): str,
|
vol.Optional("number"): str,
|
||||||
vol.Optional("barcode"): str,
|
vol.Optional("barcode"): str,
|
||||||
|
vol.Optional("barcode_type"): str,
|
||||||
vol.Optional("logo"): str,
|
vol.Optional("logo"): str,
|
||||||
vol.Optional("notes"): str,
|
vol.Optional("notes"): str,
|
||||||
vol.Optional("color"): str,
|
vol.Optional("color"): str,
|
||||||
|
|||||||
Reference in New Issue
Block a user