Skip to content

Commit

Permalink
feat(wallet): add metadata to wallet transaction (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomiguelpinto authored Aug 16, 2024
1 parent 83fd526 commit e6bee80
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lago_python_client/models/wallet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional
from typing import List, Optional, Dict

from lago_python_client.base_model import BaseModel

Expand All @@ -15,6 +15,7 @@ class RecurringTransactionRule(BaseModel):
granted_credits: Optional[str]
started_at: Optional[str]
target_ongoing_balance: Optional[str]
transaction_metadata: Optional[List[Dict[str, str]]]


class RecurringTransactionRuleResponse(BaseModel):
Expand All @@ -28,6 +29,7 @@ class RecurringTransactionRuleResponse(BaseModel):
started_at: Optional[str]
target_ongoing_balance: Optional[str]
created_at: Optional[str]
transaction_metadata: Optional[List[Dict[str, str]]]


class RecurringTransactionRuleList(BaseModel):
Expand All @@ -47,6 +49,7 @@ class Wallet(BaseModel):
expiration_at: Optional[str]
currency: Optional[str]
recurring_transaction_rules: Optional[RecurringTransactionRuleList]
transaction_metadata: Optional[List[Dict[str, str]]]


class WalletResponse(BaseResponseModel):
Expand Down
5 changes: 4 additions & 1 deletion lago_python_client/models/wallet_transaction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, List, Dict

from lago_python_client.base_model import BaseModel

Expand All @@ -10,15 +10,18 @@ class WalletTransaction(BaseModel):
paid_credits: Optional[str]
granted_credits: Optional[str]
voided_credits: Optional[str]
metadata: Optional[List[Dict[str, str]]]


class WalletTransactionResponse(BaseResponseModel):
lago_id: str
lago_wallet_id: str
status: str
source: str
transaction_status: str
transaction_type: str
amount: str
credit_amount: str
settled_at: Optional[str]
created_at: str
metadata: Optional[List[Dict[str, str]]]
2 changes: 2 additions & 0 deletions tests/fixtures/wallet_transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac1111",
"lago_wallet_id": "12345",
"status": "settled",
"source": "manual",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10",
Expand All @@ -15,6 +16,7 @@
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac1222",
"lago_wallet_id": "12345",
"status": "settled",
"source": "manual",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10",
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/wallet_transaction_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac1111",
"lago_wallet_id": "12345",
"status": "settled",
"source": "manual",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10",
Expand All @@ -15,6 +16,7 @@
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac1222",
"lago_wallet_id": "12345",
"status": "settled",
"source": "manual",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10",
Expand Down

0 comments on commit e6bee80

Please sign in to comment.