Changeset 5c142f7
- Timestamp:
- 01/03/23 15:08:45 (23 months ago)
- Branches:
- main
- Children:
- d37f9ee
- Parents:
- 594d4c4
- Location:
- FullyStocked/src/main/java/com/bazi/fullystocked/Models
- Files:
-
- 8 added
- 1 edited
- 13 moved
Legend:
- Unmodified
- Added
- Removed
-
FullyStocked/src/main/java/com/bazi/fullystocked/Models/AnswerId.java
r594d4c4 r5c142f7 16 16 @ManyToOne 17 17 @JoinColumn(name="questionid") 18 private questions question;18 private Questions question; 19 19 @Override 20 20 public boolean equals(Object o) { -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Answers.java
r594d4c4 r5c142f7 13 13 @NoArgsConstructor 14 14 @Data 15 public class answers {15 public class Answers { 16 16 @EmbeddedId 17 17 private AnswerId answerId; … … 22 22 private String answertext; 23 23 24 public answers(String answertext) {24 public Answers(String answertext) { 25 25 this.datecreated = LocalDateTime.now(); 26 26 this.answertext = answertext; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Articles.java
r594d4c4 r5c142f7 1 1 package com.bazi.fullystocked.Models; 2 2 3 import jdk.jfr.Category;4 3 import lombok.Data; 5 4 import lombok.NoArgsConstructor; … … 14 13 @Entity 15 14 @NoArgsConstructor 16 public class articles {15 public class Articles { 17 16 @Id 18 17 @GeneratedValue(strategy = GenerationType.IDENTITY) … … 35 34 inverseJoinColumns = @JoinColumn(name = "categoryid") 36 35 ) 37 private List< categories> categoryList=new ArrayList<>();36 private List<Categories> categoryList=new ArrayList<>(); 38 37 39 public articles(String description, String articlename, String imageurl, int maxquantityperlocation) {38 public Articles(String description, String articlename, int maxquantityperlocation) { 40 39 this.description = description; 41 40 this.articlename = articlename; 42 this.imageurl = imageurl;43 41 this.maxquantityperlocation = maxquantityperlocation; 44 42 } -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Categories.java
r594d4c4 r5c142f7 13 13 @Entity 14 14 @NoArgsConstructor 15 public class categories {15 public class Categories { 16 16 @Id 17 17 @GeneratedValue(strategy = GenerationType.IDENTITY) … … 26 26 private String description; 27 27 @ManyToMany(mappedBy = "categoryList") 28 private List< articles> articlesList=new ArrayList<>();28 private List<Articles> articlesList=new ArrayList<>(); 29 29 @ManyToMany(mappedBy = "categoryList2") 30 private List< suppliers> suppliersList=new ArrayList<>();30 private List<Suppliers> suppliersList=new ArrayList<>(); 31 31 32 32 33 public categories(String categoryname, String description) {33 public Categories(String categoryname, String description) { 34 34 this.categoryname = categoryname; 35 35 this.description = description; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/InvoicedArticles.java
r594d4c4 r5c142f7 6 6 import javax.persistence.*; 7 7 import javax.validation.constraints.Min; 8 import javax.validation.constraints.NotEmpty;9 8 import javax.validation.constraints.NotNull; 10 9 … … 12 11 @Entity 13 12 @NoArgsConstructor 14 public class invoicedarticles { 13 @Table(name="invoicedarticles") 14 public class InvoicedArticles { 15 15 @Id 16 16 @GeneratedValue(strategy = GenerationType.IDENTITY) … … 26 26 @ManyToOne 27 27 @JoinColumn(name = "invoiceid") 28 private invoices invoice;28 private Invoices invoice; 29 29 @ManyToOne 30 30 @JoinColumn(name = "articleid") 31 private articles article;31 private Articles article; 32 32 33 public invoicedarticles(int price, int quantity, invoices invoice, articles article) {33 public InvoicedArticles(int price, int quantity, Invoices invoice, Articles article) { 34 34 this.price = price; 35 35 this.quantity = quantity; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Invoices.java
r594d4c4 r5c142f7 12 12 @Entity 13 13 @NoArgsConstructor 14 public class invoices {14 public class Invoices { 15 15 @Id 16 16 @GeneratedValue(strategy = GenerationType.IDENTITY) 17 17 private Integer invoiceid; 18 @Column(nullable = false)19 @NotNull(message = "Invoice must have customer name")20 @NotEmpty(message = "Invoice must have customer name")21 18 private String customername; 22 @Column(nullable = false)23 @NotNull(message = "Invoice must have customer phone")24 @NotEmpty(message = "Invoice must have customer phone")25 19 private String customerphone; 26 @Column(nullable = false)27 @NotNull(message = "Invoice must have customer street")28 @NotEmpty(message = "Invoice must have customer street")29 20 private String street; 30 @Column(nullable = false)31 @NotNull(message = "Invoice must have customer street number")32 21 private int streetnumber; 33 @Column(nullable = false)34 @NotNull(message = "Invoice must have customer city")35 @NotEmpty(message = "Invoice must have customer city")36 22 private String city; 37 23 @Column(nullable = false) … … 40 26 @ManyToOne 41 27 @JoinColumn(name = "workeruserid") 42 private workers worker;28 private Workers worker; 43 29 44 public invoices(String customername, String customerphone, 45 String street, int streetnumber, String city, workers worker) { 30 public Invoices(Workers worker) { 31 32 this.datecreate = LocalDateTime.now(); 33 this.worker = worker; 34 } 35 36 public Invoices(String customername, String customerphone, String street, int streetnumber, String city, Workers worker) { 46 37 this.customername = customername; 47 38 this.customerphone = customerphone; … … 49 40 this.streetnumber = streetnumber; 50 41 this.city = city; 51 this.datecreate = LocalDateTime.now();52 42 this.worker = worker; 53 43 } -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Locations.java
r594d4c4 r5c142f7 11 11 @Entity 12 12 @NoArgsConstructor 13 public class locations {13 public class Locations { 14 14 @Id 15 15 @GeneratedValue(strategy = GenerationType.IDENTITY) … … 35 35 private String city; 36 36 37 public locations(String locationname, String phone, String street, Integer streetnumber, String city) {37 public Locations(String locationname, String phone, String street, Integer streetnumber, String city) { 38 38 this.locationname = locationname; 39 39 this.phone = phone; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Managers.java
r594d4c4 r5c142f7 11 11 @Data 12 12 @NoArgsConstructor 13 public class managers extends User{14 public managers(String firstname, String lastname, String username, String email, String password) {13 public class Managers extends User{ 14 public Managers(String firstname, String lastname, String username, String email, String password) { 15 15 super(firstname, lastname, username, email, password); 16 16 } -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/OrderedArticles.java
r594d4c4 r5c142f7 1 1 package com.bazi.fullystocked.Models; 2 2 3 import com.bazi.fullystocked.Models.Enumerations.ArticleStatus; 3 4 import lombok.Data; 4 5 import lombok.NoArgsConstructor; 5 import lombok.RequiredArgsConstructor;6 6 7 7 import javax.persistence.*; … … 13 13 @Entity 14 14 @NoArgsConstructor 15 public class orderedarticles { 15 @Table(name="orderedarticles") 16 public class OrderedArticles { 16 17 @Id 17 18 @GeneratedValue(strategy = GenerationType.IDENTITY) … … 24 25 private int quantity; 25 26 @Column(nullable = false) 26 @NotNull(message = "Ordered Article must have status") 27 @NotEmpty(message = "Ordered Article must have status") 28 private String articlestatus; 27 @Enumerated(EnumType.STRING) 28 private ArticleStatus articlestatus; 29 29 @ManyToOne 30 30 @JoinColumn(name = "orderid") 31 private orders order;31 private Orders order; 32 32 @ManyToOne 33 33 @JoinColumn(name = "locationid") 34 private locations location;34 private Locations location; 35 35 @ManyToOne 36 36 @JoinColumn(name = "articleid") 37 private articles article;37 private Articles article; 38 38 39 public orderedarticles(int price, int quantity, String articlestatus, orders order, locations location, articles article) { 40 this.price = price; 39 public OrderedArticles(int quantity, Orders order, Locations location, Articles article) { 41 40 this.quantity = quantity; 42 this.articlestatus = articlestatus;41 this.articlestatus = ArticleStatus.ORDERED; 43 42 this.order = order; 44 43 this.location = location; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Orders.java
r594d4c4 r5c142f7 1 1 package com.bazi.fullystocked.Models; 2 2 3 import com.bazi.fullystocked.Models.Enumerations.OrderPriority; 4 import com.bazi.fullystocked.Models.Enumerations.OrderStatus; 3 5 import lombok.Data; 4 6 import lombok.NoArgsConstructor; … … 12 14 @Entity 13 15 @NoArgsConstructor 14 public class orders {16 public class Orders { 15 17 @Id 16 18 @GeneratedValue(strategy = GenerationType.IDENTITY) 17 19 private Integer orderid; 18 20 @Column(nullable = false) 19 @NotNull(message = "Order must have status") 20 @NotEmpty(message = "Order must have status") 21 private String status; 21 @Enumerated(EnumType.STRING) 22 private OrderStatus status; 22 23 private String supplierremark; 23 24 private String managerremark; … … 27 28 private LocalDateTime dateapproved; 28 29 @Column(nullable = false) 29 @NotNull(message = "Order must have priority") 30 @NotEmpty(message = "Order must have priority") 31 private String priority; 30 @Enumerated(EnumType.STRING) 31 private OrderPriority priority; 32 32 @ManyToOne 33 33 @JoinColumn(name = "manageruserid") 34 private managers manager;34 private Managers manager; 35 35 @ManyToOne 36 36 @JoinColumn(name = "supplieruserid") 37 private suppliers supplier;37 private Suppliers supplier; 38 38 39 public orders(String status, String supplierremark, String managerremark, 40 LocalDateTime dateapproved, String priority, managers manager, suppliers supplier) { 41 this.status = status; 42 this.supplierremark = supplierremark; 43 this.managerremark = managerremark; 39 public Orders(OrderPriority priority, Managers manager, Suppliers supplier) { 40 this.status = OrderStatus.CREATED; 44 41 this.datecreated = LocalDateTime.now(); 45 this.dateapproved = dateapproved;46 42 this.priority = priority; 47 43 this.manager = manager; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Questions.java
r594d4c4 r5c142f7 14 14 @Entity 15 15 @NoArgsConstructor 16 public class questions {16 public class Questions { 17 17 @Id 18 18 @GeneratedValue(strategy = GenerationType.IDENTITY) … … 27 27 @ManyToOne 28 28 @JoinColumn(name = "workeruserid") 29 private workers worker;29 private Workers worker; 30 30 @ManyToOne 31 31 @JoinColumn(name = "manageruserid") 32 private managers manager;32 private Managers manager; 33 33 @ManyToMany(mappedBy = "questionsList") 34 private List< storedarticles> storedarticlesList=new ArrayList<>();34 private List<StoredArticles> storedarticlesList=new ArrayList<>(); 35 35 36 36 37 public questions(String questiontext, workers worker, managers manager) {37 public Questions(String questiontext, Workers worker, Managers manager) { 38 38 this.questiontext = questiontext; 39 39 this.datecreated = LocalDateTime.now(); -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/StoredArticles.java
r594d4c4 r5c142f7 6 6 import javax.persistence.*; 7 7 import javax.validation.constraints.Min; 8 import javax.validation.constraints.NotEmpty;9 8 import javax.validation.constraints.NotNull; 10 9 import java.util.ArrayList; … … 14 13 @Entity 15 14 @NoArgsConstructor 16 public class storedarticles { 15 @Table(name="storedarticles") 16 public class StoredArticles { 17 17 @Id 18 18 @GeneratedValue(strategy = GenerationType.IDENTITY) … … 24 24 @ManyToOne 25 25 @JoinColumn(name = "locationid") 26 private locations locations;26 private Locations locations; 27 27 @ManyToOne 28 28 @JoinColumn(name = "articleid") 29 private articles article;29 private Articles article; 30 30 @ManyToMany 31 31 @JoinTable(name = "question_availability_for_storedarticle", … … 33 33 inverseJoinColumns = @JoinColumn(name = "questionid") 34 34 ) 35 private List< questions> questionsList=new ArrayList<>();35 private List<Questions> questionsList=new ArrayList<>(); 36 36 37 public storedarticles(int quantity, locations locations, articles article) {37 public StoredArticles(int quantity, Locations locations, Articles article) { 38 38 this.quantity = quantity; 39 39 this.locations = locations; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Suppliers.java
r594d4c4 r5c142f7 15 15 @Data 16 16 @NoArgsConstructor 17 public class suppliers extends User{17 public class Suppliers extends User{ 18 18 @Column(nullable = false) 19 19 @NotNull(message = "Supplier must have supplierInfo") … … 40 40 inverseJoinColumns = @JoinColumn(name = "categoryid") 41 41 ) 42 private List< categories> categoryList2=new ArrayList<>();42 private List<Categories> categoryList2=new ArrayList<>(); 43 43 44 public suppliers(String firstname, String lastname, String username, String email, String password, String supplierinfo, String phone, String street, int sttreetnumber, String city) {44 public Suppliers(String firstname, String lastname, String username, String email, String password, String supplierinfo, String phone, String street, int sttreetnumber, String city) { 45 45 super(firstname, lastname, username, email, password); 46 46 this.supplierinfo = supplierinfo; -
FullyStocked/src/main/java/com/bazi/fullystocked/Models/Workers.java
r594d4c4 r5c142f7 5 5 import lombok.NoArgsConstructor; 6 6 7 import javax.persistence.Column;8 7 import javax.persistence.Entity; 9 8 import javax.persistence.JoinColumn; 10 9 import javax.persistence.ManyToOne; 11 import javax.validation.constraints.NotNull;12 10 13 11 @Entity … … 15 13 @Data 16 14 @NoArgsConstructor 17 public class workers extends User{15 public class Workers extends User{ 18 16 @ManyToOne 19 17 @JoinColumn(name = "locationid") 20 private locations location;18 private Locations location; 21 19 22 public workers(String firstname, String lastname, String username, String email, String password, locations location) {20 public Workers(String firstname, String lastname, String username, String email, String password, Locations location) { 23 21 super(firstname, lastname, username, email, password); 24 22 this.location = location;
Note:
See TracChangeset
for help on using the changeset viewer.