feat: ability to reset marketplace

This commit is contained in:
2024-11-11 10:41:51 +03:00
parent 8cb94d06bf
commit 4841578dee
7 changed files with 47 additions and 2 deletions

View File

@@ -36,7 +36,8 @@ def get_marketplace_suppliers_and_company_warehouses(marketplace: Marketplace):
async def get_stocks_data(
session: AsyncSession,
marketplace: Marketplace,
product_ids: Union[list[int], None] = None
product_ids: Union[list[int], None] = None,
reset: bool = False
) -> List[StockData]:
if not product_ids:
product_ids = []
@@ -302,7 +303,7 @@ async def get_stocks_data(
slaves_stock,
price_recommended,
is_archived) in marketplace_products:
if is_archived or (sell_from_price > price_recommended) or is_paused:
if is_archived or (sell_from_price > price_recommended) or is_paused or reset:
response.append({
'article': denco_article,
'full_stock': 0,