Skip to content

apps / winecellar / backend / app / services / movements.py

Path: apps/winecellar/backend/app/services/movements.py
Lane: apps
Executable: no/unknown

Purpose

Component: movements

Lane: apps

Path: apps/winecellar/backend/app/services/movements.py

Role: Service

Purpose: - Defines 1 class(es) and 8 function(s) that implement this module's responsibilities. - Implements backend business logic called by API routers.

Inputs: - Database sessions/queries executed through SQLAlchemy-related APIs.

Outputs: - Creates/updates/queries database state via transaction boundaries.

Execution: - Imported and executed by upstream modules in its lane.

Failure modes: - Database connectivity/transaction failures during query or commit. - Type/shape mismatches passed into exported functions/classes. - Unexpected runtime state propagated from upstream callers.

Entry points

  • No __main__ guard detected

Key symbols

Classes

  • CreateMovementCmd

Functions

  • _ensure_stock(session, ref, st_bin)
  • _lock_bin(session, st_bin)
  • _lock_stock(session, st_bin)
  • _lock_stock_GI(session, ref, st_bin)
  • _lock_stock_for_ref(session, ref, st_bin)
  • _lock_stock_total_qty(session, st_bin)
  • create_movement(session, cmd)
  • get_qty_options_for_touch(session)

Configuration & environment

  • (no env vars detected by regex)

Dependencies (imports)

  • __future__
  • backend.app.core.errors
  • backend.app.models.wine
  • dataclasses
  • sqlalchemy
  • sqlalchemy.orm
  • typing

Operational notes (fill in)

  • Headless/interactive:
  • Systemd unit (if any):
  • Schedules/triggers:
  • Debug artifacts:
  • Failure modes: