From 9a29499c395875af382785fb144d0c2d44557e2b Mon Sep 17 00:00:00 2001 From: David Guler Date: Fri, 14 Oct 2022 21:15:19 +0200 Subject: [PATCH] feat: GardenPlan types and interfaces Created the type and interface relating to the GardenPlan --- .../java/ch/zhaw/gartenverwaltung/io/GardenPlan.java | 12 ++++++++++++ .../ch/zhaw/gartenverwaltung/types/UserPlanting.java | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/main/java/ch/zhaw/gartenverwaltung/io/GardenPlan.java create mode 100644 src/main/java/ch/zhaw/gartenverwaltung/types/UserPlanting.java diff --git a/src/main/java/ch/zhaw/gartenverwaltung/io/GardenPlan.java b/src/main/java/ch/zhaw/gartenverwaltung/io/GardenPlan.java new file mode 100644 index 0000000..94e1346 --- /dev/null +++ b/src/main/java/ch/zhaw/gartenverwaltung/io/GardenPlan.java @@ -0,0 +1,12 @@ +package ch.zhaw.gartenverwaltung.io; + +import ch.zhaw.gartenverwaltung.types.UserPlanting; + +import java.io.IOException; +import java.util.List; + +public interface GardenPlan { + List getPlantings(); + void savePlanting(UserPlanting planting) throws IOException; + void removePlanting(UserPlanting planting) throws IOException; +} diff --git a/src/main/java/ch/zhaw/gartenverwaltung/types/UserPlanting.java b/src/main/java/ch/zhaw/gartenverwaltung/types/UserPlanting.java new file mode 100644 index 0000000..804d388 --- /dev/null +++ b/src/main/java/ch/zhaw/gartenverwaltung/types/UserPlanting.java @@ -0,0 +1,10 @@ +package ch.zhaw.gartenverwaltung.types; + +import java.util.Date; + +public record UserPlanting( + long plantId, + Date startDate, + int area +) { +}