1er
This commit is contained in:
1
backend/app/services/__init__.py
Normal file
1
backend/app/services/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Services utilitaires côté backend."""
|
||||
BIN
backend/app/services/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
backend/app/services/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
backend/app/services/__pycache__/pricing.cpython-313.pyc
Normal file
BIN
backend/app/services/__pycache__/pricing.cpython-313.pyc
Normal file
Binary file not shown.
12
backend/app/services/pricing.py
Normal file
12
backend/app/services/pricing.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def price_trend(prices: list[float]) -> str:
|
||||
if not prices:
|
||||
return "stable"
|
||||
first, last = prices[0], prices[-1]
|
||||
if last > first:
|
||||
return "up"
|
||||
if last < first:
|
||||
return "down"
|
||||
return "stable"
|
||||
Reference in New Issue
Block a user