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

[ANCHOR-435]: Update event callback schema #1095

Merged
merged 10 commits into from
Sep 7, 2023

Conversation

JakeUrban
Copy link
Contributor

@JakeUrban JakeUrban commented Sep 7, 2023

Lets hold off on this until we merge everything from SoftServe

Description

Updates the schema used when sending event callbacks to the business server.

Context

Current schema:

{
  timestamp: 1693524508,
  payload: {
    type: 'transaction_created',
    id: '19f8caad-0214-4ef3-99a6-134f59a3dbbe',
    sep: '24',
    transaction: {
      id: '29f84658-7090-47b7-874d-5d4ffa592a39',
      sep: '24',
      kind: 'deposit',
      status: 'incomplete',
      amount_expected: [Object],
      started_at: '2023-08-31T23:28:25.120858Z',
      destination_account: 'GA57OTKBRMLNMYIMK3VL23HI6XVCB7P2H5Q353U3ZEQR6HIE5TBAXY3O'
    }
  }
}

New schema:

{
  id: '19f8caad-0214-4ef3-99a6-134f59a3dbbe',
  timestamp: '2023-08-31T23:28:25.120858Z',
  type: 'transaction_created',
  payload: {
    transaction: {
      id: '29f84658-7090-47b7-874d-5d4ffa592a39',
      sep: '24',
      kind: 'deposit',
      status: 'incomplete',
      amount_expected: [Object],
      started_at: '2023-08-31T23:28:25.120858Z',
      destination_account: 'GA57OTKBRMLNMYIMK3VL23HI6XVCB7P2H5Q353U3ZEQR6HIE5TBAXY3O'
    }
  }
}

In the current schema, the sep field is duplicated, the timestamp uses a unix timestamp instead a properly formatted datetime string, and the id and type fields are inside payload when they are really metadata that should be outside payload.

Testing

./gradlew test

Known limitations

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Code Coverage

Overall Project 28.17% -0.27%
Files changed 0%

Module Coverage
api-schema 1.78% -0.59%
Files
Module File Coverage
api-schema SendEventRequestPayload.java 0%
SendEventRequest.java 0% -12.82%

Copy link
Collaborator

@lijamie98 lijamie98 left a comment

Choose a reason for hiding this comment

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

The new schema makes sense to me.

@JakeUrban JakeUrban merged commit 471b632 into develop Sep 7, 2023
@JakeUrban JakeUrban deleted the update-event-callback-schema branch September 7, 2023 20:01
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.

2 participants