From 0b9af1262547f52c85735be84a9766401461d95f Mon Sep 17 00:00:00 2001 From: 6reenhorn Date: Wed, 6 May 2026 22:06:20 +0800 Subject: [PATCH 1/3] style: root api view update --- queueless_backend/queueless_backend/views.py | 42 +++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/queueless_backend/queueless_backend/views.py b/queueless_backend/queueless_backend/views.py index 32b0761..db4b8bd 100644 --- a/queueless_backend/queueless_backend/views.py +++ b/queueless_backend/queueless_backend/views.py @@ -44,12 +44,12 @@ def landing_page(request): background: var(--bg); background-image: var(--gradient-bg); color: var(--text); - height: 100vh; + min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; - overflow: hidden; + padding: 5rem 1.5rem 2rem 1.5rem; }} .nav {{ position: absolute; @@ -133,6 +133,7 @@ def landing_page(request): gap: 1rem; justify-content: center; align-items: center; + flex-wrap: wrap; }} .btn {{ padding: 1rem 2rem; @@ -200,6 +201,43 @@ def landing_page(request): ); border-radius: 50%; }} + @media (max-width: 640px) {{ + .stats {{ + gap: 2rem; + flex-wrap: wrap; + }} + h1 {{ + font-size: 2.5rem; + }} + .nav {{ + padding: 1.5rem; + }} + }} + @media (max-width: 480px) {{ + .cta-group {{ + flex-direction: column; + width: 100%; + }} + .btn {{ + width: 100%; + text-align: center; + }} + .stats {{ + gap: 1.5rem; + flex-direction: column; + align-items: center; + text-align: center; + }} + .stat-item {{ + text-align: center; + }} + h1 {{ + font-size: 2.25rem; + }} + p {{ + font-size: 1.1rem; + }} + }} From bb522b7b0273ff1f7c16fbbd99ee118486666f24 Mon Sep 17 00:00:00 2001 From: 6reenhorn Date: Wed, 6 May 2026 22:15:13 +0800 Subject: [PATCH 2/3] chore: added seed mock data update commands --- .../management/commands/seed_mock_data.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/queueless_backend/mock_api/management/commands/seed_mock_data.py b/queueless_backend/mock_api/management/commands/seed_mock_data.py index e5ffc94..b182f10 100644 --- a/queueless_backend/mock_api/management/commands/seed_mock_data.py +++ b/queueless_backend/mock_api/management/commands/seed_mock_data.py @@ -83,12 +83,30 @@ def add_arguments(self, parser): action="store_true", help="Delete existing queue entries for seeded institutions first.", ) + parser.add_argument( + "--flush", + action="store_true", + help="Delete ALL institutions and queue entries before seeding.", + ) + parser.add_argument( + "--close-count", + type=int, + default=0, + help="Number of institutions to set as CLOSED for simulation.", + ) def handle(self, *args, **options): skip_queues = options["skip_queues"] min_queue = options["min_queue"] max_queue = options["max_queue"] reset_queues = options["reset_queues"] + flush = options["flush"] + close_count = options["close_count"] + + if flush: + self.stdout.write(self.style.WARNING("Flushing all data...")) + QueueEntry.objects.all().delete() + Institution.objects.all().delete() if min_queue < 0 or max_queue < 0: self.stderr.write(self.style.ERROR("Queue limits cannot be negative.")) @@ -121,6 +139,16 @@ def handle(self, *args, **options): else: updated_count += 1 + # Handle closing random institutions + if close_count > 0: + to_close = random.sample( + seeded_institutions, min(close_count, len(seeded_institutions)) + ) + for inst in to_close: + inst.status = Institution.Status.CLOSED + inst.save() + self.stdout.write(f"Closed {len(to_close)} institutions for simulation.") + self.stdout.write( self.style.SUCCESS( "Institutions seeded. " From 289c382dcac6ffaa6198b8e4664bc4b8c8ad2344 Mon Sep 17 00:00:00 2001 From: 6reenhorn Date: Wed, 6 May 2026 22:19:26 +0800 Subject: [PATCH 3/3] docs: added seed management markdown guide --- seed-management.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 seed-management.md diff --git a/seed-management.md b/seed-management.md new file mode 100644 index 0000000..94222c0 --- /dev/null +++ b/seed-management.md @@ -0,0 +1,52 @@ +# Seed Data Management + +This document provides instructions on how to use the custom management commands to seed and manage mock data for the QueueLess Backend. + +## 1. Seeding Mock Data +The `seed_mock_data` command is used to populate the database with mock institutions and queue entries for simulation. + +### Basic Seeding +Populate the database with default institutions and a random number of queue entries: +```bash +python manage.py seed_mock_data +``` + +### Resetting to a Clean State +If you want to clear all existing data (institutions and queues) and start fresh from Ticket #1: +```bash +python manage.py seed_mock_data --flush +``` + +### Simulating Closed Institutions +To randomly set a specific number of institutions to `CLOSED` status for testing "Unavailable" states: +```bash +python manage.py seed_mock_data --close-count 3 +``` + +## 2. Advanced Options + +| Argument | Type | Default | Description | +|----------|------|---------|-------------| +| `--flush` | flag | N/A | Deletes ALL institutions and queue entries before seeding. | +| `--close-count` | int | 0 | Number of institutions to randomly set as CLOSED. | +| `--min-queue` | int | 5 | Minimum random queue entries per institution. | +| `--max-queue` | int | 12 | Maximum random queue entries per institution. | +| `--skip-queues` | flag | N/A | Create institutions only, skip generating queue entries. | +| `--reset-queues`| flag | N/A | Deletes queue entries for seeded institutions only (keeps non-seeded ones). | + +## 3. Example Scenarios + +**Scenario A: High Traffic Simulation** +```bash +python manage.py seed_mock_data --min-queue 50 --max-queue 100 +``` + +**Scenario B: Limited Availability Test** +```bash +python manage.py seed_mock_data --flush --close-count 5 +``` + +**Scenario C: Empty Institutions Only** +```bash +python manage.py seed_mock_data --flush --skip-queues +```