# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Dict, Union
from datetime import datetime
from typing_extensions import Literal, Required, Annotated, TypedDict

from ..._utils import PropertyInfo

__all__ = ["TransactionScheduleUpdateParams"]


class TransactionScheduleUpdateParams(TypedDict, total=False):
    org_id: Annotated[str, PropertyInfo(alias="orgId")]

    balance_id: Required[Annotated[str, PropertyInfo(alias="balanceId")]]

    amount: Required[float]
    """The amount of each Balance Transaction created by this Schedule."""

    code: Required[str]
    """The unique short code of the Balance Transaction Schedule."""

    end_date: Required[Annotated[Union[str, datetime], PropertyInfo(alias="endDate", format="iso8601")]]
    """The end date (_in ISO-8601 format_) of the Balance Transaction Schedule.

    **NOTE:** End date is exclusive.
    """

    frequency: Required[Literal["DAILY", "WEEKLY", "MONTHLY", "ANNUALLY"]]
    """Represents standard scheduling frequencies options for a job."""

    frequency_interval: Required[Annotated[int, PropertyInfo(alias="frequencyInterval")]]
    """
    Used in conjunction with `frequency` to define how often Balance Transactions
    are generated by the Schedule. For example, if `frequency` is MONTHLY and
    `frequencyInterval` is 3, then Balance Transactions are generated every three
    months.
    """

    name: Required[str]
    """The name of the Balance Transaction Schedule."""

    start_date: Required[Annotated[Union[str, datetime], PropertyInfo(alias="startDate", format="iso8601")]]
    """The start date (_in ISO-8601 format_) of the Balance Transaction Schedule."""

    transaction_description: Required[Annotated[str, PropertyInfo(alias="transactionDescription")]]
    """
    The description of each Balance Transaction that will be created by this
    Schedule.
    """

    transaction_type_id: Required[Annotated[str, PropertyInfo(alias="transactionTypeId")]]
    """
    The unique identifier (UUID) of the transaction type used to create Transactions
    by this Schedule. You can obtain a list of Transaction Types created for the
    Organization. See the the
    [List TransactionTypes](https://www.m3ter.com/docs/api#tag/TransactionType/operation/ListTransactionTypes)
    endpoint of this API Reference.
    """

    currency_paid: Annotated[str, PropertyInfo(alias="currencyPaid")]
    """The currency code of the payment if it differs from the Balance currency.

    For example: USD, GBP or EUR.
    """

    custom_fields: Annotated[Dict[str, Union[str, float]], PropertyInfo(alias="customFields")]
    """User defined fields enabling you to attach custom data.

    The value for a custom field can be either a string or a number.

    If `customFields` can also be defined for this entity at the Organizational
    level, `customField` values defined at individual level override values of
    `customFields` with the same name defined at Organization level.

    See
    [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields)
    in the m3ter documentation for more information.
    """

    paid: float
    """The payment amount if the payment currency differs from the Balance currency."""

    version: int
    """The version number of the entity:

    - **Create entity:** Not valid for initial insertion of new entity - _do not use
      for Create_. On initial Create, version is set at 1 and listed in the
      response.
    - **Update Entity:** On Update, version is required and must match the existing
      version because a check is performed to ensure sequential versioning is
      preserved. Version is incremented by 1 and listed in the response.
    """
