From 68dc9fbd067ee627302b1835ae658a812bf78635 Mon Sep 17 00:00:00 2001 From: Kostubh Upadhyay <146160336+iKostubh@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:40:41 -0600 Subject: [PATCH 1/3] Create Client.java --- .../wellsfargo/counselor/entity/Client.java | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/main/java/com/wellsfargo/counselor/entity/Client.java diff --git a/src/main/java/com/wellsfargo/counselor/entity/Client.java b/src/main/java/com/wellsfargo/counselor/entity/Client.java new file mode 100644 index 00000000..a53bd504 --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/entity/Client.java @@ -0,0 +1,97 @@ +package com.wellsfargo.counselor.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; + +@Entity +public class Client { + + @Id + @GeneratedValue + private long clientId; + + @Column(nullable = false) + private String firstName; + + @Column(nullable = false) + private String lastName; + + @Column(nullable = false) + private String email; + + @Column(nullable = false) + private String phone; + + @Column(nullable = false) + private String address; + + @ManyToOne + private Advisor advisor; + + protected Client() { + } + + public Client(String firstName, String lastName, String email, String phone, String address, Advisor advisor) { + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.phone = phone; + this.address = address; + this.advisor = advisor; + } + + public long getClientId() { + return clientId; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Advisor getAdvisor() { + return advisor; + } + + public void setAdvisor(Advisor advisor) { + this.advisor = advisor; + } +} From dde88bdac110a22faae778f5a1ccc3940bed9668 Mon Sep 17 00:00:00 2001 From: Kostubh Upadhyay <146160336+iKostubh@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:43:12 -0600 Subject: [PATCH 2/3] Create Portfolio.java --- .../counselor/entity/Portfolio.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/main/java/com/wellsfargo/counselor/entity/Portfolio.java diff --git a/src/main/java/com/wellsfargo/counselor/entity/Portfolio.java b/src/main/java/com/wellsfargo/counselor/entity/Portfolio.java new file mode 100644 index 00000000..4457f495 --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/entity/Portfolio.java @@ -0,0 +1,50 @@ +package com.wellsfargo.counselor.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import java.util.Date; + +@Entity +public class Portfolio { + + @Id + @GeneratedValue + private long portfolioId; + + @ManyToOne + private Client client; + + @Column(nullable = false) + private Date creationDate; + + protected Portfolio() { + } + + public Portfolio(Client client, Date creationDate) { + this.client = client; + this.creationDate = creationDate; + } + + public long getPortfolioId() { + return portfolioId; + } + + public Client getClient() { + return client; + } + + public void setClient(Client client) { + this.client = client; + } + + public Date getCreationDate() { + return creationDate; + } + + public void setCreationDate(Date creationDate) { + this.creationDate = creationDate; + } +} From edd895e25743c3f216b8a2e7cbfe8affd81c07c5 Mon Sep 17 00:00:00 2001 From: Kostubh Upadhyay <146160336+iKostubh@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:44:03 -0600 Subject: [PATCH 3/3] Create Security.java --- .../wellsfargo/counselor/entity/Security.java | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/main/java/com/wellsfargo/counselor/entity/Security.java diff --git a/src/main/java/com/wellsfargo/counselor/entity/Security.java b/src/main/java/com/wellsfargo/counselor/entity/Security.java new file mode 100644 index 00000000..a400b2bd --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/entity/Security.java @@ -0,0 +1,98 @@ +package com.wellsfargo.counselor.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import java.util.Date; + +@Entity +public class Security { + + @Id + @GeneratedValue + private long securityId; + + @ManyToOne + private Portfolio portfolio; + + @Column(nullable = false) + private String name; + + @Column(nullable = false) + private String category; + + @Column(nullable = false) + private Date purchaseDate; + + @Column(nullable = false) + private float purchasePrice; + + @Column(nullable = false) + private int quantity; + + protected Security() { + } + + public Security(Portfolio portfolio, String name, String category, Date purchaseDate, float purchasePrice, int quantity) { + this.portfolio = portfolio; + this.name = name; + this.category = category; + this.purchaseDate = purchaseDate; + this.purchasePrice = purchasePrice; + this.quantity = quantity; + } + + public long getSecurityId() { + return securityId; + } + + public Portfolio getPortfolio() { + return portfolio; + } + + public void setPortfolio(Portfolio portfolio) { + this.portfolio = portfolio; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public Date getPurchaseDate() { + return purchaseDate; + } + + public void setPurchaseDate(Date purchaseDate) { + this.purchaseDate = purchaseDate; + } + + public float getPurchasePrice() { + return purchasePrice; + } + + public void setPurchasePrice(float purchasePrice) { + this.purchasePrice = purchasePrice; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } +}