53 lines
2.1 KiB
Python
53 lines
2.1 KiB
Python
# /home/Autopartes/pos/services/catalog_service.py
|
|
"""Catalog service: TecDoc vehicle hierarchy queries with local stock enrichment.
|
|
|
|
Stub — full implementation in Task 1 of the catalog vehicle navigation plan.
|
|
Each function queries the master (nexus_autoparts) DB for vehicle/part hierarchy
|
|
and optionally enriches with tenant stock data.
|
|
"""
|
|
|
|
|
|
def get_brands(master_conn):
|
|
"""Return vehicle brands that have parts in the catalog."""
|
|
raise NotImplementedError("catalog_service.get_brands — implement in Task 1")
|
|
|
|
|
|
def get_models(master_conn, brand_id):
|
|
"""Return models for a given brand."""
|
|
raise NotImplementedError("catalog_service.get_models — implement in Task 1")
|
|
|
|
|
|
def get_years(master_conn, model_id):
|
|
"""Return years for a given model."""
|
|
raise NotImplementedError("catalog_service.get_years — implement in Task 1")
|
|
|
|
|
|
def get_engines(master_conn, model_id, year_id):
|
|
"""Return engines/MYE entries for a model+year combination."""
|
|
raise NotImplementedError("catalog_service.get_engines — implement in Task 1")
|
|
|
|
|
|
def get_categories(master_conn, mye_id):
|
|
"""Return part categories that have parts for the given vehicle (MYE)."""
|
|
raise NotImplementedError("catalog_service.get_categories — implement in Task 1")
|
|
|
|
|
|
def get_groups(master_conn, mye_id, category_id):
|
|
"""Return part groups (subcategories) for vehicle + category."""
|
|
raise NotImplementedError("catalog_service.get_groups — implement in Task 1")
|
|
|
|
|
|
def get_parts(master_conn, mye_id, group_id, tenant_conn, branch_id, page, per_page):
|
|
"""Return parts for vehicle + group, enriched with local stock/pricing."""
|
|
raise NotImplementedError("catalog_service.get_parts — implement in Task 1")
|
|
|
|
|
|
def get_part_detail(master_conn, part_id, tenant_conn, branch_id):
|
|
"""Return full part detail with bodegas, stock, and alternatives."""
|
|
raise NotImplementedError("catalog_service.get_part_detail — implement in Task 1")
|
|
|
|
|
|
def smart_search(master_conn, query, tenant_conn, branch_id, limit):
|
|
"""Smart search: match by part number, OEM, or text across catalog."""
|
|
raise NotImplementedError("catalog_service.smart_search — implement in Task 1")
|