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: anrok - add error detail to invoice serialization #2329

Merged
merged 37 commits into from
Jul 25, 2024

Conversation

annvelents
Copy link
Contributor

@annvelents annvelents commented Jul 24, 2024

Context

As part of implementation logic to store errors received from Anrok through Nango we need to serialize error_details to the FE and API

Description

Added Error Details to serializers

@annvelents annvelents force-pushed the ftr-anrok-graphql-serialize-error-detail branch from 03ad076 to a8af1fd Compare July 24, 2024 07:23
@annvelents annvelents force-pushed the ftr-anrok-create-integration-error-details-service branch from c62c619 to 8318ccc Compare July 24, 2024 09:49
@annvelents annvelents force-pushed the ftr-anrok-graphql-serialize-error-detail branch 2 times, most recently from 40a4849 to 4e518d1 Compare July 24, 2024 12:11
@annvelents annvelents force-pushed the ftr-anrok-create-integration-error-details-service branch from 826e703 to 3154c9e Compare July 24, 2024 12:52
@annvelents annvelents force-pushed the ftr-anrok-graphql-serialize-error-detail branch from 74ccbc5 to 9072e0c Compare July 24, 2024 12:54
Base automatically changed from ftr-anrok-create-integration-error-details-service to main July 24, 2024 14:42
@annvelents annvelents force-pushed the ftr-anrok-graphql-serialize-error-detail branch from 62a603d to 9d7bd8e Compare July 24, 2024 15:08
@annvelents annvelents force-pushed the ftr-anrok-graphql-serialize-error-detail branch from 9d7bd8e to 3d9861b Compare July 24, 2024 15:11
@annvelents annvelents self-assigned this Jul 24, 2024
@annvelents annvelents marked this pull request as ready for review July 24, 2024 15:25
@annvelents annvelents changed the title Feat: anrok serialize error detail Feat: anrok - add error detail to invoice serialization Jul 24, 2024
Copy link
Contributor

@ancorcruz ancorcruz left a comment

Choose a reason for hiding this comment

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

LGTM!

@annvelents annvelents merged commit 7c71728 into main Jul 25, 2024
6 checks passed
@annvelents annvelents deleted the ftr-anrok-graphql-serialize-error-detail branch July 25, 2024 07:59
graphql_name 'ErrorDetail'

field :error_code, Types::ErrorDetails::ErrorCodesEnum, null: false
field :error_details, GraphQL::Types::JSON, null: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think of making it string? It would be easier for FE to fetch it and it follows structure used on other similar places (e.g. netsuite object). If we will have new key in error details, we will just expose it as new field in this object...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, sure!
Was thinking about making it a string, but found Jsons at some places, so thought it's more common to use Jsons 🙈

Copy link
Collaborator

Choose a reason for hiding this comment

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

yep, we also use JSON somewhere, but in those cases that field is flexible and can have various keys. In our case (until we extend error details) it is just string that is describing error code. If doable, I prefer defining type to avoid errors related to it :D

annvelents added a commit that referenced this pull request Jul 25, 2024
## Context

When adding error_details to the invoices
[PR](#2329), we added details of
the errors as a jsonb object, while for now we'll be only storing there
the error_code / error clarification and FE doesn't need the whole
object for this

## Description

Updated error_detail type to send only first value of it's detils
abdussamadbello pushed a commit to abdussamadbello/lago-api that referenced this pull request Aug 8, 2024
## Context

As part of implementation logic to store errors received from Anrok
through Nango we need to serialize error_details to the FE and API

## Description

Added Error Details to serializers

---------
abdussamadbello pushed a commit to abdussamadbello/lago-api that referenced this pull request Aug 8, 2024
…go#2333)

## Context

When adding error_details to the invoices
[PR](getlago#2329), we added details of
the errors as a jsonb object, while for now we'll be only storing there
the error_code / error clarification and FE doesn't need the whole
object for this

## Description

Updated error_detail type to send only first value of it's detils
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.

3 participants