-
Notifications
You must be signed in to change notification settings - Fork 0
Get transactions #15
base: main
Are you sure you want to change the base?
Get transactions #15
Conversation
2807592 to
38377b0
Compare
38377b0 to
1aac491
Compare
| """ | ||
|
|
||
| @spec all_by_account( | ||
| %{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about creating a type for these params and the response?
@typep params :: %{
:account_id => String.t(),
:from => Date.t(),
:to => Date.t(),
optional(:page_size) => integer(),
optional(:page) => integer()
}
@typep ok_response :: %{page: integer(), total_pages: integer(), total: integer(), transactions: [t()]}
@typep error_response :: PluggyElixir.HttpClient.Error.t() | String.t()
@typep response :: {:ok, ok_response()} | {:error, error_response()}| %{ | |
| params() |
| }, | ||
| Config.config_overrides() | ||
| ) :: | ||
| {:ok, %{page: integer(), total_pages: integer(), total: integer(), transactions: [t()]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the thread above we could also replace the code here for response()
| ] | ||
| end | ||
|
|
||
| defp parse_transaction(transaction) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about creating a module called PluggyElixir.Transaction.Parser that includes this and the functions below?
Or even a PluggyElixir.Transaction.ResponseHandler that includes the parser functions and the handling ones too.
Add macro to perform pluggy assertions
Motivation
The API supports transactions listing.
Proposed solution
Adds function to allow transactions listing according to Pluggy's documentation.