"""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 Optional
from typing_extensions import NotRequired, TypedDict


class PaymentEventType(str, Enum):
    r"""The type of payment event associated with the ACH transaction"""

    PAYROLL = "Payroll"
    CONTRACTOR_PAYMENT = "ContractorPayment"


class AchTransactionRecipientType(str, Enum):
    r"""The type of recipient associated with the ACH transaction"""

    EMPLOYEE = "Employee"
    CONTRACTOR = "Contractor"


class PaymentStatus(str, Enum):
    r"""The status of the ACH transaction"""

    UNSUBMITTED = "unsubmitted"
    SUBMITTED = "submitted"
    SUCCESSFUL = "successful"
    FAILED = "failed"


class PaymentDirection(str, Enum):
    r"""The direction of the payment"""

    CREDIT = "credit"
    DEBIT = "debit"


class AchTransactionTypedDict(TypedDict):
    r"""Representation of an ACH transaction"""

    uuid: str
    r"""Unique identifier of an ACH transaction"""
    company_uuid: NotRequired[str]
    r"""Unique identifier of the company to which the ACH transaction belongs"""
    payment_event_type: NotRequired[PaymentEventType]
    r"""The type of payment event associated with the ACH transaction"""
    payment_event_uuid: NotRequired[str]
    r"""Unique identifier for the payment event associated with the ACH transaction"""
    recipient_type: NotRequired[AchTransactionRecipientType]
    r"""The type of recipient associated with the ACH transaction"""
    recipient_uuid: NotRequired[str]
    r"""Unique identifier for the recipient associated with the ACH transaction"""
    error_code: NotRequired[str]
    r"""The error code associated with the ACH transaction, if any. If there is no error on the ACH transaction, this field will be nil. See [this article](https://engineering.gusto.com/how-ach-works-a-developer-perspective-part-2/) for a complete list of ACH return codes."""
    transaction_type: NotRequired[str]
    r"""The type of transaction associated with the ACH transaction"""
    payment_status: NotRequired[PaymentStatus]
    r"""The status of the ACH transaction"""
    payment_direction: NotRequired[PaymentDirection]
    r"""The direction of the payment"""
    payment_event_check_date: NotRequired[str]
    r"""The date of the payment event check associated with the ACH transaction"""
    payment_date: NotRequired[str]
    r"""The date of the payment associated with the ACH transaction"""
    amount: NotRequired[str]
    r"""The amount of money moved by the ACH transaction. This amount is always non-negative."""
    description: NotRequired[str]
    r"""The description of the ACH transaction. Can be used to identify the ACH transaction on the recipient's bank statement."""


class AchTransaction(BaseModel):
    r"""Representation of an ACH transaction"""

    uuid: str
    r"""Unique identifier of an ACH transaction"""

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

    payment_event_type: Optional[PaymentEventType] = None
    r"""The type of payment event associated with the ACH transaction"""

    payment_event_uuid: Optional[str] = None
    r"""Unique identifier for the payment event associated with the ACH transaction"""

    recipient_type: Optional[AchTransactionRecipientType] = None
    r"""The type of recipient associated with the ACH transaction"""

    recipient_uuid: Optional[str] = None
    r"""Unique identifier for the recipient associated with the ACH transaction"""

    error_code: Optional[str] = None
    r"""The error code associated with the ACH transaction, if any. If there is no error on the ACH transaction, this field will be nil. See [this article](https://engineering.gusto.com/how-ach-works-a-developer-perspective-part-2/) for a complete list of ACH return codes."""

    transaction_type: Optional[str] = None
    r"""The type of transaction associated with the ACH transaction"""

    payment_status: Optional[PaymentStatus] = None
    r"""The status of the ACH transaction"""

    payment_direction: Optional[PaymentDirection] = None
    r"""The direction of the payment"""

    payment_event_check_date: Optional[str] = None
    r"""The date of the payment event check associated with the ACH transaction"""

    payment_date: Optional[str] = None
    r"""The date of the payment associated with the ACH transaction"""

    amount: Optional[str] = None
    r"""The amount of money moved by the ACH transaction. This amount is always non-negative."""

    description: Optional[str] = None
    r"""The description of the ACH transaction. Can be used to identify the ACH transaction on the recipient's bank statement."""
