Skip to content

Commit 85edc72

Browse files
committed
✨ transactions api change
1 parent d042cc4 commit 85edc72

12 files changed

+611
-170
lines changed

lunchable/models/_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
Base Pydantic Object for Containers
33
"""
44

5-
6-
from pydantic import BaseModel
5+
from pydantic import BaseModel, ConfigDict
76

87

98
class LunchableModel(BaseModel):
109
"""
1110
Hashable Pydantic Model
1211
"""
1312

13+
model_config = ConfigDict(extra="allow")
14+
1415
def __hash__(self) -> int:
1516
"""
1617
Hash Method for Pydantic BaseModels

lunchable/models/_descriptions.py

Lines changed: 154 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -387,84 +387,189 @@ class _TransactionDescriptions:
387387
Descriptions for TransactionObject
388388
"""
389389

390-
amount = """
391-
Amount of the transaction in numeric format to 4 decimal places
390+
id = """
391+
Unique identifier for transaction
392+
"""
393+
date = """
394+
Date of transaction in ISO 8601 format
392395
"""
393396
payee = """
394-
Name of payee If recurring_id is not null, this field will show the payee
397+
Name of payee. If recurring_id is not null, this field will show the payee
395398
of associated recurring expense instead of the original transaction payee
396399
"""
400+
amount = """
401+
Amount of the transaction in numeric format to 4 decimal places
402+
"""
397403
currency = """
398404
Three-letter lowercase currency code of the transaction in ISO 4217 format
399405
"""
406+
to_base = """
407+
The amount converted to the user's primary currency. If the multicurrency
408+
feature is not being used, to_base and amount will be the same.
409+
"""
410+
category_id = """
411+
Unique identifier of associated category
412+
"""
413+
category_name = """
414+
Name of category associated with transaction
415+
"""
416+
category_group_id = """
417+
Unique identifier of associated category group, if any
418+
"""
419+
category_group_name = """
420+
Name of category group associated with transaction, if any
421+
"""
422+
is_income = """
423+
Based on the associated category's property, denotes if transaction is
424+
treated as income
425+
"""
426+
exclude_from_budget = """
427+
Based on the associated category's property, denotes if transaction is
428+
excluded from budget
429+
"""
430+
exclude_from_totals = """
431+
Based on the associated category's property, denotes if transaction is
432+
excluded from totals
433+
"""
434+
created_at = """
435+
The date and time of when the transaction was created (in the ISO 8601
436+
extended format).
437+
"""
438+
updated_at = """
439+
The date and time of when the transaction was last updated (in the ISO 8601
440+
extended format).
441+
"""
442+
status = """
443+
One of the following: <ul>
444+
<li>cleared: User has reviewed the transaction</li>
445+
<li>uncleared: User has not yet reviewed the transaction</li>
446+
<li>recurring: Transaction is linked to a recurring expense</li>
447+
<li>recurring_suggested: Transaction is listed as a suggested transaction
448+
for an existing recurring expense.</li>
449+
<li>pending: Imported transaction is marked as pending. This should be a
450+
temporary state.</li>
451+
</ul>
452+
User intervention is required to change this to recurring.
453+
"""
454+
is_pending = """
455+
Denotes if transaction is pending (not posted)
456+
"""
400457
notes = """
401458
User-entered transaction notes If recurring_id is not null, this field will
402459
be description of associated recurring expense
403460
"""
404-
category_id = """
405-
Unique identifier of associated category (see Categories)
461+
original_name = """
462+
The transactions original name before any payee name updates. For synced
463+
transactions, this is the raw original payee name from your bank.
464+
"""
465+
recurring_id = """
466+
Unique identifier of associated recurring item
467+
"""
468+
recurring_payee = """
469+
Payee name of associated recurring item
470+
"""
471+
recurring_description = """
472+
Description of associated recurring item
473+
"""
474+
recurring_cadence = """
475+
Cadence of associated recurring item (one of `once a week`, `every 2 weeks`,
476+
`twice a month`, `monthly`, `every 2 months`, `every 3 months`, `every 4 months`,
477+
`twice a year`, `yearly`)
478+
"""
479+
recurring_type = """
480+
Type of associated recurring (one of `cleared`, `suggested`, `dismissed`)
481+
"""
482+
recurring_amount = """
483+
Amount of associated recurring item
484+
"""
485+
recurring_currency = """
486+
Currency of associated recurring item
487+
"""
488+
parent_id = """
489+
Exists if this is a split transaction. Denotes the transaction ID of the
490+
original transaction. Note that the parent transaction is not returned in
491+
this call.
492+
"""
493+
has_children = """
494+
True if this transaction is a parent transaction and is split into 2 or
495+
more other transactions
496+
"""
497+
group_id = """
498+
Exists if this transaction is part of a group. Denotes the parent’s
499+
transaction ID
500+
"""
501+
is_group = """
502+
True if this transaction represents a group of transactions. If so, amount
503+
and currency represent the totalled amount of transactions bearing this
504+
transaction’s id as their group_id. Amount is calculated based on the
505+
user’s primary currency.
406506
"""
407507
asset_id = """
408508
Unique identifier of associated manually-managed account (see Assets)
409509
Note: plaid_account_id and asset_id cannot both exist for a transaction
410510
"""
511+
asset_institution_name = """
512+
Institution name of associated manually-managed account
513+
"""
514+
asset_name = """
515+
Name of associated manually-managed account
516+
"""
517+
asset_display_name = """
518+
Display name of associated manually-managed account
519+
"""
520+
asset_status = """
521+
Status of associated manually-managed account (one of `active`, `closed`)
522+
"""
411523
plaid_account_id = """
412524
Unique identifier of associated Plaid account (see Plaid Accounts) Note:
413525
plaid_account_id and asset_id cannot both exist for a transaction
414526
"""
415-
status = """
416-
One of the following: cleared: User has reviewed the transaction | uncleared:
417-
User has not yet reviewed the transaction | recurring: Transaction is linked
418-
to a recurring expense | recurring_suggested: Transaction is listed as a
419-
suggested transaction for an existing recurring expense | pending: Imported
420-
transaction is marked as pending. This should be a temporary state. User intervention
421-
is required to change this to recurring.
527+
plaid_account_name = """
528+
Name of associated Plaid account
422529
"""
423-
parent_id = """
424-
Exists if this is a split transaction. Denotes the transaction ID of the original
425-
transaction. Note that the parent transaction is not returned in this call.
530+
plaid_account_mask = """
531+
Mask of associated Plaid account
426532
"""
427-
is_group = """
428-
True if this transaction represents a group of transactions. If so, amount
429-
and currency represent the totalled amount of transactions bearing this
430-
transaction's id as their group_id. Amount is calculated based on the
431-
user's primary currency.
533+
institution_name = """
534+
Institution name of associated Plaid account
432535
"""
433-
group_id = """
434-
Exists if this transaction is part of a group. Denotes the parent's transaction ID
536+
plaid_account_display_name = """
537+
Display name of associated Plaid account
435538
"""
436-
external_id = """
437-
User-defined external ID for any manually-entered or imported transaction.
438-
External ID cannot be accessed or changed for Plaid-imported transactions.
439-
External ID must be unique by asset_id. Max 75 characters.
539+
plaid_metadata = """
540+
Metadata associated with imported transaction from Plaid
440541
"""
441-
original_name = """
442-
The transactions original name before any payee name updates. For synced transactions,
443-
this is the raw original payee name from your bank.
542+
source = """
543+
Source of the transaction (one of `api`, `csv`, `manual`,`merge`,`plaid`,
544+
`recurring`,`rule`,`user`)
444545
"""
445-
type = """
446-
(for synced investment transactions only) The transaction type as set by
447-
Plaid for investment transactions. Possible values include: buy, sell, cash,
448-
transfer and more
546+
display_name = """
547+
Display name for payee for transaction based on whether or not it is
548+
linked to a recurring item. If linked, returns `recurring_payee` field.
549+
Otherwise, returns the `payee` field.
449550
"""
450-
subtype = """
451-
(for synced investment transactions only) The transaction type as set by Plaid
452-
for investment transactions. Possible values include: management fee, withdrawal,
453-
dividend, deposit and more
551+
display_notes = """
552+
Display notes for transaction based on whether or not it is linked to a
553+
recurring item. If linked, returns `recurring_notes` field. Otherwise,
554+
returns the `notes` field.
454555
"""
455-
fees = """
456-
(for synced investment transactions only) The fees as set by Plaid for investment
457-
transactions.
556+
account_display_name = """
557+
Display name for associated account (manual or Plaid). If this is a synced
558+
account, returns `plaid_account_display_name` or `asset_display_name`.
458559
"""
459-
price = """
460-
(for synced investment transactions only) The price as set by Plaid for investment
461-
transactions.
560+
tags = """
561+
Array of Tag objects
462562
"""
463-
quantity = """
464-
(for synced investment transactions only) The quantity as set by Plaid for investment
465-
transactions.
563+
external_id = """
564+
User-defined external ID for any manually-entered or imported transaction.
565+
External ID cannot be accessed or changed for Plaid-imported transactions.
566+
External ID must be unique by asset_id. Max 75 characters.
466567
"""
467-
to_base = """
468-
The amount converted to the user's primary currency. If the multicurrency
469-
feature is not being used, to_base and amount will be the same.
568+
children = """
569+
Array of Transaction objects. Only exists if this transaction is a parent
570+
transaction and is split into 2 or more other transactions. Child transactions
571+
do not contain all of the same fields as parent transactions.
572+
"""
573+
formatted_date = """
574+
Date of transaction in user's preferred format
470575
"""

0 commit comments

Comments
 (0)