-
Notifications
You must be signed in to change notification settings - Fork 0
RentalTooService ‐ Fetch Pricing Details for A Tool
Dennis Chacko edited this page Jul 19, 2024
·
10 revisions
Table of Contents |
---|
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
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"
}
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
The operation throws a ValidationException if called with an invalid tool code