Index: Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Adoption.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Adoption.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Adoption.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
@@ -5,5 +5,4 @@
 
 import java.time.LocalDate;
-import java.util.Date;
 
 @Data
@@ -27,7 +26,7 @@
 
     @Column(name = "id_adopter", nullable = false)
-    private int adopterId;
+    private Integer adopterId;
 
-    public Adoption(LocalDate startDate, LocalDate endDateFoster, boolean approved, int adopterId) {
+    public Adoption(LocalDate startDate, LocalDate endDateFoster, boolean approved, Integer adopterId) {
         this.startDate = startDate;
         this.endDateFoster = endDateFoster;
Index: Prototype Application/Paw5/src/main/java/finki/paw5/model/exceptions/InvalidPetIdException.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/model/exceptions/InvalidPetIdException.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/model/exceptions/InvalidPetIdException.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
@@ -0,0 +1,4 @@
+package finki.paw5.model.exceptions;
+
+public class InvalidPetIdException extends RuntimeException{
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/AdoptionService.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/AdoptionService.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/AdoptionService.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
@@ -0,0 +1,8 @@
+package finki.paw5.service;
+
+import finki.paw5.model.entities.Adoption;
+
+public interface AdoptionService {
+
+    void save(Adoption adoption);
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/AdoptionServiceImplementation.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/AdoptionServiceImplementation.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/AdoptionServiceImplementation.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
@@ -0,0 +1,21 @@
+package finki.paw5.service.implementation;
+
+import finki.paw5.model.entities.Adoption;
+import finki.paw5.repository.AdoptionRepository;
+import finki.paw5.service.AdoptionService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AdoptionServiceImplementation implements AdoptionService {
+
+    private final AdoptionRepository adoptionRepository;
+
+    public AdoptionServiceImplementation(AdoptionRepository adoptionRepository) {
+        this.adoptionRepository = adoptionRepository;
+    }
+
+    @Override
+    public void save(Adoption adoption) {
+        this.adoptionRepository.save(adoption);
+    }
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PetController.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PetController.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PetController.java	(revision 9a180fd9245330b18c29e3354bf118fde9fc1fdd)
@@ -1,6 +1,16 @@
 package finki.paw5.web.controllers;
 
+import finki.paw5.model.entities.Adoption;
+import finki.paw5.model.entities.Pet;
+import finki.paw5.model.entities.User;
+import finki.paw5.model.exceptions.InvalidPetIdException;
+import finki.paw5.service.AdoptionService;
 import finki.paw5.service.PetService;
+import jakarta.servlet.http.HttpServletRequest;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.time.LocalDate;
 
 @Controller
@@ -8,8 +18,25 @@
 
     private final PetService petService;
+    private final AdoptionService adoptionService;
 
-    public PetController(PetService petService) {
+    public PetController(PetService petService, AdoptionService adoptionService) {
         this.petService = petService;
+        this.adoptionService = adoptionService;
     }
 
+    @PostMapping("/submit-adopton-{id}")
+    public String saveAdoption(@PathVariable Integer id, HttpServletRequest request) {
+
+        Pet pet = this.petService.findById(id).orElseThrow(InvalidPetIdException::new);
+        
+        User user = (User) request.getSession().getAttribute("user");
+
+        Adoption adoption = new Adoption(LocalDate.now(), null, false, user.getId());
+        this.adoptionService.save(adoption);
+
+        pet.setAdoptionId(adoption.getId());
+        this.petService.save(pet);
+
+        return "redirect:/home";
+    }
 }
