Skip to content
Snippets Groups Projects
Commit 21a5b265 authored by Stian Lyng Stræte's avatar Stian Lyng Stræte
Browse files

Merge branch 'feature/27-implement-allergies-vegaterian-choice' into 'main'

Feature/27 implement allergies vegaterian choice

See merge request idatt2106-v23-03/backend!15
parents 394ae8e8 444739d0
No related branches found
No related tags found
No related merge requests found
package ntnu.idatt2016.v233.SmartMat.model;
/**
* This is a record class representing an allergy
*
* @author Stian Lyng
* @version 1.0
*
* @param name The name of the allergy
* @param description The description of the allergy
*/
public record Allergy(String name, String description) {
}
\ No newline at end of file
package ntnu.idatt2016.v233.SmartMat.repository;
import ntnu.idatt2016.v233.SmartMat.model.Allergy;
import java.util.List;
import java.util.Optional;
/**
* Repository for allergies
*
* @author Stian Lyng
* @version 1.0
* @since 04.04.2023
*/
public interface AllergyRepository {
/**
* Saves a allergy to the database
*
* @param allergy Allergy to save
*/
Allergy save (Allergy allergy);
/**
* Gets an allergy by name
*
* @param name the name of the allergy
* @return an optional containing the Allergy if it exists
*/
Optional<Allergy> getByName(String name);
/**
* Gets all allergies
*
* @return an optional containing a list of all allergies
*/
Optional<List<Allergy>> getAll();
/**
* Deletes an allergy by its name
*
* @param name the name of the allergy
*/
void deleteById(String name);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment