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

Fixed bug in component checkins via api #15851

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

marcusmoore
Copy link
Collaborator

@marcusmoore marcusmoore commented Nov 20, 2024

Description

This PR fixes a bug in component checkins via the api where a user could check in a quantity higher than was checked out if the checked out quantity was 1.

It also includes tests around the endpoint.

Type of change

  • Testing

@marcusmoore marcusmoore requested a review from snipe as a code owner November 20, 2024 00:18
Copy link

what-the-diff bot commented Nov 20, 2024

PR Summary

  • Improved checkin method in ComponentsController.php
    • The method's structure was streamlined by eliminating unnecessary spaces and merging certain lines of code. This enhances the readability and ease of maintaining the code.
    • Enhanced comparison accuracy by replacing loose equality with strict equality. This ensures that only precise matches occur during the check-in process.
  • Introduced ComponentCheckinTest.php
    • This addition ensures comprehensive testing of check-in operations via the API. It includes important checks for user permissions and component existence.
    • It has safeguards against users checking in more than the quantity they checked out.
    • It confirms that the correct processes are carried out during successful check-in.
    • It includes tests focusing on the support for multiple companies, ensuring that each company's operations remain within its respective parameters.
    • It checks that all check-in activities are properly recorded in the database.

@marcusmoore marcusmoore marked this pull request as draft November 20, 2024 17:38
@marcusmoore
Copy link
Collaborator Author

Gonna check one thing then move this back to ready.

@marcusmoore marcusmoore changed the title Added tests around component checkins via api Fixed bug in component checkins via api Nov 20, 2024
@marcusmoore marcusmoore marked this pull request as ready for review November 20, 2024 20:34
@snipe snipe merged commit 8b38dc8 into snipe:develop Nov 21, 2024
9 checks passed
@marcusmoore marcusmoore deleted the testing/api-component-checkin branch November 21, 2024 19:38
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