You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
557 B
Python

import pandas as pd
from repository.wms_ingredients_log_repository import WmsIngredientsLogRepository
class WmsIngredientsService:
def __init__(self):
self.repo = WmsIngredientsLogRepository()
def get_monthly_weight_df(self):
rows = self.repo.get_monthly_net_weight()
df = pd.DataFrame(rows, columns=["month", "total_weight"])
df["month"] = pd.to_datetime(df["month"])
return df
def get_ingredients_log_by_code_sn(self, code_sn: str):
return self.repo.get_ingredients_log_by_code_sn(code_sn)