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

Requestable/Request Item API Endpoints #15922

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

spencerrlongg
Copy link
Collaborator

Description

This adds actions for creating and cancelling checkout requests, as well as adding new endpoints for the API to bring the functionality there. This should probably not be merged until #15893 is as it relies on the same pattern.

The only real change here I think is that the cancel functionality has been broken out into its own route and action for the GUI, whereas before it was combined into the same controller method. I also renamed the controller methods to keep it CRUD-y.

There are some tests written for the new API functionality, and all other tests are passing.

I wrote this a while ago so I might be forgetting some things, but I wanted to get #15893 open before opening this one, so please ask questions about anything that's unclear. :)

Fixes #SC-24347

Type of change

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

How Has This Been Tested?

Tests written.

Test Configuration:

  • PHP version: 8.1
  • MySQL version 8.1

Copy link

what-the-diff bot commented Dec 4, 2024

PR Summary

  • Adding and Handling of Checkout Requests
    We have now implemented the classes CancelCheckoutRequestAction and CreateCheckoutRequestAction. These will respectively allow for the canceling and creating of requests for any specified asset.

  • Asset and User Exceptions Management
    Two new exception cases have been added - AssetNotRequestable and UserDoestExistException. These account for situations where an asset cannot be requested or a user does not exist, providing necessary error handling.

  • Improved Asset View and Request Handling
    Changes have been made to the ViewAssetsController and a new CheckoutRequest API Controller has been implemented. This is part of moving towards the new CheckoutRequest actions for handling asset requests and cancellations.

  • Updates to Asset Model and Factory
    Updates for the Asset model have been implemented, specifically defining return types for better standardization. Additionally, we've enhanced the AssetFactory for more in-depth data creation during asset creation.

  • Adjusted JavaScript Template and Routes
    The JavaScript Template has been updated to change the form action for canceling asset requests, aligning with the new API route syntax. Routes have been adapted and added to better handle storing and destroying checkout requests.

  • Established Test Cases
    New test cases have been created for checking the functionality of creating and canceling asset requests. These will ensure the new features are working as expected, and catch any future regression issues.

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.

1 participant