Schliesse das Notebook-Source-Mapping, damit Wizard und Taxonomie ohne leere Kategorie starten.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b276758ee1
commit
d784248e28
13 files changed
+1505
-9
No files matched your search
@@ -9,7 +9,7 @@ from sqlalchemy.orm import Session
|
||||
from app.domain.validation import parse_scoring_model
|
||||
from app.persistence.db import SessionLocal
|
||||
from app.persistence.models import ScoringModelRecord, SourceRecord
|
||||
from app.services.catalog_service import ensure_product_category
|
||||
from app.services.catalog_service import ensure_product_category, ensure_source_category
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
RULES = ROOT / "rules" / "generic-v1.json"
|
||||
@@ -19,6 +19,14 @@ def run_bootstrap(session: Session) -> None:
|
||||
_seed_source(session)
|
||||
_seed_scoring_model(session)
|
||||
ensure_product_category(session, "notebook", "Notebooks")
|
||||
ensure_source_category(
|
||||
session,
|
||||
source_id="geizhals",
|
||||
external_category_key="nb",
|
||||
product_category_id="notebook",
|
||||
name="Notebooks",
|
||||
source_url="https://geizhals.de/?cat=nb",
|
||||
)
|
||||
session.commit()
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.discovery.definitions import get_definition_by_key, upsert_definition
|
||||
from app.persistence.models import AttributeDefinitionRecord
|
||||
from app.services.catalog_service import ensure_product_category
|
||||
from app.services.catalog_service import ensure_product_category, ensure_source_category
|
||||
|
||||
|
||||
NOTEBOOK_ATTRIBUTE_SEEDS = (
|
||||
@@ -72,6 +72,14 @@ NOTEBOOK_CRITERION_SEEDS = (
|
||||
|
||||
def seed_notebook_pilot(session: Session) -> None:
|
||||
ensure_product_category(session, "notebook", "Notebooks")
|
||||
ensure_source_category(
|
||||
session,
|
||||
source_id="geizhals",
|
||||
external_category_key="nb",
|
||||
product_category_id="notebook",
|
||||
name="Notebooks",
|
||||
source_url="https://geizhals.de/?cat=nb",
|
||||
)
|
||||
for item in NOTEBOOK_ATTRIBUTE_SEEDS:
|
||||
if session.get(AttributeDefinitionRecord, item["key"]) is None:
|
||||
session.add(AttributeDefinitionRecord(**item, description=None))
|
||||
|
||||
Reference in new issue
Block a user