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

Draft: [postal-savings-rs] Card transactions #743

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

osipxd
Copy link
Contributor

@osipxd osipxd commented Apr 14, 2024

Depends on #742

TODO:

  • Card number input
  • Fetch transactions
  • Parse transactions
  • Merge card transactions with account transactions (should fix [postal-savings-rs] Транзакции дублируются #740)
    • Fetch exchange rates
    • Implement currency exchange
    • Match card transaction to account transaction using transaction amount in account currency
  • Paging (maximum is 100 transactions per request)

Nice to have:

  • Assume transactions starting with ATMPSB as cash withdrawal with zero fee

@osipxd osipxd marked this pull request as draft April 14, 2024 21:46
@osipxd osipxd force-pushed the postal-savings/card-transactions branch from f0a2f7f to b434910 Compare April 22, 2024 19:46
Comment on lines +24 to +31
return {
...account,
cardNumber,
rawData
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if I'm doing the right thing here. Is it legal to attach data to an account this way? Will it be better to create wrapper-type instead, to not pass rawData to ZenMoney?

I'm sorry, it's my first time I'm using TypeScript, so I'm not sure about some constructions.

src/plugins/postal-savings-rs/api.ts Show resolved Hide resolved
src/plugins/postal-savings-rs/models.ts Outdated Show resolved Hide resolved
@osipxd osipxd force-pushed the postal-savings/card-transactions branch from b434910 to 67a8dde Compare April 22, 2024 20:08
import { Transaction } from '../../types/zenmoney'

function accountCardKey (accountId: string): string {
return `account/${accountId}/card`
Copy link
Contributor Author

@osipxd osipxd Apr 22, 2024

Choose a reason for hiding this comment

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

Here are two options for the key format:

  1. account/{accountId}/card
  2. accountCard/{accountId}

I've picked the first one because it allows us to bind other data to an account if it is needed

@osipxd osipxd force-pushed the postal-savings/card-transactions branch from c112900 to e2d2698 Compare April 23, 2024 21:40
@osipxd osipxd force-pushed the postal-savings/card-transactions branch from e2d2698 to ece09b6 Compare May 14, 2024 21:42
@osipxd osipxd force-pushed the postal-savings/card-transactions branch from ece09b6 to a9cb6aa Compare May 14, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[postal-savings-rs] Транзакции дублируются
3 participants