diff --git a/process/.agents/skills/up-code-generate/SKILL.md b/process/.agents/skills/up-code-generate/SKILL.md index 00a9dc6..3fe2a5c 100644 --- a/process/.agents/skills/up-code-generate/SKILL.md +++ b/process/.agents/skills/up-code-generate/SKILL.md @@ -55,7 +55,7 @@ Rules (apply to every story): 4. Enforce tenant isolation and authorization per the architecture spike's validated pattern. 5. Update `iteration_surface_matrix.md` with implementation status and verification evidence. In `traceability_graph.md`, transition requirement status to **`Implemented (Domain/Schema)`** upon code and unit test completion. DO NOT mark requirements as `Delivered` at this stage; `Delivered (E2E Verified)` is reserved for Gate 14.1 closure after all delivery surfaces, migrations, and dual QA assets pass. 6. Do not place secrets, live tokens, or production credentials in code, fixtures, logs, or commits. -7. **Strict Anti-Placeholder Rule:** Stub functions, mock controllers where real database logic was specified, and zero-coverage test stubs are strictly forbidden. All code must implement genuine business logic. +7. **Strict Anti-Placeholder Rule:** Stub functions, mock controllers where real database logic was specified, and zero-coverage test stubs are strictly forbidden. All code must implement genuine business logic. Every web portal/screen declared in `iteration_surface_matrix.md` must have a physical, genuine frontend view implementation (`.tsx`/`.vue`) on disk wired via typed API clients and registered in the application router. Ghost screens or unimplemented UI placeholders cannot be marked as `Delivered (E2E Verified)` and will fail Gate 14.1 check `G14-013`. 8. **Automated Test Coverage Budgets:** Ensure code meets the thresholds configured in `tech-profile.yaml`: - Backend Domain & FSMs: **≥95.0%** statement and branch coverage. - Integration Adapters: **≥90.0%** against Wave 0 sandboxes. diff --git a/process/.agents/skills/up-test-model-generate/SKILL.md b/process/.agents/skills/up-test-model-generate/SKILL.md index 0c19954..5868591 100644 --- a/process/.agents/skills/up-test-model-generate/SKILL.md +++ b/process/.agents/skills/up-test-model-generate/SKILL.md @@ -42,7 +42,7 @@ For every `STORY-xxx` in the current iteration: **Manual Testing Guide & 21-Sheet Excel Workbook:** For every iteration, Stage 12 MUST produce TWO complementary manual QA deliverables: 1. Markdown walkthrough guide: `project_sdlc/07_test_design/manual_qa/iteration-NN/MANUAL_TESTING_GUIDE.md` (preconditions, steps, disposable personas, expected results). -2. 21-sheet, 30-column Excel Manual QA Workbook: `project_sdlc/07_test_design/manual_qa/workbooks/IterationNN__Complete_Manual_Testcases.xlsx`, compiled deterministically using `scripts/generate_manual_qa_workbook.py`. The workbook MUST be densely populated with **$\ge 20$ concrete test cases** spanning the 16 test categories. Zero-row or empty template workbooks violate the anti-placeholder rule and fail Gate 14.1 with Critical errors. +2. 21-sheet, 30-column Excel Manual QA Workbook: `project_sdlc/07_test_design/manual_qa/workbooks/IterationNN__Complete_Manual_Testcases.xlsx`, compiled deterministically using `scripts/generate_manual_qa_workbook.py`. The workbook MUST be densely populated with **$\ge 20$ concrete test cases** spanning the 16 test categories, and MUST achieve **$\ge 80\%$ semantic alignment** directly targeting this iteration's specific in-scope Use Cases, Stories, and FRs. Copying identical boilerplate test cases across workbooks is strictly prohibited and fails Gate 14.1 with Critical error `G14-014`. Zero-row or empty template workbooks violate the anti-placeholder rule and fail Gate 14.1 with Critical error `G14-007`. **Test Idempotency & Disposable Personas:** Automated browser (Playwright) and API tests MUST enforce test idempotency — tests MUST NOT mutate shared global records. Use disposable personas or isolated database fixtures. diff --git a/process/.agents/skills/up-traceability-gate/SKILL.md b/process/.agents/skills/up-traceability-gate/SKILL.md index 7289dd1..67cd6b4 100644 --- a/process/.agents/skills/up-traceability-gate/SKILL.md +++ b/process/.agents/skills/up-traceability-gate/SKILL.md @@ -69,17 +69,17 @@ FAIL (do not proceed) if any Critical issue exists: 1. Requirement mapped across all applicable delivery surfaces in `iteration_surface_matrix.md`. 2. API documented; database migration present; integration adapter verified. 3. Tests passing: unit + API integration + real-runtime tests via `scripts/run_tests.sh`. - 4. Browser-E2E evidence for all web portals/views in scope. + 4. Frontend surface physical existence on disk: Every declared portal/screen in `iteration_surface_matrix.md` marked as `Delivered (E2E Verified)` has a corresponding physical `.tsx` component under `project_code/frontend/src/` and is registered in the router (`App.tsx`) (`G14-013`). 5. Explicit Unit/Smoke/Usability applicability decisions recorded. - 6. Required QA deliverables exist and meet **semantic density**: + 6. Required QA deliverables exist and meet **semantic density & alignment**: - `project_sdlc/07_test_design/manual_qa/iteration-NN/MANUAL_TESTING_GUIDE.md` present. - - 21-sheet Excel QA Workbook (`IterationNN__Complete_Manual_Testcases.xlsx`) compiled and densely populated with **$\ge 20$ concrete test cases** (zero-row/stub templates are strictly blocked with Critical errors). - 7. Bruno API Collections: Git-versioned `.bru` requests present under `project_code/docs/api/bruno/` for every declared API endpoint in the surface matrix. - 8. Functional Test Models: `07_test_design/functional_test_cases/TC-xxx.md` files verified across all 4 mandatory dimensions: Happy Path, Boundary/Edge, Negative/Security, and FSM Invariant. + - 21-sheet Excel QA Workbook (`IterationNN__Complete_Manual_Testcases.xlsx`) compiled and densely populated with **$\ge 20$ concrete test cases** (`G14-007`), achieving **$\ge 80\%$ semantic alignment** targeting the iteration's specific in-scope Use Cases without boilerplate copying across iterations (`G14-014`). + 7. Bruno API Collections: Git-versioned `.bru` requests present under `project_code/docs/api/bruno/` for every declared API endpoint in the surface matrix (`G14-008`). + 8. Functional Test Models: `07_test_design/functional_test_cases/TC-xxx.md` files verified across all 4 mandatory dimensions: Happy Path, Boundary/Edge, Negative/Security, and FSM Invariant (`G14-009`, `G14-010`). 9. Multi-path automated code and branch coverage meets or exceeds configured tier budgets (e.g. **≥95.0%** for domain FSMs, **≥90.0%** for adapters, **≥80.0%** for frontend components). 10. Cumulative regression suite passes via `scripts/run_tests.sh --scope iteration-NN`. -FAIL if any story lacks passing tests, automated test coverage does not meet configured thresholds, regression tests fail, QA workbooks have < 20 test cases, Bruno collections are missing, or delivery surfaces are unowned. +FAIL if any story lacks passing tests, automated test coverage does not meet configured thresholds, regression tests fail, QA workbooks have < 20 test cases, QA workbooks fail semantic alignment (< 80%), declared UI surfaces lack physical implementation on disk, Bruno collections are missing, or delivery surfaces are unowned. **Requirement Status Lifecycle:** - While stories and code are being implemented: status is `In Construction` or `Implemented (Domain/Schema)`. diff --git a/process/AI_Native_Unified_Process_v1.md b/process/AI_Native_Unified_Process_v1.md index f73afe4..9d9d3b2 100644 --- a/process/AI_Native_Unified_Process_v1.md +++ b/process/AI_Native_Unified_Process_v1.md @@ -125,7 +125,7 @@ Cross-cutting governance IDs: `DEC-xxx` (decision), `AMB-xxx` (ambiguity), `ASM- - **Frontend UI Components:** **≥80.0%** component branch coverage + mandatory Playwright browser-E2E test suites for all primary user journeys. Every user story must be tested across at least four dimensions: Happy Path, Alternate & Boundary/Edge Cases, Negative/Validation Failures, and FSM Invariant/Concurrency flows. 9. **Deterministic Gate Verification:** Quality Gates 5.1, 9.1, and 14.1 MUST be executed and verified via `scripts/verify_traceability_gates.py`. AI agents cannot self-certify gate closure without clean CLI validation evidence. -10. **Strict Anti-Placeholder & Semantic Density Enforcement (Gate 14.1):** An iteration cannot close and requirements cannot transition to 'Delivered' on the basis of empty templates, stub test suites, or zero-row workbooks. Gate 14.1 deterministically inspects Excel workbooks for a minimum density of $\ge 20$ test cases across test categories, verifies `.bru` collections in `docs/api/bruno/` for all declared API surfaces, and asserts 4-dimension coverage (Happy Path, Boundary/Edge, Negative/Security, FSM Invariant) in `07_test_design/functional_test_cases/`. Missing workbooks, zero-row workbooks, or missing Bruno collections are blocking Critical findings. +10. **Strict Anti-Placeholder & Semantic Density Enforcement (Gate 14.1):** An iteration cannot close and requirements cannot transition to 'Delivered' on the basis of empty templates, stub test suites, or zero-row workbooks. Gate 14.1 deterministically inspects Excel workbooks for a minimum density of $\ge 20$ test cases across test categories (`G14-007`), asserts $\ge 80\%$ semantic alignment targeting the iteration's in-scope Use Cases without stale boilerplate copying (`G14-014`), verifies physical disk existence of genuine frontend components (`.tsx`/`.vue`) in `project_code/frontend/src/` and registration in application routing for all declared UI surfaces (`G14-013`), verifies `.bru` collections in `project_code/docs/api/bruno/` for all declared API surfaces (`G14-008`), and asserts 4-dimension coverage (Happy Path, Boundary/Edge, Negative/Security, FSM Invariant) in `07_test_design/functional_test_cases/` (`G14-009`, `G14-010`). Missing workbooks, zero-row workbooks, misaligned QA workbooks, missing UI components, or missing Bruno collections are blocking Critical findings. 11. **Granular Requirement Status Progression:** Requirements in `traceability_graph.md` must strictly follow the progression: `Baselined` → `In Construction` → `Implemented (Domain/Schema)` → `Delivered (E2E Verified)`. Jumping directly from `Baselined` to `Delivered` without completing all delivery surfaces, live database migrations, UI wiring, and dual QA verification is strictly prohibited. 12. **Automated Test Execution Binding:** Passing automated tests via `scripts/run_tests.sh --scope ` is mandatory for Gate 14.1 closure. Tests must achieve configured coverage thresholds and pass without regression. @@ -355,7 +355,7 @@ Process adjustments follow their own dedicated meta-governance lifecycle, tracke | **Gate 5.1** | Stage 6 (Risk Ranking) | Zero UC with no FR; zero FR with invalid `parent_uc`. | `python3 scripts/verify_traceability_gates.py --gate 5.1` | | **Gate 9.1** | Construction | Zero FR without SRS + HLD + LLD linkage. | `python3 scripts/verify_traceability_gates.py --gate 9.1` | | **QG-E** | Construction (Stage 10) | Architecture baseline validated; Gates 5.1 and 9.1 both pass. | `@gatekeeper` | -| **Gate 14.1** | Next Iteration / Transition | Every STORY has a passing TC; explicit Unit/Smoke/Usability applicability decisions; automated coverage meets tiered budget ($\ge 95\%$ domain, $\ge 90\%$ adapter, $\ge 80\%$ frontend); cumulative regression suite passes; all delivery surfaces evidenced; real browser QA validated; required QA deliverables present (Manual Testing Guide and 21-sheet Excel workbook with $\ge 20$ dense test cases); Bruno `.bru` collections present for all declared APIs; 4 test dimensions verified; parallel lanes integrated cleanly. | `python3 scripts/verify_traceability_gates.py --gate 14.1 --iteration iteration-NN [--run-tests]` | +| **Gate 14.1** | Next Iteration / Transition | Every STORY has a passing TC; explicit Unit/Smoke/Usability applicability decisions; automated coverage meets tiered budget ($\ge 95\%$ domain, $\ge 90\%$ adapter, $\ge 80\%$ frontend); cumulative regression suite passes; all delivery surfaces evidenced; declared UI screens have physical `.tsx`/`.vue` implementations on disk in `project_code/frontend/src/` registered in routing (`G14-013`); required QA deliverables present (Manual Testing Guide and 21-sheet Excel workbook with $\ge 20$ dense test cases, $\ge 80\%$ semantic alignment to in-scope UCs without cross-iteration boilerplate copying, `G14-007`, `G14-014`); Bruno `.bru` collections present for all declared APIs (`G14-008`); 4 test dimensions verified (`G14-009`, `G14-010`); parallel lanes integrated cleanly. | `python3 scripts/verify_traceability_gates.py --gate 14.1 --iteration iteration-NN [--run-tests]` | | **QG-T** | Production Deployment | UAT passed; production readiness checklist passed; traceability graph 100% Delivered-or-Deferred-with-CR. | `@gatekeeper` | --- @@ -370,7 +370,8 @@ Process adjustments follow their own dedicated meta-governance lifecycle, tracke | **v1.3** | 2026-10-03 | **Multi-Stack & Frappe Framework Integration (`PCR-003`):** (1) Created ready-reference `tech-profile-presets.md` covering Frappe, Django, Spring Boot, FastAPI, and NestJS; (2) Upgraded `scripts/run_tests.sh` with multi-framework test runner dispatch (`bench run-tests`, `mvn/gradle`, `pytest`); (3) Updated `up-code-generate`, `up-arch-risk-spike`, and `up-wireframe-spec` with Frappe DocType schema generation, `bench migrate` synchronization, site-based multi-tenancy, and Frappe Desk screen conventions; (4) Segregated Process Change Requests (`PCR-xxx`) into `process_change_register.md` to prevent ID collisions with product changes (`CR-xxx`). | | **v1.4** | 2026-10-10 | **Gate 14.1 Semantic Density & Anti-Superficiality Hardening (`PCR-005`):** (1) Hardened `scripts/verify_traceability_gates.py` to enforce semantic density on 21-sheet Excel workbooks ($\ge 20$ populated test cases), blocking zero-row/stub templates with `Critical` exit codes; (2) Added mandatory Bruno API collection check asserting git-versioned `.bru` requests in `docs/api/bruno/` for all declared API surfaces; (3) Added 4-dimension functional test model verification (Happy Path, Boundary/Edge, Negative/Security, FSM Invariant); (4) Bound automated test execution (`--run-tests` hook) to Gate 14.1 closure; (5) Enforced granular requirement lifecycle states (`Baselined` → `In Construction` → `Implemented (Domain/Schema)` → `Delivered (E2E Verified)`); (6) Upgraded `scripts/generate_manual_qa_workbook.py` with dual-engine execution (openpyxl + zero-dependency zipfile/XML) and auto-population; (7) Injected binding anti-placeholder and anti-superficiality rules into `AGENTS.md`. | | **v1.6** | 2026-10-13 | **Top-Level 3-Directory Architecture & Customer Isolation (`PCR-007`):** (1) Formalized 3-tier top-level project layout separating universal process framework (`process/`), internal project engineering artifacts (`project_sdlc/`), and customer-deliverable codebase (`project_code/`); (2) Isolated customer deliverables into `project_code/` with self-contained Bruno API collections (`project_code/docs/api/bruno/`) and operational runbooks, eliminating external symlinks; (3) Updated `up-project-bootstrap` and `init-new-project.sh` to initialize clean scaffolding with empty `project_code/` (.gitkeep); (4) Enforced just-in-time directory auto-creation across all skills and strict 100% root-relative path hygiene. | -| **v1.7+** | (Future) | Process adjustments approved via `PCR-xxx` (Trigger Type `Process-Adjustment`) are version-bumped and recorded here per §8.8. | +| **v1.7** | 2026-10-16 | **Gate 14.1 Anti-Ghost-Surface & QA Alignment Hardening (`PCR-011`):** (1) Hardened `scripts/verify_traceability_gates.py` with check `G14-013` enforcing physical disk existence of genuine frontend components (`.tsx`/`.vue`) in `project_code/frontend/src/` and application route mapping for all UI delivery surfaces marked `Delivered (E2E Verified)`; (2) Added check `G14-014` enforcing $\ge 80\%$ semantic alignment of manual QA workbooks against iteration in-scope Use Cases, strictly blocking copy-paste boilerplate across workbooks; (3) Hardened `up-code-generate`, `up-test-model-generate`, and `up-traceability-gate` skills with binding physical surface existence and semantic QA rules; (4) Added complete operational frontend screen coverage and sales demo dataset seeding engine with reversible teardown. | +| **v1.8+** | (Future) | Process adjustments approved via `PCR-xxx` (Trigger Type `Process-Adjustment`) are version-bumped and recorded here per §8.8. | diff --git a/process/process_change_register.md b/process/process_change_register.md index 672a376..7822b9f 100644 --- a/process/process_change_register.md +++ b/process/process_change_register.md @@ -36,6 +36,8 @@ This guarantees: | `PCR-008` | Process-Adjustment | Process Architect / Framework Lead | 2026-10-13 | Framework Documentation Alignment & Root Agent Symlink Consolidation | Renamed `process/02_Skills_Usage_Guide.md` to `process/Skills_GUIDE.md` for consistent casing and naming convention. Consolidated all agent framework guides (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`) inside `process/` as the single canonical source of truth, linking root files via relative symlinks to ensure git-subtree synchronization and seamless multi-platform AI assistant discovery. Aligned `process/README.md` and root `README.md` with the 3-directory top-level architecture and updated `init-new-project.sh` to scaffold all agent symlinks automatically. | `process/Skills_GUIDE.md`, `process/AGENTS.md`, `process/CLAUDE.md`, `process/GEMINI.md`, `process/README.md`, `README.md`, `process/scripts/init-new-project.sh`, `process/process_change_register.md` | Documentation hygiene and agent framework single-source-of-truth consolidation | Approved | Closed | | `PCR-009` | Process-Adjustment | Process Architect / Project Governance Lead | 2026-10-13 | Root Layout Hygiene & Transcripts Encapsulation under `project_sdlc/prompts/` | Eliminated root `prompts` convenience symlink in favor of exclusive placement under `project_sdlc/prompts/`. Updated process specification, scaffolding script (`init-new-project.sh`), bootstrap skill (`up-project-bootstrap`), process `AGENTS.md` instructions, and repository documentation to reference `project_sdlc/prompts/` directly via root-relative paths. Preserves a pristine repository root containing only the 3 primary directories (`process/`, `project_sdlc/`, `project_code/`) and essential agent entrypoint symlinks. | `process/AI_Native_Unified_Process_v1.md`, `process/scripts/init-new-project.sh`, `process/.agents/skills/up-project-bootstrap/SKILL.md`, `process/AGENTS.md`, `process/README.md`, `README.md`, `process/process_change_register.md` | Root hygiene and strict project_sdlc encapsulation | Approved | Closed | | `PCR-010` | Process-Adjustment | Process Architect / Engineering Lead | 2026-10-13 | Complete Path Modernization Across Framework Guides, Presets, Templates & Skills | Audited and modernized all remaining legacy path references (`04_generated_documentation/`, `05_implementation_workspace/`, `01_BRD/`, `02_legacy_source_code/`, `00_prompts/`) across `process/framework_guides/` (Frappe App-Centric guide), `process/templates/` (`tech-profile-presets.md`, `tech-profile.template.yaml`), `process/Skills_GUIDE.md`, and all 19 canonical agent skills (`process/.agents/skills/*/SKILL.md`). Replaced legacy paths with canonical root-relative paths under `project_sdlc/` and `project_code/`, ensuring 100% path alignment with the 3-directory top-level architecture. | `process/framework_guides/frappe_app_centric_development_guide.md`, `process/templates/tech-profile-presets.md`, `process/templates/tech-profile.template.yaml`, `process/Skills_GUIDE.md`, `process/.agents/skills/*/SKILL.md`, `process/scripts/generate_manual_qa_workbook.py`, `process/process_change_register.md` | Complete framework path consistency and eradication of legacy directory references | Approved | Closed | +| `PCR-011` | Process-Adjustment | Quality Assurance Architect / Process Lead | 2026-10-16 | Gate 14.1 Anti-Ghost-Surface & QA Alignment Hardening | Hardened Gate 14.1 and construction skills against superficial completion: (1) Added rule `G14-013` to `scripts/verify_traceability_gates.py` enforcing physical disk existence of genuine frontend components (`.tsx`/`.vue`) in `project_code/frontend/src/` and application route mapping for all UI delivery surfaces marked `Delivered (E2E Verified)`; (2) Added rule `G14-014` enforcing $\ge 80\%$ semantic alignment of manual QA workbooks against iteration in-scope Use Cases, strictly blocking copy-paste boilerplate across workbooks; (3) Hardened `up-code-generate`, `up-test-model-generate`, and `up-traceability-gate` skills with binding physical surface existence and semantic QA rules; (4) Added complete operational frontend screen coverage and sales demo dataset seeding engine with reversible teardown. | `process/AI_Native_Unified_Process_v1.md`, `scripts/verify_traceability_gates.py`, `process/.agents/skills/up-code-generate/SKILL.md`, `process/.agents/skills/up-test-model-generate/SKILL.md`, `process/.agents/skills/up-traceability-gate/SKILL.md`, `process/process_change_register.md` | UP-AI v1.7 bump; Gate 14.1 anti-ghost surface validation and QA workbook semantic alignment | Approved | Closed | + diff --git a/process/scripts/demo/cleanup_demo_data.py b/process/scripts/demo/cleanup_demo_data.py index bfb51b5..23de8b1 100755 --- a/process/scripts/demo/cleanup_demo_data.py +++ b/process/scripts/demo/cleanup_demo_data.py @@ -15,10 +15,14 @@ import sys # Ensure project_code is importable CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) -PROJECT_ROOT = os.path.abspath(os.path.join(CURRENT_DIR, "..", "..")) -PROJECT_CODE = os.path.join(PROJECT_ROOT, "project_code") +PROJECT_CODE = None +for parent_lvl in [os.path.join(CURRENT_DIR, "..", ".."), os.path.join(CURRENT_DIR, "..", "..", "..")]: + cand = os.path.abspath(os.path.join(parent_lvl, "project_code")) + if os.path.isdir(cand): + PROJECT_CODE = cand + break -if PROJECT_CODE not in sys.path: +if PROJECT_CODE and PROJECT_CODE not in sys.path: sys.path.insert(0, PROJECT_CODE) try: @@ -176,7 +180,25 @@ def main(): sys.exit(1) try: - metrics = safely_purge_demo_tenant(storage, tenant_id) + from backend.app.db.demo_seed import purge_demo_dataset + metrics = purge_demo_dataset(storage, tenant_id) + + # Also synchronize running backend server if active + try: + import urllib.request + import json + req = urllib.request.Request( + "http://localhost:8000/api/v1/demo/cleanup", + data=json.dumps({"tenant_id": tenant_id}).encode("utf-8"), + headers={"Content-Type": "application/json"}, + method="POST" + ) + with urllib.request.urlopen(req, timeout=3) as resp: + if resp.status == 200: + print("[API] Synced running backend server at http://localhost:8000") + except Exception: + pass + total_records = sum(v for k, v in metrics.items() if isinstance(v, int)) print("=" * 72) print(f"[SUMMARY] Total demo records safely removed: {total_records}") diff --git a/process/scripts/demo/seed_demo_data.py b/process/scripts/demo/seed_demo_data.py index 199a8dd..c3d1b9a 100755 --- a/process/scripts/demo/seed_demo_data.py +++ b/process/scripts/demo/seed_demo_data.py @@ -20,10 +20,14 @@ import uuid # Ensure project_code is importable CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) -PROJECT_ROOT = os.path.abspath(os.path.join(CURRENT_DIR, "..", "..")) -PROJECT_CODE = os.path.join(PROJECT_ROOT, "project_code") +PROJECT_CODE = None +for parent_lvl in [os.path.join(CURRENT_DIR, "..", ".."), os.path.join(CURRENT_DIR, "..", "..", "..")]: + cand = os.path.abspath(os.path.join(parent_lvl, "project_code")) + if os.path.isdir(cand): + PROJECT_CODE = cand + break -if PROJECT_CODE not in sys.path: +if PROJECT_CODE and PROJECT_CODE not in sys.path: sys.path.insert(0, PROJECT_CODE) try: @@ -667,18 +671,31 @@ def main(): print("=" * 72) print(f"[CONFIG] Target Tenant: {tenant_id}") - if args.clean_first: - purge_existing_demo_tenant(storage, tenant_id) + from backend.app.db.demo_seed import seed_demo_dataset - seed_demo_tenant(storage, tenant_id) - seed_master_data(storage, tenant_id) - seed_connected_storyboard_transactions(storage, tenant_id) - seed_20day_historical_snapshots(storage, tenant_id) + summary = seed_demo_dataset(storage, tenant_id) + + # Synchronize running backend server if active + try: + import urllib.request + import json + req = urllib.request.Request( + "http://localhost:8000/api/v1/demo/seed", + data=json.dumps({"tenant_id": tenant_id}).encode("utf-8"), + headers={"Content-Type": "application/json"}, + method="POST" + ) + with urllib.request.urlopen(req, timeout=3) as resp: + if resp.status == 200: + print("[API] Synced running backend server at http://localhost:8000") + except Exception: + pass print("=" * 72) print("[SUCCESS] Demo Environment Successfully Initialized!") print(f"Tenant Name : {DEFAULT_BUSINESS_NAME}") print(f"Tenant ID : {tenant_id}") + print(f"Seeded Items : {summary}") print("Sample Login : buyer@malwa-agri.demo (Passwordless in Mock Mode)") print("Story Sauda : SDA-2026-001 (25 MT Soybean @ ₹4,850/Qtl)") print("Story Bilty : BLT-2026-089 (24 MT Dispatched on MP09BC8812)") diff --git a/process/scripts/generate_manual_qa_workbook.py b/process/scripts/generate_manual_qa_workbook.py index 5fc168c..0419442 100755 --- a/process/scripts/generate_manual_qa_workbook.py +++ b/process/scripts/generate_manual_qa_workbook.py @@ -65,37 +65,157 @@ def col_num_to_letter(col_idx: int) -> str: return col_letter +def parse_tc_markdown_file(tc_path: Path): + """Parses a functional test model markdown file (TC-*.md) into test case objects.""" + text = tc_path.read_text(encoding="utf-8") + parent_uc_m = re.search(r"Parent Use Case.*?`(UC-\d{3})`", text, re.IGNORECASE) + parent_uc = parent_uc_m.group(1).upper() if parent_uc_m else "" + if not parent_uc: + uc_fallback = re.search(r"UC-\d{3}", text) + if uc_fallback: + parent_uc = uc_fallback.group(0).upper() + + frs = list(dict.fromkeys(re.findall(r"FR-[A-Z0-9_\-]+", text))) + + cases = [] + sections = re.split(r"\n##\s+(TC-[^\n]+)", text) + for i in range(1, len(sections), 2): + header = sections[i] + body = sections[i + 1] + + tc_id_m = re.search(r"TC-[A-Z0-9_\-]+", header) + tc_id = tc_id_m.group(0) if tc_id_m else header.split(":")[0].strip() + + title_m = re.search(r":\s*(.*?)(?:\s*\((.*?)\))?$", header) + title = title_m.group(1).strip() if title_m else header + dim = title_m.group(2).strip() if title_m and title_m.group(2) else "Functional" + + precond_m = re.search(r"-\s+\*\*Preconditions:\*\*\s*(.*?)(?=\n-\s+\*\*|\n##|\Z)", body, re.DOTALL) + precond = " ".join(precond_m.group(1).split()) if precond_m else "" + + steps_m = re.search(r"-\s+\*\*Steps:\*\*\s*(.*?)(?=\n-\s+\*\*Expected Result:\*\*|\n##|\Z)", body, re.DOTALL) + steps = " ".join(steps_m.group(1).split()) if steps_m else "" + + expected_m = re.search(r"-\s+\*\*Expected Result:\*\*\s*(.*?)(?=\n-\s+\*\*|\n##|\Z)", body, re.DOTALL) + expected = " ".join(expected_m.group(1).split()) if expected_m else "" + + priority_m = re.search(r"-\s+\*\*Priority:\*\*\s*(P\d)", body) + priority = priority_m.group(1) if priority_m else "P0" + + cases.append({ + "tc_id": tc_id, + "title": title, + "dim": dim, + "priority": priority, + "precond": precond, + "steps": steps, + "expected": expected, + "parent_uc": parent_uc, + "parent_frs": frs, + "source_file": tc_path.name + }) + return parent_uc, frs, cases + + def get_default_iteration_cases(iteration_str: str, name: str, repo_root: Path = None): - """Generates a dense, comprehensive set of test cases (>20 cases) covering all 16 test categories.""" + """Generates a dense, comprehensive set of test cases (>20 cases) covering all 16 test categories, + dynamically extracted from the iteration backlog, surface matrix, and functional test models (TC-*.md). + """ + if repo_root is None: + repo_root = find_repo_root(Path(__file__)) + it_num = re.sub(r"[^0-9]", "", iteration_str) or "01" it_tag = f"iteration-{it_num.zfill(2)}" + sdlc_dir = (repo_root / "project_sdlc") if (repo_root / "project_sdlc").exists() else (repo_root / "04_generated_documentation") + iter_dir = sdlc_dir / "05_iteration_planning" / "iterations" / it_tag + tc_dir = sdlc_dir / "07_test_design" / "functional_test_cases" # Discover UC and FRs in iteration if planning files exist - uc_id = "UC-001" - fr_ids = ["FR-AUTH-001", "FR-AUTH-002", "FR-AUTH-003"] - brd_id = "BRD-FR-001" - stories = ["STORY-AUTH-001", "STORY-AUTH-002", "STORY-AUTH-003"] + in_scope_ucs = [] + stories = [] + surfaces = {} + + backlog_file = iter_dir / "iteration_backlog.md" + if backlog_file.exists(): + bl_text = backlog_file.read_text(encoding="utf-8") + in_scope_ucs = sorted(list(set(re.findall(r"UC-\d{3}", bl_text)))) + for line in bl_text.splitlines(): + parts = [p.strip() for p in line.split("|")] + if len(parts) >= 8 and parts[1].startswith("`STORY-"): + stories.append({ + "story_id": parts[1].replace("`", ""), + "parent_fr": parts[2].replace("`", ""), + "title": parts[3], + "roles": parts[7] + }) + + surface_file = iter_dir / "iteration_surface_matrix.md" + if surface_file.exists(): + sf_text = surface_file.read_text(encoding="utf-8") + if not in_scope_ucs: + in_scope_ucs = sorted(list(set(re.findall(r"UC-\d{3}", sf_text)))) + for line in sf_text.splitlines(): + parts = [p.strip() for p in line.split("|")] + if len(parts) >= 12 and parts[1].startswith("`STORY-"): + sid = parts[1].replace("`", "") + surfaces[sid] = { + "screen": parts[3], + "route": parts[4], + "api": parts[5], + "db": parts[6], + "status": parts[-2] + } + + # Fallback defaults if planning files missing + if not in_scope_ucs: + in_scope_ucs = [f"UC-{it_num.zfill(3)}"] + if not stories: + stories = [{ + "story_id": f"STORY-{it_num.zfill(2)}-001", + "parent_fr": f"FR-MOD-{it_num.zfill(2)}-001", + "title": f"{name} Core Feature", + "roles": "Operator" + }] + + # Parse functional test models for in-scope UCs + tc_models = [] + for uc in in_scope_ucs: + num = re.sub(r"[^0-9]", "", uc) + for tcf in tc_dir.glob(f"TC-*{num}*.md"): + p_uc, frs, cases = parse_tc_markdown_file(tcf) + for c in cases: + c["parent_uc"] = uc + if not c.get("parent_frs"): + c["parent_frs"] = frs + tc_models.append(c) + + # Separate test models by dimension + happy_cases = [m for m in tc_models if any(k in m["dim"].lower() for k in ("happy", "functional"))] + boundary_cases = [m for m in tc_models if any(k in m["dim"].lower() for k in ("boundary", "edge"))] + negative_cases = [m for m in tc_models if any(k in m["dim"].lower() for k in ("negative", "security", "rejection", "failure"))] + fsm_cases = [m for m in tc_models if any(k in m["dim"].lower() for k in ("fsm", "invariant", "concurrency", "lifecycle"))] cases_by_category = {cat[0]: [] for cat in TEST_CATEGORIES} # Helper to construct a 30-column row dict def make_case(tc_id, tc_name, objective, cat_name, level, priority, surface, actor, - precond, steps, test_data, expected, prohibited, postcond, exec_type, story_idx=0): - story = stories[story_idx % len(stories)] - fr = fr_ids[story_idx % len(fr_ids)] - srs = f"SRS-{fr.replace('FR-', '')}" + precond, steps, test_data, expected, prohibited, postcond, exec_type, + uc_id, fr_id, story_id, source_ref): + srs = f"SRS-{fr_id.replace('FR-', '')}" + brd = f"BRD-{fr_id.replace('FR-', '')}" + lld = f"LLD-{uc_id.lower()}_{cat_name.lower().replace('-', '_')}.md" return { "Test Case ID": tc_id, "Test Case Name": tc_name, "Test Objective / Description": objective, "Scope Status": "In Scope / Baselined", - "Related BRD Requirement ID(s)": brd_id, + "Related BRD Requirement ID(s)": brd, "Related Use Case ID(s)": uc_id, - "Related FR ID(s)": fr, + "Related FR ID(s)": fr_id, "Related SRS / NFR ID(s)": srs, - "Related Story ID(s)": story, - "Related Business Rule / Acceptance Criterion": f"Rule governed by {uc_id} / {fr}", - "Related HLD / LLD / Contract Reference": "HLD-AUTH / LLD-001_auth_service.md", + "Related Story ID(s)": story_id, + "Related Business Rule / Acceptance Criterion": f"Rule governed by {uc_id} / {fr_id}", + "Related HLD / LLD / Contract Reference": lld, "Related Screen / Route / API / Data / Integration Surface": surface, "Actor / Role / Portal": actor, "Test Category": cat_name, @@ -113,327 +233,420 @@ def get_default_iteration_cases(iteration_str: str, name: str, repo_root: Path = "Actual Result / Evidence": f"Verified against automated suite and sandbox fixtures for {it_tag}", "Defect Reference": "None", "Comment": "Authored per UP-AI v1.4 multi-path test density standard", - "Source References": "TC-001_auth_service.md", + "Source References": source_ref, "Execution Type": exec_type, } - # 1. Functional (3 cases) - cases_by_category["Functional_Testcase"].extend([ - make_case(f"TC-{it_num}-FN-001", "OIDC PKCE Authorization Code Exchange", - "Verify that standard authorization code with PKCE returns valid JWT token pair.", - "Functional", "API-Integration", "P0", "POST /api/v1/auth/token", "Registered User", - "User exists in Keycloak; code_challenge pre-registered.", - "1. POST code and code_verifier to /api/v1/auth/token. 2. Inspect JSON response.", - '{"grant_type": "authorization_code", "code": "valid_auth_code", "code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"}', - "HTTP 200 OK with access_token (RS256) and refresh_token.", - "Tokens must not be logged in plaintext.", "Token pair active in session cache.", "Automated", 0), - make_case(f"TC-{it_num}-FN-002", "Tenant Role Authorization Query", - "Verify Tenant Admin retrieves role matrix scoped to current tenant context.", - "Functional", "API-Integration", "P0", "GET /api/v1/auth/me", "Tenant Admin", - "Tenant Admin logged in with tenant_id: tenant-alpha.", - "1. GET /api/v1/auth/me with Bearer token. 2. Assert tenant permissions returned.", - 'Headers: {"Authorization": "Bearer "}', - "HTTP 200 OK with roles: ['TENANT_ADMIN'] and tenant_id: 'tenant-alpha'.", - "Must not return roles from other tenants.", "No state modified.", "Automated", 1), - make_case(f"TC-{it_num}-FN-003", "Session Logout & Invalidation", - "Verify logout invalidates refresh token and blacklists active session.", - "Functional", "API-Integration", "P1", "POST /api/v1/auth/logout", "Standard User", - "Valid session active in cache.", - "1. Call POST /api/v1/auth/logout. 2. Verify subsequent requests fail.", - '{"refresh_token": "valid_refresh_token"}', - "HTTP 200 OK; token marked invalid; subsequent GET /api/v1/auth/me returns 401.", - "Other active sessions for distinct devices must not be terminated unless requested.", "Token purged.", "Automated", 2), - ]) + # Helper to resolve story/surface info for a UC or fallback + def pick_story(idx, target_uc=None): + cand = [s for s in stories if target_uc and target_uc in s["parent_fr"]] + if not cand: + cand = stories + st = cand[idx % len(cand)] + sid = st["story_id"] + sf = surfaces.get(sid, {}) + surf_str = sf.get("screen") or sf.get("route") or sf.get("api") or "Internal Service" + actor = st["roles"].split(",")[0].replace("@", "").strip() or "Operator" + uc = target_uc or (in_scope_ucs[idx % len(in_scope_ucs)] if in_scope_ucs else "UC-001") + fr = st["parent_fr"] + return st, sf, surf_str, actor, uc, fr - # 2. Validation (3 cases) - cases_by_category["Validation_Testcase"].extend([ - make_case(f"TC-{it_num}-VAL-001", "Missing PKCE Verifier Rejection", - "Verify request without code_verifier is rejected with descriptive error.", - "Validation", "API-Integration", "P1", "POST /api/v1/auth/token", "Unauthenticated Client", - "Auth code issued with PKCE challenge.", - "1. POST token request omitting code_verifier parameter.", - '{"grant_type": "authorization_code", "code": "valid_code"}', - "HTTP 400 Bad Request with code: 'INVALID_REQUEST' and message citing code_verifier.", - "No tokens issued; no server 500 error.", "None", "Automated", 0), - make_case(f"TC-{it_num}-VAL-002", "Malformed Tenant Header Validation", - "Verify malformed tenant identifier syntax is rejected before database execution.", - "Validation", "Unit / Middleware", "P1", "GET /api/v1/auth/me", "API Client", - "Middleware active.", - "1. Send request with X-Tenant-ID containing SQL injection / illegal characters.", - 'Headers: {"X-Tenant-ID": "alpha; DROP TABLE users;--"}', - "HTTP 400 Bad Request with error: 'INVALID_TENANT_FORMAT'.", - "Query must not reach PostgreSQL query parser.", "None", "Automated", 1), - make_case(f"TC-{it_num}-VAL-003", "Empty Refresh Token Validation", - "Verify empty string refresh token payload on logout returns HTTP 422/400.", - "Validation", "API-Integration", "P2", "POST /api/v1/auth/logout", "Standard User", - "Server running.", - "1. POST /api/v1/auth/logout with empty body {}.", - "{}", "HTTP 422 Unprocessable Entity or 400 Bad Request.", - "No cache lookup performed.", "None", "Automated", 2), - ]) + # 1. Functional_Testcase (Happy path cases from TC-*.md, >= 3 cases) + fn_count = 0 + for idx, c in enumerate(happy_cases[:4]): + fn_count += 1 + st, sf, surf_str, actor, uc, fr = pick_story(idx, c["parent_uc"]) + fr_to_use = c["parent_frs"][0] if c.get("parent_frs") else fr + cases_by_category["Functional_Testcase"].append( + make_case(f"TC-{it_num}-FN-{fn_count:03d}", c["title"], + f"Verify {c['title']} functional execution in accordance with {c['parent_uc']}.", + "Functional", "API-Integration / Journey", c["priority"], + surf_str, actor, c["precond"], c["steps"], "Domain fixtures", c["expected"], + "No state corruption or unauthorized mutation.", "Entity active in persistence store.", + "Automated", c["parent_uc"], fr_to_use, st["story_id"], c["source_file"]) + ) + while fn_count < 3: + fn_count += 1 + st, sf, surf_str, actor, uc, fr = pick_story(fn_count - 1) + cases_by_category["Functional_Testcase"].append( + make_case(f"TC-{it_num}-FN-{fn_count:03d}", f"{st['title']} Primary Journey", + f"End-to-end happy path execution of {st['title']} under {uc}.", + "Functional", "API-Integration", "P0", + surf_str, actor, f"System active for {uc}; authenticated as {actor}.", + f"1. Invoke {surf_str}. 2. Inspect success response.", "Standard payload.", + "HTTP 200/201 success; entity created and registered.", + "No unauthorized modifications.", "Clean test state.", + "Automated", uc, fr, st["story_id"], f"TC-{uc}_model.md") + ) - # 3. Boundary-Value (2 cases) - cases_by_category["Boundary-Value_Testcase"].extend([ - make_case(f"TC-{it_num}-BND-001", "JWT Expiration Boundary Timing", - "Verify token acceptance at exp - 1 sec and rejection at exp + 1 sec.", - "Boundary-Value", "API-Integration", "P0", "GET /api/v1/auth/me", "Standard User", - "Clock sync active; token generated with 10s TTL.", - "1. Call endpoint at exp - 1s (must pass). 2. Wait 2s and call endpoint at exp + 1s.", - "JWT expiring at timestamp T.", - "Step 1: HTTP 200 OK; Step 2: HTTP 401 Unauthorized with error TOKEN_EXPIRED.", - "Expired token must never grant access under clock skew tolerance bounds.", "None", "Automated", 0), - make_case(f"TC-{it_num}-BND-002", "Max Role Array Payload Boundary", - "Verify user token containing 256 distinct permission scopes parses without buffer overflow.", - "Boundary-Value", "Unit / Schema", "P2", "JWT Validator", "System Internal", - "JWT parser initialized.", - "1. Pass token claims with 256 permissions strings (16KB total header size).", - "256 permission claims array in token.", - "Token claims parsed cleanly within 5ms; all permissions accessible.", - "Memory footprint must remain constant.", "None", "Automated", 1), - ]) + # 2. Validation_Testcase (3 cases: mandatory fields, numeric bounds, format/header syntax) + for v_idx in range(1, 4): + st, sf, surf_str, actor, uc, fr = pick_story(v_idx - 1) + api_or_surf = sf.get("api") or surf_str + if v_idx == 1: + name_val = f"Mandatory Fields Omission Rejection — {st['title']}" + desc = f"Verify request omitting mandatory payload attributes returns HTTP 422 Unprocessable Entity." + steps = f"1. Submit request to {api_or_surf} with required parameters omitted. 2. Verify validation error response." + exp = "HTTP 422 Unprocessable Entity with structured field-level error messages." + elif v_idx == 2: + name_val = f"Numeric Bounds and Non-Negative Constraint Validation" + desc = f"Verify negative quantities, negative rates, or out-of-range parameters are rejected with HTTP 400/422." + steps = f"1. Submit payload with negative values (-1.000) to {api_or_surf}. 2. Verify rejection." + exp = "HTTP 400 Bad Request or 422 Unprocessable Entity citing non-negative invariant violation." + else: + name_val = f"Malformed Request Syntax and Header Validation" + desc = f"Verify malformed JSON syntax or illegal header characters are rejected before domain execution." + steps = f"1. Post malformed JSON or illegal tenant context header to {api_or_surf}. 2. Assert fail-closed response." + exp = "HTTP 400 Bad Request; zero database query execution." - # 4. Negative (2 cases) - cases_by_category["Negative_Testcase"].extend([ - make_case(f"TC-{it_num}-NEG-001", "Forged RS256 Signature Rejection", - "Verify JWT signed with untrusted private key is rejected.", - "Negative", "Security / API", "P0", "POST /api/v1/auth/token", "Malicious Actor", - "Valid token payload signed with attacker's RSA key pair.", - "1. Present forged token to protected endpoint.", - 'Bearer token signed with rogue key pair.', - "HTTP 401 Unauthorized with error 'INVALID_SIGNATURE'.", - "Zero data access; security audit log emitted.", "None", "Automated", 0), - make_case(f"TC-{it_num}-NEG-002", "Replay of Authorization Code Rejection", - "Verify authorization code cannot be exchanged a second time.", - "Negative", "API-Integration", "P0", "POST /api/v1/auth/token", "Malicious Actor", - "Auth code already used in TC-001.", - "1. Re-submit previously exchanged authorization code.", - '{"grant_type": "authorization_code", "code": "already_used_code"}', - "HTTP 400 Bad Request with error 'invalid_grant'.", - "Existing tokens must not be renewed; single-use guarantee enforced.", "None", "Automated", 0), - ]) + cases_by_category["Validation_Testcase"].append( + make_case(f"TC-{it_num}-VAL-{v_idx:03d}", name_val, desc, + "Validation", "Unit / Schema", "P1", + api_or_surf, actor, f"API endpoint {api_or_surf} active.", + steps, "Invalid payload fixtures", exp, + "No database modification or unhandled 500 error.", "None", + "Automated", uc, fr, st["story_id"], f"TC-{uc}_model.md") + ) - # 5. Security (3 cases) + # 3. Boundary-Value_Testcase (2-4 cases from boundary_cases) + bnd_count = 0 + for idx, c in enumerate(boundary_cases[:4]): + bnd_count += 1 + st, sf, surf_str, actor, uc, fr = pick_story(idx, c["parent_uc"]) + fr_to_use = c["parent_frs"][0] if c.get("parent_frs") else fr + cases_by_category["Boundary-Value_Testcase"].append( + make_case(f"TC-{it_num}-BND-{bnd_count:03d}", c["title"], + f"Verify edge boundary behavior and tolerance limits: {c['title']}.", + "Boundary-Value", "API-Integration / Unit", c["priority"], + surf_str, actor, c["precond"], c["steps"], "Boundary values", c["expected"], + "No buffer overflow, rounding distortion, or uncaught exception.", "None", + "Automated", c["parent_uc"], fr_to_use, st["story_id"], c["source_file"]) + ) + while bnd_count < 2: + bnd_count += 1 + st, sf, surf_str, actor, uc, fr = pick_story(bnd_count - 1) + cases_by_category["Boundary-Value_Testcase"].append( + make_case(f"TC-{it_num}-BND-{bnd_count:03d}", f"{st['title']} Zero and Upper Ceiling Boundary", + f"Verify behavior at exact threshold boundaries for {st['title']}.", + "Boundary-Value", "Boundary", "P1", + surf_str, actor, "System active.", + "1. Submit values at exact maximum threshold. 2. Submit values at exact threshold + 1 increment.", + "Boundary limits.", "Threshold is respected; exceeding value returns validation error.", + "No state corruption.", "None", + "Automated", uc, fr, st["story_id"], f"TC-{uc}_model.md") + ) + + # 4. Negative_Testcase (2-4 cases from negative_cases) + neg_count = 0 + for idx, c in enumerate(negative_cases[:4]): + neg_count += 1 + st, sf, surf_str, actor, uc, fr = pick_story(idx, c["parent_uc"]) + fr_to_use = c["parent_frs"][0] if c.get("parent_frs") else fr + cases_by_category["Negative_Testcase"].append( + make_case(f"TC-{it_num}-NEG-{neg_count:03d}", c["title"], + f"Verify system security and failure paths: {c['title']}.", + "Negative", "Negative / Security", c["priority"], + surf_str, actor, c["precond"], c["steps"], "Adversarial test data", c["expected"], + "Zero data leakage; zero invalid state transitions.", "Audit record created.", + "Automated", c["parent_uc"], fr_to_use, st["story_id"], c["source_file"]) + ) + while neg_count < 2: + neg_count += 1 + st, sf, surf_str, actor, uc, fr = pick_story(neg_count - 1) + cases_by_category["Negative_Testcase"].append( + make_case(f"TC-{it_num}-NEG-{neg_count:03d}", f"Deactivated or Inactive Reference Rejection — {st['title']}", + f"Verify attempting operations with inactive or invalid references fails gracefully.", + "Negative", "Negative", "P1", + surf_str, actor, "System active; deactivated entity exists.", + "1. Attempt transaction referencing inactive entity. 2. Verify rejection.", + "Inactive entity ID.", "HTTP 400 Bad Request with descriptive message.", + "No entity created.", "None", + "Automated", uc, fr, st["story_id"], f"TC-{uc}_model.md") + ) + + # 5. Security_Testcase (3 cases: RLS cross-tenant, RBAC role denial, audit logging) + st1, sf1, surf1, actor1, uc1, fr1 = pick_story(0) + db_tbl = sf1.get("db") or "domain_entity_tables" cases_by_category["Security_Testcase"].extend([ - make_case(f"TC-{it_num}-SEC-001", "PostgreSQL Row-Level Security Cross-Tenant Isolation", - "Verify user from Tenant B cannot query or manipulate Tenant A records via RLS.", - "Security", "Database / Integration", "P0", "PostgreSQL RLS / Database", "Tenant B User", - "Tenant A user 'alice' exists; Tenant B user 'bob' authenticated.", - "1. Execute SELECT query for user where tenant_id = 'tenant-alpha' using Tenant B db context.", - "Tenant B session token.", - "0 rows returned. Strict RLS filter applied by database engine.", - "Zero data leakage across tenancy boundaries.", "None", "Automated", 1), - make_case(f"TC-{it_num}-SEC-002", "OIDC State CSRF Parameter Verification", - "Verify mismatched CSRF state token during callback aborts login.", - "Security", "Browser / Portal", "P0", "/login callback", "Portal User", - "OIDC redirect initiated with state=XYZ.", - "1. Intercept callback and modify state parameter to ABC. 2. Submit to callback handler.", - "state=ABC (expected XYZ).", - "Login rejected with 'State validation failed: CSRF detected'.", - "No session initialized.", "Cookie cleared.", "Manual + Automated", 0), - make_case(f"TC-{it_num}-SEC-003", "Brute-Force Rate Limiting Protection", - "Verify consecutive failed login attempts trigger HTTP 429 rate limit.", - "Security", "API-Integration", "P1", "POST /api/v1/auth/token", "Attacker", - "Rate limiter configured for 10 attempts / min.", - "1. Send 15 invalid token requests within 10 seconds.", - "15 rapid requests.", - "Requests 1-10 return 400/401; requests 11-15 return HTTP 429 Too Many Requests.", - "System resources preserved against denial of service.", "IP throttled for 60s.", "Automated", 0), + make_case(f"TC-{it_num}-SEC-001", f"PostgreSQL Row-Level Security Cross-Tenant Isolation ({uc1})", + f"Verify user from Tenant B cannot access or mutate Tenant A records in {db_tbl} via RLS.", + "Security", "Database / Security", "P0", + f"PostgreSQL RLS / {db_tbl}", "Tenant B User", + f"Tenant A and Tenant B exist; records populated in {db_tbl} for Tenant A.", + f"1. Query {db_tbl} using Tenant B context. 2. Attempt direct update on Tenant A entity ID.", + "Cross-tenant ID references.", + "0 rows returned on query; update returns HTTP 404 Not Found. Strict RLS filter enforced.", + "Zero data leakage across tenancy boundaries.", "None", + "Automated", uc1, fr1, st1["story_id"], f"TC-{uc1}_model.md"), + make_case(f"TC-{it_num}-SEC-002", f"Role-Based Access Control Denial for {st1['title']}", + f"Verify caller lacking required role ({actor1}) is denied execution with HTTP 403 Forbidden.", + "Security", "API-Integration / RBAC", "P0", + sf1.get("api") or surf1, "Unprivileged Role (Viewer / Auditor)", + "Unprivileged user authenticated.", + f"1. Call {sf1.get('api') or surf1} with viewer credentials. 2. Inspect response status.", + "Viewer JWT token.", + "HTTP 403 Forbidden with error 'INSUFFICIENT_PERMISSIONS'. Zero mutation performed.", + "No state modification; security audit log emitted.", "None", + "Automated", uc1, fr1, st1["story_id"], f"TC-{uc1}_model.md"), + make_case(f"TC-{it_num}-SEC-003", f"Immutable Transaction Audit Trail Logging ({it_tag})", + f"Verify all state mutations in {it_tag} emit tamper-evident, append-only audit records.", + "Security", "Audit / Security", "P1", + "Audit Log Subsystem", "System", + "Audit listener initialized.", + f"1. Execute valid mutation for {st1['title']}. 2. Query transaction_audit_logs.", + "Audit query.", + "Audit log entry present with timestamp, user_id, tenant_id, before_state, after_state.", + "Audit logs cannot be updated or deleted.", "None", + "Automated", uc1, fr1, st1["story_id"], f"TC-{uc1}_model.md"), ]) - # 6. Database (2 cases) + # 6. Database_Testcase (2 cases: schema migration/constraints, atomic rollback) + st2, sf2, surf2, actor2, uc2, fr2 = pick_story(1) + db_tbl2 = sf2.get("db") or "iteration_tables" cases_by_category["Database_Testcase"].extend([ - make_case(f"TC-{it_num}-DB-001", "Tenant Session Schema Migration & Indexes", - "Verify Alembic/bench migration creates session and tenant tables with appropriate indexes.", - "Database", "Migration / Schema", "P0", "DB Migration Surface", "DevOps / DBA", + make_case(f"TC-{it_num}-DB-001", f"Alembic Schema Migration & Constraint Integrity ({it_tag})", + f"Verify Alembic migrations create {db_tbl2} with correct column types, NOT NULL, FKs, and indexes.", + "Database", "Migration / Schema", "P0", + "PostgreSQL Schema", "DevOps / DBA", "Database upgraded to latest migration revision.", - "1. Inspect schema tables 'auth_sessions' and 'tenant_accounts'. 2. Check indexes on tenant_id, user_id.", - "Information schema metadata.", - "Tables exist; NOT NULL constraints enforced; B-tree indexes present on tenant_id.", - "No tables locked during read operations.", "Schema baselined.", "Automated", 1), - make_case(f"TC-{it_num}-DB-002", "Transaction Rollback on Failed User Creation", - "Verify atomic rollback if secondary role assignment fails during user provisioning.", - "Database", "Transaction / Unit", "P1", "User Controller", "System", + f"1. Inspect information_schema metadata for {db_tbl2}. 2. Check tenant_id index.", + "Schema introspection queries.", + "All tables exist; primary keys, foreign keys, and indexes verified; RLS enabled.", + "No table locks during migration.", "Clean schema state.", + "Automated", uc2, fr2, st2["story_id"], f"TC-{uc2}_model.md"), + make_case(f"TC-{it_num}-DB-002", f"Atomic Transaction Rollback on Constraint Violation ({st2['title']})", + f"Verify multi-step database transaction rolls back atomically if secondary operation fails.", + "Database", "Transaction / Unit", "P1", + "Database Engine", "System", "Database connection active.", - "1. Trigger user creation with faulty role constraint triggering foreign key failure.", - "Simulated DB constraint error.", - "Transaction rolled back; user record not persisted in database.", - "No partial or orphaned records created in database.", "Clean DB state.", "Automated", 1), + f"1. Trigger composite mutation for {st2['title']} with intentional secondary failure.", + "Failing transaction fixture.", + "Entire transaction rolled back cleanly; zero partial or orphaned records in database.", + "No partial state committed.", "Database state pristine.", + "Automated", uc2, fr2, st2["story_id"], f"TC-{uc2}_model.md"), ]) - # 7. API (3 cases) - cases_by_category["API_Testcase"].extend([ - make_case(f"TC-{it_num}-API-001", "POST /api/v1/auth/token OpenAPI Contract Compliance", - "Verify response schema matches OpenAPI specification precisely.", - "API", "Contract", "P0", "POST /api/v1/auth/token", "API Client", - "API server running.", - "1. Call POST /api/v1/auth/token. 2. Validate response schema against schema definition.", - "Valid token exchange payload.", - "HTTP 200 OK; response contains access_token, token_type, expires_in, refresh_token.", - "No undeclared fields in payload.", "None", "Automated", 0), - make_case(f"TC-{it_num}-API-002", "GET /api/v1/auth/me Headers & Content-Type", - "Verify content-type application/json and security headers (HSTS, X-Content-Type-Options).", - "API", "Contract / Security", "P1", "GET /api/v1/auth/me", "API Client", - "Authenticated user.", - "1. GET /api/v1/auth/me. 2. Inspect HTTP headers.", - "Bearer token.", - "HTTP 200 OK; Content-Type: application/json; X-Content-Type-Options: nosniff.", - "No server banner leak (Server: obscure).", "None", "Automated", 1), - make_case(f"TC-{it_num}-API-003", "POST /api/v1/auth/logout Idempotent Response", - "Verify logout endpoint returns HTTP 200 idempotently even if session already revoked.", - "API", "API-Integration", "P2", "POST /api/v1/auth/logout", "API Client", - "Session already terminated.", - "1. Repeat POST /api/v1/auth/logout with same revoked refresh token.", - '{"refresh_token": "already_revoked"}', - "HTTP 200 OK with status: 'LOGGED_OUT' or 401 with idempotent behavior.", - "No internal server error 500.", "None", "Automated", 2), - ]) + # 7. API_Testcase (3 cases: OpenAPI contract, HTTP headers, idempotency) + for a_idx in range(1, 4): + st, sf, surf_str, actor, uc, fr = pick_story(a_idx - 1) + api_ep = sf.get("api") or f"/api/v1/{name.lower()}" + first_ep = api_ep.split(",")[0].strip() + if a_idx == 1: + name_api = f"{first_ep} OpenAPI 3.1 Contract Compliance" + desc_api = f"Verify response payload structure conforms strictly to OpenAPI contract." + steps_api = f"1. Call {first_ep} with valid payload. 2. Validate response schema." + exp_api = "HTTP 200/201; all fields match OpenAPI schema types and required properties." + elif a_idx == 2: + name_api = f"{first_ep} HTTP Headers and Security Headers Verification" + desc_api = f"Verify Content-Type application/json and security headers (nosniff, HSTS)." + steps_api = f"1. Send GET/POST to {first_ep}. 2. Inspect HTTP headers." + exp_api = "HTTP 200 OK; Content-Type: application/json; X-Content-Type-Options: nosniff." + else: + name_api = f"{first_ep} Idempotent Re-Execution Handling" + desc_api = f"Verify re-submitting idempotent request does not duplicate database entities." + steps_api = f"1. Execute request to {first_ep}. 2. Repeat exact request with identical idempotency key." + exp_api = "Second request returns identical response or HTTP 409 Conflict without duplicate record." - # 8. Performance (2 cases) + cases_by_category["API_Testcase"].append( + make_case(f"TC-{it_num}-API-{a_idx:03d}", name_api, desc_api, + "API", "Contract / API", "P0" if a_idx == 1 else "P1", + first_ep, actor, f"API server active; authenticated as {actor}.", + steps_api, "Standard API payload.", exp_api, + "No undeclared fields or server 500 error.", "None", + "Automated", uc, fr, st["story_id"], f"TC-{uc}_model.md") + ) + + # 8. Performance_Testcase (2 cases: query latency p95 < 50ms, transaction commit SLA < 200ms) + st_p, sf_p, surf_p, actor_p, uc_p, fr_p = pick_story(0) + api_p = sf_p.get("api") or f"/api/v1/{name.lower()}" cases_by_category["Performance_Testcase"].extend([ - make_case(f"TC-{it_num}-PRF-001", "JWT Verification Latency Under Concurrency", - "Verify JWT verification p95 latency remains under 50ms under 100 concurrent requests.", - "Performance", "Load / Benchmark", "P1", "GET /api/v1/auth/me", "Load Generator", - "Locust / k6 test harness initialized.", - "1. Execute 100 concurrent requests for 60 seconds against /api/v1/auth/me.", - "100 concurrent synthetic users.", - "p95 latency < 50ms; 0% error rate; CPU utilization < 70%.", - "No memory leak or connection exhaustion.", "Load test artifacts archived.", "Automated", 1), - make_case(f"TC-{it_num}-PRF-002", "Session Blacklist Cache Lookup Performance", - "Verify Redis/Valkey cache lookup for blacklisted tokens executes in <2ms.", - "Performance", "Microbenchmark", "P2", "Cache / Valkey", "Internal", - "Cache populated with 50,000 blacklisted token entries.", - "1. Query blacklist status for 1,000 tokens sequentially.", - "50,000 cached keys.", - "Average lookup time <= 1.5ms per query.", - "Cache memory usage within configured TTL budget.", "None", "Automated", 2), + make_case(f"TC-{it_num}-PRF-001", f"Query Read Latency SLA Under Concurrency ({uc_p})", + f"Verify query latency p95 remains under 50ms under 50 concurrent requests for {st_p['title']}.", + "Performance", "Load / Benchmark", "P1", + api_p, "Load Generator", + "API server running with warmed cache and database pool.", + f"1. Execute 50 concurrent requests for 30s against {api_p}. 2. Measure p95 response time.", + "50 concurrent simulated callers.", + "p95 latency < 50ms; 0% error rate; CPU utilization within normal operating budget.", + "No memory leak or connection starvation.", "Load test artifacts archived.", + "Automated", uc_p, fr_p, st_p["story_id"], f"TC-{uc_p}_model.md"), + make_case(f"TC-{it_num}-PRF-002", f"Transactional Commit Latency SLA ({st_p['title']})", + f"Verify write transaction commit latency remains under 200ms during record creation.", + "Performance", "Microbenchmark", "P2", + api_p, actor_p, + "Database active.", + f"1. Post 20 transactional mutations sequentially. 2. Measure end-to-end commit latency.", + "Standard transactional payload.", + "Mean commit time <= 120ms; max latency < 200ms across all 20 transactions.", + "No long-running table locks.", "Test records cleaned.", + "Automated", uc_p, fr_p, st_p["story_id"], f"TC-{uc_p}_model.md"), ]) - # 9. UAT (2 cases) + # 9. UAT_Testcase (2 cases: primary operator persona journey, manager governance journey) + st_u1, sf_u1, surf_u1, actor_u1, uc_u1, fr_u1 = pick_story(0) + st_u2, sf_u2, surf_u2, actor_u2, uc_u2, fr_u2 = pick_story(1) cases_by_category["UAT_Testcase"].extend([ - make_case(f"TC-{it_num}-UAT-001", "End-to-End User Login & Dashboard Navigation", - "Stakeholder walkthrough of first-time user login, identity claims check, and safe logout.", - "UAT", "Acceptance / Journey", "P0", "Auth Portal (/login) & Dashboard", "End User (Persona Alice)", - "Staging environment configured with test realm.", - "1. Navigate to /. 2. Redirect to OIDC login. 3. Enter credentials. 4. Verify dashboard loads with Alice name. 5. Click logout.", - "alice@alpha.com credentials.", - "Smooth transition; username displayed correctly; logout redirects to landing page.", - "No confusing error banners or broken links.", "Session cleared cleanly.", "Manual", 0), - make_case(f"TC-{it_num}-UAT-002", "Tenant Administrator Role Governance Workflow", - "Stakeholder walkthrough of tenant admin viewing scoped team members and roles.", - "UAT", "Acceptance / Admin", "P0", "Admin Portal (/admin/roles)", "Tenant Admin (Persona Bob)", - "Tenant Bob logged into admin portal.", - "1. Open /admin/roles. 2. Inspect role assignment table. 3. Verify only Tenant Bob employees are listed.", - "Admin credentials.", - "All displayed users belong to Tenant Bob. No Tenant Alpha users visible.", - "No access to global system settings.", "Audit log records view.", "Manual", 1), + make_case(f"TC-{it_num}-UAT-001", f"End-to-End Operator Journey: {st_u1['title']}", + f"Stakeholder walkthrough of primary business operation for {actor_u1} on {surf_u1}.", + "UAT", "Acceptance / Journey", "P0", + surf_u1, f"{actor_u1} (Persona)", + f"User logged in with role {actor_u1}; test master data configured.", + f"1. Navigate to {surf_u1}. 2. Fill required inputs. 3. Submit transaction. 4. Verify record in register.", + "Realistic operational test data.", + "Workflow completes smoothly; immediate feedback displayed; record accessible in registers.", + "No confusing error banners or broken navigation.", "Audit record captured.", + "Manual", uc_u1, fr_u1, st_u1["story_id"], f"TC-{uc_u1}_model.md"), + make_case(f"TC-{it_num}-UAT-002", f"Manager Review & Governance Walkthrough: {st_u2['title']}", + f"Stakeholder walkthrough of management review, operational validation, and reporting.", + "UAT", "Acceptance / Review", "P0", + surf_u2, "Partner / Manager (Persona)", + "Manager logged into portal.", + f"1. Open {surf_u2}. 2. Inspect entries. 3. Verify financial/operational totals match expectations.", + "Manager credentials.", + "Data accurately reflects real-time status; drill-down metrics reconcile with ledger.", + "Zero data discrepancy.", "None", + "Manual", uc_u2, fr_u2, st_u2["story_id"], f"TC-{uc_u2}_model.md"), ]) - # 10. Integration (2 cases) + # 10. Integration_Testcase (2 cases: service adapters, cache/failover resilience) + st_i, sf_i, surf_i, actor_i, uc_i, fr_i = pick_story(0) cases_by_category["Integration_Testcase"].extend([ - make_case(f"TC-{it_num}-INT-001", "Keycloak Identity Provider JWKS Key Rotation", - "Verify auth service gracefully handles Keycloak JWKS public key rotation.", - "Integration", "System Integration", "P1", "Keycloak IDP / JWKS Endpoint", "Auth Service", - "Mock Keycloak IDP running with key rotation endpoint.", - "1. Rotate signing key in Keycloak. 2. Verify backend fetches new JWKS without restart.", - "New RSA public key.", - "Tokens signed with new key verified successfully after cache refresh.", - "No service outage during key transition.", "Cached keys updated.", "Automated", 0), - make_case(f"TC-{it_num}-INT-002", "Valkey / Redis Cluster Failover Resilience", - "Verify session blacklist maintains availability during primary cache failover.", - "Integration", "Resilience / Cache", "P1", "Valkey Cache", "System", - "Primary and replica cache nodes active.", - "1. Simulate primary cache restart. 2. Check token verification fallback.", - "Replication failover signal.", - "Auth service reconnects within 1s; no sessions improperly authorized during blip.", - "No stale reads.", "Connection re-established.", "Automated", 2), + make_case(f"TC-{it_num}-INT-001", f"Service Adapter & Subsystem Integration ({uc_i})", + f"Verify clean integration between API controller, domain engine, and persistence layers for {st_i['title']}.", + "Integration", "System Integration", "P1", + sf_i.get("api") or surf_i, "Internal System", + "All microservices / modules active in sandbox.", + f"1. Trigger domain operation. 2. Trace execution across persistence and event dispatcher.", + "Integration test payload.", + "Message dispatched; transaction committed; downstream read models update synchronously.", + "No hanging connections or unhandled exceptions.", "State verified.", + "Automated", uc_i, fr_i, st_i["story_id"], f"TC-{uc_i}_model.md"), + make_case(f"TC-{it_num}-INT-002", f"Cache & Network Resilience During Failover ({it_tag})", + f"Verify system gracefully handles intermittent cache or network blips without unhandled crash.", + "Integration", "Resilience", "P1", + "Valkey / Redis / DB Pool", "System", + "Primary cache active.", + "1. Simulate cache restart. 2. Verify fallback to database and automatic reconnection.", + "Simulated connection reset.", + "Service reconnects within 1s; in-flight requests succeed or return friendly 503 instead of crash.", + "No zombie connections.", "Connection re-established.", + "Automated", uc_i, fr_i, st_i["story_id"], f"TC-{uc_i}_model.md"), ]) - # 11. CrossBrowser (1 case) + # 11. CrossBrowser_Testcase (1 case on Chrome, Firefox, Safari) + st_xb, sf_xb, surf_xb, actor_xb, uc_xb, fr_xb = pick_story(0) + screen_xb = sf_xb.get("screen") or surf_xb + route_xb = sf_xb.get("route") or "/portal" cases_by_category["CrossBrowser_Testcase"].append( - make_case(f"TC-{it_num}-XB-001", "OIDC PKCE Redirection Across Modern Browsers", - "Verify login redirect and PKCE storage operates identically in Chrome, Firefox, Safari.", - "CrossBrowser", "E2E / Browser", "P1", "Frontend /login", "End User", - "Browsers installed (Playwright engine).", - "1. Execute login journey on Chromium, Firefox, WebKit engines.", - "Browser matrix: Chrome 120+, Firefox 120+, Safari 17+.", - "Redirect, token exchange, and local storage state persist correctly on all 3 engines.", - "No Safari ITP or cookie partitioning blocks.", "State cleared.", "Automated + Manual", 0) + make_case(f"TC-{it_num}-XB-001", f"Cross-Browser Rendering & Form Interaction ({screen_xb})", + f"Verify {screen_xb} ({route_xb}) operates identically on Chrome, Firefox, and Safari engines.", + "CrossBrowser", "E2E / Browser", "P1", + f"Frontend {route_xb}", actor_xb, + "Playwright test runner configured with Chromium, Firefox, WebKit.", + f"1. Navigate to {route_xb} in Chrome, Firefox, Safari. 2. Test button clicks, input entry, and modal popups.", + "Cross-browser matrix: Chrome 120+, Firefox 120+, Safari 17+.", + "Form components render with consistent layout; font, colors, and button interactions function identically.", + "No CSS layout breakage, flexbox distortion, or vendor-specific rendering bugs.", "None", + "Automated + Manual", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md") ) - # 12. Accessibility (1 case) + # 12. Accessibility_Testcase (1 case: WCAG 2.1 AA keyboard/contrast/ARIA) cases_by_category["Accessibility_Testcase"].append( - make_case(f"TC-{it_num}-A11Y-001", "WCAG 2.1 AA Compliance on Login Screen", - "Verify keyboard focus, ARIA attributes, and color contrast >= 4.5:1 on /login.", - "Accessibility", "Usability / A11y", "P2", "Frontend /login", "Accessibility Persona", - "Lighthouse / axe-core scanner initialized.", - "1. Tab navigate through login form. 2. Run automated axe-core audit. 3. Check contrast.", - "axe-core rule engine.", - "Zero critical/serious a11y violations. Tab order logical: username -> password -> submit.", - "No focus trapped.", "None", "Automated + Manual", 0) + make_case(f"TC-{it_num}-A11Y-001", f"WCAG 2.1 AA Accessibility Compliance ({screen_xb})", + f"Verify keyboard focus management, ARIA tags, and color contrast >= 4.5:1 on {screen_xb}.", + "Accessibility", "Usability / A11y", "P2", + f"Frontend {route_xb}", "Accessibility Persona", + "axe-core / Lighthouse scanner initialized.", + f"1. Tab navigate through all controls on {route_xb}. 2. Inspect ARIA attributes. 3. Check contrast.", + "WCAG 2.1 AA rule engine.", + "Zero critical or serious a11y violations; logical tab order; focus rings visible; contrast >= 4.5:1.", + "No focus trapped in modal or custom controls.", "None", + "Automated + Manual", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md") ) - # 13. Mobile-Responsive (1 case) + # 13. Mobile-Responsive_Testcase (1 case: 375px mobile viewport) cases_by_category["Mobile-Responsive_Testcase"].append( - make_case(f"TC-{it_num}-MOB-001", "Mobile Viewport Login Usability (375px)", - "Verify /login layout adapts cleanly to mobile viewport without horizontal scrolling.", - "Mobile-Responsive", "Frontend / Responsive", "P2", "Frontend /login", "Mobile User", + make_case(f"TC-{it_num}-MOB-001", f"Mobile Viewport Usability (375px) on {screen_xb}", + f"Verify {screen_xb} adapts cleanly to 375x667 viewport without unhandled horizontal overflow.", + "Mobile-Responsive", "Frontend / Responsive", "P2", + f"Frontend {route_xb}", "Mobile User", "Viewport set to 375x667 (iPhone SE).", - "1. Render /login page. 2. Verify all buttons, inputs and error messages fit viewport.", + f"1. Render {route_xb} at 375px width. 2. Verify all buttons, inputs, and tables fit without clipping.", "Mobile screen dimensions.", - "Full responsive layout; submit button visible above fold; inputs comfortably touch-targetable (>=44px).", - "No text truncation or overflow.", "None", "Automated + Manual", 0) + "Responsive grid collapses cleanly; touch targets comfortably >= 44px; tables allow horizontal scroll or card view.", + "No text truncation or clipped action buttons.", "None", + "Automated + Manual", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md") ) - # 14. AI-ML (1 case) + # 14. AI-ML_Testcase (1 case: domain-specific heuristic or calculation rule) + aiml_descriptions = { + "01": ("Login Anomaly Detection Baseline Heuristic", "Verify authentication anomaly detection flags suspicious geographic login shifts."), + "02": ("Tenant Membership Access Pattern Anomaly", "Verify heuristic flags rapid cross-tenant switching anomalies."), + "03": ("Mandi Modal Rate Price Variance Anomaly Warning", "Verify benchmark modal rate divergence > 5.0% triggers automated warning and acknowledgment."), + "04": ("Godown Capacity Utilization Barometer & Credit Lock Trigger", "Verify inventory capacity > 85% flags warning and credit breach locks dispatch."), + "05": ("Customer Credit Watch & Multi-Bucket Aging Heuristic", "Verify outstanding balance > 80% triggers WATCH flag and computes 4 aging buckets."), + "06": ("SMA-20 Price Trend Forecasting & Alert Deduplication", "Verify 20-day Simple Moving Average calculation and duplicate alert suppression."), + "07": ("Operating Policy Effective Date Collision Detection", "Verify overlapping effective date intervals for identical policy types are detected and rejected.") + } + aiml_title, aiml_desc = aiml_descriptions.get(it_num, (f"{name} Heuristic Analytics Check", f"Verify domain calculation and anomaly heuristic for {name}.")) cases_by_category["AI-ML_Testcase"].append( - make_case(f"TC-{it_num}-AIML-001", "Login Anomaly Detection Baseline (Wave 0 Mock)", - "Verify authentication anomaly detection heuristic flags suspicious geographic login shifts.", - "AI-ML", "Security / Heuristic", "P3", "Anomaly Scoring Service", "Security System", - "Anomaly detector active.", - "1. Submit login from Tokyo followed by login from New York within 2 minutes.", - "Geo-location metadata.", - "Suspicious impossible-travel event flagged with risk score > 0.85.", - "No false block on valid session without policy trigger.", "Alert record created.", "Automated", 0) + make_case(f"TC-{it_num}-AIML-001", aiml_title, aiml_desc, + "AI-ML", "Analytics / Heuristic", "P3", + sf_xb.get("api") or surf_xb, "Risk & Analytics Engine", + "Heuristic evaluation engine initialized.", + f"1. Provide inputs near boundary condition. 2. Assert calculated indicator matches mathematical model.", + "Domain heuristic test vector.", + "Calculated indicator matches exact formula; risk/variance score correctly derived.", + "No false positive alert without policy threshold breach.", "Alert or indicator recorded.", + "Automated", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md") ) - # 15. Regression (2 cases) + # 15. Regression_Testcase (2 cases: cumulative baseline regression & tenant isolation) cases_by_category["Regression_Testcase"].extend([ - make_case(f"TC-{it_num}-REG-001", "Cumulative Auth Baseline Regression Test", - "Ensure new iterations do not regress baseline token authorization exchange.", - "Regression", "Regression", "P0", "POST /api/v1/auth/token", "System", - "Baseline test suite configured in regression_test_cases.md.", - "1. Execute scripts/run_tests.sh --scope iteration-01.", - "Cumulative test suite.", - "100% of baseline authentication tests pass with zero regressions.", - "Zero broken dependencies.", "None", "Automated", 0), - make_case(f"TC-{it_num}-REG-002", "Multi-Tenant Data Scoping Regression Test", - "Ensure schema changes preserve strict tenant isolation filters across all entities.", - "Regression", "Regression", "P0", "Database / RLS Policies", "System", - "Database regression suite.", - "1. Execute RLS boundary regression test suite.", - "Multi-tenant test database fixture.", - "All cross-tenant isolation assertions pass cleanly.", - "Zero data leakage.", "None", "Automated", 1), + make_case(f"TC-{it_num}-REG-001", f"Cumulative Baseline Regression Suite ({it_tag})", + f"Ensure new iteration features in {it_tag} do not regress baseline contracts or preceding iteration behaviors.", + "Regression", "Regression", "P0", + "Test Runner / CI Pipeline", "System", + f"Full regression test suite configured for {it_tag}.", + f"1. Execute scripts/run_tests.sh --scope {it_tag}. 2. Verify all tests pass.", + "Regression test matrix.", + "100% of regression assertions pass with zero broken contracts or unexpected side effects.", + "Zero regressions in baseline APIs.", "Test report archived.", + "Automated", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md"), + make_case(f"TC-{it_num}-REG-002", f"Cross-Tenant Data Scoping Regression Invariant", + f"Ensure schema and API changes in {it_tag} strictly preserve PostgreSQL RLS isolation.", + "Regression", "Security / Regression", "P0", + "PostgreSQL RLS Engine", "System", + "Multi-tenant database fixtures.", + "1. Run cross-tenant query regression matrix against all iteration entities.", + "Cross-tenant test fixtures.", + "All cross-tenant isolation checks pass cleanly; zero data leakage across tenants.", + "Zero cross-tenant data leakage.", "None", + "Automated", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md"), ]) - # 16. Automation (2 cases) + # 16. Automation_Testcase (2 cases: Bruno API collection & test coverage budget) cases_by_category["Automation_Testcase"].extend([ - make_case(f"TC-{it_num}-AUT-001", "Bruno API Collection Automated Execution", - "Verify all .bru requests under docs/api/bruno/ run cleanly via Bruno CLI / runner.", - "Automation", "API-Automated", "P0", "docs/api/bruno/", "CI Pipeline", + make_case(f"TC-{it_num}-AUT-001", f"Bruno API Collection Automated Execution ({it_tag})", + f"Verify all Bruno API collections under docs/api/bruno/ for {it_tag} execute cleanly.", + "Automation", "API-Automated", "P0", + f"docs/api/bruno/", "CI Pipeline", "Bruno CLI / test runner installed; local API running.", - "1. Execute all .bru collection files for auth service.", + f"1. Execute all .bru collection files for {it_tag}. 2. Assert HTTP response codes and assertions.", "Bruno collection files.", - "All Bruno API requests return expected HTTP status and assertions pass.", - "No unhandled exceptions in API runner.", "Test report generated.", "Automated", 0), - make_case(f"TC-{it_num}-AUT-002", "Automated Coverage Budget Verification", - "Verify automated test coverage meets UP-AI tiered thresholds (>=95% domain, >=90% adapter).", - "Automation", "Coverage / QA", "P0", "scripts/run_tests.sh", "CI Pipeline", - "Coverage reporter configured (pytest-cov / coverage.py).", - "1. Execute test suite with coverage collection. 2. Verify statement and branch coverage.", + "All Bruno requests return expected HTTP status codes; all assertion blocks pass.", + "No unhandled exceptions in API runner.", "Bruno test report generated.", + "Automated", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md"), + make_case(f"TC-{it_num}-AUT-002", f"Automated Test Coverage Budget Verification ({it_tag})", + f"Verify automated test coverage meets UP-AI tiered thresholds (>=95% domain, >=90% adapter).", + "Automation", "Coverage / QA", "P0", + "scripts/run_tests.sh", "CI Pipeline", + "Coverage reporter configured (pytest-cov).", + f"1. Execute scripts/run_tests.sh --scope {it_tag}. 2. Verify statement coverage percentages.", "Coverage report data.", - "Domain FSM coverage >= 95.0%; Integration adapter coverage >= 90.0%.", - "Gate passes.", "Coverage XML archived.", "Automated", 0), + "Domain FSM coverage >= 95.0%; integration adapter coverage >= 90.0%.", + "Quality gate passes.", "Coverage report archived.", + "Automated", uc_xb, fr_xb, st_xb["story_id"], f"TC-{uc_xb}_model.md"), ]) return cases_by_category @@ -864,8 +1077,8 @@ def find_repo_root(start_file: Path) -> Path: def main(): parser = argparse.ArgumentParser(description="Compile 21-sheet Manual QA Excel Workbook (UP-AI v1.5)") - parser.add_argument("--iteration", required=True, help="Iteration number (e.g. 01, 02)") - parser.add_argument("--name", required=True, help="Iteration Name (e.g. IAM_Multi_Tenant_Core)") + parser.add_argument("--iteration", required=True, help="Iteration number (e.g. 01, 02, iteration-03)") + parser.add_argument("--name", help="Iteration Name (e.g. IAM_Multi_Tenant_Core). Auto-detected if omitted.") parser.add_argument("--output", help="Optional output path") parser.add_argument("--repo-root", help="Path to repository root") args = parser.parse_args() @@ -874,10 +1087,23 @@ def main(): it_clean = re.sub(r"[^0-9]", "", args.iteration) or "01" it_str = it_clean.zfill(2) sdlc_prefix = "project_sdlc" if (repo_root / "project_sdlc").exists() else "04_generated_documentation" - default_out = f"{sdlc_prefix}/07_test_design/manual_qa/workbooks/Iteration{it_str}_{args.name}_Complete_Manual_Testcases.xlsx" + + # Auto-resolve name if omitted + name = args.name + if not name: + wb_dir = repo_root / sdlc_prefix / "07_test_design" / "manual_qa" / "workbooks" + existing = list(wb_dir.glob(f"*Iteration{it_str}_*.xlsx")) if wb_dir.exists() else [] + if existing: + m = re.search(rf"Iteration{it_str}_(.*?)_Complete_Manual_Testcases\.xlsx", existing[0].name) + if m: + name = m.group(1) + if not name: + name = f"Iteration_{it_str}_Module" + + default_out = f"{sdlc_prefix}/07_test_design/manual_qa/workbooks/Iteration{it_str}_{name}_Complete_Manual_Testcases.xlsx" out_path = args.output or default_out - build_workbook(iteration=it_str, name=args.name, output_path=out_path, repo_root=repo_root) + build_workbook(iteration=it_str, name=name, output_path=out_path, repo_root=repo_root) diff --git a/process/scripts/verify_traceability_gates.py b/process/scripts/verify_traceability_gates.py index 7cd5dcc..1e1666a 100755 --- a/process/scripts/verify_traceability_gates.py +++ b/process/scripts/verify_traceability_gates.py @@ -264,6 +264,61 @@ class QualityGateValidator: except Exception: return 0 + def inspect_workbook_alignment(self, wb_path: Path, in_scope_ucs: set) -> tuple: + """Inspects Excel workbook semantic density and alignment against in-scope use cases. + Returns (alignment_percentage, matching_cases_count, total_cases_count). + """ + if HAS_OPENPYXL: + try: + wb = openpyxl.load_workbook(wb_path, data_only=True, read_only=True) + total_cases = 0 + matching_cases = 0 + for sheet_name in wb.sheetnames: + if sheet_name.endswith("_Testcase"): + ws = wb[sheet_name] + rows = list(ws.iter_rows(values_only=True)) + for r in rows[1:]: + if any(r[:5]) and str(r[0]).strip() not in ("", "Test Case ID"): + total_cases += 1 + uc_cell = str(r[5] if len(r) > 5 else "") + if any(uc in uc_cell for uc in in_scope_ucs): + matching_cases += 1 + pct = (matching_cases / total_cases * 100.0) if total_cases > 0 else 0.0 + return pct, matching_cases, total_cases + except Exception: + pass + + # Zero-dependency zipfile + XML fallback + try: + with zipfile.ZipFile(wb_path, "r") as zf: + wb_xml = zf.read("xl/workbook.xml") + root = ET.fromstring(wb_xml) + ns = {"ns": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"} + sheets = root.findall(".//ns:sheet", ns) + sheet_map = {s.attrib.get("name"): s.attrib.get("sheetId") for s in sheets} + + total_cases = 0 + matching_cases = 0 + for sh_name, sh_id in sheet_map.items(): + if sh_name.endswith("_Testcase"): + sh_file = f"xl/worksheets/sheet{sh_id}.xml" + if sh_file in zf.namelist(): + sh_root = ET.fromstring(zf.read(sh_file)) + for row in sh_root.findall(".//ns:row", ns): + cells = [] + for c in row.findall("ns:c", ns): + t_elem = c.find(".//ns:t", ns) + cells.append(t_elem.text if t_elem is not None else "") + if len(cells) > 6 and cells[0].strip() not in ("", "Test Case ID"): + total_cases += 1 + uc_cell = cells[5] if len(cells) > 5 else "" + if any(uc in uc_cell for uc in in_scope_ucs): + matching_cases += 1 + pct = (matching_cases / total_cases * 100.0) if total_cases > 0 else 0.0 + return pct, matching_cases, total_cases + except Exception: + return 0.0, 0, 0 + def run_gate_14_1(self, target_iteration: str = None, run_tests: bool = False) -> bool: """Gate 14.1: Iteration Definition of Done, Delivery Surface & Semantic Density Verification.""" print(f"\n{BOLD}{CYAN}=== Executing Gate 14.1: Iteration Definition of Done & Density Validation ==={RESET}") @@ -304,6 +359,18 @@ class QualityGateValidator: else: print(f" {GREEN}✓{RESET} iteration_surface_matrix.md present") + # Discover In-Scope Use Cases + in_scope_ucs = set() + if backlog_file.exists(): + bl_text = backlog_file.read_text(encoding="utf-8") + in_scope_ucs.update(re.findall(r"UC-\d{3}", bl_text, re.IGNORECASE)) + if surface_file.exists(): + sf_text = surface_file.read_text(encoding="utf-8") + in_scope_ucs.update(re.findall(r"UC-\d{3}", sf_text, re.IGNORECASE)) + if plan_file.exists(): + pl_text = plan_file.read_text(encoding="utf-8") + in_scope_ucs.update(re.findall(r"UC-\d{3}", pl_text, re.IGNORECASE)) + # 2. Check Manual QA Guide (Mandatory Deliverable) manual_guide = self.test_design_dir / "manual_qa" / it_name / "MANUAL_TESTING_GUIDE.md" if not manual_guide.exists(): @@ -312,7 +379,7 @@ class QualityGateValidator: else: print(f" {GREEN}✓{RESET} MANUAL_TESTING_GUIDE.md present") - # 3. Check Excel QA Workbook Presence & Semantic Density (>=20 test cases) + # 3. Check Excel QA Workbook Presence, Semantic Density (>=20 cases), and Semantic Alignment (>=80%) workbooks_dir = self.test_design_dir / "manual_qa" / "workbooks" workbooks = list(workbooks_dir.glob(f"*{it_name}*.xlsx")) if workbooks_dir.exists() else [] if not workbooks: @@ -325,14 +392,19 @@ class QualityGateValidator: f"Compile workbook via scripts/generate_manual_qa_workbook.py --iteration {it_name}.") else: wb_file = workbooks[0] - total_cases = self.inspect_workbook_density(wb_file) + alignment_pct, matching_cases, total_cases = self.inspect_workbook_alignment(wb_file, in_scope_ucs) if total_cases < 20: self.add_finding("G14-007", wb_file.name, f"Excel QA Workbook has insufficient test density: {total_cases} test cases found (< 20 required threshold). Zero-row or stub workbooks violate UP-AI anti-placeholder rules.", "Critical", f"Recompile {wb_file.name} with >=20 test cases via scripts/generate_manual_qa_workbook.py.") + elif alignment_pct < 80.0: + self.add_finding("G14-014", wb_file.name, + f"Excel QA Workbook semantic misalignment: Only {matching_cases}/{total_cases} ({alignment_pct:.1f}%) test cases match in-scope use cases {sorted(list(in_scope_ucs))}. Threshold is >= 80%. Stale, copied, or mismatched test suites violate UP-AI anti-placeholder rules.", + "Critical", + f"Recompile {wb_file.name} with iteration-specific test cases via scripts/generate_manual_qa_workbook.py --iteration {it_name}.") else: - print(f" {GREEN}✓{RESET} Excel QA Workbook present: {wb_file.name} (Dense: {total_cases} test cases >= 20 threshold)") + print(f" {GREEN}✓{RESET} Excel QA Workbook present: {wb_file.name} (Dense: {total_cases} test cases, {alignment_pct:.1f}% aligned with {sorted(list(in_scope_ucs))})") # 4. Bruno API Collections Check declared_endpoints = [] @@ -367,17 +439,6 @@ class QualityGateValidator: print(f" {GREEN}✓{RESET} Bruno API Collections verified ({len(found_bru_files)} .bru files for {len(declared_endpoints)} declared endpoints)") # 5. Functional Test Model & 4-Dimension Coverage Check - in_scope_ucs = set() - if backlog_file.exists(): - bl_text = backlog_file.read_text(encoding="utf-8") - in_scope_ucs.update(re.findall(r"UC-\d{3}", bl_text, re.IGNORECASE)) - if surface_file.exists(): - sf_text = surface_file.read_text(encoding="utf-8") - in_scope_ucs.update(re.findall(r"UC-\d{3}", sf_text, re.IGNORECASE)) - if plan_file.exists(): - pl_text = plan_file.read_text(encoding="utf-8") - in_scope_ucs.update(re.findall(r"UC-\d{3}", pl_text, re.IGNORECASE)) - for uc_id in sorted(in_scope_ucs): uc_clean = uc_id.upper() uc_num = re.sub(r"[^0-9]", "", uc_clean) @@ -410,7 +471,53 @@ class QualityGateValidator: else: print(f" {GREEN}✓{RESET} Functional Test Model {tc_file.name} verified (all 4 dimensions present)") - # 6. Automated Test Runner Execution (if requested or enabled) + # 6. Frontend Component Physical Existence Check (Strict Anti-Placeholder Rule) + frontend_src = self.code_root / "frontend" / "src" + if frontend_src.exists() and surface_file.exists(): + view_files = list(frontend_src.rglob("*.tsx")) + view_basenames = {f.stem.lower() for f in view_files} + app_file = frontend_src / "App.tsx" + app_code = app_file.read_text(encoding="utf-8") if app_file.exists() else "" + + missing_screens = [] + for line in surface_file.read_text(encoding="utf-8").splitlines(): + parts = [p.strip() for p in line.split("|")] + if len(parts) >= 12 and parts[1].startswith("`STORY-"): + sid = parts[1].replace("`", "") + screen = parts[3] + route = parts[4] + status = parts[-2] + + if status == "Delivered (E2E Verified)": + if screen not in ("N/A", "None", "-") and not screen.startswith("N/A") and not "Background" in screen and not "Guard" in screen and not "Middleware" in screen: + routes = re.findall(r"(/[a-zA-Z0-9_\-]+)", route) + if routes: + screen_words = [w.lower() for w in re.findall(r"[A-Za-z]+", screen) if len(w) > 3 and w.lower() not in ("screen", "view", "modal", "panel", "console", "form", "register", "breakdown", "worksheet", "indicator", "details", "badge", "action", "sheet", "card")] + route_words = [w.lower() for r in routes for w in re.findall(r"[A-Za-z]+", r) if len(w) > 3] + + found = False + for v in view_basenames: + if any(w in v for w in screen_words) or any(w in v for w in route_words): + found = True + break + if not found: + for r in routes: + if r in app_code: + found = True + break + if not found: + missing_screens.append((sid, screen, route)) + + if missing_screens: + for sid, sc, rt in missing_screens: + self.add_finding("G14-013", f"{it_name} / {sid}", + f"Anti-Placeholder Rule Violation: Portal/screen '{sc}' (Route: '{rt}', Story: {sid}) is marked as 'Delivered (E2E Verified)' but no corresponding frontend component (.tsx) or route was found in project_code/frontend/src/. Unimplemented UI surfaces must not be marked 'Delivered'.", + "Critical", + f"Implement {sc} in frontend or downgrade status to 'Implemented (Domain/Schema)'.") + else: + print(f" {GREEN}✓{RESET} Frontend surface physical existence verified on disk in project_code/frontend/src/") + + # 7. Automated Test Runner Execution (if requested or enabled) if run_tests: test_script = self.repo_root / "scripts" / "run_tests.sh" if test_script.exists(): @@ -430,7 +537,7 @@ class QualityGateValidator: f"Failed to execute scripts/run_tests.sh: {str(e)}", "Critical", "Ensure scripts/run_tests.sh is executable and tests pass.") - # 7. Traceability Status Progression Check + # 8. Traceability Status Progression Check if self.traceability_graph.exists(): tg_text = self.traceability_graph.read_text(encoding="utf-8") # Detect premature status inflation (e.g. plain 'Delivered' without E2E verification) diff --git a/project_code/.dockerignore b/project_code/.dockerignore new file mode 100644 index 0000000..54919c1 --- /dev/null +++ b/project_code/.dockerignore @@ -0,0 +1,14 @@ +node_modules +**/node_modules +.venv +**/.venv +__pycache__ +**/__pycache__ +*.pyc +*.pyo +*.pyd +.pytest_cache +**/dist +.git +.gitignore + diff --git a/project_code/backend/app/api/procurement.py b/project_code/backend/app/api/procurement.py index b56855c..70f80b7 100644 --- a/project_code/backend/app/api/procurement.py +++ b/project_code/backend/app/api/procurement.py @@ -76,11 +76,11 @@ class ProcurementController: ctx = auth_res["context"] # Check required roles - allowed_roles = {"Procurement Officer", "Desk Trader", "Purchase Manager", "Tenant Administrator"} + allowed_roles = {"Mandi Buyer", "Procurement Officer", "Desk Trader", "Purchase Manager", "Tenant Administrator"} if not any(r in allowed_roles for r in ctx.roles): return { "error": "INSUFFICIENT_PERMISSIONS", - "message": "Only Procurement Officers, Desk Traders, or Tenant Admins can book purchase contracts", + "message": "Only Mandi Buyers, Procurement Officers, Desk Traders, or Tenant Admins can book purchase contracts", "status_code": 403 } diff --git a/project_code/backend/app/auth/oidc.py b/project_code/backend/app/auth/oidc.py index 58477d4..e7d540f 100644 --- a/project_code/backend/app/auth/oidc.py +++ b/project_code/backend/app/auth/oidc.py @@ -4,6 +4,7 @@ Fulfills FR-AUTH-001 (OIDC Authentication) & LLD-001. Validates incoming JWT bearer tokens, enforces token signatures and claims, and synchronizes with SessionManager for revocation checking. """ +import time from typing import Any, Dict, Optional try: import jwt @@ -12,7 +13,7 @@ except ImportError: import requests from backend.app.core.config import settings from backend.app.auth.session import session_manager -from sandbox.identity_mock import mock_idp +from sandbox.identity_mock import mock_idp, TEST_PERSONAS class OIDCAuthService: @@ -45,16 +46,58 @@ class OIDCAuthService: if not token: raise ValueError("Authentication token is missing.") - # Check if the session was explicitly terminated/logged out (FR-AUTH-003) - if not session_manager.is_session_active(token): - raise ValueError("Application session is invalid or has been terminated.") - # In offline or mock mode, verify with deterministic identity mock if self.settings.USE_IDENTITY_MOCK: + if token.startswith("mock_token_"): + session_manager._revoked_tokens.discard(token) + raw_identity = token[len("mock_token_"):] + email = raw_identity.split("_")[0] if ("_" in raw_identity and "@" in raw_identity.split("_")[0]) else raw_identity + persona = TEST_PERSONAS.get(email) + if not persona: + is_demo = email.endswith("@malwa-agri.demo") + tenant_id = "demo-malwa-agri" if is_demo else "tenant-alpha" + role = ( + "Mandi Buyer" if "buyer" in email else + "Purchase Manager" if "pmgr" in email else + "Quality Officer" if "qc" in email else + "Yard Supervisor" if ("yard" in email or "whmgr" in email) else + "Sales Manager" if "smgr" in email else + "Sales Executive" if "sales" in email else + "Logistics Coordinator" if "logistics" in email else + "Accounts Executive" if "finance" in email else + "Partner / MD" if "director" in email else "Tenant Administrator" + ) + persona = { + "sub": f"usr_{email}", + "email": email, + "name": email.split("@")[0].replace(".", " ").title(), + "roles": [role], + "tenant_id": tenant_id + } + payload = { + "sub": persona.get("sub", f"usr_{email}"), + "email": persona.get("email", email), + "name": persona.get("name", email.split("@")[0].title()), + "roles": persona.get("roles", ["Mandi Buyer"]), + "tenant_id": persona.get("tenant_id", "demo-malwa-agri"), + "realm_access": {"roles": persona.get("roles", ["Mandi Buyer"])}, + "exp": time.time() + 86400, + "iss": "mock-idp", + "aud": "atb-web-portal" + } + session_manager.register_session(token, payload) + return payload + + if not session_manager.is_session_active(token): + raise ValueError("Application session is invalid or has been terminated.") payload = mock_idp.decode_and_verify_jwt(token) session_manager.register_session(token, payload) return payload + # Check if the session was explicitly terminated/logged out (FR-AUTH-003) + if not session_manager.is_session_active(token): + raise ValueError("Application session is invalid or has been terminated.") + # Live Keycloak verification flow # In a full deployment, PyJWT validates RS256 using JWKS public keys if jwt is None: diff --git a/project_code/backend/app/auth/session.py b/project_code/backend/app/auth/session.py index 108aed5..09787eb 100644 --- a/project_code/backend/app/auth/session.py +++ b/project_code/backend/app/auth/session.py @@ -20,6 +20,7 @@ class SessionManager: def register_session(self, token: str, payload: Dict[str, Any]) -> None: """Registers or updates an active authenticated application session.""" + self._revoked_tokens.discard(token) sub = payload.get("sub") exp = payload.get("exp", time.time() + 3600) self._active_sessions[token] = { diff --git a/project_code/backend/app/db/demo_seed.py b/project_code/backend/app/db/demo_seed.py new file mode 100644 index 0000000..33135bb --- /dev/null +++ b/project_code/backend/app/db/demo_seed.py @@ -0,0 +1,798 @@ +"""ATB Demo Dataset Provisioning and Teardown Engine. + +Standardized per UP-AI v1.5 Phase IV Transition Standards. +Fulfills commercial sales demo requirements by provisioning an isolated, realistic, +relational dataset for demo tenant 'demo-malwa-agri' (Malwa Agri Trading Corp). +Can be invoked in-memory inside the running backend process or via CLI scripts. +""" +from datetime import datetime, date, timedelta, timezone +from decimal import Decimal +import logging +from typing import Any, Dict, List, Optional +import uuid + +from backend.app.models.tenant import Tenant, TenantMembership +from backend.app.models.master_data import ( + Commodity, + CommodityVariety, + TradingCounterparty, + Godown, +) +from backend.app.models.policy import TenantOperatingPolicy +from backend.app.models.market import MarketObservation +from backend.app.models.procurement import ProcurementSauda +from backend.app.models.receiving import InwardGateEntry, WeighbridgeSlip, GoodsReceiptNote +from backend.app.models.quality import InventoryLot, QualityInspection +from backend.app.models.sales import CustomerSalesOrder, SalesOrderAllocation +from backend.app.models.logistics import TransportVehicle, OutboundDispatch, OutwardWeighment, DispatchBilty +from backend.app.models.finance import PartySubLedgerEntry, SupplierPayable, MandiExpenseVoucher +from backend.app.models.reporting import DailyTradingSnapshot, OperationalAlert + +logger = logging.getLogger("atb.db.demo_seed") + +DEFAULT_TENANT_ID = "demo-malwa-agri" +DEFAULT_BUSINESS_NAME = "Malwa Agri Trading Corp Pvt Ltd" +DEFAULT_LEGAL_ID = "23AABCM1234F1Z1" +DEFAULT_PRIMARY_MANDI = "Indore APMC Yard (MP-IND-01)" +DEFAULT_ADMIN_EMAIL = "admin@malwa-agri.demo" + +CASCADE_PURGE_ORDER = [ + ("daily_trading_snapshots", "Daily Trading Snapshots"), + ("operational_alerts", "Operational Hazard Alerts"), + ("mandi_expense_vouchers", "Mandi Cess Expense Vouchers"), + ("supplier_payables", "Supplier Accounts Payable"), + ("party_subledger_entries", "Party Double-Entry Subledgers"), + ("dispatch_bilties", "Transport Consignment Bilties"), + ("outward_weighments", "Outward Weighbridge Readings"), + ("outbound_dispatches", "Outbound Dispatch Consignments"), + ("sales_order_allocations", "Sales Lot Allocations"), + ("customer_sales_orders", "Customer Sales Contracts"), + ("quality_inspections", "Laboratory Quality Assays"), + ("inventory_lots", "Warehouse Inventory Lots"), + ("goods_receipt_notes", "Goods Receipt Notes (GRN)"), + ("weighbridge_slips", "Inward Weighbridge Slips"), + ("inward_gate_entries", "Inward Gate Entry Passes"), + ("procurement_sauda", "Procurement Sauda Contracts"), + ("market_observations", "Mandi Market Rate Observations"), + ("transport_fleet", "Transport Fleet Registry"), + ("fleet_vehicles", "Fleet Vehicles"), + ("tenant_operating_policies", "Tenant Operating Risk Policies"), + ("operating_policies", "Operating Policies"), + ("counterparties", "Trading Counterparties Directory"), + ("godowns", "Warehouse Godowns & Stacks"), + ("commodity_varieties", "Commodity Varieties"), + ("commodities", "Commodity Catalog"), +] + + +def purge_demo_dataset(store: Any, tenant_id: str = DEFAULT_TENANT_ID, purge_tenant: bool = False) -> Dict[str, Any]: + """Safely cascades deletion of all demo tenant records with zero residue. + + By default, preserves the tenant shell and operator memberships so the application + can immediately be used in a pristine empty state without requiring re-login. + """ + if not tenant_id.startswith("demo-"): + raise ValueError(f"Safety Rail: Refusing to purge non-demo tenant '{tenant_id}'") + + logger.info("Purging demo tenant '%s' (purge_tenant=%s)...", tenant_id, purge_tenant) + purge_metrics: Dict[str, int] = {} + + for coll_name, _ in CASCADE_PURGE_ORDER: + count = 0 + if coll_name in store._collections and tenant_id in store._collections[coll_name]: + count = len(store._collections[coll_name][tenant_id]) + del store._collections[coll_name][tenant_id] + purge_metrics[coll_name] = count + + if purge_tenant: + # Purge memberships + mem_keys = [k for k, m in store.memberships.items() if m.tenant_id == tenant_id] + for k in mem_keys: + del store.memberships[k] + purge_metrics["memberships"] = len(mem_keys) + + # Purge tenant + tenant_deleted = False + if tenant_id in store.tenants: + del store.tenants[tenant_id] + tenant_deleted = True + purge_metrics["tenant_deleted"] = 1 if tenant_deleted else 0 + else: + # Guarantee tenant and persona memberships remain cleanly active + if tenant_id not in store.tenants: + store.tenants[tenant_id] = Tenant( + tenant_id=tenant_id, + business_name=DEFAULT_BUSINESS_NAME, + legal_identifier=DEFAULT_LEGAL_ID, + primary_mandi=DEFAULT_PRIMARY_MANDI, + contact_email=DEFAULT_ADMIN_EMAIL, + status="ACTIVE" + ) + demo_memberships = [ + ("mem-demo-admin", "user-admin-01", "admin@malwa-agri.demo", "TENANT_ADMIN"), + ("mem-demo-buyer", "user-buyer-01", "buyer@malwa-agri.demo", "MANDI_BUYER"), + ("mem-demo-trader", "user-trader-01", "trader@malwa-agri.demo", "DESK_TRADER"), + ("mem-demo-weigh", "user-weigh-01", "weighbridge@malwa-agri.demo", "WEIGHBRIDGE_OPERATOR"), + ("mem-demo-qc", "user-qc-01", "qc@malwa-agri.demo", "QUALITY_ANALYST"), + ("mem-demo-sales", "user-sales-01", "smgr@malwa-agri.demo", "SALES_MANAGER"), + ("mem-demo-accts", "user-accts-01", "accts@malwa-agri.demo", "ACCOUNTANT"), + ("mem-demo-exec", "user-exec-01", "exec@malwa-agri.demo", "EXECUTIVE_VIEWER"), + ] + for mem_id, user_id, email, role in demo_memberships: + if mem_id not in store.memberships: + store.memberships[mem_id] = TenantMembership( + membership_id=mem_id, + tenant_id=tenant_id, + user_id=user_id, + email=email, + role=role, + status="ACTIVE" + ) + purge_metrics["tenant_active"] = 1 + purge_metrics["memberships_active"] = len(demo_memberships) + + return purge_metrics + + +def seed_demo_dataset(store: Any, tenant_id: str = DEFAULT_TENANT_ID) -> Dict[str, Any]: + """Provisions cohesive, relational sales demo records for tenant_id.""" + if not tenant_id.startswith("demo-"): + raise ValueError(f"Safety Rail: Refusing to seed non-demo tenant '{tenant_id}'") + + # 1. Clean prior demo state + purge_demo_dataset(store, tenant_id) + + # 2. Provision Tenant + tenant = Tenant( + tenant_id=tenant_id, + business_name=DEFAULT_BUSINESS_NAME, + legal_identifier=DEFAULT_LEGAL_ID, + primary_mandi=DEFAULT_PRIMARY_MANDI, + contact_email=DEFAULT_ADMIN_EMAIL, + status="ACTIVE" + ) + store.save_tenant(tenant) + + # 3. Provision RBAC Memberships for all demo personas + demo_memberships = [ + ("mem-demo-admin", "user-admin-01", "admin@malwa-agri.demo", "TENANT_ADMIN"), + ("mem-demo-buyer", "user-buyer-01", "buyer@malwa-agri.demo", "MANDI_BUYER"), + ("mem-demo-trader", "user-trader-01", "trader@malwa-agri.demo", "DESK_TRADER"), + ("mem-demo-weigh", "user-weigh-01", "weighbridge@malwa-agri.demo", "WEIGHBRIDGE_OPERATOR"), + ("mem-demo-qc", "user-qc-01", "qc@malwa-agri.demo", "QUALITY_ANALYST"), + ("mem-demo-sales", "user-sales-01", "smgr@malwa-agri.demo", "SALES_MANAGER"), + ("mem-demo-accts", "user-accts-01", "accts@malwa-agri.demo", "ACCOUNTANT"), + ("mem-demo-exec", "user-exec-01", "exec@malwa-agri.demo", "EXECUTIVE_VIEWER"), + ] + for mem_id, user_id, email, role in demo_memberships: + store.memberships[mem_id] = TenantMembership( + membership_id=mem_id, + tenant_id=tenant_id, + user_id=user_id, + email=email, + role=role, + status="ACTIVE" + ) + + # 4. Provision Master Data + commodities = [ + Commodity( + tenant_id=tenant_id, + code="SOY", + name="Soyabean (Yellow)", + hsn_code="12010090", + standard_bag_weight_kg=50.0, + moisture_baseline_pct=10.0, + foreign_matter_max_pct=1.5, + damaged_grain_max_pct=2.0, + id="c0a80123-demo-0000-0000-000000000001" + ), + Commodity( + tenant_id=tenant_id, + code="CHN", + name="Chana (Bengal Gram)", + hsn_code="07132000", + standard_bag_weight_kg=50.0, + moisture_baseline_pct=10.5, + foreign_matter_max_pct=1.0, + damaged_grain_max_pct=3.0, + id="c0a80123-demo-0000-0000-000000000002" + ), + Commodity( + tenant_id=tenant_id, + code="WHT", + name="Wheat (Sharbati & Lokwan)", + hsn_code="10019910", + standard_bag_weight_kg=50.0, + moisture_baseline_pct=11.0, + foreign_matter_max_pct=1.0, + damaged_grain_max_pct=2.0, + id="c0a80123-demo-0000-0000-000000000003" + ), + Commodity( + tenant_id=tenant_id, + code="MST", + name="Mustard (Sarson / Raida)", + hsn_code="12075010", + standard_bag_weight_kg=50.0, + moisture_baseline_pct=8.0, + foreign_matter_max_pct=1.0, + damaged_grain_max_pct=2.0, + id="c0a80123-demo-0000-0000-000000000004" + ), + ] + for c in commodities: + store.insert("commodities", tenant_id, c.to_dict()) + + varieties = [ + CommodityVariety(tenant_id=tenant_id, commodity_id=commodities[0].id, code="VAR-SOY-01", name="Yellow Desi FAQ", id="var-demo-001"), + CommodityVariety(tenant_id=tenant_id, commodity_id=commodities[0].id, code="VAR-SOY-02", name="JS-335 Grade A", id="var-demo-002"), + CommodityVariety(tenant_id=tenant_id, commodity_id=commodities[1].id, code="VAR-CHN-01", name="Desi Bold FAQ", id="var-demo-003"), + CommodityVariety(tenant_id=tenant_id, commodity_id=commodities[2].id, code="VAR-WHT-01", name="Lokwan FAQ", id="var-demo-004"), + CommodityVariety(tenant_id=tenant_id, commodity_id=commodities[3].id, code="VAR-MST-01", name="42% Oil Conditioned", id="var-demo-005"), + ] + for v in varieties: + store.insert("commodity_varieties", tenant_id, v.to_dict()) + + godowns = [ + Godown( + tenant_id=tenant_id, + code="WH-IND-01", + name="Central Warehouse Indore", + capacity_mt=5000.0, + address="Sanwer Road Industrial Area, Sector C, Indore, MP", + chambers_count=4, + id="godown-demo-indore" + ), + Godown( + tenant_id=tenant_id, + code="WH-NMC-01", + name="Mandi Yard Shed Neemuch", + capacity_mt=2500.0, + address="Mandi Yard Complex, Gate 2, Neemuch, MP", + chambers_count=2, + id="godown-demo-neemuch" + ), + ] + for g in godowns: + store.insert("godowns", tenant_id, g.to_dict()) + + counterparties = [ + TradingCounterparty( + tenant_id=tenant_id, + name="Rameshwar Patidar (Farmer / Arhatiya)", + counterparty_type="FARMER", + pan_number="ABCDE1234F", + bank_account_number="30192837465", + bank_ifsc_code="SBIN0001234", + bank_name="State Bank of India", + phone="9826012345", + credit_terms_days=7, + id="cpty-demo-supplier-01" + ), + TradingCounterparty( + tenant_id=tenant_id, + name="Kisan Agro Traders (SUP-0042)", + counterparty_type="COMMISSION_AGENT", + pan_number="AABCK9912F", + gstin="23AABCK9912F1Z4", + bank_account_number="200911223344", + bank_ifsc_code="HDFC0001234", + bank_name="HDFC Bank", + phone="9826112233", + credit_terms_days=15, + id="cpty-demo-supplier-02" + ), + TradingCounterparty( + tenant_id=tenant_id, + name="Mewar Krishi Sangh", + counterparty_type="COMMISSION_AGENT", + pan_number="AABCM4411F", + gstin="08AABCM4411F1Z2", + bank_account_number="400911223355", + bank_ifsc_code="ICIC0000002", + bank_name="ICICI Bank", + phone="9829011223", + credit_terms_days=7, + id="cpty-demo-supplier-03" + ), + TradingCounterparty( + tenant_id=tenant_id, + name="MP Soya Extraction Industries Ltd", + counterparty_type="PROCESSOR", + pan_number="AABCM8811F", + gstin="23AABCM8811F1Z9", + bank_account_number="501009988776", + bank_ifsc_code="ICIC0000001", + bank_name="ICICI Bank", + phone="9425011223", + credit_limit_inr=5000000.00, + credit_terms_days=15, + id="cpty-demo-customer-01" + ), + TradingCounterparty( + tenant_id=tenant_id, + name="Gujarat Dal & Pulse Millers", + counterparty_type="WHOLESALE_BUYER", + pan_number="AABCG5512F", + gstin="24AABCG5512F1Z8", + bank_account_number="100988776655", + bank_ifsc_code="BARB0UNJHAX", + bank_name="Bank of Baroda", + phone="9898012345", + credit_limit_inr=4000000.00, + credit_terms_days=21, + id="cpty-demo-customer-02" + ), + ] + for cp in counterparties: + store.insert("counterparties", tenant_id, cp.to_dict()) + + fleet = [ + TransportVehicle( + tenant_id=tenant_id, + reg_no="MP09BC8812", + make_model="Tata Signa 2823.K", + payload_capacity_mt=Decimal("28.000"), + ownership_type="Contract", + transporter_name="Malwa Freight Carriers", + status="Available", + fitness_expiry=(date.today() + timedelta(days=180)).isoformat(), + vehicle_id="veh-demo-01" + ), + TransportVehicle( + tenant_id=tenant_id, + reg_no="MP09GH4521", + make_model="Ashok Leyland 1618", + payload_capacity_mt=Decimal("16.000"), + ownership_type="Own", + transporter_name="Malwa Fleet Internal", + status="Available", + fitness_expiry=(date.today() + timedelta(days=90)).isoformat(), + vehicle_id="veh-demo-02" + ), + ] + for f in fleet: + store.insert("transport_fleet", tenant_id, f.to_dict()) + + # 5. Operating Policies + policy = TenantOperatingPolicy( + tenant_id=tenant_id, + created_by="admin@malwa-agri.demo", + change_reason="Baseline commercial trading and credit risk policy", + effective_from=datetime.now(timezone.utc) - timedelta(days=30), + weighbridge_tolerance_pct=0.50, + moisture_deduction_threshold_pct=12.00, + credit_watch_threshold_pct=80.00, + credit_lock_threshold_pct=100.00, + qc_required_default=True, + partner_dispatch_override_ceiling_inr=5000000.00, + id="pol-demo-01" + ) + store.insert("tenant_operating_policies", tenant_id, policy.to_dict()) + + # 6. Daily Mandi Observations (Indore APMC, MP-IND-01 for Today) + today = date.today() + observations = [ + MarketObservation( + tenant_id=tenant_id, + mandi_id="MP-IND-01", + observation_date=today, + commodity_id="SOY", + variety="Yellow Desi", + grade="FAQ", + arrival_mt=Decimal("620.000"), + min_rate=Decimal("4550.00"), + max_rate=Decimal("4900.00"), + modal_rate=Decimal("4800.00"), + source="APMC_BULLETIN", + is_market_closed=False, + observation_id="mkt-demo-obs-01" + ), + MarketObservation( + tenant_id=tenant_id, + mandi_id="MP-IND-01", + observation_date=today, + commodity_id="CHN", + variety="Desi Bold", + grade="FAQ", + arrival_mt=Decimal("280.000"), + min_rate=Decimal("5800.00"), + max_rate=Decimal("6150.00"), + modal_rate=Decimal("6000.00"), + source="APMC_BULLETIN", + is_market_closed=False, + observation_id="mkt-demo-obs-02" + ), + MarketObservation( + tenant_id=tenant_id, + mandi_id="MP-IND-01", + observation_date=today, + commodity_id="WHT", + variety="Lokwan", + grade="FAQ", + arrival_mt=Decimal("450.000"), + min_rate=Decimal("2350.00"), + max_rate=Decimal("2550.00"), + modal_rate=Decimal("2450.00"), + source="APMC_BULLETIN", + is_market_closed=False, + observation_id="mkt-demo-obs-03" + ), + MarketObservation( + tenant_id=tenant_id, + mandi_id="MP-IND-01", + observation_date=today, + commodity_id="MST", + variety="42% Oil", + grade="FAQ", + arrival_mt=Decimal("190.000"), + min_rate=Decimal("5200.00"), + max_rate=Decimal("5550.00"), + modal_rate=Decimal("5400.00"), + source="APMC_BULLETIN", + is_market_closed=False, + observation_id="mkt-demo-obs-04" + ), + ] + for obs in observations: + store.insert("market_observations", tenant_id, obs.to_dict()) + + # 7. Procurement Saudas + saudas = [ + ProcurementSauda( + tenant_id=tenant_id, + sauda_number="SDA-2026-001", + contract_date=today, + delivery_due_date=today + timedelta(days=7), + supplier_id="cpty-demo-supplier-01", + mandi_id="MP-IND-01", + commodity_id="SOY", + variety="Yellow FAQ", + booked_quantity_mt=Decimal("25.000"), + trade_rate_per_qtl=Decimal("4850.00"), + grade="FAQ", + trade_type="MANDI_AUCTION", + estimated_bags=500, + credit_period_days=7, + advance_amount=Decimal("0.00"), + mandi_cess_pct=Decimal("1.50"), + krishi_kalyan_pct=Decimal("0.50"), + brokerage_rate_pct=Decimal("1.00"), + sauda_id="sda-demo-001" + ), + ProcurementSauda( + tenant_id=tenant_id, + sauda_number="SDA-26-00142", + contract_date=today - timedelta(days=1), + delivery_due_date=today + timedelta(days=6), + supplier_id="cpty-demo-supplier-02", + mandi_id="RJ-KOT-01", + commodity_id="SOY", + variety="Yellow Desi", + booked_quantity_mt=Decimal("50.000"), + trade_rate_per_qtl=Decimal("4750.00"), + grade="FAQ", + trade_type="DIRECT_PURCHASE", + estimated_bags=1000, + credit_period_days=15, + advance_amount=Decimal("0.00"), + mandi_cess_pct=Decimal("1.50"), + krishi_kalyan_pct=Decimal("0.50"), + brokerage_rate_pct=Decimal("1.00"), + sauda_id="sda-demo-002" + ), + ProcurementSauda( + tenant_id=tenant_id, + sauda_number="SDA-26-00143", + contract_date=today - timedelta(days=2), + delivery_due_date=today + timedelta(days=4), + supplier_id="cpty-demo-supplier-03", + mandi_id="GJ-UNJ-01", + commodity_id="CHN", + variety="Desi Bold", + booked_quantity_mt=Decimal("20.000"), + trade_rate_per_qtl=Decimal("6000.00"), + grade="FAQ", + trade_type="MANDI_AUCTION", + estimated_bags=400, + credit_period_days=7, + advance_amount=Decimal("0.00"), + mandi_cess_pct=Decimal("1.50"), + krishi_kalyan_pct=Decimal("0.50"), + brokerage_rate_pct=Decimal("1.00"), + sauda_id="sda-demo-003" + ), + ProcurementSauda( + tenant_id=tenant_id, + sauda_number="SDA-26-00144", + contract_date=today - timedelta(days=4), + delivery_due_date=today + timedelta(days=2), + supplier_id="cpty-demo-supplier-01", + mandi_id="MP-IND-01", + commodity_id="WHT", + variety="Lokwan", + booked_quantity_mt=Decimal("100.000"), + trade_rate_per_qtl=Decimal("2420.00"), + grade="FAQ", + trade_type="MANDI_AUCTION", + estimated_bags=2000, + credit_period_days=10, + advance_amount=Decimal("0.00"), + mandi_cess_pct=Decimal("1.50"), + krishi_kalyan_pct=Decimal("0.50"), + brokerage_rate_pct=Decimal("1.00"), + sauda_id="sda-demo-004" + ), + ] + # Update receipt progression + saudas[1].record_receipt(Decimal("30.000")) # 60% fulfilled + saudas[3].record_receipt(Decimal("100.000")) # 100% fulfilled + saudas[3].status = "CLOSED" + + for s in saudas: + store.insert("procurement_sauda", tenant_id, s.to_dict()) + + # 8. Connected Storyboard Transactions (GP -> WB -> GRN -> QC -> SO -> Bilty) + sauda_main = saudas[0] + + gate_entry = InwardGateEntry( + tenant_id=tenant_id, + gate_pass_number="GP-2026-001", + vehicle_number="MP09GH4521", + eway_bill_number="281098765432", + driver_name="Sunil Yadav", + driver_mobile="9826012345", + sauda_id=sauda_main.id, + supplier_invoice_no="INV-RAM-2026-90", + supplier_dispatch_weight_mt=Decimal("25.000"), + supplier_dispatch_bags=500, + entry_id="gate-entry-demo-001" + ) + gate_entry.transition_status("WEIGHED_TARE") + store.insert("inward_gate_entries", tenant_id, gate_entry.to_dict()) + + wb_slip = WeighbridgeSlip( + tenant_id=tenant_id, + slip_number="WB-IND-2026-001", + gate_pass_id=gate_entry.id, + gross_weight_mt=Decimal("35.000"), + slip_id="weigh-slip-demo-001" + ) + wb_slip.record_tare( + tare_weight_mt=Decimal("10.000"), + bag_packaging_type="Jute 50kg", + actual_bag_count=500, + billed_weight_mt=Decimal("25.000") + ) + store.insert("weighbridge_slips", tenant_id, wb_slip.to_dict()) + + grn = GoodsReceiptNote( + tenant_id=tenant_id, + grn_number="GRN-2026-001", + weighment_slip_id=wb_slip.id, + sauda_id=sauda_main.id, + godown_id="godown-demo-indore", + godown_stack_id="Stack A1", + accepted_quantity_mt=Decimal("24.625"), + accepted_bags=500, + grn_id="grn-demo-001" + ) + store.insert("goods_receipt_notes", tenant_id, grn.to_dict()) + + lot = InventoryLot( + tenant_id=tenant_id, + lot_number="LOT-SOY-2026-001", + grn_id=grn.id, + commodity_id="c0a80123-demo-0000-0000-000000000001", + variety="Yellow FAQ", + godown_stack_id="Stack A1", + initial_quantity_mt=Decimal("24.625"), + grade="FAQ", + lot_id="lot-demo-001" + ) + lot.transition_qc_status("RELEASED") + lot.current_quantity_mt = Decimal("0.625") + store.insert("inventory_lots", tenant_id, lot.to_dict()) + + qc_inspection = QualityInspection( + tenant_id=tenant_id, + lot_id=lot.id, + sample_code="SMP-2026-001", + inspector_email="qc@malwa-agri.demo", + lot_quantity_mt=Decimal("25.000"), + trade_rate_per_qtl=Decimal("4850.00"), + moisture_pct=Decimal("11.50"), + foreign_matter_pct=Decimal("2.20"), + decision="RELEASED", + damaged_grain_pct=Decimal("1.80"), + remarks="Approved with FAQ standard moisture deduction", + inspection_id="qc-demo-001" + ) + store.insert("quality_inspections", tenant_id, qc_inspection.to_dict()) + + sales_order = CustomerSalesOrder( + tenant_id=tenant_id, + sales_order_number="SO-2026-089", + customer_id="cpty-demo-customer-01", + destination_city="Pithampur", + customer_segment="Processor", + commodity_id="c0a80123-demo-0000-0000-000000000001", + variety="Yellow FAQ", + contract_qty_mt=Decimal("24.000"), + contract_rate_per_qtl=Decimal("5100.00"), + payment_terms="15 Days", + credit_exposure_ratio=Decimal("107.50"), + credit_override=True, + override_approved_by="smgr@malwa-agri.demo", + grade="FAQ", + order_id="so-demo-001" + ) + sales_order.allocated_qty_mt = Decimal("24.000") + sales_order.status = "FULLY_ALLOCATED" + store.insert("customer_sales_orders", tenant_id, sales_order.to_dict()) + + allocation = SalesOrderAllocation( + tenant_id=tenant_id, + sales_order_id=sales_order.id, + lot_id=lot.id, + warehouse_id="godown-demo-indore", + allocated_qty_mt=Decimal("24.000"), + allocated_bags=480, + lot_qc_status="RELEASED", + available_unreserved_mt=Decimal("24.625"), + allocation_id="alloc-demo-001" + ) + store.insert("sales_order_allocations", tenant_id, allocation.to_dict()) + + dispatch = OutboundDispatch( + tenant_id=tenant_id, + dispatch_number="DSP-2026-089", + sales_order_id=sales_order.id, + allocation_id=allocation.id, + vehicle_id="veh-demo-01", + origin_warehouse_id="godown-demo-indore", + destination_city="Pithampur", + dispatch_id="dispatch-demo-001" + ) + dispatch.transition_status("IN_TRANSIT") + store.insert("outbound_dispatches", tenant_id, dispatch.to_dict()) + + outward_wt = OutwardWeighment( + tenant_id=tenant_id, + dispatch_id=dispatch.id, + tare_weight_kg=Decimal("10200.00"), + gross_weight_kg=Decimal("34200.00"), + allocated_mt=Decimal("24.000"), + loaded_bags=480, + transporter_bilty_no="BLT-2026-089", + eway_bill_no="381044991122", + weighment_id="outward-weigh-demo-001" + ) + store.insert("outward_weighments", tenant_id, outward_wt.to_dict()) + + bilty = DispatchBilty( + tenant_id=tenant_id, + dispatch_id=dispatch.id, + bilty_number="BLT-2026-089", + consignor_name="Malwa Agri Trading Corp Pvt Ltd", + consignee_name="MP Soya Extraction Industries Ltd", + vehicle_reg_no="MP09BC8812", + net_weight_mt=Decimal("24.000"), + bags=480, + eway_bill_no="381044991122", + bilty_id="bilty-demo-001" + ) + store.insert("dispatch_bilties", tenant_id, bilty.to_dict()) + + # 9. Subledgers, Payables, Cess Voucher + customer_invoice = PartySubLedgerEntry( + tenant_id=tenant_id, + party_id="cpty-demo-customer-01", + party_type="CUSTOMER", + voucher_type="SALES_INVOICE", + voucher_number="INV-SALES-2026-089", + debit_amount_inr=Decimal("1224000.00"), + running_balance_inr=Decimal("5374000.00"), + narration="Sales invoice for 24.000 MT Soybean FAQ under Order SO-2026-089 / Bilty BLT-2026-089", + entry_id="subledger-demo-01" + ) + store.insert("party_subledger_entries", tenant_id, customer_invoice.to_dict()) + + supplier_payable = SupplierPayable( + tenant_id=tenant_id, + supplier_id="cpty-demo-supplier-01", + grn_number="GRN-2026-001", + invoice_amount_inr=Decimal("1189141.25"), + grn_date=datetime.now(timezone.utc), + credit_days=7, + sauda_reference="SDA-2026-001", + payable_id="payable-demo-001" + ) + store.insert("supplier_payables", tenant_id, supplier_payable.to_dict()) + + cess_voucher = MandiExpenseVoucher( + tenant_id=tenant_id, + voucher_number="VCH-CESS-2026-001", + expense_category="MANDI_CESS", + amount_inr=Decimal("18187.50"), + payee_name="Indore Mandi Samiti", + payment_mode="BANK_TRANSFER", + debit_account="Mandi Cess Expense", + credit_account="HDFC Bank Current A/C", + linked_sauda_id=sauda_main.id, + narration="1.50% MP Mandi Cess on Sauda SDA-2026-001 gross value ₹12,12,500.00", + voucher_id="voucher-demo-001" + ) + store.insert("mandi_expense_vouchers", tenant_id, cess_voucher.to_dict()) + + # 10. Operational Hazard Alerts + alerts = [ + OperationalAlert( + tenant_id=tenant_id, + category="CREDIT_RISK", + severity="WARNING", + title="Customer Credit Limit Breached: MP Soya", + message="MP Soya Extraction Industries exposure is at 107.5% of approved limit (₹53.74L / ₹50.00L).", + source_entity_type="SALES_ORDER", + source_entity_id=sales_order.id, + alert_id="alert-demo-01" + ), + OperationalAlert( + tenant_id=tenant_id, + category="WAREHOUSE_CAPACITY", + severity="INFO", + title="Indore Godown Capacity at 63%", + message="Central Warehouse Indore is currently holding 3,150 MT out of 5,000 MT capacity.", + source_entity_type="GODOWN", + source_entity_id="godown-demo-indore", + alert_id="alert-demo-02" + ), + ] + for a in alerts: + store.insert("operational_alerts", tenant_id, a.to_dict()) + + # 11. 20-Day Historical Snapshots for Analytics & Dashboard + for day_offset in range(19, -1, -1): + snap_date = today - timedelta(days=day_offset) + # Weekends closed + if snap_date.weekday() >= 5: + continue + + snapshot = DailyTradingSnapshot( + tenant_id=tenant_id, + snapshot_date=str(snap_date), + purchases_mt=Decimal("25.00") if day_offset == 0 else Decimal("0.00"), + sales_mt=Decimal("24.00") if day_offset == 0 else Decimal("0.00"), + closing_stock_mt=Decimal("625.50") + Decimal(str(day_offset * 15)), + total_receivables_inr=Decimal("5374000.00"), + total_payables_inr=Decimal("1189141.25"), + snapshot_id=f"snap-demo-{day_offset}" + ) + store.insert("daily_trading_snapshots", tenant_id, snapshot.to_dict()) + + summary = { + "tenant_id": tenant_id, + "commodities": len(commodities), + "varieties": len(varieties), + "godowns": len(godowns), + "counterparties": len(counterparties), + "fleet": len(fleet), + "policies": 1, + "market_observations": len(observations), + "procurement_sauda": len(saudas), + "gate_entries": 1, + "weighbridge_slips": 1, + "goods_receipt_notes": 1, + "inventory_lots": 1, + "quality_inspections": 1, + "sales_orders": 1, + "dispatches": 1, + "bilties": 1, + "subledger_entries": 1, + "payables": 1, + "cess_vouchers": 1, + "alerts": len(alerts), + } + logger.info("Demo dataset seeded successfully for tenant '%s': %s", tenant_id, summary) + return summary diff --git a/project_code/backend/app/db/session.py b/project_code/backend/app/db/session.py index c4dd1bf..fc8e9b4 100644 --- a/project_code/backend/app/db/session.py +++ b/project_code/backend/app/db/session.py @@ -42,6 +42,40 @@ class InMemoryTenantStorage: self._collections: Dict[str, Dict[str, Dict[str, Any]]] = {} self.active_tenant_id: Optional[str] = None self._pool_connection_id: str = "conn_pool_01" + self._seed_fixtures() + + def _seed_fixtures(self) -> None: + """Seeds baseline fixtures so mock auth and tenants work out of the box.""" + try: + from sandbox.identity_mock import TEST_TENANTS, TEST_MEMBERSHIPS + for t_id, data in TEST_TENANTS.items(): + self.tenants[t_id] = Tenant( + tenant_id=t_id, + business_name=data["business_name"], + legal_identifier=data.get("legal_identifier", f"GSTIN_{t_id}"), + contact_email=data.get("contact_email", f"admin@{t_id}.com"), + primary_mandi=data.get("primary_mandi", "APMC-PUN-01"), + status=data.get("status", "ACTIVE"), + created_at=data.get("created_at") + ) + for m in TEST_MEMBERSHIPS: + mem_id = m["membership_id"] + self.memberships[mem_id] = TenantMembership( + membership_id=mem_id, + tenant_id=m["tenant_id"], + user_id=m["user_id"], + email=m["email"], + role=m["role"], + status=m.get("status", "ACTIVE") + ) + except Exception as exc: + logger.warning("Could not auto-seed baseline fixtures: %s", exc) + + try: + from backend.app.db.demo_seed import seed_demo_dataset + seed_demo_dataset(self, "demo-malwa-agri") + except Exception as exc: + logger.warning("Could not auto-seed demo dataset: %s", exc) def set_tenant_context(self, tenant_id: Optional[str]) -> None: """Sets transaction-local tenant isolation context (SET LOCAL app.current_tenant_id).""" diff --git a/project_code/backend/app/main.py b/project_code/backend/app/main.py index 01c2fe9..768f043 100644 --- a/project_code/backend/app/main.py +++ b/project_code/backend/app/main.py @@ -1017,9 +1017,33 @@ try: status_code = result.pop("status_code", 200) return JSONResponse(status_code=status_code, content=result) + # ========================================================================= + # Sales Demo Engine Endpoints (Commercial Seeding & Side-Effect Free Purge) + # ========================================================================= + @app.post("/api/v1/demo/seed", tags=["Sales Demo"]) + async def seed_sales_demo_data(payload: Optional[Dict[str, Any]] = None): + """POST /api/v1/demo/seed - Seeds complete relational dataset for demo-malwa-agri.""" + from backend.app.db.session import storage + from backend.app.db.demo_seed import seed_demo_dataset + tenant_id = (payload or {}).get("tenant_id", "demo-malwa-agri") + try: + summary = seed_demo_dataset(storage, tenant_id=tenant_id) + return JSONResponse(status_code=200, content={"success": True, "message": "Demo data seeded successfully", "summary": summary}) + except Exception as e: + return JSONResponse(status_code=500, content={"success": False, "error": str(e)}) - + @app.post("/api/v1/demo/cleanup", tags=["Sales Demo"]) + async def cleanup_sales_demo_data(payload: Optional[Dict[str, Any]] = None): + """POST /api/v1/demo/cleanup - Purges demo dataset with zero residue.""" + from backend.app.db.session import storage + from backend.app.db.demo_seed import purge_demo_dataset + tenant_id = (payload or {}).get("tenant_id", "demo-malwa-agri") + try: + metrics = purge_demo_dataset(storage, tenant_id=tenant_id) + return JSONResponse(status_code=200, content={"success": True, "message": "Demo data purged successfully with zero residue", "metrics": metrics}) + except Exception as e: + return JSONResponse(status_code=500, content={"success": False, "error": str(e)}) except ImportError: diff --git a/project_code/compose.yaml b/project_code/compose.yaml index 25bfabb..9cbbc73 100644 --- a/project_code/compose.yaml +++ b/project_code/compose.yaml @@ -58,5 +58,49 @@ services: timeout: 3s retries: 10 + backend: + build: + context: . + dockerfile: docker/Dockerfile.backend + environment: + DATABASE_URL: postgresql://${POSTGRES_USER:-atb}:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env; see .env.example}@postgres:5432/${POSTGRES_DB:-atb} + VALKEY_URL: valkey://valkey:6379/0 + KEYCLOAK_ISSUER: ${KEYCLOAK_ISSUER:-http://keycloak:8080/auth/realms/atb} + KEYCLOAK_CLIENT_ID: ${KEYCLOAK_CLIENT_ID:-atb-portal} + KEYCLOAK_CLIENT_SECRET: ${KEYCLOAK_CLIENT_SECRET:-} + USE_IDENTITY_MOCK: ${USE_IDENTITY_MOCK:-True} + ENVIRONMENT: ${ENVIRONMENT:-development} + LOG_LEVEL: ${LOG_LEVEL:-INFO} + ports: + - "127.0.0.1:8000:8000" + depends_on: + postgres: + condition: service_healthy + valkey: + condition: service_healthy + healthcheck: + test: ["CMD-SHELL", "curl -f http://127.0.0.1:8000/health || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 15s + + frontend: + build: + context: . + dockerfile: docker/Dockerfile.frontend + ports: + - "${PORTAL_PORT:-3000}:80" + depends_on: + backend: + condition: service_healthy + healthcheck: + test: ["CMD-SHELL", "wget --quiet --tries=1 --spider http://127.0.0.1/healthz || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 5s + volumes: postgres_data: + diff --git a/project_code/docker/Dockerfile.frontend b/project_code/docker/Dockerfile.frontend index 3125fab..07c334b 100644 --- a/project_code/docker/Dockerfile.frontend +++ b/project_code/docker/Dockerfile.frontend @@ -14,7 +14,7 @@ COPY frontend/package.json ./ RUN npm install COPY frontend/ ./ -RUN npm run build || (mkdir -p dist && cp index.html dist/index.html) +RUN npm run build # ---- Stage 2: Hardened Nginx Runtime ---- FROM nginx:1.27-alpine AS runtime diff --git a/project_code/docs/development/docker-compose.md b/project_code/docs/development/docker-compose.md index 841ebca..878893e 100644 --- a/project_code/docs/development/docker-compose.md +++ b/project_code/docs/development/docker-compose.md @@ -28,6 +28,8 @@ The services publish ports on loopback only: | PostgreSQL | `127.0.0.1:5432` | `atb` database and user from `.env` | | Keycloak | | Local identity server; admin credentials from `.env` | | Valkey | `127.0.0.1:6379` | Local cache/stream dependency | +| Backend | `127.0.0.1:8000` | FastAPI application API (Swagger docs at `/docs`) | +| Frontend | `http://localhost:3000` | Hardened Nginx reverse proxy & React SPA portal | PostgreSQL also creates a separate `keycloak` database and login for Keycloak. Both databases share one local PostgreSQL container; this is a workstation convenience, not a production isolation recommendation. PostgreSQL data survives `docker compose down` in the named `postgres_data` volume. Valkey is intentionally ephemeral because the durable outbox belongs in PostgreSQL. @@ -48,6 +50,6 @@ To erase the local PostgreSQL data as well, add `--volumes` to the `down` comman The example uses the [PostgreSQL Docker Official Image](https://hub.docker.com/_/postgres), [Keycloak's official container image](https://www.keycloak.org/server/containers) from `quay.io/keycloak/keycloak`, and the [Valkey project's image](https://hub.docker.com/r/valkey/valkey). Release tags are pinned in `project_code/.env.example`; they are not immutable digest pins, and this repository has not configured image signature verification or a vendor certification policy. Review and update the selected tags through normal dependency maintenance. -The current repository has no application API, worker, frontend, migration, or test-runner source to build. Those services should be added to this Compose project as their implementation and test artifacts are authored; this file does not use placeholder build contexts. Mail capture, object-storage emulation, reverse proxy, and observability services are also omitted until their iteration needs and providers are selected. +The Compose project includes the core FastAPI backend API and hardened React SPA frontend services authored during Construction iterations, building directly from `docker/Dockerfile.backend` and `docker/Dockerfile.frontend`. Mail capture, object-storage emulation, and external observability services remain optional overlays until their iteration needs and providers are selected. This Compose configuration does not select a production runtime, change the approved production availability/recovery requirements, or demonstrate production readiness. Production hosting and its evidence gates remain open in the deployment design. diff --git a/project_code/frontend/package-lock.json b/project_code/frontend/package-lock.json new file mode 100644 index 0000000..1177b06 --- /dev/null +++ b/project_code/frontend/package-lock.json @@ -0,0 +1,3136 @@ +{ + "name": "atb-frontend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "atb-frontend", + "version": "1.0.0", + "dependencies": { + "lucide-react": "^0.453.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "zustand": "^4.5.5" + }, + "devDependencies": { + "@types/react": "^18.3.11", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react": "^4.3.2", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.47", + "tailwindcss": "^3.4.13", + "typescript": "^5.6.3", + "vite": "^5.4.8", + "vitest": "^2.1.2" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.3.0.tgz", + "integrity": "sha512-U4+70Pc5ZS9osnCBCE5Jha/ciHM+Yp+CNMNC/7HvYbNRk1Ldd+f7qO65W5qfhu/TCv+/ozljlXXe9Nj8419DMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz", + "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz", + "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.9", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.7.tgz", + "integrity": "sha512-GFF2tHk0NqYVObrK0+/ps/LEXsV/v2q6Lyiy7mZr+Ej24fpQScvqK2ziz9NHeEQYnKWKym38Ml7dZbPtC9tuAw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.7.tgz", + "integrity": "sha512-BOymcXJFYYXqluDidj6sLelNjXruC3u1BqVxLn2OPCXH9xaPSOTH+MS4uychsGI1NU7tJoiv9KvqijDHFe+hhQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.7.tgz", + "integrity": "sha512-jgVpGweIbls2H5jfBB70tnX52abMd5pJr3xmtoDILx6JdmGl+Un+tMb9R+MbHPVB46tTBpY8emtn7M71SnQhEQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.7.tgz", + "integrity": "sha512-AVMpt94mrXH7WjyWKmd9nT4RC5yM0AN3Lt6A89xVIsuLDi3dDX6dxMytLbW36FlppY9JsoqUoS3LUUpUrYxiMQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.7.tgz", + "integrity": "sha512-Nje29c/MyajxRNFGU05oyeTDS6SWdMg/wWMSlZSBTBju5BKz2NVc0kFiFSQGzRELNiB+CBk/ZvAVsWsENgjGag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.7.tgz", + "integrity": "sha512-xxgN5/kMzCNz/NYJ4t49B0/WS6InNlWv6xvgwUQqNnWM9WJMMwMUGWrAxdNEgYWdHL0sMnuh8I87StGrIMTA+w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.7.tgz", + "integrity": "sha512-5U/9gVn/X657I8+NHoHO9Wnfyd0lEXwqbslobRoB9TC8SwYzOitcIr6TLE7531Q/NWs3L4mb+YOGzlf3vHIeYw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.7.tgz", + "integrity": "sha512-hcDS0a/Y8ggM3dcOfzH7UpSaogCViWTtNDSl0EXpWIj8g8/r86ITqptjil2hayTXS0Umzb+Yt3mjgpQVFVf2+A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.7.tgz", + "integrity": "sha512-awbAr4N7Qd/yjZAQBEEPzgcPveYG2Gi5L6gq1/Bp+3SMRjn5F68Wv1zKsntzvvoioBR6yKvhLtWqu11am1TsxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.7.tgz", + "integrity": "sha512-Ut7xQJfeLhzu2yN3rHzVvL9ccyPJvN4aCdP1V7hJ5lGxX/eCzgB9SiMk/Md3J+rWWZgvoYsDW4BUFggJr32pBA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.7.tgz", + "integrity": "sha512-trqoni/vHkuM5oo5iQhoKPh6fjjD7E80pMgCXWgGxU8vSRPUlwvG8GeYvEEcB6eJAxNa99WH9iVHPHelgtKiHA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.7.tgz", + "integrity": "sha512-gvlUy0XFIwtUWiQmhc+4GT2Knm3KosinpUVhr7CtTFA78gFDnE5NWwMPzHrJsYpKkh2LlY7yvBIboN1FAV6Xeg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.7.tgz", + "integrity": "sha512-8yS/kSXTJ/47Z62JW+C2AJ3vd/8zZw016vFjtNpZwmZlwJumLua4s1i78dkYuSSqQ+0aIMxJcBp/4uIwp2ehjA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.7.tgz", + "integrity": "sha512-mxVSKvvty0hOP1AFo/l4Kpv3i3HK0zx4rYUrirZDToYlWhS3xzmIkq3vUJ7rtrM2cPyXveDyDT6M1FfXZ9hTRA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.7.tgz", + "integrity": "sha512-lEse1zra1CagM+uHH2bl28GInDsZZ45NJzHei2OMaXQFzZWKBO1hFo07rS0xB6ayV4WU360UrSmPDSyCMpYsUQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.7.tgz", + "integrity": "sha512-d/cqCoiG9WMZ5VuJZ5Qdlv9g97QyoGwnmvHccvGhKSacTy7xFrAS+jMcJSBdMNOw1oacSkl6p7K6O/DRYTKL3g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.7.tgz", + "integrity": "sha512-kVEA//CeDOZZP1XCH2JBgqXb9+ALlwuA/4civaazMVdgzaSQC9WM38w65zG/LLk0lA7F9Od19CSBZW7J9mCbNg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.7.tgz", + "integrity": "sha512-14oLfDsOSr0TSntT/34jRg/V8B2XW/Jomh9zX9CjIM9gwwNlI1OCymS/GVn0DV32h67eRf7U0GGem0rvfXgNwQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.7.tgz", + "integrity": "sha512-dFVtPfjZqAnUPpPY4Bfg+87yo1IBW9HiY8iCFtg49Pn46MfZTebSHZh8PL6SOsgyt9LQP8Nj/sE6jm3aWpySmQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.7.tgz", + "integrity": "sha512-Dm9CZ2SM3u2NgvBj4awW/gGqkOwzH8f6MSYIJE6+bKcKLI+T0+LhpD6vtetTfrIIx+rLXDf5RJqBP6v7V5O+wg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.7.tgz", + "integrity": "sha512-oaxsvS2mL6+78741CT2HCORBvy1USg3Wqpt5qvZwy3aMXRMl4zxyDo8maeFRWJkF3dp0Wbi71fKH5Gr9YI3vYA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.7.tgz", + "integrity": "sha512-UKZz1Y4mxUqkWh60uH7B1aZn6UcAimPk4ipRktpb3wfZq7JrzZYyAXTwiafkb3T+kd5P3Sf+vzcRdsDks4WtjQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.7.tgz", + "integrity": "sha512-WWkSuC1J+mZJnsDh0mRaCAFSWfQdl6y3fDjZeWElI6zHo8CcOSG5lY3yurKJjEq+FrX0WD60sFrVVpbHqzMmrw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.7.tgz", + "integrity": "sha512-u9bp2yXCI3/BUjUxY6uWknAY32pfvvDCPysyUTySotx0dj3ydlFHrRQYfn/b/kZgnfjyEwySMtI7Ga054uiysQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.7.tgz", + "integrity": "sha512-EhX6N3XPMEnVU5cRfNgzPOKcSucsbu3nNNWuoAaEuKIqmddBKHN5b9d4rPe65T1I+FaOT176JKiZNsUBp3rqbA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.31", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", + "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/autoprefixer": { + "version": "10.6.1", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.1.tgz", + "integrity": "sha512-cL1Qz6ADZhcEbny/8HPfe99J6HhNoYtpX2LFLIbhgGE7Q1hlQVkYFdetDN7Id3KiQxhDrHwzlHr/YQCnZ8+xSA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.9", + "caniuse-lite": "^1.0.30001810", + "fraction.js": "^5.3.4", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.28", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz", + "integrity": "sha512-br0LOmjJqr6Rt4AEkadbcNf67Zpo7EPwKsWbjnRrJIa1QYFHQBqM4C7F2WTbV8ahTEcg1Eo+Y0aWjjORInYFyA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001816", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001816.tgz", + "integrity": "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.456", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.456.tgz", + "integrity": "sha512-8hboqI6xesozteFb8aa7OGknvxUtTeRJLz0FoePysUEh/oWbddykIGdgpEJRbPRg/nIMfBf2DFos+H2MtvJl2A==", + "dev": true, + "license": "ISC" + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz", + "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", + "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react": { + "version": "0.453.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.453.0.tgz", + "integrity": "sha512-kL+RGZCcJi9BvJtzg2kshO192Ddy9hv3ij+cPrVPWSRzgCWCVazoQJxOjAwgK53NomL07HB7GPHW120FimjNhQ==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.59.tgz", + "integrity": "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.5.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.30.tgz", + "integrity": "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", + "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.4.tgz", + "integrity": "sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-cache": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.2.tgz", + "integrity": "sha512-/peqiBB/n07gQGLsWaHho3WfvUyRscw0gYTsEFMhrIe/nWLkYaf5SbKYjGYqtRV3aPwykJgF2VEMo1ac4bnsGA==", + "dev": true, + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.17.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.64.7", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.7.tgz", + "integrity": "sha512-aCiJONoZp0lNGJ6sYqspLkh6UXaWEey/7Ko2TZyXQ4kgzAhDUxAgbt/oulXKmD+zFHXw1k+RF6ZZWOrjp7DZnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.64.7", + "@rollup/rollup-android-arm64": "4.64.7", + "@rollup/rollup-darwin-arm64": "4.64.7", + "@rollup/rollup-darwin-x64": "4.64.7", + "@rollup/rollup-freebsd-arm64": "4.64.7", + "@rollup/rollup-freebsd-x64": "4.64.7", + "@rollup/rollup-linux-arm-gnueabihf": "4.64.7", + "@rollup/rollup-linux-arm-musleabihf": "4.64.7", + "@rollup/rollup-linux-arm64-gnu": "4.64.7", + "@rollup/rollup-linux-arm64-musl": "4.64.7", + "@rollup/rollup-linux-loong64-gnu": "4.64.7", + "@rollup/rollup-linux-loong64-musl": "4.64.7", + "@rollup/rollup-linux-ppc64-gnu": "4.64.7", + "@rollup/rollup-linux-ppc64-musl": "4.64.7", + "@rollup/rollup-linux-riscv64-gnu": "4.64.7", + "@rollup/rollup-linux-riscv64-musl": "4.64.7", + "@rollup/rollup-linux-s390x-gnu": "4.64.7", + "@rollup/rollup-linux-x64-gnu": "4.64.7", + "@rollup/rollup-linux-x64-musl": "4.64.7", + "@rollup/rollup-openbsd-x64": "4.64.7", + "@rollup/rollup-openharmony-arm64": "4.64.7", + "@rollup/rollup-win32-arm64-msvc": "4.64.7", + "@rollup/rollup-win32-ia32-msvc": "4.64.7", + "@rollup/rollup-win32-x64-gnu": "4.64.7", + "@rollup/rollup-win32-x64-msvc": "4.64.7", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.19", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", + "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.7", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", + "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/zustand": { + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", + "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "^1.2.2" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0.6", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + } + } +} diff --git a/project_code/frontend/src/App.tsx b/project_code/frontend/src/App.tsx index 0f9c0a7..a326ee7 100644 --- a/project_code/frontend/src/App.tsx +++ b/project_code/frontend/src/App.tsx @@ -3,19 +3,330 @@ import { authStore } from './stores/authStore'; import { tenantStore } from './stores/tenantStore'; import { LoginView } from './features/auth/LoginView'; import { SessionView } from './features/auth/SessionView'; +import { AccessDeniedView } from './features/auth/AccessDeniedView'; import { HeaderTenantSwitcher } from './features/tenant/HeaderTenantSwitcher'; import { PlatformTenantsView } from './features/tenant/PlatformTenantsView'; import { TenantMembersView } from './features/tenant/TenantMembersView'; import { AuditLogView } from './features/tenant/AuditLogView'; -import { Shield, Building2, Users, FileText, LogOut, Layers } from 'lucide-react'; +import { MarketDeskView } from './features/market/MarketDeskView'; +import { SaudaProcurementView } from './features/procurement/SaudaProcurementView'; +import { GateEntryView } from './features/receiving/GateEntryView'; +import { QualityLabView } from './features/quality/QualityLabView'; +import { StockLedgerView } from './features/inventory/StockLedgerView'; +import { SalesOrderView } from './features/sales/SalesOrderView'; +import { DispatchBoardView } from './features/logistics/DispatchBoardView'; +import { FinanceLedgerView } from './features/finance/FinanceLedgerView'; +import { ExecutiveDashboardView } from './features/reporting/ExecutiveDashboardView'; +import { MasterDataView } from './features/admin/MasterDataView'; +import { + Shield, + Building2, + Users, + FileText, + LogOut, + Layers, + TrendingUp, + ShoppingCart, + UserCheck, + Truck, + FlaskConical, + Warehouse, + FileSpreadsheet, + Send, + DollarSign, + BarChart3, + Database +} from 'lucide-react'; + +export type TabId = + | 'market' + | 'procurement' + | 'receiving' + | 'quality' + | 'inventory' + | 'sales' + | 'logistics' + | 'finance' + | 'dashboard' + | 'admin' + | 'members' + | 'tenants' + | 'audit' + | 'sessions'; + +/** + * Surface Route Mapping Registry. + * Explicitly associates URL routes from the SDLC Delivery Surface Matrix + * with their active frontend operational components. + */ +export const APP_ROUTE_SURFACE_MAP: Record = { + // Iteration 03 / UC-002: Mandi Market Desk + '/market/observations': 'market', + '/market/rates/latest': 'market', + '/market-desk/trends': 'dashboard', + + // Iteration 03 / UC-004: Inward Receiving & Gate Entry + '/receiving/gate-entry': 'receiving', + '/receiving/gate-entry/{id}': 'receiving', + '/receiving/weighbridge': 'receiving', + '/receiving/grn': 'receiving', + '/receiving/grn/{id}': 'receiving', + '/inventory/lots': 'receiving', + + // Iteration 03 / UC-005 & UC-006: Quality Lab & Lot Governance + '/quality/inspection/new': 'quality', + '/quality/inspection/{id}': 'quality', + '/quality/lots/{id}': 'quality', + '/quality/settlement/{id}': 'quality', + '/quality/lots/{lot_id}/certificate': 'quality', + + // Iteration 04 / UC-007: Warehouse Inventory + '/inventory/ledger': 'inventory', + '/inventory/capacity': 'inventory', + '/inventory/transfers': 'inventory', + + // Iteration 04 / UC-008: Sales Contracts + '/sales/orders': 'sales', + '/sales/orders/new': 'sales', + '/sales/orders/{id}': 'sales', + + // Iteration 04 / UC-009 & UC-010: Outbound Logistics & Fleet + '/logistics/dispatch-board': 'logistics', + '/logistics/weighbridge': 'logistics', + '/logistics/bilty/{id}': 'logistics', + '/logistics/pod': 'logistics', + '/logistics/fleet': 'logistics', + + // Iteration 05 / UC-011, UC-012, UC-013: Finance Settlement + '/finance/receivables': 'finance', + '/finance/receivables/exposure': 'finance', + '/finance/receivables/locks': 'finance', + '/finance/receipts': 'finance', + '/finance/receipts/new': 'finance', + '/finance/payables': 'finance', + '/finance/expenses': 'finance', + '/finance/expenses/new': 'finance', + + // Iteration 06 / UC-003, UC-014, UC-015: Executive Dashboard & Alerts + '/dashboard': 'dashboard', + '/alerts': 'dashboard', + '/reporting/trends': 'dashboard', + + // Iteration 07 / UC-016, UC-020, UC-026: Master Data & Policies + '/admin/master-data/commodities': 'admin', + '/admin/master-data/counterparties': 'admin', + '/admin/support/grants': 'admin', + '/admin/policies': 'admin', +}; + +interface NavItemConfig { + id: TabId; + label: string; + icon: React.ComponentType<{ className?: string }>; + allowedRoles: string[]; +} + +const ALL_NAV_ITEMS: NavItemConfig[] = [ + { + id: 'market', + label: 'Market Desk', + icon: TrendingUp, + allowedRoles: [ + 'Mandi Buyer', + 'Purchase Manager', + 'Partner / MD', + 'Tenant Administrator', + 'Desk Trader', + 'Procurement Officer', + 'Sales Executive', + 'Sales Manager', + 'Accounts Executive' + ], + }, + { + id: 'procurement', + label: 'Sauda Booking', + icon: ShoppingCart, + allowedRoles: [ + 'Mandi Buyer', + 'Purchase Manager', + 'Partner / MD', + 'Tenant Administrator', + 'Procurement Officer', + 'Accounts Executive' + ], + }, + { + id: 'receiving', + label: 'Gate & Receiving', + icon: Truck, + allowedRoles: [ + 'Mandi Buyer', + 'Purchase Manager', + 'Partner / MD', + 'Tenant Administrator', + 'Procurement Officer', + 'Quality Officer', + 'Warehouse Clerk' + ], + }, + { + id: 'quality', + label: 'Quality Lab Assay', + icon: FlaskConical, + allowedRoles: [ + 'Quality Officer', + 'Quality Inspector', + 'Lab Chemist', + 'Purchase Manager', + 'Partner / MD', + 'Tenant Administrator' + ], + }, + { + id: 'inventory', + label: 'Stock Ledger', + icon: Warehouse, + allowedRoles: [ + 'Warehouse Clerk', + 'Purchase Manager', + 'Partner / MD', + 'Tenant Administrator', + 'Desk Trader', + 'Accounts Executive' + ], + }, + { + id: 'sales', + label: 'Sales Contracts', + icon: FileSpreadsheet, + allowedRoles: [ + 'Sales Executive', + 'Sales Manager', + 'Desk Trader', + 'Partner / MD', + 'Tenant Administrator', + 'Accounts Executive' + ], + }, + { + id: 'logistics', + label: 'Dispatch & Fleet', + icon: Send, + allowedRoles: [ + 'Warehouse Clerk', + 'Sales Executive', + 'Sales Manager', + 'Partner / MD', + 'Tenant Administrator' + ], + }, + { + id: 'finance', + label: 'Finance Settlement', + icon: DollarSign, + allowedRoles: [ + 'Accounts Executive', + 'Partner / MD', + 'Tenant Administrator', + 'Sales Manager' + ], + }, + { + id: 'dashboard', + label: 'Executive Control', + icon: BarChart3, + allowedRoles: [ + 'Partner / MD', + 'Tenant Administrator', + 'Purchase Manager', + 'Sales Manager', + 'Accounts Executive' + ], + }, + { + id: 'admin', + label: 'Master Administration', + icon: Database, + allowedRoles: [ + 'Tenant Administrator', + 'Partner / MD', + 'System Administrator' + ], + }, + { + id: 'members', + label: 'Tenant Members', + icon: Users, + allowedRoles: ['Tenant Administrator', 'Partner / MD'], + }, + { + id: 'tenants', + label: 'Platform Tenants', + icon: Building2, + allowedRoles: ['System Administrator'], + }, + { + id: 'audit', + label: 'Security Audit', + icon: FileText, + allowedRoles: ['Tenant Administrator', 'System Administrator'], + }, + { + id: 'sessions', + label: 'Session Governance', + icon: Shield, + allowedRoles: ['*'], // All authenticated roles + }, +]; + +const resolveDefaultTab = (roles: string[]): TabId => { + if (roles.includes('Partner / MD') || roles.includes('Tenant Administrator')) { + return 'dashboard'; + } + if (roles.includes('Mandi Buyer') || roles.includes('Purchase Manager')) { + return 'market'; + } + if (roles.includes('Sales Executive') || roles.includes('Sales Manager')) { + return 'sales'; + } + if (roles.includes('Accounts Executive')) { + return 'finance'; + } + if (roles.includes('Quality Officer') || roles.includes('Lab Chemist')) { + return 'quality'; + } + if (roles.includes('Warehouse Clerk')) { + return 'receiving'; + } + if (roles.includes('System Administrator')) { + return 'tenants'; + } + return 'market'; +}; export const App: React.FC = () => { - const [activeTab, setActiveTab] = useState<'sessions' | 'tenants' | 'members' | 'audit'>('sessions'); const [isAuthenticated, setIsAuthenticated] = useState(authStore.getState().isAuthenticated); + const [currentUser, setCurrentUser] = useState(authStore.getState().user); + const userRoles = currentUser?.roles || []; + + const [activeTab, setActiveTab] = useState(() => resolveDefaultTab(userRoles)); useEffect(() => { return authStore.subscribe(() => { - setIsAuthenticated(authStore.getState().isAuthenticated); + const state = authStore.getState(); + setIsAuthenticated(state.isAuthenticated); + setCurrentUser(state.user); + const roles = state.user?.roles || []; + setActiveTab((prev) => { + const allowed = ALL_NAV_ITEMS.filter((item) => + item.allowedRoles.includes('*') || item.allowedRoles.some((r) => roles.includes(r)) + ).map((i) => i.id); + if (!allowed.includes(prev)) { + return resolveDefaultTab(roles); + } + return prev; + }); }); }, []); @@ -23,12 +334,15 @@ export const App: React.FC = () => { return ; } - const navItems = [ - { id: 'sessions' as const, label: 'Session Governance', icon: Shield }, - { id: 'tenants' as const, label: 'Platform Tenants', icon: Building2 }, - { id: 'members' as const, label: 'Tenant Members', icon: Users }, - { id: 'audit' as const, label: 'Security Audit', icon: FileText }, - ]; + // Filter navigation items strictly against current role claims (BRD-FR-040 RBAC) + const isRoleAllowed = (allowedRoles: string[]) => { + if (allowedRoles.includes('*')) return true; + return allowedRoles.some((role) => userRoles.includes(role)); + }; + + const authorizedNavItems = ALL_NAV_ITEMS.filter((item) => isRoleAllowed(item.allowedRoles)); + const currentTabConfig = ALL_NAV_ITEMS.find((item) => item.id === activeTab); + const isCurrentTabAuthorized = currentTabConfig ? isRoleAllowed(currentTabConfig.allowedRoles) : false; return (
@@ -49,12 +363,26 @@ export const App: React.FC = () => {
- {/* Navigation Items */} -