"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from enum import Enum
from gusto_embedded.types import BaseModel
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict


class RecoveryCaseStatus(str, Enum):
    r"""Status of the recovery case"""

    OPEN = "open"
    REDEBIT_INITIATED = "redebit_initiated"
    WIRE_INITIATED = "wire_initiated"
    RECOVERED = "recovered"
    LOST = "lost"


class RecoveryCaseTypedDict(TypedDict):
    r"""Representation of a recovery case"""

    uuid: str
    r"""Unique identifier of an recovery case"""
    company_uuid: NotRequired[str]
    r"""Unique identifier of the company to which the recovery case belongs"""
    status: NotRequired[RecoveryCaseStatus]
    r"""Status of the recovery case"""
    latest_error_code: NotRequired[str]
    r"""The latest bank error code for the recovery case. See [this doc](https://docs.gusto.com/embedded-payroll/docs/ach-codes-and-transaction-types) for a list of common ACH return codes."""
    original_debit_date: NotRequired[str]
    r"""Date when funds were originally debited from the company's bank account"""
    check_date: NotRequired[str]
    r"""Check date for the associated payroll or contractor payments"""
    payroll_uuid: NotRequired[str]
    r"""The uuid of the associated payroll for which the recovery case was created. If the recovery case was created for a contractor payment, this field will be null."""
    contractor_payment_uuids: NotRequired[List[str]]
    r"""The uuids of the associated contractor payments for which the recovery case was created. If the recovery case was created for a payroll, this field will be null."""
    amount_outstanding: NotRequired[str]
    r"""Amount outstanding for the recovery case"""
    event_total_amount: NotRequired[str]
    r"""Total amount to be debited from the payroll or contractor payments"""


class RecoveryCase(BaseModel):
    r"""Representation of a recovery case"""

    uuid: str
    r"""Unique identifier of an recovery case"""

    company_uuid: Optional[str] = None
    r"""Unique identifier of the company to which the recovery case belongs"""

    status: Optional[RecoveryCaseStatus] = None
    r"""Status of the recovery case"""

    latest_error_code: Optional[str] = None
    r"""The latest bank error code for the recovery case. See [this doc](https://docs.gusto.com/embedded-payroll/docs/ach-codes-and-transaction-types) for a list of common ACH return codes."""

    original_debit_date: Optional[str] = None
    r"""Date when funds were originally debited from the company's bank account"""

    check_date: Optional[str] = None
    r"""Check date for the associated payroll or contractor payments"""

    payroll_uuid: Optional[str] = None
    r"""The uuid of the associated payroll for which the recovery case was created. If the recovery case was created for a contractor payment, this field will be null."""

    contractor_payment_uuids: Optional[List[str]] = None
    r"""The uuids of the associated contractor payments for which the recovery case was created. If the recovery case was created for a payroll, this field will be null."""

    amount_outstanding: Optional[str] = None
    r"""Amount outstanding for the recovery case"""

    event_total_amount: Optional[str] = None
    r"""Total amount to be debited from the payroll or contractor payments"""
