mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-09-30 08:53:13 +00:00
Playwright-based menu scraper for Redefine Meals, self-contained HTML order form with S3/CloudFront hosting, DynamoDB-backed order submission via API Gateway, and automated payroll deduction reports via SES.
26 lines
619 B
Python
26 lines
619 B
Python
import json
|
|
import os
|
|
|
|
import boto3
|
|
|
|
from shared.db import current_week, get_form_status, set_form_status
|
|
|
|
_lambda = boto3.client("lambda")
|
|
|
|
|
|
def lambda_handler(event, context):
|
|
week = event.get("week", current_week())
|
|
|
|
status = get_form_status(week)
|
|
if status == "closed":
|
|
return {"status": "already_closed", "week": week}
|
|
|
|
set_form_status(week, "closed")
|
|
|
|
_lambda.invoke(
|
|
FunctionName=os.environ["AGGREGATE_FUNCTION_ARN"],
|
|
InvocationType="Event",
|
|
Payload=json.dumps({"week": week}),
|
|
)
|
|
|
|
return {"status": "closed", "week": week, "aggregate_triggered": True}
|