Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet): add metadata to wallet transaction #257

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could add some metadata in this file to validates it is correctly mapped in the python object

"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
Loading