refactor: change backup_orders to use cutoff param instead of start/end
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -9,8 +9,7 @@ from order_bak.csv_utils import CSV_COLUMNS, entity_to_row, parse_row
|
||||
def backup_orders(
|
||||
scan_path: Path,
|
||||
backup_dir: Path,
|
||||
start: datetime,
|
||||
end: datetime,
|
||||
cutoff: datetime,
|
||||
) -> int:
|
||||
backup_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -25,7 +24,7 @@ def backup_orders(
|
||||
order_time = entity["OrderTime"]
|
||||
if order_time is None:
|
||||
continue
|
||||
if order_time < start or order_time >= end:
|
||||
if order_time >= cutoff:
|
||||
continue
|
||||
date_key = order_time.strftime("%Y-%m-%d")
|
||||
by_date[date_key].append(entity)
|
||||
|
||||
Reference in New Issue
Block a user