Class TaxBandService
java.lang.Object
com.example.vehicletaxsystem.services.TaxBandService
Service class to handle the logic for tax band queries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.Loggerprivate final TaxBandRepositoryprivate final TaxRateRepository -
Constructor Summary
ConstructorsConstructorDescriptionTaxBandService(TaxBandRepository taxBandRepository, TaxRateRepository taxRateRepository) -
Method Summary
Modifier and TypeMethodDescriptionprivate TaxBandDTOconvertToTaxBandDTO(TaxBand taxband) getIndividualTaxRateValues(TaxBand taxband) getTaxBandDTOSByDescription(String description) Search for tax bands based on partial matchesupdateTaxBand(int id, TaxBandDTO taxBandDTO) Updates the description and the tax rate id, the list of vehicles wouldn't change across the board.
It's more of a one way change, if all vehicles in the band were going to change, its probably because the band itself has changed
-
Field Details
-
logger
private final org.slf4j.Logger logger -
taxBandRepository
-
taxRateRepository
-
-
Constructor Details
-
TaxBandService
-
-
Method Details
-
getIndividualTaxRateValues
-
convertToTaxBandDTO
-
getAllTaxBandDTO
-
getTaxBandDTOByBandId
-
getTaxBandDTOSByDescription
Search for tax bands based on partial matches- Parameters:
description- string to search tax bands by- Returns:
- List of taxbands which have descriptions containing the search parameter
-
updateTaxBand
Updates the description and the tax rate id, the list of vehicles wouldn't change across the board.
It's more of a one way change, if all vehicles in the band were going to change, its probably because the band itself has changed- Parameters:
id- id of the tax band being changedtaxBandDTO- the updated tax band fields- Returns:
- TaxBandDTO with updated field values
-