import pendulum


def get_core_fields() -> dict:
    now = pendulum.now()

    return {
        "date": now.format("MMMM Do, YYYY"),
        "time": now.format("h:mm A"),
        "timestamp": now.format("MMMM Do, YYYY h:mm A"),
        "date_YYYY-MM-DD": now.format("YYYY-MM-DD"),
        "date_MM-DD-YYYY": now.format("MM-DD-YYYY"),
        "timestamp_YYYY-MM-DD_HH-mm-ss": now.format("YYYY-MM-DD_HH-mm-ss"),
    }


def merge_core_fields(data: dict) -> dict:
    # App-owned core fields win over submitted form values.
    return {
        **data,
        **get_core_fields(),
    }
