Requests
Overview
In a Laravel-based e-commerce API, request classes are essential for validating and managing incoming API requests. They ensure that data adheres to expected formats and rules, which helps in maintaining security and efficient data processing.
1. Accounts
- Purpose: Manage user accounts and customer data.
- Examples:
UpdateCustomerLimitsRequest: Validates data for updating customer limits.AbstractCustomerLimitsRequest: Base class for customer limits operations.CreateChildAccountRequest: Creates a new child account for a customer.GetAccountCustomersRequest: Retrieves customers associated with an account.
2. Branches
- Purpose: Handle operations related to branch locations.
- Examples:
NearestBranchRequest: Validates data for finding the nearest branch.AddFavouriteBranchRequest: Adds a branch to the user's list of favorites.SetDefaultBranchRequest: Sets a default branch for the user.
3. Concerns
- Purpose: Share common functionality across multiple request classes.
- Examples:
HasCustomerData: A trait used for managing customer-related data in requests.UpdateContactPreferencesRequest: Updates the user's contact preferences.
4. Delivery Methods
- Purpose: Manage delivery options and methods.
- Examples:
DeliveryMethodsRequest: Handles requests related to available delivery methods.ProductEstimatedDeliveryRequest: Estimates delivery time for a product.
5. Guest
- Purpose: Handle requests from users who are not logged in or registered.
- Examples:
ConvertToCustomerRequest: Converts a guest user to a registered customer.RegistrationRequest: Manages new user registration requests.ResetPasswordRequest: Resets a user's password.SendPasswordResetEmailRequest: Sends a password reset email to a user.
6. Payments
- Purpose: Process payment-related operations and manage payment methods.
- Examples:
CreatePaymentMethodRequest: Validates data for creating a new payment method.HandleBraintreeWebhookRequest: Processes webhooks from Braintree for payment events.UpdatePaymentMethodRequest: Updates existing payment method details.
7. Trade Credit
- Purpose: Manage trade credit operations and handle bank transfers.
- Examples:
UpdateDirectDebitRequest: Updates direct debit details for trade credit.BankTransferDetailsRequest: Handles requests for bank transfer information.BankTransferRequest: Processes bank transfer transactions.
8. Trolley
- Purpose: Manage shopping trolley operations, including items and attributes.
- Examples:
AddLaPosteAddressRequest: Adds a La Poste address to the trolley.AddPostNLAddressRequest: Adds a PostNL address to the trolley.ApplyPromoCodeRequest: Applies a promo code to the trolley.BaseTrolleyRequest: Base class for all trolley-related requests.BraintreeCheckoutTrolleyRequest: Handles trolley checkout requests via Braintree.ConvertGuestTrolleyToCustomerRequest: Converts a guest's trolley to a registered customer’s trolley.CreateNewTrolleyRequest: Creates a new trolley.CreateTrolleyAttributeRequest: Adds an attribute to the trolley.CreateTrolleyLineRequest: Adds a line item to the trolley.DeleteTrolleyLineRequest: Removes a line item from the trolley.DeleteTrolleyRequest: Deletes a trolley.PatchTrolleyAttributeRequest: Updates an attribute of the trolley.PatchTrolleyLineRequest: Updates a line item in the trolley.RecalculateTrolleyDeliveryMethodsRequest: Recalculates delivery methods for the trolley.RemovePromoCodeRequest: Removes a promo code from the trolley.RemoveTrolleyAttributeRequest: Removes an attribute from the trolley.UpdateTrolleyRequest: Updates an existing trolley.UpdateTrolleyLineQuantityRequest: Updates the quantity of a line item.UpdateTrolleyLineDeliveryMethodRequest: Updates the delivery method for a line item.UpdateTrolleyLineChannelRequest: Updates the channel for a line item.TrolleyDiscountRequest: Applies or updates discounts on the trolley.TrolleyTotalsRequest: Retrieves the total value of the trolley.ViewTrolleyRequest: Retrieves details of a trolley.ViewCustomerTrolleysRequest: Retrieves all trolleys for a customer.ShareTrolleyByEmailRequest: Shares the trolley via email.
9. Additional Requests
- Purpose: Various requests that do not fit into the above categories but are essential for specific functionalities.
- Examples:
AddSavedListItemRequest: Adds an item to a saved list.AttributeRequest: Manages attribute-related operations.CareFormRequest: Handles care form submissions.ContactRequest: Manages contact form submissions.ContinueApplicationRequest: Continues an existing application.CreateApplicationRequest: Creates a new application.CreateComestriOrderRequest: Creates an order via Comestri integration.CreateCustomerAddressRequest: Adds a new address for a customer.CreateOrderAttributeRequest: Adds attributes to an order.CreateOrderRequest: Creates a new order.CreateSavedListRequest: Creates a new saved list.CustomerCardRequest: Manages customer card details.CustomerCatalogueRequest: Requests customer catalogue data.CustomerDocumentSignedUrlRequest: Retrieves signed URL for customer documents.CustomerLoginRequest: Manages customer login operations.CustomerRegisterTradeInterestRequest: Registers a customer's trade interest.CustomerRegistrationRequest: Handles customer registration.CustomerSignatureRequest: Manages customer signature data.CustomerUsernameCheckRequest: Checks the availability of a customer username.DeleteCustomerAddressRequest: Deletes a customer address.FetchContentRequest: Fetches content for various purposes.FetchStockRequest: Retrieves stock information.MatchPrincipleRequest: Matches principles in a given context.NewsletterSignupRequest: Signs up a user for the newsletter.OrderInvoicePdfRequest: Retrieves a PDF of an order invoice.OrderInvoiceRequest: Retrieves order invoice details.ProcardDraftApplicationRequest: Submits a draft application for Procard.ProcardSaveApplicationRequest: Saves an application for Procard.ProcardSubmitApplicationRequest: Submits a final application for Procard.UpdateCustomerAddressRequest: Updates an existing customer address.UpdateCustomerRequest: Updates customer information.UpdatePasswordRequest: Updates user password.UpdateSavedListItemRequest: Updates an item in a saved list.UpdateSavedListRequest: Updates a saved list.ValidPromotionCode: Validates a promotion code.
Summary
Laravel requests in an e-com API are crucial for handling a wide range of operations, from managing user accounts and payments to handling shopping trolleys and additional specific functionalities. By organizing request classes into categories, the system ensures that data validation and processing are handled efficiently, supporting secure and effective API interactions.
This documentation now includes an overview of all request files, including those that do not fall into the primary categories but are important for the overall functionality of the e-com API. Adjust descriptions and examples as needed to better fit the specifics of your project.