chore: reorganize into polyglot monorepo (workshop)
- Move bigmind/ -> mcp/bigmind/ - Move webscraper/ -> mcp/webscraper/ - Move mss-failsafe/ -> java/mss-failsafe/ - Move Wellmann-Shop/ -> java/wellmann-shop/ (normalize to kebab-case) - Add .roo/ IDE config files to tracking - Add plans/REPO_STRATEGY.md (monorepo strategy document) - Expand .gitignore: Java/Maven, Node/TS, coverage, uv.lock - Rewrite README.md as navigation index - Update .roo/mcp.json webscraper path to mcp/webscraper/
This commit is contained in:
@@ -0,0 +1,214 @@
|
||||
package model.adresses;
|
||||
|
||||
import java.util.Objects;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import model.AbstractEntity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@MappedSuperclass
|
||||
public class Address extends AbstractEntity{
|
||||
|
||||
//Land
|
||||
@NotNull(message = "Land darf nicht null sein")
|
||||
private String country;
|
||||
|
||||
//Straßenname
|
||||
@NotNull(message = "Strasse darf nicht null sein")
|
||||
private String street;
|
||||
|
||||
//Hausnummer
|
||||
@NotNull(message = "Hausnummer darf nicht null sein")
|
||||
private String number;
|
||||
|
||||
//Zusatz
|
||||
private String extra;
|
||||
|
||||
//PLZ
|
||||
@NotNull(message = "PLZ darf nicht null sein")
|
||||
private Integer postnumber;
|
||||
|
||||
//Bundesland
|
||||
@NotNull(message = "Bundesland darf nicht null sein")
|
||||
private String county;
|
||||
|
||||
//Ort
|
||||
@NotNull(message = "Ort darf nicht null sein")
|
||||
private String place;
|
||||
|
||||
private String contact;
|
||||
|
||||
private String comment;
|
||||
|
||||
public Address() {
|
||||
}
|
||||
|
||||
public Address(String street, String number, String extra, Integer postnumber, String county, String place) {
|
||||
this.street = street;
|
||||
this.number = number;
|
||||
this.extra = extra;
|
||||
this.postnumber = postnumber;
|
||||
this.county = county;
|
||||
this.place = place;
|
||||
}
|
||||
|
||||
public Address(String country, String street, String number, String extra, Integer postnumber, String county, String place) {
|
||||
this.country = country;
|
||||
this.street = street;
|
||||
this.number = number;
|
||||
this.extra = extra;
|
||||
this.postnumber = postnumber;
|
||||
this.county = county;
|
||||
this.place = place;
|
||||
}
|
||||
|
||||
public Address(String country, String street, String number, String extra, Integer postnumber, String county, String place, String contact, String comment) {
|
||||
this.country = country;
|
||||
this.street = street;
|
||||
this.number = number;
|
||||
this.extra = extra;
|
||||
this.postnumber = postnumber;
|
||||
this.county = county;
|
||||
this.place = place;
|
||||
this.contact = contact;
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public Address(Address toCopyAddress){
|
||||
this.country = toCopyAddress.getCountry();
|
||||
this.street = toCopyAddress.getStreet();
|
||||
this.number = toCopyAddress.getNumber();
|
||||
this.extra = toCopyAddress.getExtra();
|
||||
this.postnumber = toCopyAddress.getPostnumber();
|
||||
this.county = toCopyAddress.getCounty();
|
||||
this.place = toCopyAddress.getPlace();
|
||||
this.contact = toCopyAddress.getContact();
|
||||
this.comment = toCopyAddress.getComment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 83 * hash + Objects.hashCode(this.country);
|
||||
hash = 83 * hash + Objects.hashCode(this.street);
|
||||
hash = 83 * hash + Objects.hashCode(this.number);
|
||||
hash = 83 * hash + Objects.hashCode(this.extra);
|
||||
hash = 83 * hash + Objects.hashCode(this.postnumber);
|
||||
hash = 83 * hash + Objects.hashCode(this.county);
|
||||
hash = 83 * hash + Objects.hashCode(this.place);
|
||||
hash = 83 * hash + Objects.hashCode(this.contact);
|
||||
hash = 83 * hash + Objects.hashCode(this.comment);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final Address other = (Address) obj;
|
||||
if (!Objects.equals(this.country, other.country)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.street, other.street)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.number, other.number)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.extra, other.extra)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.county, other.county)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.place, other.place)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.comment, other.comment)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(this.postnumber, other.postnumber);
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet(String street) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
return extra;
|
||||
}
|
||||
|
||||
public void setExtra(String extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public Integer getPostnumber() {
|
||||
return postnumber;
|
||||
}
|
||||
|
||||
public void setPostnumber(Integer postnumber) {
|
||||
this.postnumber = postnumber;
|
||||
}
|
||||
|
||||
public String getCounty() {
|
||||
return county;
|
||||
}
|
||||
|
||||
public void setCounty(String county) {
|
||||
this.county = county;
|
||||
}
|
||||
|
||||
public String getPlace() {
|
||||
return place;
|
||||
}
|
||||
|
||||
public void setPlace(String place) {
|
||||
this.place = place;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.adresses;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import model.company.Company;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class CompanyBillingAddress extends Address{
|
||||
@ManyToOne
|
||||
private Company company;
|
||||
|
||||
private boolean delivery;
|
||||
|
||||
public CompanyBillingAddress() {
|
||||
}
|
||||
|
||||
public CompanyBillingAddress(Company company, boolean delivery) {
|
||||
this.company = company;
|
||||
this.delivery = delivery;
|
||||
}
|
||||
|
||||
public CompanyBillingAddress(Company company, boolean delivery,String country, String street, String number, String extra, Integer postnumber, String county, String place) {
|
||||
super(country, street, number, extra, postnumber, county, place);
|
||||
this.company = company;
|
||||
this.delivery = delivery;
|
||||
}
|
||||
|
||||
public Company getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(Company company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public boolean isDelivery() {
|
||||
return delivery;
|
||||
}
|
||||
|
||||
public void setDelivery(boolean delivery) {
|
||||
this.delivery = delivery;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.adresses;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToOne;
|
||||
import model.company.Location;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class LocationAddress extends Address {
|
||||
|
||||
@OneToOne
|
||||
private Location location;
|
||||
|
||||
public LocationAddress() {
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.company;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.OneToMany;
|
||||
import model.AbstractEntity;
|
||||
import model.adresses.CompanyBillingAddress;
|
||||
import model.customer.Customer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class Company extends AbstractEntity {
|
||||
|
||||
public static final String FIND_BY_NAME = "Company.findByName";
|
||||
public static final String FIND_BY_STEUERID = "Company.findBySteuerID";
|
||||
public static final String FIND_BY_UMSATZSTEUERID = "Company.findByUmsatzsteuerID";
|
||||
public static final String FIND_BY_CUSTOMER = "Company.findByCustomer";
|
||||
public static final String FIND_BY_ADDRESS = "Company.findByAddress";
|
||||
public static final String FIND_BY_DELIVERYADDRESS = "Company.findByLocation";
|
||||
|
||||
@Column(unique = true, nullable = false)
|
||||
private String name;
|
||||
|
||||
@Column(unique = true, nullable = true)
|
||||
private String steuerNr;
|
||||
|
||||
@Column(unique = true, nullable = true)
|
||||
private String umsatzSteuerID;
|
||||
|
||||
@Column(unique = true, nullable = true)
|
||||
private String kundenNr;
|
||||
|
||||
@Column(unique = false, nullable = true)
|
||||
private String headerInspection;
|
||||
|
||||
@Column(unique = false, nullable = true)
|
||||
private String headerService;
|
||||
|
||||
@Column(unique = false, nullable = false)
|
||||
@Enumerated(EnumType.ORDINAL)
|
||||
private Status status;
|
||||
|
||||
@OneToMany(mappedBy = "company", cascade = CascadeType.ALL)
|
||||
private Set<CompanyBillingAddress> addresses;
|
||||
|
||||
@OneToMany(mappedBy = "company", cascade = CascadeType.ALL)
|
||||
private Set<Location> locations;
|
||||
|
||||
@OneToMany(mappedBy = "company", cascade = {
|
||||
CascadeType.MERGE,
|
||||
CascadeType.REFRESH
|
||||
})
|
||||
private Set<Customer> customers;
|
||||
|
||||
public Company() {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSteuerNr() {
|
||||
return steuerNr;
|
||||
}
|
||||
|
||||
public void setSteuerNr(String steuerNr) {
|
||||
this.steuerNr = steuerNr;
|
||||
}
|
||||
|
||||
public String getUmsatzSteuerID() {
|
||||
return umsatzSteuerID;
|
||||
}
|
||||
|
||||
public void setUmsatzSteuerID(String umsatzSteuerID) {
|
||||
this.umsatzSteuerID = umsatzSteuerID;
|
||||
}
|
||||
|
||||
public String getKundenNr() {
|
||||
return kundenNr;
|
||||
}
|
||||
|
||||
public void setKundenNr(String kundenNr) {
|
||||
this.kundenNr = kundenNr;
|
||||
}
|
||||
|
||||
public String getHeaderInspection() {
|
||||
return headerInspection;
|
||||
}
|
||||
|
||||
public void setHeaderInspection(String headerInspection) {
|
||||
this.headerInspection = headerInspection;
|
||||
}
|
||||
|
||||
public String getHeaderService() {
|
||||
return headerService;
|
||||
}
|
||||
|
||||
public void setHeaderService(String headerService) {
|
||||
this.headerService = headerService;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Set<CompanyBillingAddress> getAddresses() {
|
||||
return addresses;
|
||||
}
|
||||
|
||||
public void setAddresses(Set<CompanyBillingAddress> addresses) {
|
||||
this.addresses = addresses;
|
||||
}
|
||||
|
||||
public Set<Location> getLocations() {
|
||||
return locations;
|
||||
}
|
||||
|
||||
public void setLocations(Set<Location> locations) {
|
||||
this.locations = locations;
|
||||
}
|
||||
|
||||
public Set<Customer> getCustomers() {
|
||||
return customers;
|
||||
}
|
||||
|
||||
public void setCustomers(Set<Customer> customers) {
|
||||
this.customers = customers;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.company;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import model.AbstractEntity;
|
||||
import model.adresses.LocationAddress;
|
||||
import model.customer.Customer;
|
||||
import model.machine.Machine;
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class Location extends AbstractEntity{
|
||||
|
||||
@ManyToOne
|
||||
private Company company;
|
||||
|
||||
@OneToOne
|
||||
private LocationAddress address;
|
||||
|
||||
@OneToMany(mappedBy = "location")
|
||||
private Set<Machine> machines;
|
||||
|
||||
@ManyToMany
|
||||
private Set<Customer> contacts;
|
||||
|
||||
public Location() {
|
||||
}
|
||||
|
||||
public Company getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(Company company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public LocationAddress getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(LocationAddress address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public Set<Machine> getMachines() {
|
||||
return machines;
|
||||
}
|
||||
|
||||
public void setMachines(Set<Machine> machines) {
|
||||
this.machines = machines;
|
||||
}
|
||||
|
||||
public Set<Customer> getContacts() {
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public void setContacts(Set<Customer> contacts) {
|
||||
this.contacts = contacts;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.company;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
public enum Status {
|
||||
ACTIVE,
|
||||
INACTIVE;
|
||||
|
||||
private Status() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch(this){
|
||||
case ACTIVE:
|
||||
return "aktiv";
|
||||
case INACTIVE:
|
||||
return "inaktiv";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String toLanguageString(Locale locale){
|
||||
if (locale == null ||locale.equals(Locale.GERMAN) || locale.equals(Locale.GERMANY)) {
|
||||
return getGerman();
|
||||
}
|
||||
|
||||
if (locale.equals(Locale.ENGLISH)) {
|
||||
getEnglish();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private String getGerman() {
|
||||
return toString();
|
||||
}
|
||||
|
||||
private String getEnglish(){
|
||||
switch(this){
|
||||
case ACTIVE:
|
||||
return "active";
|
||||
case INACTIVE:
|
||||
return "inactive";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.customer;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.ManyToOne;
|
||||
import model.person.Person;
|
||||
import model.company.Company;
|
||||
import model.company.Location;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class Customer extends Person{
|
||||
|
||||
@ManyToOne
|
||||
private Company company;
|
||||
|
||||
@ManyToMany
|
||||
private Set<Location> locations;
|
||||
|
||||
@Column(nullable = true, length = 210)
|
||||
private String note;
|
||||
|
||||
public Customer() {
|
||||
}
|
||||
|
||||
public Customer(Company company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public Company getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(Company company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public Set<Location> getLocations() {
|
||||
return locations;
|
||||
}
|
||||
|
||||
public void setLocations(Set<Location> locations) {
|
||||
this.locations = locations;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.files;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.InheritanceType;
|
||||
import javax.persistence.Lob;
|
||||
import model.AbstractEntity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
||||
public class FileDB extends AbstractEntity{
|
||||
@Column(nullable = false, length = 100)
|
||||
private String name;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Mime mime;
|
||||
|
||||
@Lob
|
||||
private byte[] fileData;
|
||||
|
||||
public FileDB() {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public byte[] getFileData() {
|
||||
return fileData;
|
||||
}
|
||||
|
||||
public void setFileData(byte[] fileData) {
|
||||
this.fileData = fileData;
|
||||
}
|
||||
|
||||
public Mime getMime() {
|
||||
return mime;
|
||||
}
|
||||
|
||||
public void setMime(Mime mime) {
|
||||
this.mime = mime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.files;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToMany;
|
||||
import model.ticket.Ticket;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class Invoice extends FileDB {
|
||||
@OneToMany
|
||||
private Ticket ticket;
|
||||
|
||||
public Invoice() {
|
||||
}
|
||||
|
||||
public Invoice(Ticket ticket) {
|
||||
this.ticket = ticket;
|
||||
}
|
||||
|
||||
public Ticket getTicket() {
|
||||
return ticket;
|
||||
}
|
||||
|
||||
public void setTicket(Ticket ticket) {
|
||||
this.ticket = ticket;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.files;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
public enum Mime {
|
||||
AAC(".aac", "AAC audio", "audio/aac"),
|
||||
ABW(".abw", "AbiWord document", "application/x-abiword"),
|
||||
ARC(".arc", "Archive document (multiple files embedded)", "application/x-freearc"),
|
||||
AVI(".avi", "AVI: Audio Video Interleave", "video/x-msvideo"),
|
||||
AZW(".azw", "Amazon Kindle eBook format", "application/vnd.amazon.ebook"),
|
||||
BIN(".bin", "Any kind of binary data", "application/octet-stream"),
|
||||
BMP(".bmp", "Windows OS/2 Bitmap Graphics", "image/bmp"),
|
||||
BZ(".bz", "BZip archive", "application/x-bzip"),
|
||||
BZ2(".bz2", "BZip2 archive", "application/x-bzip2"),
|
||||
CDA(".cda", "CD audio", "application/x-cdf"),
|
||||
CSH(".csh", "C-Shell script", "application/x-csh"),
|
||||
CSS(".css", "Cascading Style Sheets (CSS)", "text/css"),
|
||||
CSV(".csv", "Comma-separated values (CSV", "text/csv"),
|
||||
DOC(".doc", "Microsoft Word", "application/msword"),
|
||||
DOCX(".docx", "Microsoft Word (OpenXML)", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"),
|
||||
EOT(".eot", "MS Embedded OpenType fonts", "application/vnd.ms-fontobject"),
|
||||
EPUB(".epub", "Electronic publication (EPUB)", "application/epub+zip"),
|
||||
GZ(".gz", "GZip Compressed Archive", "application/gzip"),
|
||||
GIF(".gif", "Graphics Interchange Format (GIF)", "image/gif"),
|
||||
HTM(".htm", "HyperText Markup Language (HTML)", "text/html"),
|
||||
HTML(".html", "HyperText Markup Language (HTML)", "text/html"),
|
||||
ICO(".ico", "Icon format", "image/vnd.microsoft.icon"),
|
||||
ICS(".ics", "iCalendar format", "text/calendar"),
|
||||
JAR(".jar", "Java Archive (JAR)", "application/java-archive"),
|
||||
JPG(".jpg", "JPEG images", "image/jpeg"),
|
||||
JPEG(".jpeg", "JPEG images", "image/jpeg"),
|
||||
JS(".js", "JavaScript", "text/javascript"),
|
||||
JSON(".json", "JSON format", "application/json"),
|
||||
JSONLD(".jsonld", "JSON-LD format", "application/ld+json"),
|
||||
MID(".mid", "Musical Instrument Digital Interface (MIDI)", "audio/midi"),
|
||||
MIDI(".midi", "Musical Instrument Digital Interface (MIDI)", "audio/midi"),
|
||||
MJS(".mjs", "JavaScript module", "text/javascript"),
|
||||
MP3(".mp3", "MP3 audio", "audio/mpeg"),
|
||||
MP4(".mp4", "MP4 video", "video/mp4"),
|
||||
MPEG(".mpeg", "MPEG Video", "video/mpeg"),
|
||||
MPKG(".mpkg", "Apple Installer Package", "application/vnd.apple.installer+xml"),
|
||||
ODP(".odp", "OpenDocument presentation document", "application/vnd.oasis.opendocument.presentation"),
|
||||
ODS(".ods", "OpenDocument spreadsheet document", "application/vnd.oasis.opendocument.spreadsheet"),
|
||||
ODT(".odt", "OpenDocument text document", "application/vnd.oasis.opendocument.text"),
|
||||
OGA(".oga", "OGG audio", "audio/ogg"),
|
||||
OGV(".ogv", "OGG video", "video/ogg"),
|
||||
OGX(".ogx", "OGG", "application/ogg"),
|
||||
OPUUS(".opus", "Opus audio", "audio/opus"),
|
||||
OTF(".otf", "OpenType font", "font/otf"),
|
||||
PNG(".png", "Portable Network Graphics", "image/png"),
|
||||
PDF(".pdf", "Adobe Portable Document Format (PDF)", "application/pdf"),
|
||||
PHP(".php", "Hypertext Preprocessor (Personal Home Page)", "application/x-httpd-php"),
|
||||
PPT(".ppt", "Microsoft PowerPoint", "application/vnd.ms-powerpoint"),
|
||||
PPTX(".pptx", "Microsoft PowerPoint (OpenXML)", "application/vnd.openxmlformats-officedocument.presentationml.presentation"),
|
||||
RAR(".rar", "RAR archive", "application/vnd.rar"),
|
||||
RTF(".rtf", "Rich Text Format (RTF)", "application/rtf"),
|
||||
SH(".sh", "Bourne shell script", "application/x-sh"),
|
||||
SVG(".svg", "Scalable Vector Graphics (SVG)", "image/svg+xml"),
|
||||
SWF(".swf", "Small web format (SWF) or Adobe Flash document", "application/x-shockwave-flash"),
|
||||
TAR(".tar", "Tape Archive (TAR)", "application/x-tar"),
|
||||
TIF(".tif", "Tagged Image File Format (TIFF)", "image/tiff"),
|
||||
TIFF(".tiff", "Tagged Image File Format (TIFF)", "image/tiff"),
|
||||
TS(".ts", "MPEG transport stream", "video/mp2t"),
|
||||
TTF(".ttf", "TrueType Font", "font/ttf"),
|
||||
TXT(".txt", "Text, (generally ASCII or ISO 8859-n)", "text/plain"),
|
||||
VSD(".vsd", "Microsoft Visio", "application/vnd.visio"),
|
||||
WAV(".wav", "Waveform Audio Format", "audio/wav"),
|
||||
WEBA(".weba", "WEBM audio", "audio/webm"),
|
||||
WEBM(".webm", "WEBM video", "video/webm"),
|
||||
WEBP(".webp", "WEBP image", "image/webp"),
|
||||
WOFF(".woff", "Web Open Font Format (WOFF)", "font/woff"),
|
||||
WOFF2(".woff2", "Web Open Font Format (WOFF)", "font/woff2"),
|
||||
XHTML(".xhtml", "XHTML", "application/xhtml+xml"),
|
||||
XLS(".xls", "Microsoft Excel", "application/vnd.ms-excel"),
|
||||
XLSX(".xlsx", "Microsoft Excel (OpenXML)", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
|
||||
XML(".xml", "XML", "application/xml"),
|
||||
XUL(".xul", "XUL", "application/vnd.mozilla.xul+xml"),
|
||||
ZIP(".zip", "ZIP archive", "application/zip"),
|
||||
GP3V(".3gp", "3GPP audio/video container", "video/3gpp"),
|
||||
GP3A(".3gp", "3GPP audio/video container", "audio/3gpp"),
|
||||
G23V(".3g2", "3GPP2 audio/video container", "video/3gpp2"),
|
||||
G23A(".3g2", "3GPP2 audio/video container", "audio/3gpp2"),
|
||||
Z7(".7z", "7-zip archive", "application/x-7z-compressed");
|
||||
|
||||
private final String extension;
|
||||
private final String kindOfDocument;
|
||||
private final String mimeType;
|
||||
|
||||
private Mime(String extension, String kindOfDocument, String mimeType) {
|
||||
this.extension = extension;
|
||||
this.kindOfDocument = kindOfDocument;
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
public String getExtension() {
|
||||
return extension;
|
||||
}
|
||||
|
||||
public String getKindOfDocument() {
|
||||
return kindOfDocument;
|
||||
}
|
||||
|
||||
public String getMimeType() {
|
||||
return mimeType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.files;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToMany;
|
||||
import model.ticket.Ticket;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class Report extends FileDB{
|
||||
|
||||
@OneToMany
|
||||
private Ticket ticket;
|
||||
|
||||
public Report() {
|
||||
}
|
||||
|
||||
public Ticket getTicket() {
|
||||
return ticket;
|
||||
}
|
||||
|
||||
public void setTicket(Ticket ticket) {
|
||||
this.ticket = ticket;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.machine;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import model.AbstractEntity;
|
||||
import model.company.Location;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class Machine extends AbstractEntity {
|
||||
|
||||
@ManyToOne
|
||||
private Location location;
|
||||
|
||||
public Machine() {
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.ticket;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import model.AbstractEntity;
|
||||
import model.person.Person;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class Comment extends AbstractEntity implements Comparable<Comment> {
|
||||
|
||||
@Column(columnDefinition = "longblob")
|
||||
private String message;
|
||||
|
||||
@ManyToOne
|
||||
private Person writer;
|
||||
|
||||
private boolean edited;
|
||||
|
||||
@ManyToOne
|
||||
private Ticket ticket;
|
||||
|
||||
public Comment() {
|
||||
}
|
||||
|
||||
public Comment(Person writer, String message) {
|
||||
this.writer = writer;
|
||||
this.edited = false;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
edited = true;
|
||||
}
|
||||
|
||||
public LocalDateTime getLastEditedDate() {
|
||||
return getChangedDate();
|
||||
}
|
||||
|
||||
public boolean isEdited() {
|
||||
return edited;
|
||||
}
|
||||
|
||||
public void setEdited(boolean edited) {
|
||||
this.edited = edited;
|
||||
setChangedDate(LocalDateTime.now());
|
||||
}
|
||||
|
||||
public Ticket getTicket() {
|
||||
return ticket;
|
||||
}
|
||||
|
||||
public void setTicket(Ticket ticket) {
|
||||
this.ticket = ticket;
|
||||
setChangedDate(LocalDateTime.now());
|
||||
}
|
||||
|
||||
public Person getWriter() {
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 79 * hash + Objects.hashCode(this.message);
|
||||
hash = 79 * hash + Objects.hashCode(this.writer);
|
||||
hash = 79 * hash + Objects.hashCode(getCreationDate());
|
||||
hash = 79 * hash + Objects.hashCode(getChangedDate());
|
||||
hash = 79 * hash + (this.edited ? 1 : 0);
|
||||
hash = 79 * hash + Objects.hashCode(this.ticket);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final Comment other = (Comment) obj;
|
||||
if (this.edited != other.edited) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.message, other.message)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.writer, other.writer)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(getCreationDate(), other.getCreationDate())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.ticket, other.ticket)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Comment{" + "writer=" + writer.getEmail() + ", creationDate=" + getCreationDate() + ", id=" + getId() + ", message="+ message + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Comment c) {
|
||||
return c.getCreationDate().compareTo(this.getCreationDate());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.ticket;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
public enum FilenameGeneration {
|
||||
INSPEKTIONNR,
|
||||
MASCHINEDESCRIPTION,
|
||||
LOCATION;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch(this){
|
||||
case INSPEKTIONNR:
|
||||
return "inspektionnr";
|
||||
case MASCHINEDESCRIPTION:
|
||||
return "maschinedescription";
|
||||
case LOCATION:
|
||||
return "location";
|
||||
}
|
||||
|
||||
return "nothing";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.ticket;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
public enum Status {
|
||||
NEW("Neu"),
|
||||
PENDING("Zu bestätigen"),
|
||||
HOLD("Angehalten"),
|
||||
ACTIVE("Aktiv"),
|
||||
SHIPPING("Liefern"),
|
||||
PAYMENTPENDING("Zahlung austehend"),
|
||||
CLOSED("Geschlossen"),
|
||||
REOPENED("Wiedergeöffnet");
|
||||
|
||||
private final String name;
|
||||
|
||||
private Status(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.ticket;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import model.AbstractEntity;
|
||||
import model.adresses.CompanyBillingAddress;
|
||||
import model.company.Company;
|
||||
import model.company.Location;
|
||||
import model.files.Invoice;
|
||||
import model.files.Report;
|
||||
import model.person.Person;
|
||||
import model.person.Token;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class Ticket extends AbstractEntity{
|
||||
|
||||
@Column(nullable = false)
|
||||
@OneToOne
|
||||
private Company company;
|
||||
|
||||
@OneToOne
|
||||
private CompanyBillingAddress billingAddress;
|
||||
|
||||
@OneToMany
|
||||
private List<Location> locations;
|
||||
|
||||
@Column(nullable = false)
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Status status;
|
||||
|
||||
@Column(nullable = false)
|
||||
@OneToOne
|
||||
private Person creator;
|
||||
|
||||
@Column(nullable = true)
|
||||
@OneToOne
|
||||
private Person owner;
|
||||
|
||||
private LocalDateTime startDate;
|
||||
|
||||
private LocalDateTime endDate;
|
||||
|
||||
@OneToMany(mappedBy = "ticket", cascade = CascadeType.ALL)
|
||||
private List<Comment> comments;
|
||||
|
||||
private boolean payed;
|
||||
|
||||
@OneToMany(mappedBy = "ticket", orphanRemoval = true, cascade = CascadeType.ALL)
|
||||
private List<Token> tokens;
|
||||
|
||||
@OneToMany(mappedBy = "ticket", cascade = {CascadeType.PERSIST, CascadeType.PERSIST})
|
||||
private List<Report> reports;
|
||||
|
||||
@OneToMany(mappedBy = "ticket", cascade = {CascadeType.PERSIST, CascadeType.PERSIST})
|
||||
private List<Invoice> invoices;
|
||||
|
||||
@Column(nullable = false, length = 200)
|
||||
private String filenameGeneration;
|
||||
|
||||
public Ticket() {
|
||||
}
|
||||
|
||||
public CompanyBillingAddress getBillingAddress() {
|
||||
return billingAddress;
|
||||
}
|
||||
|
||||
public void setBillingAddress(CompanyBillingAddress billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
}
|
||||
|
||||
public LocalDateTime getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(LocalDateTime startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public LocalDateTime getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(LocalDateTime endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public Company getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(Company company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public List<Location> getLocations() {
|
||||
return locations;
|
||||
}
|
||||
|
||||
public void setLocations(List<Location> locations) {
|
||||
this.locations = locations;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Person getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(Person creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public Person getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(Person owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public List<Comment> getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(List<Comment> comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public boolean isPayed() {
|
||||
return payed;
|
||||
}
|
||||
|
||||
public void setPayed(boolean payed) {
|
||||
this.payed = payed;
|
||||
}
|
||||
|
||||
public List<Token> getTokens() {
|
||||
return tokens;
|
||||
}
|
||||
|
||||
public void setTokens(List<Token> tokens) {
|
||||
this.tokens = tokens;
|
||||
}
|
||||
|
||||
public List<Report> getReports() {
|
||||
return reports;
|
||||
}
|
||||
|
||||
public void setReports(List<Report> reports) {
|
||||
this.reports = reports;
|
||||
}
|
||||
|
||||
public List<Invoice> getInvoices() {
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public void setInvoices(List<Invoice> invoices) {
|
||||
this.invoices = invoices;
|
||||
}
|
||||
|
||||
public String getFilenameGeneration() {
|
||||
return filenameGeneration;
|
||||
}
|
||||
|
||||
public void setFilenameGeneration(String filenameGeneration) {
|
||||
this.filenameGeneration = filenameGeneration;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.ticket;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToOne;
|
||||
import model.AbstractEntity;
|
||||
import model.company.Location;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class TicketLocation extends AbstractEntity{
|
||||
@ManyToOne
|
||||
private Ticket ticket;
|
||||
|
||||
@OneToOne
|
||||
private Location location;
|
||||
|
||||
|
||||
private List<TicketMachine> machines;
|
||||
|
||||
|
||||
public TicketLocation() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package model.ticket;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import model.AbstractEntity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToOne;
|
||||
import model.machine.Machine;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author patri
|
||||
*/
|
||||
@Entity
|
||||
public class TicketMachine extends AbstractEntity{
|
||||
@ManyToOne
|
||||
private Ticket ticket;
|
||||
|
||||
@OneToOne
|
||||
private Machine machine;
|
||||
|
||||
public TicketMachine() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
|
||||
<persistence-unit name="pu_datalayer" transaction-type="JTA">
|
||||
<jta-data-source>java:/mss-failsave</jta-data-source>
|
||||
<class>model.company.Location</class>
|
||||
<class>model.adresses.LocationAdress</class>
|
||||
<class>model.machine.Machine</class>
|
||||
<properties>
|
||||
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
Reference in New Issue
Block a user