// Path: code/exercise_3/exercise/src/main/java/com/frankmoley/talks/spring/intro/data/repository/ItemRepository.java
// @Repository
// public class ItemRepository {
//     //TODO later
// }
// 
// Path: code/exercise_2/solution/src/main/java/com/frankmoley/talks/spring/intro/data/repository/PersonRepository.java
// public class PersonRepository {
//     //TODO Later
// }
// 
// Path: code/exercise_4/solution/src/main/java/com/frankmoley/talks/spring/intro/service/domain/model/DetailedInventoryItem.java
// public class DetailedInventoryItem  extends InventoryItem{
//     private String description;
//     private Double cost;
//     private Date acquired;
//     private String model;
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     public Date getAcquired() {
//         return acquired;
//     }
// 
//     public void setAcquired(Date acquired) {
//         this.acquired = acquired;
//     }
// 
//     public String getModel() {
//         return model;
//     }
// 
//     public void setModel(String model) {
//         this.model = model;
//     }
// 
//     public Double getCost() {
//         return cost;
//     }
// 
//     public void setCost(Double cost) {
//         this.cost = cost;
//     }
// }
// 
// Path: code/exercise_4/solution/src/main/java/com/frankmoley/talks/spring/intro/service/domain/model/Inventory.java
// public class Inventory {
//     private String emailAddress;
//     private String firstName;
//     private long personId;
//     List<InventoryItem> items;
// 
//     public String getEmailAddress() {
//         return emailAddress;
//     }
// 
//     public void setEmailAddress(String emailAddress) {
//         this.emailAddress = emailAddress;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public void setFirstName(String firstName) {
//         this.firstName = firstName;
//     }
// 
//     public long getPersonId() {
//         return personId;
//     }
// 
//     public void setPersonId(long personId) {
//         this.personId = personId;
//     }
// 
//     public List<InventoryItem> getItems() {
//         return items;
//     }
// 
//     public void setItems(List<InventoryItem> items) {
//         this.items = items;
//     }
// }


import com.frankmoley.talks.spring.intro.data.repository.ItemRepository;
import com.frankmoley.talks.spring.intro.data.repository.PersonRepository;
import com.frankmoley.talks.spring.intro.service.domain.model.DetailedInventoryItem;
import com.frankmoley.talks.spring.intro.service.domain.model.Inventory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
package com.frankmoley.talks.spring.intro.service;


/**
 * The inventory service manages all of the user inventory information including adding, updating, and retrieving the relevant details of the user and his or her items.
 */
@Service
public class InventoryService {

    private final ItemRepository itemRepository;
    private final PersonRepository personRepository;

    @Autowired
    public InventoryService(ItemRepository itemRepository, PersonRepository personRepository){
        super();
        this.itemRepository = itemRepository;
        this.personRepository = personRepository;
    }

// Path: code/exercise_3/exercise/src/main/java/com/frankmoley/talks/spring/intro/data/repository/ItemRepository.java
// @Repository
// public class ItemRepository {
//     //TODO later
// }
// 
// Path: code/exercise_2/solution/src/main/java/com/frankmoley/talks/spring/intro/data/repository/PersonRepository.java
// public class PersonRepository {
//     //TODO Later
// }
// 
// Path: code/exercise_4/solution/src/main/java/com/frankmoley/talks/spring/intro/service/domain/model/DetailedInventoryItem.java
// public class DetailedInventoryItem  extends InventoryItem{
//     private String description;
//     private Double cost;
//     private Date acquired;
//     private String model;
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     public Date getAcquired() {
//         return acquired;
//     }
// 
//     public void setAcquired(Date acquired) {
//         this.acquired = acquired;
//     }
// 
//     public String getModel() {
//         return model;
//     }
// 
//     public void setModel(String model) {
//         this.model = model;
//     }
// 
//     public Double getCost() {
//         return cost;
//     }
// 
//     public void setCost(Double cost) {
//         this.cost = cost;
//     }
// }
// 
// Path: code/exercise_4/solution/src/main/java/com/frankmoley/talks/spring/intro/service/domain/model/Inventory.java
// public class Inventory {
//     private String emailAddress;
//     private String firstName;
//     private long personId;
//     List<InventoryItem> items;
// 
//     public String getEmailAddress() {
//         return emailAddress;
//     }
// 
//     public void setEmailAddress(String emailAddress) {
//         this.emailAddress = emailAddress;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public void setFirstName(String firstName) {
//         this.firstName = firstName;
//     }
// 
//     public long getPersonId() {
//         return personId;
//     }
// 
//     public void setPersonId(long personId) {
//         this.personId = personId;
//     }
// 
//     public List<InventoryItem> getItems() {
//         return items;
//     }
// 
//     public void setItems(List<InventoryItem> items) {
//         this.items = items;
//     }
// }


// Path: code/exercise_4/solution/src/main/java/com/frankmoley/talks/spring/intro/service/InventoryService.java
import com.frankmoley.talks.spring.intro.data.repository.ItemRepository;
import com.frankmoley.talks.spring.intro.data.repository.PersonRepository;
import com.frankmoley.talks.spring.intro.service.domain.model.DetailedInventoryItem;
import com.frankmoley.talks.spring.intro.service.domain.model.Inventory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

package com.frankmoley.talks.spring.intro.service;


/**
 * The inventory service manages all of the user inventory information including adding, updating, and retrieving the relevant details of the user and his or her items.
 */
@Service
public class InventoryService {

    private final ItemRepository itemRepository;
    private final PersonRepository personRepository;

    @Autowired
    public InventoryService(ItemRepository itemRepository, PersonRepository personRepository){
        super();
        this.itemRepository = itemRepository;
        this.personRepository = personRepository;
    }

    public Inventory getInventory(long personId){