Skip to content

RentalTooService ‐ Fetch Pricing Details for A Tool

Dennis Chacko edited this page Jul 19, 2024 · 10 revisions

Get Pricing Details for tool

Table of Contents

Overview

The Get Pricing Details for tool operation fetches the pricing details for a particular tool, including:

  • The daily rental price
  • Details on whether the rent is charged on weekdays, weekends and holidays

Sample Request/Response

Request to fetch pricing details for a tool

The below curl command can be used to fetch all available tools

curl --location --globoff '{{baseUrl}}/api/v1/tool/:CHNS/rentalprice' \ --header 'Accept: application/json'

Response to fetch pricing details for a tool
{
  "code": "CHNS",
  "daily_charge": "2.99",
  "holiday_charge": "true",
  "weekend_charge": "false"
}

Sequence diagram

sequenceDiagram
    AbstractController->>+RentalAgreementService: Fetch pricing details for tool code
    RentalAgreementService->>+ToolPriceRepository: Fetch pricing details for tool code
      
    ToolPriceRepository-->>-RentalAgreementService: pricing details
    alt invalid tool code
        RentalAgreementService->>ToolPriceRepository: Fetch pricing details for tool code
        ToolPriceRepository->>RentalAgreementService: Tool code not found
        RentalAgreementService ->> RentalAgreementService: Throw ValidationException
      end
    RentalAgreementService-->>-AbstractController: pricing details
Loading

Exception

The operation throws a ValidationException if called with an invalid tool code

Clone this wiki locally