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

Added #14665: add checkout functionality to accessories #15184

Conversation

arne-kroeger
Copy link

Added #14979: add checkout functionality to accessories

Description

Add feature to checkout accessories to locations or assets.

Added #14665
Added #12381
Added #12452
Added #11820
Added #10956
Added #5140 (parts of it)
Added #14979 (parts of it)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tests\Feature\Checkouts\Ui\AccessoryCheckoutTest::testAccessoryCanBeCheckedOutToLocationWithQuantity
  • Tests\Feature\Checkouts\Ui\AccessoryCheckoutTest::testAccessoryCanBeCheckedOutToAssetWithQuantity

Test Configuration:

  • PHP version: 8.3.9
  • MariaDB version - 10.11
  • Webserver version - php server
  • OS version - Mac OS

Checklist:

arne-kroeger added 2 commits July 29, 2024 10:54
@arne-kroeger arne-kroeger requested a review from snipe as a code owner July 29, 2024 09:15
Copy link

welcome bot commented Jul 29, 2024

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@snipe
Copy link
Owner

snipe commented Jul 29, 2024

I don't understand what this is supposed to do, and there are definitely some breaking changes here. Not to mention that PRs should be put against the develop branch, not master, per the dev documentation.

@snipe snipe closed this Jul 29, 2024
Copy link

what-the-diff bot commented Jul 29, 2024

PR Summary

  • Renaming of Variables and Relationships
    All instances of users in the code base, both as variables and relationships, were replaced with checkouts. This happens across multiple files, including app/Console/Commands/RestoreFromBackup.php, app/Helpers/Helper.php, app/Http/Controllers/Accessories/AccessoriesController.php, etc. The change ensures greater clarity and precision in variable naming, aligning with the actual function and purpose.

  • Introduction of AccessoryCheckout Model
    A new model class AccessoryCheckout has been created, setting up one-to-one relationships with both Accessory and User models and introducing new methods for better asset assignment and search functionality.

  • Update of User Model and AccessoryPresenter
    The User model and AccessoryPresenter class got a facelift as well, their respective methods changing from employing the users relationship to the checkouts relationship, maintaining consistency throughout the code base.

  • Changes in AccessoryFactory Class
    The AccessoryFactory class was updated where it was creating a new AccessoryCheckout entry instead of attaching an accessory to a user, both in withoutItemsRemaining and checkedOutToUser methods.

  • Migration to 'accessories_checkout' Table
    There was a migration from the accessories_users table to the accessories_checkout table, which also meant the addition of a new column called assigned_type.

  • Changes in View Files
    The checkout.blade.php and view.blade.php view files were updated with edits made in table ID, column fields, and form fields to reflect the new changes better.

  • Updated Testing Classes
    Two Test classes, AccessoryCheckinTest and AccessoryCheckoutTest, had their methods updated to use new field names and relationships, ensuring correct and efficient implementation and measurement of the intended changes.

Overall, these adjustments in variable terms, relationships, new methods, and structural changes in tables will make the code clearer and efficiently precise, leading to better overall performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants