Skip to content

Conversation

Copy link

Copilot AI commented Nov 26, 2025

Replaces hardcoded "kitchen", "bar", "gng" stations with a dynamic Station model that can be created/managed via admin interface. Maintains full backward compatibility with existing data.

Model Changes

  • Station: Added unique code constraint, get_or_create_default_stations() helper
  • Dish: Added station_code property falling back to legacy field, effective_station property
  • Order: Added dynamic station status methods:
    • get_station_status(), set_station_status() for per-station control
    • all_stations_complete(), all_stations_approved_or_complete() for aggregate checks
    • Uses M2M fields status_0_stations through status_4_stations for dynamic tracking

Usage

# Creating a new station
Station.objects.create(friendly_name="Pastry", code="pastry", icon="cake")

# Assigning to dish
dish.new_station = Station.objects.get(code="pastry")

# Order status management
order.set_station_status("pastry", 1)  # Approved
order.all_stations_complete()  # True when all done

Other Updates

  • Views: POS, online store, deliveries updated to use dynamic stations
  • Templates: Station names rendered dynamically with fallback to legacy labels
  • Admin: Enhanced DishAdmin with station filtering, StationAdmin with list display
  • Migration: Creates default stations (Kitchen, Bar, Grab & Go) and migrates existing dishes

Screenshot

Station Admin Interface

Original prompt

Can you upgrade the system from pre-defined stations like "kitchen", "bar", "gng" to have dynamic stations that can be created in the admin interface and be asigned to each dish.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 26, 2025 21:22
Co-authored-by: Collert <17819526+Collert@users.noreply.github.com>
Co-authored-by: Collert <17819526+Collert@users.noreply.github.com>
Co-authored-by: Collert <17819526+Collert@users.noreply.github.com>
Copilot AI changed the title [WIP] Update system to support dynamic station creation Upgrade from pre-defined stations to dynamic admin-configurable stations Nov 26, 2025
Copilot AI requested a review from Collert November 26, 2025 21:33
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.

2 participants