Package com.dzidzi.api
Interface ExtraApi
public interface ExtraApi
ExtraApi contains all the api operations handling
Extra in the DzidziApp.-
Method Summary
Modifier and TypeMethodDescriptioncom.dzidzi.job.dto.JobbulkAddExtra(com.dzidzi.job.dto.ExtraJobRequest extraJobRequest) An async job is triggered to make bulk addition of extrascreateExtra(AddExtraRequest addExtraRequest) Adds/create a new extra by the logged in restaurant user.voiddeleteExtra(UUID extraId) Removes an extra by extra id and logged in restaurant.voiddisableExtraVisibility(UUID extraId) An extra is disabled to be invisible to users.com.dzidzi.job.dto.JobdisableExtraVisibilityJob(List<UUID> extraIds) An async job that disabled the visibility of bulk extras to users.editExtra(ChangeExtraRequest changeExtraRequest) Changes a field/all fields of an existing extra.voidenableExtraVisibility(UUID extraId) An extra is enabled to be visible by users.com.dzidzi.job.dto.JobenableExtraVisibilityJob(List<UUID> extraIds) An async job that enables the visibility of bulk extras to users.findExtraById(UUID extraId) Finds an extra by id.findExtras(FindExtraRequest findExtraRequest) The paged results of the provided request.
-
Method Details
-
findExtraById
Finds an extra by id.- Parameters:
extraId- the id of the extra- Returns:
- the extra found
- Throws:
com.dzidzi.exception.EntityNotFoundException- when the extra is not found
-
createExtra
Adds/create a new extra by the logged in restaurant user.- Parameters:
addExtraRequest- theAddExtraRequestcontaining the properties to create/add a new extra- Returns:
- the extra created/added
- Throws:
com.dzidzi.exception.DzidziException- when image is unable to load
-
editExtra
Changes a field/all fields of an existing extra.- Parameters:
changeExtraRequest- theChangeExtraRequestcontaining the properties to change the existing extra- Returns:
- the updated extra
- Throws:
com.dzidzi.exception.DzidziException- when image is unable to load
-
deleteExtra
Removes an extra by extra id and logged in restaurant. You can only delete a restaurant only if you are logged in as eitherUserRole.RESTAURANT_ADMINorUserRole.RESTAURANT_BRANCHand the extra belongs to the logged in restaurant.- Parameters:
extraId- the id of the extra
-
bulkAddExtra
com.dzidzi.job.dto.Job bulkAddExtra(com.dzidzi.job.dto.ExtraJobRequest extraJobRequest) An async job is triggered to make bulk addition of extras- Parameters:
extraJobRequest- the request body- Returns:
- the
Job
-
enableExtraVisibility
An extra is enabled to be visible by users.- Parameters:
extraId- the extra id to enable
-
disableExtraVisibility
An extra is disabled to be invisible to users.- Parameters:
extraId- the extra id to disable
-
enableExtraVisibilityJob
An async job that enables the visibility of bulk extras to users.- Parameters:
extraIds- the extra ids to enable- Returns:
- the
Job
-
disableExtraVisibilityJob
An async job that disabled the visibility of bulk extras to users.- Parameters:
extraIds- the extra ids to disable- Returns:
- the
Job
-
findExtras
The paged results of the provided request.- Parameters:
findExtraRequest- the requests used for filtering extras- Returns:
- the
DzidziPaginationDTO
-