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

Adds support for claims API #460

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Conversation

ralexmatthews
Copy link
Contributor

@ralexmatthews ralexmatthews commented Jul 23, 2024

Description

Creates the model, service, tests, and types for the claims API.

Also fixes a minor issue with the beta APIs where it added two slashes, making it like //beta/whatever

Testing

Adds new tests based off the existing insurance tests

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc)

@ralexmatthews ralexmatthews requested a review from a team July 23, 2024 14:27
nwithan8
nwithan8 previously approved these changes Jul 23, 2024
expect(firstIdOfFirstPage).to.not.equal(firstIdOfSecondPage);
} catch (error) {
if (!(error instanceof EndOfPaginationError)) {
throw new Error('Test failed intentionally');
Copy link
Member

Choose a reason for hiding this comment

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

I believe this logic is backwards? Getting an EndOfPaginationError is fine and is the eventual expected path. Getting any other error is an error. Perhaps the wording "intentionally" is invalid here.

Copy link
Contributor Author

@ralexmatthews ralexmatthews Jul 23, 2024

Choose a reason for hiding this comment

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

Hmmm... I just copy-pasted this from insurance's tests. I'm not quite sure I understand?

Getting an EndOfPaginationError is fine and is the eventual expected path

Yea, I think thats what this is counting on. If it's not an EndOfPaginationError, then throw an error.

I can probably refactor this to be more clear what we are doing with something like

if (error instanceof EndOfPaginationError) {
  // all gucci
  return;
}

throw error

@nwithan8 nwithan8 self-requested a review July 23, 2024 18:20
@nwithan8 nwithan8 dismissed their stale review July 23, 2024 18:21

Accidental

Copy link
Member

@nwithan8 nwithan8 left a comment

Choose a reason for hiding this comment

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

Please bump all endpoints to their v2 (GA) equivalent.

@ralexmatthews ralexmatthews changed the title Adds support for beta claims API Adds support for claims API Jul 23, 2024
@ralexmatthews ralexmatthews merged commit d17e60c into EasyPost:master Jul 23, 2024
14 checks passed
@ralexmatthews ralexmatthews deleted the claims branch July 23, 2024 19:15
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