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

Full integration with external API #108

Merged
merged 33 commits into from
Jan 12, 2024
Merged

Conversation

eggwhat
Copy link
Contributor

@eggwhat eggwhat commented Jan 11, 2024

Features:

  • Integration with MiniCurrier
  • PricingService Update
  • Api.Gateway fixed ntrada.yml (auth still doesn't work)
  • Customers service bug fixed

Api guideline will be published soon in a new issue.

Copy link
Owner

@SaintAngeLs SaintAngeLs left a comment

Choose a reason for hiding this comment

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

@an2508374, please confirm, that create inquiry with external api, while sending the request for offers returns offers from the frontend side.

@an2508374
Copy link
Collaborator

Unfortunately, there is a problem during getting offers by endpoint /parcels/{parcelId}/offers because offer from external api is null. Some error in ExternalApiLecturerService can be observed and it can be associated with getting document as null in query handler related to that endpoint.
problem3
problem4
problem5

@eggwhat
Copy link
Contributor Author

eggwhat commented Jan 11, 2024

Unfortunately, there is a problem during getting offers by endpoint /parcels/{parcelId}/offers because offer from external api is null. Some error in ExternalApiLecturerService can be observed and it can be associated with getting document as null in query handler related to that endpoint. problem3 problem4 problem5

You are right. It doesn't take into account when MiniCurrier rejects our request. I will push update in a moment. And one important thing. Our backend uses values in following units: "Meters", "Kilograms" and "Pln". The reason why this request was rejected is because parcel was to big and it failed MiniCurrier validation.

@eggwhat
Copy link
Contributor Author

eggwhat commented Jan 11, 2024

I deleted objects with wrong structure and provided a change. Please let me know if you encounter any issues now.

@an2508374
Copy link
Collaborator

an2508374 commented Jan 11, 2024

Now, endpoint parcels/{parcelId}/offers works great for some inquiry created by you some time ago, it returns two offers (from SwiftParcel and MiniCurrier), but now I have problem with InquiriesServiceException during creating an inquiry and this exception is thrown by ExternalApiLecturerService. Below there is fragment of code in AddParcelHandler.cs file.
problem6

@eggwhat
Copy link
Contributor Author

eggwhat commented Jan 11, 2024

Now, endpoint parcels/{parcelId}/offers works great for some inquiry created by you some time ago, it returns two offers (from SwiftParcel and MiniCurrier), but now I have problem with InquiriesServiceException during creating an inquiry and this exception is thrown by ExternalApiLecturerService. Below there is fragment of code in AddParcelHandler.cs file. problem6

This is probably failed validation on MiniCurrier side -> the parcel dimensions and weight are too big. I will add some validation on our side to not accept such big values. As i said the backend treats this values as in meters and kilograms respectively.

@eggwhat
Copy link
Contributor Author

eggwhat commented Jan 12, 2024

Now, endpoint parcels/{parcelId}/offers works great for some inquiry created by you some time ago, it returns two offers (from SwiftParcel and MiniCurrier), but now I have problem with InquiriesServiceException during creating an inquiry and this exception is thrown by ExternalApiLecturerService. Below there is fragment of code in AddParcelHandler.cs file. problem6

This is probably failed validation on MiniCurrier side -> the parcel dimensions and weight are too big. I will add some validation on our side to not accept such big values. As i said the backend treats this values as in meters and kilograms respectively.

I checked it and proper values for parcel are between:
"Length should be between 0.2m and 8m"
"Height should be between 0.2m and 8m"
"Width should be between 0.2m and 8m"
and for weight:
"'Weight' must be between 0,1 and 100. You entered 100000."

@an2508374
Copy link
Collaborator

an2508374 commented Jan 12, 2024

Thank you @eggwhat for this checks. What do you think, it will be better when user would not be allowed to enter data out of this ranges and always will get offer from two apis, or not to check it and then in the worst case user will get only an offer from our company? If the first case is better option, I will update validation during creating inquiry on the frontend side.

@eggwhat
Copy link
Contributor Author

eggwhat commented Jan 12, 2024

I think the first option is our go-to. I will update our backend validation to always have valid values also for MiniCurrier service.

@eggwhat
Copy link
Contributor Author

eggwhat commented Jan 12, 2024

Also i will add validation for pickup and delivery date, because for MiniCurrier the inquiry has to have pickupDate > current time and deliveryDate > pickupDate

@eggwhat
Copy link
Contributor Author

eggwhat commented Jan 12, 2024

I also found an issue in MiniCurrier Api. Inquiry can have some dimensions equal 8 meters but when all dimensions are equal 8 meters there is error 500. So i will have to make validation <8

@eggwhat eggwhat merged commit f580468 into development Jan 12, 2024
18 checks passed
SaintAngeLs pushed a commit that referenced this pull request Jan 20, 2024
@eggwhat eggwhat deleted the external_api_integration branch January 23, 2024 23:10
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