From e9cc972d71b35352dc50c3f1eedee5458ef46973 Mon Sep 17 00:00:00 2001 From: kirazed08 Date: Sat, 3 Aug 2024 14:35:37 -0400 Subject: [PATCH] WellFargo_Project1 --- .../wellsfargo/counselor/entity/Client.java | 90 +++++++++++++++++++ .../counselor/entity/Portfolio.java | 42 +++++++++ .../wellsfargo/counselor/entity/Security.java | 88 ++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 src/main/java/com/wellsfargo/counselor/entity/Client.java create mode 100644 src/main/java/com/wellsfargo/counselor/entity/Portfolio.java create mode 100644 src/main/java/com/wellsfargo/counselor/entity/Security.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..b9a0d417 --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/entity/Client.java @@ -0,0 +1,90 @@ +package com.wellsfargo.counselor.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +@Entity +public class Client { + @Id + @GeneratedValue() + private long clientId; + private long advisorId; + + @Column(nullable = false) + private String firstName; + + @Column(nullable = false) + private String lastName; + + @Column(nullable = false) + private String address; + + @Column(nullable = false) + private String phone; + + @Column(nullable = false) + private String email; + + public Client() { + + } + public Client(String firstName, String lastName, String address, String phone, String email) { + this.firstName = firstName; + this.lastName = lastName; + this.address = address; + this.phone = phone; + this.email = email; + } + + public long getClientId() { + return clientId; + } + + + public long getAdvisorId() { + return advisorId; + } + + + 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 getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} 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..f41d62e7 --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/entity/Portfolio.java @@ -0,0 +1,42 @@ +package com.wellsfargo.counselor.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +@Entity +public class Portfolio { + @Id + @GeneratedValue() + private long portfolioId; + private long clientId; + + + @Column(nullable = false) + private String creationDate; + + + public Portfolio(){ + + } + public Portfolio(String creationDate){ + this.creationDate = creationDate; + } + + public long getPortfolioId() { + return portfolioId; + } + + public long getClientId() { + return clientId; + } + + public String getCreationDate() { + return creationDate; + } + + public void setCreationDate(String creationDate) { + this.creationDate = creationDate; + } +} 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..ddf7087a --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/entity/Security.java @@ -0,0 +1,88 @@ +package com.wellsfargo.counselor.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +@Entity +public class Security { + @Id + @GeneratedValue + private long securityId; + private long portfolioId; + + @Column(nullable = false) + private String securityName; + + @Column(nullable = false) + private String category; + + @Column(nullable = false) + private double purchasePrice; + + @Column(nullable = false) + private String purchaseDate; + + @Column(nullable = false) + private int quantity; + public Security() { + + } + public Security(String securityName, String category, double purchasePrice, String purchaseDate, int quantity) { + this.securityName = securityName; + this.category = category; + this.purchasePrice = purchasePrice; + this.purchaseDate = purchaseDate; + this.quantity = quantity; + + } + + public long getSecurityId() { + return securityId; + } + + public long getPortfolioId() { + return portfolioId; + } + + public String getSecurityName() { + return securityName; + } + + public void setSecurityName(String securityName) { + this.securityName = securityName; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public double getPurchasePrice() { + return purchasePrice; + } + + public void setPurchasePrice(double purchasePrice) { + this.purchasePrice = purchasePrice; + } + + public String getPurchaseDate() { + return purchaseDate; + } + + public void setPurchaseDate(String purchaseDate) { + this.purchaseDate = purchaseDate; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } +}