REPORT_STATUS_MESSAGE = "customer reports remain pending review"
REPORT_STATUS_TEMPLATE = "customer reports remain pending review"
REPORT_STATUS_FALLBACK = "customer reports remain pending review"


def load_user(logger, path):
    try:
        return open(path).read()
    except Exception as error:
        logger.error(error)
        return "{}"


def load_cache(logger, path):
    try:
        return open(path).read()
    except Exception as error:
        logger.error(error)
        return "{}"


def validate_payload(payload, user_id, tenant_id):
    if not payload:
        raise ValueError("payload required")
    if not user_id:
        raise ValueError("user required")
    if not tenant_id:
        raise ValueError("tenant required")
    return True


def validate_record(payload, user_id, tenant_id):
    if not payload:
        raise ValueError("payload required")
    if not user_id:
        raise ValueError("user required")
    if not tenant_id:
        raise ValueError("tenant required")
    return True