Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
<groupId>io.zipcodewilmington</groupId>
<artifactId>ProductInventoryLab</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
Expand Down
59 changes: 59 additions & 0 deletions src/main/java/io/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package io;

import services.HockeyStickService;

import java.util.Scanner;

public class App {
private HockeyStickService stickService = new HockeyStickService();

public static void main(String... args) {
App application = new App();
application.init();
}

public void init() {
Console.printWelcome();
}

public String userInput() {
Integer opt1 = 0;
String opt2 = "";
String opt3 = "";
Integer opt4 = 0;
Integer opt5 = 0;
Double opt6 = 0.0;


while (addMore = true) {

System.out.println("What do you wish to add to inventory? Press 1 for Stick 2 for Skate");
Scanner scanner = new Scanner(String.valueOf(input));
System.out.println();
System.out.println("Product Name?");
opt2 = String.valueOf(scanner.hasNextInt());
System.out.println("Product Brand?");
opt3 = String.valueOf(scanner.hasNextInt());
System.out.println("Product Size");
opt4 = Integer.valueOf(String.valueOf(scanner.hasNextInt()));
System.out.println("Product Price");
opt6 = Double.valueOf(String.valueOf(scanner.hasNextInt()));
System.out.println("How many would you like to add?");
opt5 = Integer.valueOf(String.valueOf(scanner.hasNextInt()));
System.out.println("Products I.D.?");
if (input = 1) {
HockeyStickService.create(o)


}


}

}




}

12 changes: 12 additions & 0 deletions src/main/java/io/Console.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io;

public class Console {
public static void printWelcome(){
System.out.println("" +
"**************************************************" +
"*** Welcome and Bienvenue ***" +
"*** to ***" +
"*** ZipCo Inventory Manager ***" +
"**************************************************");
}
}
4 changes: 4 additions & 0 deletions src/main/java/io/UserInterface.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package io;

public interface UserInterface {
}
70 changes: 70 additions & 0 deletions src/main/java/models/HockeySkates.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package models;

public class HockeySkates {

private Integer id;
private String name;
private String brand;
private Integer size;
private Integer qty;
private Double price;


public HockeySkates(){
}

public HockeySkates(Integer id, String name, String brand, Integer size, Integer qty, Double price){

}


public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getBrand() {
return brand;
}

public void setBrand(String brand) {
this.brand = brand;
}

public Integer getSize() {
return size;
}

public void setSize(Integer size) {
this.size = size;
}

public Integer getQty() {
return qty;
}

public void setQty(Integer qty) {
this.qty = qty;
}

public Double getPrice() {
return price;
}

public void setPrice(Double price) {
this.price = price;
}


}
72 changes: 72 additions & 0 deletions src/main/java/models/HockeyStick.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package models;

public class HockeyStick {

private Integer id;
private String name;
private String brand;
private Integer size;
private Integer qty;
private Double price;

public HockeyStick(){
}

public HockeyStick(Integer id, String name, String brand, Integer size, Integer qty, Double price) {
this.id = id;
this.name = name;
this.brand = brand;
this.size = size;
this.qty = qty;
this.price = price;
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getBrand() {
return brand;
}

public void setBrand(String brand) {
this.brand = brand;
}

public Integer getSize() {
return size;
}

public void setSize(Integer size) {
this.size = size;
}

public Integer getQty() {
return qty;
}

public void setQty(Integer qty) {
this.qty = qty;
}

public Double getPrice() {
return price;
}

public void setPrice(Double price) {
this.price = price;
}

}
4 changes: 4 additions & 0 deletions src/main/java/services/HockeySkateService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package services;

public class HockeySkateService {
}
49 changes: 49 additions & 0 deletions src/main/java/services/HockeyStickService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package services;

import models.HockeyStick;

import java.util.ArrayList;

public class HockeyStickService {

private static int nextId = 1;

private static ArrayList<HockeyStick> inventory = new ArrayList<HockeyStick>();

public static HockeyStick create(String name, String brand, Integer size, Integer qty, Double price){

HockeyStick createdStick = new HockeyStick(nextId++, name, brand, size, qty, price);

inventory.add(createdStick);

return createdStick;
}

public HockeyStick findHockeyStick(Integer id) {
for (int i = 0; i < inventory.size(); i++) {
if (inventory.get(i).equals(id)) {
return inventory.get(i);
} else {
return null;
}
}
return null;
}


public HockeyStick[] findAll(){
return (HockeyStick[]) inventory.toArray();

}

public boolean delete(Integer id){
return inventory.remove(findHockeyStick(id));

}






}
Loading