generazione applicazione e entita

This commit is contained in:
2025-12-10 17:19:16 +01:00
parent e4b8486f4b
commit 9ad99bd05f
363 changed files with 36699 additions and 44 deletions

View File

@@ -52,6 +52,19 @@ public class CacheConfiguration {
createCache(cm, it.sw.pa.comune.artegna.domain.User.class.getName() + ".authorities");
createCache(cm, it.sw.pa.comune.artegna.domain.PersistentToken.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.User.class.getName() + ".persistentTokens");
createCache(cm, it.sw.pa.comune.artegna.domain.AuditLog.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.Disponibilita.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.Notifica.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.Prenotazione.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.Conferma.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.Struttura.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.Struttura.class.getName() + ".disponibilitas");
createCache(cm, it.sw.pa.comune.artegna.domain.Struttura.class.getName() + ".moduliLiberatories");
createCache(cm, it.sw.pa.comune.artegna.domain.UtenteApp.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.UtenteApp.class.getName() + ".liberatories");
createCache(cm, it.sw.pa.comune.artegna.domain.Liberatoria.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.ModelloLiberatoria.class.getName());
createCache(cm, it.sw.pa.comune.artegna.domain.Messaggio.class.getName());
// jhipster-needle-ehcache-add-entry
};
}

View File

@@ -0,0 +1,193 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import it.sw.pa.comune.artegna.domain.enumeration.AzioneAudit;
import it.sw.pa.comune.artegna.domain.enumeration.TipoEntita;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A AuditLog.
*/
@Entity
@Table(name = "audit_log")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class AuditLog implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Enumerated(EnumType.STRING)
@Column(name = "entita_tipo")
private TipoEntita entitaTipo;
@Column(name = "entita_id")
private Long entitaId;
@Enumerated(EnumType.STRING)
@Column(name = "azione")
private AzioneAudit azione;
@Column(name = "dettagli")
private String dettagli;
@Column(name = "ip_address")
private String ipAddress;
@Column(name = "created_at")
private Instant createdAt;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "liberatories" }, allowSetters = true)
private UtenteApp utente;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public AuditLog id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public TipoEntita getEntitaTipo() {
return this.entitaTipo;
}
public AuditLog entitaTipo(TipoEntita entitaTipo) {
this.setEntitaTipo(entitaTipo);
return this;
}
public void setEntitaTipo(TipoEntita entitaTipo) {
this.entitaTipo = entitaTipo;
}
public Long getEntitaId() {
return this.entitaId;
}
public AuditLog entitaId(Long entitaId) {
this.setEntitaId(entitaId);
return this;
}
public void setEntitaId(Long entitaId) {
this.entitaId = entitaId;
}
public AzioneAudit getAzione() {
return this.azione;
}
public AuditLog azione(AzioneAudit azione) {
this.setAzione(azione);
return this;
}
public void setAzione(AzioneAudit azione) {
this.azione = azione;
}
public String getDettagli() {
return this.dettagli;
}
public AuditLog dettagli(String dettagli) {
this.setDettagli(dettagli);
return this;
}
public void setDettagli(String dettagli) {
this.dettagli = dettagli;
}
public String getIpAddress() {
return this.ipAddress;
}
public AuditLog ipAddress(String ipAddress) {
this.setIpAddress(ipAddress);
return this;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public Instant getCreatedAt() {
return this.createdAt;
}
public AuditLog createdAt(Instant createdAt) {
this.setCreatedAt(createdAt);
return this;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public UtenteApp getUtente() {
return this.utente;
}
public void setUtente(UtenteApp utenteApp) {
this.utente = utenteApp;
}
public AuditLog utente(UtenteApp utenteApp) {
this.setUtente(utenteApp);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof AuditLog)) {
return false;
}
return getId() != null && getId().equals(((AuditLog) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "AuditLog{" +
"id=" + getId() +
", entitaTipo='" + getEntitaTipo() + "'" +
", entitaId=" + getEntitaId() +
", azione='" + getAzione() + "'" +
", dettagli='" + getDettagli() + "'" +
", ipAddress='" + getIpAddress() + "'" +
", createdAt='" + getCreatedAt() + "'" +
"}";
}
}

View File

@@ -0,0 +1,145 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import it.sw.pa.comune.artegna.domain.enumeration.TipoConferma;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A Conferma.
*/
@Entity
@Table(name = "conferma")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Conferma implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Column(name = "motivo_conferma")
private String motivoConferma;
@Enumerated(EnumType.STRING)
@Column(name = "tipo_conferma")
private TipoConferma tipoConferma;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "liberatories" }, allowSetters = true)
private UtenteApp confermataDa;
@JsonIgnoreProperties(value = { "conferma", "utente", "struttura" }, allowSetters = true)
@OneToOne(fetch = FetchType.LAZY, mappedBy = "conferma")
private Prenotazione prenotazione;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public Conferma id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public String getMotivoConferma() {
return this.motivoConferma;
}
public Conferma motivoConferma(String motivoConferma) {
this.setMotivoConferma(motivoConferma);
return this;
}
public void setMotivoConferma(String motivoConferma) {
this.motivoConferma = motivoConferma;
}
public TipoConferma getTipoConferma() {
return this.tipoConferma;
}
public Conferma tipoConferma(TipoConferma tipoConferma) {
this.setTipoConferma(tipoConferma);
return this;
}
public void setTipoConferma(TipoConferma tipoConferma) {
this.tipoConferma = tipoConferma;
}
public UtenteApp getConfermataDa() {
return this.confermataDa;
}
public void setConfermataDa(UtenteApp utenteApp) {
this.confermataDa = utenteApp;
}
public Conferma confermataDa(UtenteApp utenteApp) {
this.setConfermataDa(utenteApp);
return this;
}
public Prenotazione getPrenotazione() {
return this.prenotazione;
}
public void setPrenotazione(Prenotazione prenotazione) {
if (this.prenotazione != null) {
this.prenotazione.setConferma(null);
}
if (prenotazione != null) {
prenotazione.setConferma(this);
}
this.prenotazione = prenotazione;
}
public Conferma prenotazione(Prenotazione prenotazione) {
this.setPrenotazione(prenotazione);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Conferma)) {
return false;
}
return getId() != null && getId().equals(((Conferma) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "Conferma{" +
"id=" + getId() +
", motivoConferma='" + getMotivoConferma() + "'" +
", tipoConferma='" + getTipoConferma() + "'" +
"}";
}
}

View File

@@ -0,0 +1,228 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import it.sw.pa.comune.artegna.domain.enumeration.GiornoSettimana;
import it.sw.pa.comune.artegna.domain.enumeration.TipoDisponibilita;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDate;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A Disponibilita.
*/
@Entity
@Table(name = "disponibilita")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Disponibilita implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Enumerated(EnumType.STRING)
@Column(name = "giorno_settimana")
private GiornoSettimana giornoSettimana;
@Column(name = "data_specifica")
private LocalDate dataSpecifica;
@Column(name = "ora_inizio")
private Instant oraInizio;
@Column(name = "ora_fine")
private Instant oraFine;
@Column(name = "orario_inizio")
private String orarioInizio;
@Column(name = "orario_fine")
private String orarioFine;
@Enumerated(EnumType.STRING)
@Column(name = "tipo")
private TipoDisponibilita tipo;
@Column(name = "note")
private String note;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "disponibilitas", "moduliLiberatories" }, allowSetters = true)
private Struttura struttura;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public Disponibilita id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public GiornoSettimana getGiornoSettimana() {
return this.giornoSettimana;
}
public Disponibilita giornoSettimana(GiornoSettimana giornoSettimana) {
this.setGiornoSettimana(giornoSettimana);
return this;
}
public void setGiornoSettimana(GiornoSettimana giornoSettimana) {
this.giornoSettimana = giornoSettimana;
}
public LocalDate getDataSpecifica() {
return this.dataSpecifica;
}
public Disponibilita dataSpecifica(LocalDate dataSpecifica) {
this.setDataSpecifica(dataSpecifica);
return this;
}
public void setDataSpecifica(LocalDate dataSpecifica) {
this.dataSpecifica = dataSpecifica;
}
public Instant getOraInizio() {
return this.oraInizio;
}
public Disponibilita oraInizio(Instant oraInizio) {
this.setOraInizio(oraInizio);
return this;
}
public void setOraInizio(Instant oraInizio) {
this.oraInizio = oraInizio;
}
public Instant getOraFine() {
return this.oraFine;
}
public Disponibilita oraFine(Instant oraFine) {
this.setOraFine(oraFine);
return this;
}
public void setOraFine(Instant oraFine) {
this.oraFine = oraFine;
}
public String getOrarioInizio() {
return this.orarioInizio;
}
public Disponibilita orarioInizio(String orarioInizio) {
this.setOrarioInizio(orarioInizio);
return this;
}
public void setOrarioInizio(String orarioInizio) {
this.orarioInizio = orarioInizio;
}
public String getOrarioFine() {
return this.orarioFine;
}
public Disponibilita orarioFine(String orarioFine) {
this.setOrarioFine(orarioFine);
return this;
}
public void setOrarioFine(String orarioFine) {
this.orarioFine = orarioFine;
}
public TipoDisponibilita getTipo() {
return this.tipo;
}
public Disponibilita tipo(TipoDisponibilita tipo) {
this.setTipo(tipo);
return this;
}
public void setTipo(TipoDisponibilita tipo) {
this.tipo = tipo;
}
public String getNote() {
return this.note;
}
public Disponibilita note(String note) {
this.setNote(note);
return this;
}
public void setNote(String note) {
this.note = note;
}
public Struttura getStruttura() {
return this.struttura;
}
public void setStruttura(Struttura struttura) {
this.struttura = struttura;
}
public Disponibilita struttura(Struttura struttura) {
this.setStruttura(struttura);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Disponibilita)) {
return false;
}
return getId() != null && getId().equals(((Disponibilita) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "Disponibilita{" +
"id=" + getId() +
", giornoSettimana='" + getGiornoSettimana() + "'" +
", dataSpecifica='" + getDataSpecifica() + "'" +
", oraInizio='" + getOraInizio() + "'" +
", oraFine='" + getOraFine() + "'" +
", orarioInizio='" + getOrarioInizio() + "'" +
", orarioFine='" + getOrarioFine() + "'" +
", tipo='" + getTipo() + "'" +
", note='" + getNote() + "'" +
"}";
}
}

View File

@@ -0,0 +1,121 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A Liberatoria.
*/
@Entity
@Table(name = "liberatoria")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Liberatoria implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Column(name = "accettata")
private Instant accettata;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "liberatories" }, allowSetters = true)
private UtenteApp utente;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "struttura" }, allowSetters = true)
private ModelloLiberatoria modelloLiberatoria;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public Liberatoria id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public Instant getAccettata() {
return this.accettata;
}
public Liberatoria accettata(Instant accettata) {
this.setAccettata(accettata);
return this;
}
public void setAccettata(Instant accettata) {
this.accettata = accettata;
}
public UtenteApp getUtente() {
return this.utente;
}
public void setUtente(UtenteApp utenteApp) {
this.utente = utenteApp;
}
public Liberatoria utente(UtenteApp utenteApp) {
this.setUtente(utenteApp);
return this;
}
public ModelloLiberatoria getModelloLiberatoria() {
return this.modelloLiberatoria;
}
public void setModelloLiberatoria(ModelloLiberatoria modelloLiberatoria) {
this.modelloLiberatoria = modelloLiberatoria;
}
public Liberatoria modelloLiberatoria(ModelloLiberatoria modelloLiberatoria) {
this.setModelloLiberatoria(modelloLiberatoria);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Liberatoria)) {
return false;
}
return getId() != null && getId().equals(((Liberatoria) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "Liberatoria{" +
"id=" + getId() +
", accettata='" + getAccettata() + "'" +
"}";
}
}

View File

@@ -0,0 +1,138 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A Messaggio.
*/
@Entity
@Table(name = "messaggio")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Messaggio implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Column(name = "spedito")
private Instant spedito;
@Column(name = "testo")
private String testo;
@Column(name = "letto")
private Instant letto;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "liberatories" }, allowSetters = true)
private UtenteApp utente;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public Messaggio id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public Instant getSpedito() {
return this.spedito;
}
public Messaggio spedito(Instant spedito) {
this.setSpedito(spedito);
return this;
}
public void setSpedito(Instant spedito) {
this.spedito = spedito;
}
public String getTesto() {
return this.testo;
}
public Messaggio testo(String testo) {
this.setTesto(testo);
return this;
}
public void setTesto(String testo) {
this.testo = testo;
}
public Instant getLetto() {
return this.letto;
}
public Messaggio letto(Instant letto) {
this.setLetto(letto);
return this;
}
public void setLetto(Instant letto) {
this.letto = letto;
}
public UtenteApp getUtente() {
return this.utente;
}
public void setUtente(UtenteApp utenteApp) {
this.utente = utenteApp;
}
public Messaggio utente(UtenteApp utenteApp) {
this.setUtente(utenteApp);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Messaggio)) {
return false;
}
return getId() != null && getId().equals(((Messaggio) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "Messaggio{" +
"id=" + getId() +
", spedito='" + getSpedito() + "'" +
", testo='" + getTesto() + "'" +
", letto='" + getLetto() + "'" +
"}";
}
}

View File

@@ -0,0 +1,190 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A ModelloLiberatoria.
*/
@Entity
@Table(name = "modello_liberatoria")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class ModelloLiberatoria implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Column(name = "nome")
private String nome;
@Column(name = "testo")
private String testo;
@Lob
@Column(name = "documento")
private byte[] documento;
@Column(name = "documento_content_type")
private String documentoContentType;
@Column(name = "valido_dal")
private Instant validoDal;
@Column(name = "valido_al")
private Instant validoAl;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "disponibilitas", "moduliLiberatories" }, allowSetters = true)
private Struttura struttura;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public ModelloLiberatoria id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return this.nome;
}
public ModelloLiberatoria nome(String nome) {
this.setNome(nome);
return this;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getTesto() {
return this.testo;
}
public ModelloLiberatoria testo(String testo) {
this.setTesto(testo);
return this;
}
public void setTesto(String testo) {
this.testo = testo;
}
public byte[] getDocumento() {
return this.documento;
}
public ModelloLiberatoria documento(byte[] documento) {
this.setDocumento(documento);
return this;
}
public void setDocumento(byte[] documento) {
this.documento = documento;
}
public String getDocumentoContentType() {
return this.documentoContentType;
}
public ModelloLiberatoria documentoContentType(String documentoContentType) {
this.documentoContentType = documentoContentType;
return this;
}
public void setDocumentoContentType(String documentoContentType) {
this.documentoContentType = documentoContentType;
}
public Instant getValidoDal() {
return this.validoDal;
}
public ModelloLiberatoria validoDal(Instant validoDal) {
this.setValidoDal(validoDal);
return this;
}
public void setValidoDal(Instant validoDal) {
this.validoDal = validoDal;
}
public Instant getValidoAl() {
return this.validoAl;
}
public ModelloLiberatoria validoAl(Instant validoAl) {
this.setValidoAl(validoAl);
return this;
}
public void setValidoAl(Instant validoAl) {
this.validoAl = validoAl;
}
public Struttura getStruttura() {
return this.struttura;
}
public void setStruttura(Struttura struttura) {
this.struttura = struttura;
}
public ModelloLiberatoria struttura(Struttura struttura) {
this.setStruttura(struttura);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ModelloLiberatoria)) {
return false;
}
return getId() != null && getId().equals(((ModelloLiberatoria) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "ModelloLiberatoria{" +
"id=" + getId() +
", nome='" + getNome() + "'" +
", testo='" + getTesto() + "'" +
", documento='" + getDocumento() + "'" +
", documentoContentType='" + getDocumentoContentType() + "'" +
", validoDal='" + getValidoDal() + "'" +
", validoAl='" + getValidoAl() + "'" +
"}";
}
}

View File

@@ -0,0 +1,210 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import it.sw.pa.comune.artegna.domain.enumeration.TipoCanaleNotifica;
import it.sw.pa.comune.artegna.domain.enumeration.TipoEventoNotifica;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A Notifica.
*/
@Entity
@Table(name = "notifica")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Notifica implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Enumerated(EnumType.STRING)
@Column(name = "tipo_canale")
private TipoCanaleNotifica tipoCanale;
@Enumerated(EnumType.STRING)
@Column(name = "tipo_evento")
private TipoEventoNotifica tipoEvento;
@Column(name = "messaggio")
private String messaggio;
@Column(name = "inviata")
private Boolean inviata;
@Column(name = "inviata_at")
private Instant inviataAt;
@Column(name = "errore")
private String errore;
@Column(name = "created_at")
private Instant createdAt;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "confermataDa", "prenotazione" }, allowSetters = true)
private Conferma conferma;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public Notifica id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public TipoCanaleNotifica getTipoCanale() {
return this.tipoCanale;
}
public Notifica tipoCanale(TipoCanaleNotifica tipoCanale) {
this.setTipoCanale(tipoCanale);
return this;
}
public void setTipoCanale(TipoCanaleNotifica tipoCanale) {
this.tipoCanale = tipoCanale;
}
public TipoEventoNotifica getTipoEvento() {
return this.tipoEvento;
}
public Notifica tipoEvento(TipoEventoNotifica tipoEvento) {
this.setTipoEvento(tipoEvento);
return this;
}
public void setTipoEvento(TipoEventoNotifica tipoEvento) {
this.tipoEvento = tipoEvento;
}
public String getMessaggio() {
return this.messaggio;
}
public Notifica messaggio(String messaggio) {
this.setMessaggio(messaggio);
return this;
}
public void setMessaggio(String messaggio) {
this.messaggio = messaggio;
}
public Boolean getInviata() {
return this.inviata;
}
public Notifica inviata(Boolean inviata) {
this.setInviata(inviata);
return this;
}
public void setInviata(Boolean inviata) {
this.inviata = inviata;
}
public Instant getInviataAt() {
return this.inviataAt;
}
public Notifica inviataAt(Instant inviataAt) {
this.setInviataAt(inviataAt);
return this;
}
public void setInviataAt(Instant inviataAt) {
this.inviataAt = inviataAt;
}
public String getErrore() {
return this.errore;
}
public Notifica errore(String errore) {
this.setErrore(errore);
return this;
}
public void setErrore(String errore) {
this.errore = errore;
}
public Instant getCreatedAt() {
return this.createdAt;
}
public Notifica createdAt(Instant createdAt) {
this.setCreatedAt(createdAt);
return this;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public Conferma getConferma() {
return this.conferma;
}
public void setConferma(Conferma conferma) {
this.conferma = conferma;
}
public Notifica conferma(Conferma conferma) {
this.setConferma(conferma);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Notifica)) {
return false;
}
return getId() != null && getId().equals(((Notifica) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "Notifica{" +
"id=" + getId() +
", tipoCanale='" + getTipoCanale() + "'" +
", tipoEvento='" + getTipoEvento() + "'" +
", messaggio='" + getMessaggio() + "'" +
", inviata='" + getInviata() + "'" +
", inviataAt='" + getInviataAt() + "'" +
", errore='" + getErrore() + "'" +
", createdAt='" + getCreatedAt() + "'" +
"}";
}
}

View File

@@ -0,0 +1,226 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import it.sw.pa.comune.artegna.domain.enumeration.StatoPrenotazione;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A Prenotazione.
*/
@Entity
@Table(name = "prenotazione")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Prenotazione implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Column(name = "ora_inizio")
private Instant oraInizio;
@Column(name = "ora_fine")
private Instant oraFine;
@Enumerated(EnumType.STRING)
@Column(name = "stato")
private StatoPrenotazione stato;
@Column(name = "motivo_evento")
private String motivoEvento;
@Column(name = "numero_partecipanti")
private Integer numeroPartecipanti;
@Column(name = "note_utente")
private String noteUtente;
@JsonIgnoreProperties(value = { "confermataDa", "prenotazione" }, allowSetters = true)
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(unique = true)
private Conferma conferma;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "liberatories" }, allowSetters = true)
private UtenteApp utente;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties(value = { "disponibilitas", "moduliLiberatories" }, allowSetters = true)
private Struttura struttura;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public Prenotazione id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public Instant getOraInizio() {
return this.oraInizio;
}
public Prenotazione oraInizio(Instant oraInizio) {
this.setOraInizio(oraInizio);
return this;
}
public void setOraInizio(Instant oraInizio) {
this.oraInizio = oraInizio;
}
public Instant getOraFine() {
return this.oraFine;
}
public Prenotazione oraFine(Instant oraFine) {
this.setOraFine(oraFine);
return this;
}
public void setOraFine(Instant oraFine) {
this.oraFine = oraFine;
}
public StatoPrenotazione getStato() {
return this.stato;
}
public Prenotazione stato(StatoPrenotazione stato) {
this.setStato(stato);
return this;
}
public void setStato(StatoPrenotazione stato) {
this.stato = stato;
}
public String getMotivoEvento() {
return this.motivoEvento;
}
public Prenotazione motivoEvento(String motivoEvento) {
this.setMotivoEvento(motivoEvento);
return this;
}
public void setMotivoEvento(String motivoEvento) {
this.motivoEvento = motivoEvento;
}
public Integer getNumeroPartecipanti() {
return this.numeroPartecipanti;
}
public Prenotazione numeroPartecipanti(Integer numeroPartecipanti) {
this.setNumeroPartecipanti(numeroPartecipanti);
return this;
}
public void setNumeroPartecipanti(Integer numeroPartecipanti) {
this.numeroPartecipanti = numeroPartecipanti;
}
public String getNoteUtente() {
return this.noteUtente;
}
public Prenotazione noteUtente(String noteUtente) {
this.setNoteUtente(noteUtente);
return this;
}
public void setNoteUtente(String noteUtente) {
this.noteUtente = noteUtente;
}
public Conferma getConferma() {
return this.conferma;
}
public void setConferma(Conferma conferma) {
this.conferma = conferma;
}
public Prenotazione conferma(Conferma conferma) {
this.setConferma(conferma);
return this;
}
public UtenteApp getUtente() {
return this.utente;
}
public void setUtente(UtenteApp utenteApp) {
this.utente = utenteApp;
}
public Prenotazione utente(UtenteApp utenteApp) {
this.setUtente(utenteApp);
return this;
}
public Struttura getStruttura() {
return this.struttura;
}
public void setStruttura(Struttura struttura) {
this.struttura = struttura;
}
public Prenotazione struttura(Struttura struttura) {
this.setStruttura(struttura);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Prenotazione)) {
return false;
}
return getId() != null && getId().equals(((Prenotazione) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "Prenotazione{" +
"id=" + getId() +
", oraInizio='" + getOraInizio() + "'" +
", oraFine='" + getOraFine() + "'" +
", stato='" + getStato() + "'" +
", motivoEvento='" + getMotivoEvento() + "'" +
", numeroPartecipanti=" + getNumeroPartecipanti() +
", noteUtente='" + getNoteUtente() + "'" +
"}";
}
}

View File

@@ -0,0 +1,280 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import java.util.HashSet;
import java.util.Set;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A Struttura.
*/
@Entity
@Table(name = "struttura")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Struttura implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Column(name = "nome")
private String nome;
@Column(name = "descrizione")
private String descrizione;
@Column(name = "indirizzo")
private String indirizzo;
@Column(name = "capienza_max")
private Integer capienzaMax;
@Column(name = "attiva")
private Boolean attiva;
@Column(name = "foto_url")
private String fotoUrl;
@Column(name = "created_at")
private Instant createdAt;
@Column(name = "updated_at")
private Instant updatedAt;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "struttura")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@JsonIgnoreProperties(value = { "struttura" }, allowSetters = true)
private Set<Disponibilita> disponibilitas = new HashSet<>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "struttura")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@JsonIgnoreProperties(value = { "struttura" }, allowSetters = true)
private Set<ModelloLiberatoria> moduliLiberatories = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public Struttura id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return this.nome;
}
public Struttura nome(String nome) {
this.setNome(nome);
return this;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getDescrizione() {
return this.descrizione;
}
public Struttura descrizione(String descrizione) {
this.setDescrizione(descrizione);
return this;
}
public void setDescrizione(String descrizione) {
this.descrizione = descrizione;
}
public String getIndirizzo() {
return this.indirizzo;
}
public Struttura indirizzo(String indirizzo) {
this.setIndirizzo(indirizzo);
return this;
}
public void setIndirizzo(String indirizzo) {
this.indirizzo = indirizzo;
}
public Integer getCapienzaMax() {
return this.capienzaMax;
}
public Struttura capienzaMax(Integer capienzaMax) {
this.setCapienzaMax(capienzaMax);
return this;
}
public void setCapienzaMax(Integer capienzaMax) {
this.capienzaMax = capienzaMax;
}
public Boolean getAttiva() {
return this.attiva;
}
public Struttura attiva(Boolean attiva) {
this.setAttiva(attiva);
return this;
}
public void setAttiva(Boolean attiva) {
this.attiva = attiva;
}
public String getFotoUrl() {
return this.fotoUrl;
}
public Struttura fotoUrl(String fotoUrl) {
this.setFotoUrl(fotoUrl);
return this;
}
public void setFotoUrl(String fotoUrl) {
this.fotoUrl = fotoUrl;
}
public Instant getCreatedAt() {
return this.createdAt;
}
public Struttura createdAt(Instant createdAt) {
this.setCreatedAt(createdAt);
return this;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public Instant getUpdatedAt() {
return this.updatedAt;
}
public Struttura updatedAt(Instant updatedAt) {
this.setUpdatedAt(updatedAt);
return this;
}
public void setUpdatedAt(Instant updatedAt) {
this.updatedAt = updatedAt;
}
public Set<Disponibilita> getDisponibilitas() {
return this.disponibilitas;
}
public void setDisponibilitas(Set<Disponibilita> disponibilitas) {
if (this.disponibilitas != null) {
this.disponibilitas.forEach(i -> i.setStruttura(null));
}
if (disponibilitas != null) {
disponibilitas.forEach(i -> i.setStruttura(this));
}
this.disponibilitas = disponibilitas;
}
public Struttura disponibilitas(Set<Disponibilita> disponibilitas) {
this.setDisponibilitas(disponibilitas);
return this;
}
public Struttura addDisponibilita(Disponibilita disponibilita) {
this.disponibilitas.add(disponibilita);
disponibilita.setStruttura(this);
return this;
}
public Struttura removeDisponibilita(Disponibilita disponibilita) {
this.disponibilitas.remove(disponibilita);
disponibilita.setStruttura(null);
return this;
}
public Set<ModelloLiberatoria> getModuliLiberatories() {
return this.moduliLiberatories;
}
public void setModuliLiberatories(Set<ModelloLiberatoria> modelloLiberatorias) {
if (this.moduliLiberatories != null) {
this.moduliLiberatories.forEach(i -> i.setStruttura(null));
}
if (modelloLiberatorias != null) {
modelloLiberatorias.forEach(i -> i.setStruttura(this));
}
this.moduliLiberatories = modelloLiberatorias;
}
public Struttura moduliLiberatories(Set<ModelloLiberatoria> modelloLiberatorias) {
this.setModuliLiberatories(modelloLiberatorias);
return this;
}
public Struttura addModuliLiberatorie(ModelloLiberatoria modelloLiberatoria) {
this.moduliLiberatories.add(modelloLiberatoria);
modelloLiberatoria.setStruttura(this);
return this;
}
public Struttura removeModuliLiberatorie(ModelloLiberatoria modelloLiberatoria) {
this.moduliLiberatories.remove(modelloLiberatoria);
modelloLiberatoria.setStruttura(null);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Struttura)) {
return false;
}
return getId() != null && getId().equals(((Struttura) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "Struttura{" +
"id=" + getId() +
", nome='" + getNome() + "'" +
", descrizione='" + getDescrizione() + "'" +
", indirizzo='" + getIndirizzo() + "'" +
", capienzaMax=" + getCapienzaMax() +
", attiva='" + getAttiva() + "'" +
", fotoUrl='" + getFotoUrl() + "'" +
", createdAt='" + getCreatedAt() + "'" +
", updatedAt='" + getUpdatedAt() + "'" +
"}";
}
}

View File

@@ -0,0 +1,369 @@
package it.sw.pa.comune.artegna.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import it.sw.pa.comune.artegna.domain.enumeration.Ruolo;
import jakarta.persistence.*;
import jakarta.validation.constraints.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
/**
* A UtenteApp.
*/
@Entity
@Table(name = "utente_app")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class UtenteApp implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@NotNull
@Column(name = "username", nullable = false, unique = true)
private String username;
@NotNull
@Column(name = "email", nullable = false)
private String email;
@Column(name = "telefono")
private String telefono;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "ruolo", nullable = false)
private Ruolo ruolo;
@NotNull
@Column(name = "attivo", nullable = false)
private Boolean attivo;
@Column(name = "nome")
private String nome;
@Column(name = "cognome")
private String cognome;
@Column(name = "luogo_nascita")
private String luogoNascita;
@Column(name = "data_nascita")
private String dataNascita;
@Column(name = "residente")
private String residente;
@Column(name = "societa")
private String societa;
@Column(name = "sede")
private String sede;
@Column(name = "codfiscale")
private String codfiscale;
@Column(name = "telefono_soc")
private String telefonoSoc;
@Column(name = "email_soc")
private String emailSoc;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "utente")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@JsonIgnoreProperties(value = { "utente", "modelloLiberatoria" }, allowSetters = true)
private Set<Liberatoria> liberatories = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return this.id;
}
public UtenteApp id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return this.username;
}
public UtenteApp username(String username) {
this.setUsername(username);
return this;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return this.email;
}
public UtenteApp email(String email) {
this.setEmail(email);
return this;
}
public void setEmail(String email) {
this.email = email;
}
public String getTelefono() {
return this.telefono;
}
public UtenteApp telefono(String telefono) {
this.setTelefono(telefono);
return this;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
}
public Ruolo getRuolo() {
return this.ruolo;
}
public UtenteApp ruolo(Ruolo ruolo) {
this.setRuolo(ruolo);
return this;
}
public void setRuolo(Ruolo ruolo) {
this.ruolo = ruolo;
}
public Boolean getAttivo() {
return this.attivo;
}
public UtenteApp attivo(Boolean attivo) {
this.setAttivo(attivo);
return this;
}
public void setAttivo(Boolean attivo) {
this.attivo = attivo;
}
public String getNome() {
return this.nome;
}
public UtenteApp nome(String nome) {
this.setNome(nome);
return this;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCognome() {
return this.cognome;
}
public UtenteApp cognome(String cognome) {
this.setCognome(cognome);
return this;
}
public void setCognome(String cognome) {
this.cognome = cognome;
}
public String getLuogoNascita() {
return this.luogoNascita;
}
public UtenteApp luogoNascita(String luogoNascita) {
this.setLuogoNascita(luogoNascita);
return this;
}
public void setLuogoNascita(String luogoNascita) {
this.luogoNascita = luogoNascita;
}
public String getDataNascita() {
return this.dataNascita;
}
public UtenteApp dataNascita(String dataNascita) {
this.setDataNascita(dataNascita);
return this;
}
public void setDataNascita(String dataNascita) {
this.dataNascita = dataNascita;
}
public String getResidente() {
return this.residente;
}
public UtenteApp residente(String residente) {
this.setResidente(residente);
return this;
}
public void setResidente(String residente) {
this.residente = residente;
}
public String getSocieta() {
return this.societa;
}
public UtenteApp societa(String societa) {
this.setSocieta(societa);
return this;
}
public void setSocieta(String societa) {
this.societa = societa;
}
public String getSede() {
return this.sede;
}
public UtenteApp sede(String sede) {
this.setSede(sede);
return this;
}
public void setSede(String sede) {
this.sede = sede;
}
public String getCodfiscale() {
return this.codfiscale;
}
public UtenteApp codfiscale(String codfiscale) {
this.setCodfiscale(codfiscale);
return this;
}
public void setCodfiscale(String codfiscale) {
this.codfiscale = codfiscale;
}
public String getTelefonoSoc() {
return this.telefonoSoc;
}
public UtenteApp telefonoSoc(String telefonoSoc) {
this.setTelefonoSoc(telefonoSoc);
return this;
}
public void setTelefonoSoc(String telefonoSoc) {
this.telefonoSoc = telefonoSoc;
}
public String getEmailSoc() {
return this.emailSoc;
}
public UtenteApp emailSoc(String emailSoc) {
this.setEmailSoc(emailSoc);
return this;
}
public void setEmailSoc(String emailSoc) {
this.emailSoc = emailSoc;
}
public Set<Liberatoria> getLiberatories() {
return this.liberatories;
}
public void setLiberatories(Set<Liberatoria> liberatorias) {
if (this.liberatories != null) {
this.liberatories.forEach(i -> i.setUtente(null));
}
if (liberatorias != null) {
liberatorias.forEach(i -> i.setUtente(this));
}
this.liberatories = liberatorias;
}
public UtenteApp liberatories(Set<Liberatoria> liberatorias) {
this.setLiberatories(liberatorias);
return this;
}
public UtenteApp addLiberatorie(Liberatoria liberatoria) {
this.liberatories.add(liberatoria);
liberatoria.setUtente(this);
return this;
}
public UtenteApp removeLiberatorie(Liberatoria liberatoria) {
this.liberatories.remove(liberatoria);
liberatoria.setUtente(null);
return this;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof UtenteApp)) {
return false;
}
return getId() != null && getId().equals(((UtenteApp) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "UtenteApp{" +
"id=" + getId() +
", username='" + getUsername() + "'" +
", email='" + getEmail() + "'" +
", telefono='" + getTelefono() + "'" +
", ruolo='" + getRuolo() + "'" +
", attivo='" + getAttivo() + "'" +
", nome='" + getNome() + "'" +
", cognome='" + getCognome() + "'" +
", luogoNascita='" + getLuogoNascita() + "'" +
", dataNascita='" + getDataNascita() + "'" +
", residente='" + getResidente() + "'" +
", societa='" + getSocieta() + "'" +
", sede='" + getSede() + "'" +
", codfiscale='" + getCodfiscale() + "'" +
", telefonoSoc='" + getTelefonoSoc() + "'" +
", emailSoc='" + getEmailSoc() + "'" +
"}";
}
}

View File

@@ -0,0 +1,12 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The AzioneAudit enumeration.
*/
public enum AzioneAudit {
CREATE,
UPDATE,
DELETE,
CONFIRM,
REJECT,
}

View File

@@ -0,0 +1,14 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The GiornoSettimana enumeration.
*/
public enum GiornoSettimana {
LUNEDI,
MARTEDI,
MERCOLEDI,
GIOVEDI,
VENERDI,
SABATO,
DOMENICA,
}

View File

@@ -0,0 +1,10 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The Ruolo enumeration.
*/
public enum Ruolo {
USER,
INCARICATO,
ADMIN,
}

View File

@@ -0,0 +1,11 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The StatoPrenotazione enumeration.
*/
public enum StatoPrenotazione {
RICHIESTA,
CONFERMATA,
RIFIUTATA,
ANNULLATA,
}

View File

@@ -0,0 +1,10 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The TipoCanaleNotifica enumeration.
*/
public enum TipoCanaleNotifica {
EMAIL,
WHATSAPP,
SISTEMA,
}

View File

@@ -0,0 +1,9 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The TipoConferma enumeration.
*/
public enum TipoConferma {
CONFERMATA,
RIFIUTATA,
}

View File

@@ -0,0 +1,9 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The TipoDisponibilita enumeration.
*/
public enum TipoDisponibilita {
DISPONIBILE,
CHIUSURA,
}

View File

@@ -0,0 +1,9 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The TipoEntita enumeration.
*/
public enum TipoEntita {
PRENOTAZIONE,
CONFERMA,
}

View File

@@ -0,0 +1,12 @@
package it.sw.pa.comune.artegna.domain.enumeration;
/**
* The TipoEventoNotifica enumeration.
*/
public enum TipoEventoNotifica {
RICHIESTA_CREATA,
PRENOTAZIONE_CONFERMATA,
PRENOTAZIONE_RIFIUTATA,
REMINDER,
ANNULLAMENTO,
}

View File

@@ -0,0 +1,4 @@
/**
* This package file was generated by JHipster
*/
package it.sw.pa.comune.artegna.domain.enumeration;

View File

@@ -0,0 +1,40 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.AuditLog;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the AuditLog entity.
*/
@Repository
public interface AuditLogRepository extends JpaRepository<AuditLog, Long>, JpaSpecificationExecutor<AuditLog> {
default Optional<AuditLog> findOneWithEagerRelationships(Long id) {
return this.findOneWithToOneRelationships(id);
}
default List<AuditLog> findAllWithEagerRelationships() {
return this.findAllWithToOneRelationships();
}
default Page<AuditLog> findAllWithEagerRelationships(Pageable pageable) {
return this.findAllWithToOneRelationships(pageable);
}
@Query(
value = "select auditLog from AuditLog auditLog left join fetch auditLog.utente",
countQuery = "select count(auditLog) from AuditLog auditLog"
)
Page<AuditLog> findAllWithToOneRelationships(Pageable pageable);
@Query("select auditLog from AuditLog auditLog left join fetch auditLog.utente")
List<AuditLog> findAllWithToOneRelationships();
@Query("select auditLog from AuditLog auditLog left join fetch auditLog.utente where auditLog.id =:id")
Optional<AuditLog> findOneWithToOneRelationships(@Param("id") Long id);
}

View File

@@ -0,0 +1,40 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.Conferma;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the Conferma entity.
*/
@Repository
public interface ConfermaRepository extends JpaRepository<Conferma, Long>, JpaSpecificationExecutor<Conferma> {
default Optional<Conferma> findOneWithEagerRelationships(Long id) {
return this.findOneWithToOneRelationships(id);
}
default List<Conferma> findAllWithEagerRelationships() {
return this.findAllWithToOneRelationships();
}
default Page<Conferma> findAllWithEagerRelationships(Pageable pageable) {
return this.findAllWithToOneRelationships(pageable);
}
@Query(
value = "select conferma from Conferma conferma left join fetch conferma.confermataDa",
countQuery = "select count(conferma) from Conferma conferma"
)
Page<Conferma> findAllWithToOneRelationships(Pageable pageable);
@Query("select conferma from Conferma conferma left join fetch conferma.confermataDa")
List<Conferma> findAllWithToOneRelationships();
@Query("select conferma from Conferma conferma left join fetch conferma.confermataDa where conferma.id =:id")
Optional<Conferma> findOneWithToOneRelationships(@Param("id") Long id);
}

View File

@@ -0,0 +1,40 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.Disponibilita;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the Disponibilita entity.
*/
@Repository
public interface DisponibilitaRepository extends JpaRepository<Disponibilita, Long> {
default Optional<Disponibilita> findOneWithEagerRelationships(Long id) {
return this.findOneWithToOneRelationships(id);
}
default List<Disponibilita> findAllWithEagerRelationships() {
return this.findAllWithToOneRelationships();
}
default Page<Disponibilita> findAllWithEagerRelationships(Pageable pageable) {
return this.findAllWithToOneRelationships(pageable);
}
@Query(
value = "select disponibilita from Disponibilita disponibilita left join fetch disponibilita.struttura",
countQuery = "select count(disponibilita) from Disponibilita disponibilita"
)
Page<Disponibilita> findAllWithToOneRelationships(Pageable pageable);
@Query("select disponibilita from Disponibilita disponibilita left join fetch disponibilita.struttura")
List<Disponibilita> findAllWithToOneRelationships();
@Query("select disponibilita from Disponibilita disponibilita left join fetch disponibilita.struttura where disponibilita.id =:id")
Optional<Disponibilita> findOneWithToOneRelationships(@Param("id") Long id);
}

View File

@@ -0,0 +1,40 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.Liberatoria;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the Liberatoria entity.
*/
@Repository
public interface LiberatoriaRepository extends JpaRepository<Liberatoria, Long> {
default Optional<Liberatoria> findOneWithEagerRelationships(Long id) {
return this.findOneWithToOneRelationships(id);
}
default List<Liberatoria> findAllWithEagerRelationships() {
return this.findAllWithToOneRelationships();
}
default Page<Liberatoria> findAllWithEagerRelationships(Pageable pageable) {
return this.findAllWithToOneRelationships(pageable);
}
@Query(
value = "select liberatoria from Liberatoria liberatoria left join fetch liberatoria.utente",
countQuery = "select count(liberatoria) from Liberatoria liberatoria"
)
Page<Liberatoria> findAllWithToOneRelationships(Pageable pageable);
@Query("select liberatoria from Liberatoria liberatoria left join fetch liberatoria.utente")
List<Liberatoria> findAllWithToOneRelationships();
@Query("select liberatoria from Liberatoria liberatoria left join fetch liberatoria.utente where liberatoria.id =:id")
Optional<Liberatoria> findOneWithToOneRelationships(@Param("id") Long id);
}

View File

@@ -0,0 +1,40 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.Messaggio;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the Messaggio entity.
*/
@Repository
public interface MessaggioRepository extends JpaRepository<Messaggio, Long> {
default Optional<Messaggio> findOneWithEagerRelationships(Long id) {
return this.findOneWithToOneRelationships(id);
}
default List<Messaggio> findAllWithEagerRelationships() {
return this.findAllWithToOneRelationships();
}
default Page<Messaggio> findAllWithEagerRelationships(Pageable pageable) {
return this.findAllWithToOneRelationships(pageable);
}
@Query(
value = "select messaggio from Messaggio messaggio left join fetch messaggio.utente",
countQuery = "select count(messaggio) from Messaggio messaggio"
)
Page<Messaggio> findAllWithToOneRelationships(Pageable pageable);
@Query("select messaggio from Messaggio messaggio left join fetch messaggio.utente")
List<Messaggio> findAllWithToOneRelationships();
@Query("select messaggio from Messaggio messaggio left join fetch messaggio.utente where messaggio.id =:id")
Optional<Messaggio> findOneWithToOneRelationships(@Param("id") Long id);
}

View File

@@ -0,0 +1,12 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.ModelloLiberatoria;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the ModelloLiberatoria entity.
*/
@SuppressWarnings("unused")
@Repository
public interface ModelloLiberatoriaRepository extends JpaRepository<ModelloLiberatoria, Long> {}

View File

@@ -0,0 +1,12 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.Notifica;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the Notifica entity.
*/
@SuppressWarnings("unused")
@Repository
public interface NotificaRepository extends JpaRepository<Notifica, Long>, JpaSpecificationExecutor<Notifica> {}

View File

@@ -0,0 +1,42 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.Prenotazione;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the Prenotazione entity.
*/
@Repository
public interface PrenotazioneRepository extends JpaRepository<Prenotazione, Long>, JpaSpecificationExecutor<Prenotazione> {
default Optional<Prenotazione> findOneWithEagerRelationships(Long id) {
return this.findOneWithToOneRelationships(id);
}
default List<Prenotazione> findAllWithEagerRelationships() {
return this.findAllWithToOneRelationships();
}
default Page<Prenotazione> findAllWithEagerRelationships(Pageable pageable) {
return this.findAllWithToOneRelationships(pageable);
}
@Query(
value = "select prenotazione from Prenotazione prenotazione left join fetch prenotazione.utente left join fetch prenotazione.struttura",
countQuery = "select count(prenotazione) from Prenotazione prenotazione"
)
Page<Prenotazione> findAllWithToOneRelationships(Pageable pageable);
@Query("select prenotazione from Prenotazione prenotazione left join fetch prenotazione.utente left join fetch prenotazione.struttura")
List<Prenotazione> findAllWithToOneRelationships();
@Query(
"select prenotazione from Prenotazione prenotazione left join fetch prenotazione.utente left join fetch prenotazione.struttura where prenotazione.id =:id"
)
Optional<Prenotazione> findOneWithToOneRelationships(@Param("id") Long id);
}

View File

@@ -0,0 +1,12 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.Struttura;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the Struttura entity.
*/
@SuppressWarnings("unused")
@Repository
public interface StrutturaRepository extends JpaRepository<Struttura, Long>, JpaSpecificationExecutor<Struttura> {}

View File

@@ -0,0 +1,12 @@
package it.sw.pa.comune.artegna.repository;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data JPA repository for the UtenteApp entity.
*/
@SuppressWarnings("unused")
@Repository
public interface UtenteAppRepository extends JpaRepository<UtenteApp, Long> {}

View File

@@ -0,0 +1,88 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.domain.*; // for static metamodels
import it.sw.pa.comune.artegna.domain.AuditLog;
import it.sw.pa.comune.artegna.repository.AuditLogRepository;
import it.sw.pa.comune.artegna.service.criteria.AuditLogCriteria;
import it.sw.pa.comune.artegna.service.dto.AuditLogDTO;
import it.sw.pa.comune.artegna.service.mapper.AuditLogMapper;
import jakarta.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.jhipster.service.QueryService;
/**
* Service for executing complex queries for {@link AuditLog} entities in the database.
* The main input is a {@link AuditLogCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link Page} of {@link AuditLogDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class AuditLogQueryService extends QueryService<AuditLog> {
private static final Logger LOG = LoggerFactory.getLogger(AuditLogQueryService.class);
private final AuditLogRepository auditLogRepository;
private final AuditLogMapper auditLogMapper;
public AuditLogQueryService(AuditLogRepository auditLogRepository, AuditLogMapper auditLogMapper) {
this.auditLogRepository = auditLogRepository;
this.auditLogMapper = auditLogMapper;
}
/**
* Return a {@link Page} of {@link AuditLogDTO} which matches the criteria from the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<AuditLogDTO> findByCriteria(AuditLogCriteria criteria, Pageable page) {
LOG.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<AuditLog> specification = createSpecification(criteria);
return auditLogRepository.findAll(specification, page).map(auditLogMapper::toDto);
}
/**
* Return the number of matching entities in the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(AuditLogCriteria criteria) {
LOG.debug("count by criteria : {}", criteria);
final Specification<AuditLog> specification = createSpecification(criteria);
return auditLogRepository.count(specification);
}
/**
* Function to convert {@link AuditLogCriteria} to a {@link Specification}
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching {@link Specification} of the entity.
*/
protected Specification<AuditLog> createSpecification(AuditLogCriteria criteria) {
Specification<AuditLog> specification = Specification.unrestricted();
if (criteria != null) {
// This has to be called first, because the distinct method returns null
specification = Specification.allOf(
Boolean.TRUE.equals(criteria.getDistinct()) ? distinct(criteria.getDistinct()) : null,
buildRangeSpecification(criteria.getId(), AuditLog_.id),
buildSpecification(criteria.getEntitaTipo(), AuditLog_.entitaTipo),
buildRangeSpecification(criteria.getEntitaId(), AuditLog_.entitaId),
buildSpecification(criteria.getAzione(), AuditLog_.azione),
buildStringSpecification(criteria.getDettagli(), AuditLog_.dettagli),
buildStringSpecification(criteria.getIpAddress(), AuditLog_.ipAddress),
buildRangeSpecification(criteria.getCreatedAt(), AuditLog_.createdAt),
buildSpecification(criteria.getUtenteId(), root -> root.join(AuditLog_.utente, JoinType.LEFT).get(UtenteApp_.id))
);
}
return specification;
}
}

View File

@@ -0,0 +1,58 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.AuditLogDTO;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.AuditLog}.
*/
public interface AuditLogService {
/**
* Save a auditLog.
*
* @param auditLogDTO the entity to save.
* @return the persisted entity.
*/
AuditLogDTO save(AuditLogDTO auditLogDTO);
/**
* Updates a auditLog.
*
* @param auditLogDTO the entity to update.
* @return the persisted entity.
*/
AuditLogDTO update(AuditLogDTO auditLogDTO);
/**
* Partially updates a auditLog.
*
* @param auditLogDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<AuditLogDTO> partialUpdate(AuditLogDTO auditLogDTO);
/**
* Get all the auditLogs with eager load of many-to-many relationships.
*
* @param pageable the pagination information.
* @return the list of entities.
*/
Page<AuditLogDTO> findAllWithEagerRelationships(Pageable pageable);
/**
* Get the "id" auditLog.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<AuditLogDTO> findOne(Long id);
/**
* Delete the "id" auditLog.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,89 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.domain.*; // for static metamodels
import it.sw.pa.comune.artegna.domain.Conferma;
import it.sw.pa.comune.artegna.repository.ConfermaRepository;
import it.sw.pa.comune.artegna.service.criteria.ConfermaCriteria;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import it.sw.pa.comune.artegna.service.mapper.ConfermaMapper;
import jakarta.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.jhipster.service.QueryService;
/**
* Service for executing complex queries for {@link Conferma} entities in the database.
* The main input is a {@link ConfermaCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link Page} of {@link ConfermaDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class ConfermaQueryService extends QueryService<Conferma> {
private static final Logger LOG = LoggerFactory.getLogger(ConfermaQueryService.class);
private final ConfermaRepository confermaRepository;
private final ConfermaMapper confermaMapper;
public ConfermaQueryService(ConfermaRepository confermaRepository, ConfermaMapper confermaMapper) {
this.confermaRepository = confermaRepository;
this.confermaMapper = confermaMapper;
}
/**
* Return a {@link Page} of {@link ConfermaDTO} which matches the criteria from the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<ConfermaDTO> findByCriteria(ConfermaCriteria criteria, Pageable page) {
LOG.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Conferma> specification = createSpecification(criteria);
return confermaRepository.findAll(specification, page).map(confermaMapper::toDto);
}
/**
* Return the number of matching entities in the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(ConfermaCriteria criteria) {
LOG.debug("count by criteria : {}", criteria);
final Specification<Conferma> specification = createSpecification(criteria);
return confermaRepository.count(specification);
}
/**
* Function to convert {@link ConfermaCriteria} to a {@link Specification}
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching {@link Specification} of the entity.
*/
protected Specification<Conferma> createSpecification(ConfermaCriteria criteria) {
Specification<Conferma> specification = Specification.unrestricted();
if (criteria != null) {
// This has to be called first, because the distinct method returns null
specification = Specification.allOf(
Boolean.TRUE.equals(criteria.getDistinct()) ? distinct(criteria.getDistinct()) : null,
buildRangeSpecification(criteria.getId(), Conferma_.id),
buildStringSpecification(criteria.getMotivoConferma(), Conferma_.motivoConferma),
buildSpecification(criteria.getTipoConferma(), Conferma_.tipoConferma),
buildSpecification(criteria.getConfermataDaId(), root ->
root.join(Conferma_.confermataDa, JoinType.LEFT).get(UtenteApp_.id)
),
buildSpecification(criteria.getPrenotazioneId(), root ->
root.join(Conferma_.prenotazione, JoinType.LEFT).get(Prenotazione_.id)
)
);
}
return specification;
}
}

View File

@@ -0,0 +1,66 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.Conferma}.
*/
public interface ConfermaService {
/**
* Save a conferma.
*
* @param confermaDTO the entity to save.
* @return the persisted entity.
*/
ConfermaDTO save(ConfermaDTO confermaDTO);
/**
* Updates a conferma.
*
* @param confermaDTO the entity to update.
* @return the persisted entity.
*/
ConfermaDTO update(ConfermaDTO confermaDTO);
/**
* Partially updates a conferma.
*
* @param confermaDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<ConfermaDTO> partialUpdate(ConfermaDTO confermaDTO);
/**
* Get all the ConfermaDTO where Prenotazione is {@code null}.
*
* @return the {@link List} of entities.
*/
List<ConfermaDTO> findAllWherePrenotazioneIsNull();
/**
* Get all the confermas with eager load of many-to-many relationships.
*
* @param pageable the pagination information.
* @return the list of entities.
*/
Page<ConfermaDTO> findAllWithEagerRelationships(Pageable pageable);
/**
* Get the "id" conferma.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<ConfermaDTO> findOne(Long id);
/**
* Delete the "id" conferma.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,66 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.DisponibilitaDTO;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.Disponibilita}.
*/
public interface DisponibilitaService {
/**
* Save a disponibilita.
*
* @param disponibilitaDTO the entity to save.
* @return the persisted entity.
*/
DisponibilitaDTO save(DisponibilitaDTO disponibilitaDTO);
/**
* Updates a disponibilita.
*
* @param disponibilitaDTO the entity to update.
* @return the persisted entity.
*/
DisponibilitaDTO update(DisponibilitaDTO disponibilitaDTO);
/**
* Partially updates a disponibilita.
*
* @param disponibilitaDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<DisponibilitaDTO> partialUpdate(DisponibilitaDTO disponibilitaDTO);
/**
* Get all the disponibilitas.
*
* @param pageable the pagination information.
* @return the list of entities.
*/
Page<DisponibilitaDTO> findAll(Pageable pageable);
/**
* Get all the disponibilitas with eager load of many-to-many relationships.
*
* @param pageable the pagination information.
* @return the list of entities.
*/
Page<DisponibilitaDTO> findAllWithEagerRelationships(Pageable pageable);
/**
* Get the "id" disponibilita.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<DisponibilitaDTO> findOne(Long id);
/**
* Delete the "id" disponibilita.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,66 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.LiberatoriaDTO;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.Liberatoria}.
*/
public interface LiberatoriaService {
/**
* Save a liberatoria.
*
* @param liberatoriaDTO the entity to save.
* @return the persisted entity.
*/
LiberatoriaDTO save(LiberatoriaDTO liberatoriaDTO);
/**
* Updates a liberatoria.
*
* @param liberatoriaDTO the entity to update.
* @return the persisted entity.
*/
LiberatoriaDTO update(LiberatoriaDTO liberatoriaDTO);
/**
* Partially updates a liberatoria.
*
* @param liberatoriaDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<LiberatoriaDTO> partialUpdate(LiberatoriaDTO liberatoriaDTO);
/**
* Get all the liberatorias.
*
* @return the list of entities.
*/
List<LiberatoriaDTO> findAll();
/**
* Get all the liberatorias with eager load of many-to-many relationships.
*
* @param pageable the pagination information.
* @return the list of entities.
*/
Page<LiberatoriaDTO> findAllWithEagerRelationships(Pageable pageable);
/**
* Get the "id" liberatoria.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<LiberatoriaDTO> findOne(Long id);
/**
* Delete the "id" liberatoria.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,66 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.MessaggioDTO;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.Messaggio}.
*/
public interface MessaggioService {
/**
* Save a messaggio.
*
* @param messaggioDTO the entity to save.
* @return the persisted entity.
*/
MessaggioDTO save(MessaggioDTO messaggioDTO);
/**
* Updates a messaggio.
*
* @param messaggioDTO the entity to update.
* @return the persisted entity.
*/
MessaggioDTO update(MessaggioDTO messaggioDTO);
/**
* Partially updates a messaggio.
*
* @param messaggioDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<MessaggioDTO> partialUpdate(MessaggioDTO messaggioDTO);
/**
* Get all the messaggios.
*
* @return the list of entities.
*/
List<MessaggioDTO> findAll();
/**
* Get all the messaggios with eager load of many-to-many relationships.
*
* @param pageable the pagination information.
* @return the list of entities.
*/
Page<MessaggioDTO> findAllWithEagerRelationships(Pageable pageable);
/**
* Get the "id" messaggio.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<MessaggioDTO> findOne(Long id);
/**
* Delete the "id" messaggio.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,56 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.ModelloLiberatoriaDTO;
import java.util.List;
import java.util.Optional;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.ModelloLiberatoria}.
*/
public interface ModelloLiberatoriaService {
/**
* Save a modelloLiberatoria.
*
* @param modelloLiberatoriaDTO the entity to save.
* @return the persisted entity.
*/
ModelloLiberatoriaDTO save(ModelloLiberatoriaDTO modelloLiberatoriaDTO);
/**
* Updates a modelloLiberatoria.
*
* @param modelloLiberatoriaDTO the entity to update.
* @return the persisted entity.
*/
ModelloLiberatoriaDTO update(ModelloLiberatoriaDTO modelloLiberatoriaDTO);
/**
* Partially updates a modelloLiberatoria.
*
* @param modelloLiberatoriaDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<ModelloLiberatoriaDTO> partialUpdate(ModelloLiberatoriaDTO modelloLiberatoriaDTO);
/**
* Get all the modelloLiberatorias.
*
* @return the list of entities.
*/
List<ModelloLiberatoriaDTO> findAll();
/**
* Get the "id" modelloLiberatoria.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<ModelloLiberatoriaDTO> findOne(Long id);
/**
* Delete the "id" modelloLiberatoria.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,89 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.domain.*; // for static metamodels
import it.sw.pa.comune.artegna.domain.Notifica;
import it.sw.pa.comune.artegna.repository.NotificaRepository;
import it.sw.pa.comune.artegna.service.criteria.NotificaCriteria;
import it.sw.pa.comune.artegna.service.dto.NotificaDTO;
import it.sw.pa.comune.artegna.service.mapper.NotificaMapper;
import jakarta.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.jhipster.service.QueryService;
/**
* Service for executing complex queries for {@link Notifica} entities in the database.
* The main input is a {@link NotificaCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link Page} of {@link NotificaDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class NotificaQueryService extends QueryService<Notifica> {
private static final Logger LOG = LoggerFactory.getLogger(NotificaQueryService.class);
private final NotificaRepository notificaRepository;
private final NotificaMapper notificaMapper;
public NotificaQueryService(NotificaRepository notificaRepository, NotificaMapper notificaMapper) {
this.notificaRepository = notificaRepository;
this.notificaMapper = notificaMapper;
}
/**
* Return a {@link Page} of {@link NotificaDTO} which matches the criteria from the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<NotificaDTO> findByCriteria(NotificaCriteria criteria, Pageable page) {
LOG.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Notifica> specification = createSpecification(criteria);
return notificaRepository.findAll(specification, page).map(notificaMapper::toDto);
}
/**
* Return the number of matching entities in the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(NotificaCriteria criteria) {
LOG.debug("count by criteria : {}", criteria);
final Specification<Notifica> specification = createSpecification(criteria);
return notificaRepository.count(specification);
}
/**
* Function to convert {@link NotificaCriteria} to a {@link Specification}
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching {@link Specification} of the entity.
*/
protected Specification<Notifica> createSpecification(NotificaCriteria criteria) {
Specification<Notifica> specification = Specification.unrestricted();
if (criteria != null) {
// This has to be called first, because the distinct method returns null
specification = Specification.allOf(
Boolean.TRUE.equals(criteria.getDistinct()) ? distinct(criteria.getDistinct()) : null,
buildRangeSpecification(criteria.getId(), Notifica_.id),
buildSpecification(criteria.getTipoCanale(), Notifica_.tipoCanale),
buildSpecification(criteria.getTipoEvento(), Notifica_.tipoEvento),
buildStringSpecification(criteria.getMessaggio(), Notifica_.messaggio),
buildSpecification(criteria.getInviata(), Notifica_.inviata),
buildRangeSpecification(criteria.getInviataAt(), Notifica_.inviataAt),
buildStringSpecification(criteria.getErrore(), Notifica_.errore),
buildRangeSpecification(criteria.getCreatedAt(), Notifica_.createdAt),
buildSpecification(criteria.getConfermaId(), root -> root.join(Notifica_.conferma, JoinType.LEFT).get(Conferma_.id))
);
}
return specification;
}
}

View File

@@ -0,0 +1,48 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.NotificaDTO;
import java.util.Optional;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.Notifica}.
*/
public interface NotificaService {
/**
* Save a notifica.
*
* @param notificaDTO the entity to save.
* @return the persisted entity.
*/
NotificaDTO save(NotificaDTO notificaDTO);
/**
* Updates a notifica.
*
* @param notificaDTO the entity to update.
* @return the persisted entity.
*/
NotificaDTO update(NotificaDTO notificaDTO);
/**
* Partially updates a notifica.
*
* @param notificaDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<NotificaDTO> partialUpdate(NotificaDTO notificaDTO);
/**
* Get the "id" notifica.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<NotificaDTO> findOne(Long id);
/**
* Delete the "id" notifica.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,90 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.domain.*; // for static metamodels
import it.sw.pa.comune.artegna.domain.Prenotazione;
import it.sw.pa.comune.artegna.repository.PrenotazioneRepository;
import it.sw.pa.comune.artegna.service.criteria.PrenotazioneCriteria;
import it.sw.pa.comune.artegna.service.dto.PrenotazioneDTO;
import it.sw.pa.comune.artegna.service.mapper.PrenotazioneMapper;
import jakarta.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.jhipster.service.QueryService;
/**
* Service for executing complex queries for {@link Prenotazione} entities in the database.
* The main input is a {@link PrenotazioneCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link Page} of {@link PrenotazioneDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class PrenotazioneQueryService extends QueryService<Prenotazione> {
private static final Logger LOG = LoggerFactory.getLogger(PrenotazioneQueryService.class);
private final PrenotazioneRepository prenotazioneRepository;
private final PrenotazioneMapper prenotazioneMapper;
public PrenotazioneQueryService(PrenotazioneRepository prenotazioneRepository, PrenotazioneMapper prenotazioneMapper) {
this.prenotazioneRepository = prenotazioneRepository;
this.prenotazioneMapper = prenotazioneMapper;
}
/**
* Return a {@link Page} of {@link PrenotazioneDTO} which matches the criteria from the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<PrenotazioneDTO> findByCriteria(PrenotazioneCriteria criteria, Pageable page) {
LOG.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Prenotazione> specification = createSpecification(criteria);
return prenotazioneRepository.findAll(specification, page).map(prenotazioneMapper::toDto);
}
/**
* Return the number of matching entities in the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(PrenotazioneCriteria criteria) {
LOG.debug("count by criteria : {}", criteria);
final Specification<Prenotazione> specification = createSpecification(criteria);
return prenotazioneRepository.count(specification);
}
/**
* Function to convert {@link PrenotazioneCriteria} to a {@link Specification}
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching {@link Specification} of the entity.
*/
protected Specification<Prenotazione> createSpecification(PrenotazioneCriteria criteria) {
Specification<Prenotazione> specification = Specification.unrestricted();
if (criteria != null) {
// This has to be called first, because the distinct method returns null
specification = Specification.allOf(
Boolean.TRUE.equals(criteria.getDistinct()) ? distinct(criteria.getDistinct()) : null,
buildRangeSpecification(criteria.getId(), Prenotazione_.id),
buildRangeSpecification(criteria.getOraInizio(), Prenotazione_.oraInizio),
buildRangeSpecification(criteria.getOraFine(), Prenotazione_.oraFine),
buildSpecification(criteria.getStato(), Prenotazione_.stato),
buildStringSpecification(criteria.getMotivoEvento(), Prenotazione_.motivoEvento),
buildRangeSpecification(criteria.getNumeroPartecipanti(), Prenotazione_.numeroPartecipanti),
buildStringSpecification(criteria.getNoteUtente(), Prenotazione_.noteUtente),
buildSpecification(criteria.getConfermaId(), root -> root.join(Prenotazione_.conferma, JoinType.LEFT).get(Conferma_.id)),
buildSpecification(criteria.getUtenteId(), root -> root.join(Prenotazione_.utente, JoinType.LEFT).get(UtenteApp_.id)),
buildSpecification(criteria.getStrutturaId(), root -> root.join(Prenotazione_.struttura, JoinType.LEFT).get(Struttura_.id))
);
}
return specification;
}
}

View File

@@ -0,0 +1,58 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.PrenotazioneDTO;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.Prenotazione}.
*/
public interface PrenotazioneService {
/**
* Save a prenotazione.
*
* @param prenotazioneDTO the entity to save.
* @return the persisted entity.
*/
PrenotazioneDTO save(PrenotazioneDTO prenotazioneDTO);
/**
* Updates a prenotazione.
*
* @param prenotazioneDTO the entity to update.
* @return the persisted entity.
*/
PrenotazioneDTO update(PrenotazioneDTO prenotazioneDTO);
/**
* Partially updates a prenotazione.
*
* @param prenotazioneDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<PrenotazioneDTO> partialUpdate(PrenotazioneDTO prenotazioneDTO);
/**
* Get all the prenotaziones with eager load of many-to-many relationships.
*
* @param pageable the pagination information.
* @return the list of entities.
*/
Page<PrenotazioneDTO> findAllWithEagerRelationships(Pageable pageable);
/**
* Get the "id" prenotazione.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<PrenotazioneDTO> findOne(Long id);
/**
* Delete the "id" prenotazione.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,95 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.domain.*; // for static metamodels
import it.sw.pa.comune.artegna.domain.Struttura;
import it.sw.pa.comune.artegna.repository.StrutturaRepository;
import it.sw.pa.comune.artegna.service.criteria.StrutturaCriteria;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import it.sw.pa.comune.artegna.service.mapper.StrutturaMapper;
import jakarta.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.jhipster.service.QueryService;
/**
* Service for executing complex queries for {@link Struttura} entities in the database.
* The main input is a {@link StrutturaCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link Page} of {@link StrutturaDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class StrutturaQueryService extends QueryService<Struttura> {
private static final Logger LOG = LoggerFactory.getLogger(StrutturaQueryService.class);
private final StrutturaRepository strutturaRepository;
private final StrutturaMapper strutturaMapper;
public StrutturaQueryService(StrutturaRepository strutturaRepository, StrutturaMapper strutturaMapper) {
this.strutturaRepository = strutturaRepository;
this.strutturaMapper = strutturaMapper;
}
/**
* Return a {@link Page} of {@link StrutturaDTO} which matches the criteria from the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<StrutturaDTO> findByCriteria(StrutturaCriteria criteria, Pageable page) {
LOG.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Struttura> specification = createSpecification(criteria);
return strutturaRepository.findAll(specification, page).map(strutturaMapper::toDto);
}
/**
* Return the number of matching entities in the database.
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(StrutturaCriteria criteria) {
LOG.debug("count by criteria : {}", criteria);
final Specification<Struttura> specification = createSpecification(criteria);
return strutturaRepository.count(specification);
}
/**
* Function to convert {@link StrutturaCriteria} to a {@link Specification}
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching {@link Specification} of the entity.
*/
protected Specification<Struttura> createSpecification(StrutturaCriteria criteria) {
Specification<Struttura> specification = Specification.unrestricted();
if (criteria != null) {
// This has to be called first, because the distinct method returns null
specification = Specification.allOf(
Boolean.TRUE.equals(criteria.getDistinct()) ? distinct(criteria.getDistinct()) : null,
buildRangeSpecification(criteria.getId(), Struttura_.id),
buildStringSpecification(criteria.getNome(), Struttura_.nome),
buildStringSpecification(criteria.getDescrizione(), Struttura_.descrizione),
buildStringSpecification(criteria.getIndirizzo(), Struttura_.indirizzo),
buildRangeSpecification(criteria.getCapienzaMax(), Struttura_.capienzaMax),
buildSpecification(criteria.getAttiva(), Struttura_.attiva),
buildStringSpecification(criteria.getFotoUrl(), Struttura_.fotoUrl),
buildRangeSpecification(criteria.getCreatedAt(), Struttura_.createdAt),
buildRangeSpecification(criteria.getUpdatedAt(), Struttura_.updatedAt),
buildSpecification(criteria.getDisponibilitaId(), root ->
root.join(Struttura_.disponibilitas, JoinType.LEFT).get(Disponibilita_.id)
),
buildSpecification(criteria.getModuliLiberatorieId(), root ->
root.join(Struttura_.moduliLiberatories, JoinType.LEFT).get(ModelloLiberatoria_.id)
)
);
}
return specification;
}
}

View File

@@ -0,0 +1,48 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import java.util.Optional;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.Struttura}.
*/
public interface StrutturaService {
/**
* Save a struttura.
*
* @param strutturaDTO the entity to save.
* @return the persisted entity.
*/
StrutturaDTO save(StrutturaDTO strutturaDTO);
/**
* Updates a struttura.
*
* @param strutturaDTO the entity to update.
* @return the persisted entity.
*/
StrutturaDTO update(StrutturaDTO strutturaDTO);
/**
* Partially updates a struttura.
*
* @param strutturaDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<StrutturaDTO> partialUpdate(StrutturaDTO strutturaDTO);
/**
* Get the "id" struttura.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<StrutturaDTO> findOne(Long id);
/**
* Delete the "id" struttura.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,56 @@
package it.sw.pa.comune.artegna.service;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import java.util.List;
import java.util.Optional;
/**
* Service Interface for managing {@link it.sw.pa.comune.artegna.domain.UtenteApp}.
*/
public interface UtenteAppService {
/**
* Save a utenteApp.
*
* @param utenteAppDTO the entity to save.
* @return the persisted entity.
*/
UtenteAppDTO save(UtenteAppDTO utenteAppDTO);
/**
* Updates a utenteApp.
*
* @param utenteAppDTO the entity to update.
* @return the persisted entity.
*/
UtenteAppDTO update(UtenteAppDTO utenteAppDTO);
/**
* Partially updates a utenteApp.
*
* @param utenteAppDTO the entity to update partially.
* @return the persisted entity.
*/
Optional<UtenteAppDTO> partialUpdate(UtenteAppDTO utenteAppDTO);
/**
* Get all the utenteApps.
*
* @return the list of entities.
*/
List<UtenteAppDTO> findAll();
/**
* Get the "id" utenteApp.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<UtenteAppDTO> findOne(Long id);
/**
* Delete the "id" utenteApp.
*
* @param id the id of the entity.
*/
void delete(Long id);
}

View File

@@ -0,0 +1,313 @@
package it.sw.pa.comune.artegna.service.criteria;
import it.sw.pa.comune.artegna.domain.enumeration.AzioneAudit;
import it.sw.pa.comune.artegna.domain.enumeration.TipoEntita;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.springdoc.core.annotations.ParameterObject;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.*;
/**
* Criteria class for the {@link it.sw.pa.comune.artegna.domain.AuditLog} entity. This class is used
* in {@link it.sw.pa.comune.artegna.web.rest.AuditLogResource} to receive all the possible filtering options from
* the Http GET request parameters.
* For example the following could be a valid request:
* {@code /audit-logs?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
@ParameterObject
@SuppressWarnings("common-java:DuplicatedBlocks")
public class AuditLogCriteria implements Serializable, Criteria {
/**
* Class for filtering TipoEntita
*/
public static class TipoEntitaFilter extends Filter<TipoEntita> {
public TipoEntitaFilter() {}
public TipoEntitaFilter(TipoEntitaFilter filter) {
super(filter);
}
@Override
public TipoEntitaFilter copy() {
return new TipoEntitaFilter(this);
}
}
/**
* Class for filtering AzioneAudit
*/
public static class AzioneAuditFilter extends Filter<AzioneAudit> {
public AzioneAuditFilter() {}
public AzioneAuditFilter(AzioneAuditFilter filter) {
super(filter);
}
@Override
public AzioneAuditFilter copy() {
return new AzioneAuditFilter(this);
}
}
@Serial
private static final long serialVersionUID = 1L;
private LongFilter id;
private TipoEntitaFilter entitaTipo;
private LongFilter entitaId;
private AzioneAuditFilter azione;
private StringFilter dettagli;
private StringFilter ipAddress;
private InstantFilter createdAt;
private LongFilter utenteId;
private Boolean distinct;
public AuditLogCriteria() {}
public AuditLogCriteria(AuditLogCriteria other) {
this.id = other.optionalId().map(LongFilter::copy).orElse(null);
this.entitaTipo = other.optionalEntitaTipo().map(TipoEntitaFilter::copy).orElse(null);
this.entitaId = other.optionalEntitaId().map(LongFilter::copy).orElse(null);
this.azione = other.optionalAzione().map(AzioneAuditFilter::copy).orElse(null);
this.dettagli = other.optionalDettagli().map(StringFilter::copy).orElse(null);
this.ipAddress = other.optionalIpAddress().map(StringFilter::copy).orElse(null);
this.createdAt = other.optionalCreatedAt().map(InstantFilter::copy).orElse(null);
this.utenteId = other.optionalUtenteId().map(LongFilter::copy).orElse(null);
this.distinct = other.distinct;
}
@Override
public AuditLogCriteria copy() {
return new AuditLogCriteria(this);
}
public LongFilter getId() {
return id;
}
public Optional<LongFilter> optionalId() {
return Optional.ofNullable(id);
}
public LongFilter id() {
if (id == null) {
setId(new LongFilter());
}
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public TipoEntitaFilter getEntitaTipo() {
return entitaTipo;
}
public Optional<TipoEntitaFilter> optionalEntitaTipo() {
return Optional.ofNullable(entitaTipo);
}
public TipoEntitaFilter entitaTipo() {
if (entitaTipo == null) {
setEntitaTipo(new TipoEntitaFilter());
}
return entitaTipo;
}
public void setEntitaTipo(TipoEntitaFilter entitaTipo) {
this.entitaTipo = entitaTipo;
}
public LongFilter getEntitaId() {
return entitaId;
}
public Optional<LongFilter> optionalEntitaId() {
return Optional.ofNullable(entitaId);
}
public LongFilter entitaId() {
if (entitaId == null) {
setEntitaId(new LongFilter());
}
return entitaId;
}
public void setEntitaId(LongFilter entitaId) {
this.entitaId = entitaId;
}
public AzioneAuditFilter getAzione() {
return azione;
}
public Optional<AzioneAuditFilter> optionalAzione() {
return Optional.ofNullable(azione);
}
public AzioneAuditFilter azione() {
if (azione == null) {
setAzione(new AzioneAuditFilter());
}
return azione;
}
public void setAzione(AzioneAuditFilter azione) {
this.azione = azione;
}
public StringFilter getDettagli() {
return dettagli;
}
public Optional<StringFilter> optionalDettagli() {
return Optional.ofNullable(dettagli);
}
public StringFilter dettagli() {
if (dettagli == null) {
setDettagli(new StringFilter());
}
return dettagli;
}
public void setDettagli(StringFilter dettagli) {
this.dettagli = dettagli;
}
public StringFilter getIpAddress() {
return ipAddress;
}
public Optional<StringFilter> optionalIpAddress() {
return Optional.ofNullable(ipAddress);
}
public StringFilter ipAddress() {
if (ipAddress == null) {
setIpAddress(new StringFilter());
}
return ipAddress;
}
public void setIpAddress(StringFilter ipAddress) {
this.ipAddress = ipAddress;
}
public InstantFilter getCreatedAt() {
return createdAt;
}
public Optional<InstantFilter> optionalCreatedAt() {
return Optional.ofNullable(createdAt);
}
public InstantFilter createdAt() {
if (createdAt == null) {
setCreatedAt(new InstantFilter());
}
return createdAt;
}
public void setCreatedAt(InstantFilter createdAt) {
this.createdAt = createdAt;
}
public LongFilter getUtenteId() {
return utenteId;
}
public Optional<LongFilter> optionalUtenteId() {
return Optional.ofNullable(utenteId);
}
public LongFilter utenteId() {
if (utenteId == null) {
setUtenteId(new LongFilter());
}
return utenteId;
}
public void setUtenteId(LongFilter utenteId) {
this.utenteId = utenteId;
}
public Boolean getDistinct() {
return distinct;
}
public Optional<Boolean> optionalDistinct() {
return Optional.ofNullable(distinct);
}
public Boolean distinct() {
if (distinct == null) {
setDistinct(true);
}
return distinct;
}
public void setDistinct(Boolean distinct) {
this.distinct = distinct;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final AuditLogCriteria that = (AuditLogCriteria) o;
return (
Objects.equals(id, that.id) &&
Objects.equals(entitaTipo, that.entitaTipo) &&
Objects.equals(entitaId, that.entitaId) &&
Objects.equals(azione, that.azione) &&
Objects.equals(dettagli, that.dettagli) &&
Objects.equals(ipAddress, that.ipAddress) &&
Objects.equals(createdAt, that.createdAt) &&
Objects.equals(utenteId, that.utenteId) &&
Objects.equals(distinct, that.distinct)
);
}
@Override
public int hashCode() {
return Objects.hash(id, entitaTipo, entitaId, azione, dettagli, ipAddress, createdAt, utenteId, distinct);
}
// prettier-ignore
@Override
public String toString() {
return "AuditLogCriteria{" +
optionalId().map(f -> "id=" + f + ", ").orElse("") +
optionalEntitaTipo().map(f -> "entitaTipo=" + f + ", ").orElse("") +
optionalEntitaId().map(f -> "entitaId=" + f + ", ").orElse("") +
optionalAzione().map(f -> "azione=" + f + ", ").orElse("") +
optionalDettagli().map(f -> "dettagli=" + f + ", ").orElse("") +
optionalIpAddress().map(f -> "ipAddress=" + f + ", ").orElse("") +
optionalCreatedAt().map(f -> "createdAt=" + f + ", ").orElse("") +
optionalUtenteId().map(f -> "utenteId=" + f + ", ").orElse("") +
optionalDistinct().map(f -> "distinct=" + f + ", ").orElse("") +
"}";
}
}

View File

@@ -0,0 +1,223 @@
package it.sw.pa.comune.artegna.service.criteria;
import it.sw.pa.comune.artegna.domain.enumeration.TipoConferma;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.springdoc.core.annotations.ParameterObject;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.*;
/**
* Criteria class for the {@link it.sw.pa.comune.artegna.domain.Conferma} entity. This class is used
* in {@link it.sw.pa.comune.artegna.web.rest.ConfermaResource} to receive all the possible filtering options from
* the Http GET request parameters.
* For example the following could be a valid request:
* {@code /confermas?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
@ParameterObject
@SuppressWarnings("common-java:DuplicatedBlocks")
public class ConfermaCriteria implements Serializable, Criteria {
/**
* Class for filtering TipoConferma
*/
public static class TipoConfermaFilter extends Filter<TipoConferma> {
public TipoConfermaFilter() {}
public TipoConfermaFilter(TipoConfermaFilter filter) {
super(filter);
}
@Override
public TipoConfermaFilter copy() {
return new TipoConfermaFilter(this);
}
}
@Serial
private static final long serialVersionUID = 1L;
private LongFilter id;
private StringFilter motivoConferma;
private TipoConfermaFilter tipoConferma;
private LongFilter confermataDaId;
private LongFilter prenotazioneId;
private Boolean distinct;
public ConfermaCriteria() {}
public ConfermaCriteria(ConfermaCriteria other) {
this.id = other.optionalId().map(LongFilter::copy).orElse(null);
this.motivoConferma = other.optionalMotivoConferma().map(StringFilter::copy).orElse(null);
this.tipoConferma = other.optionalTipoConferma().map(TipoConfermaFilter::copy).orElse(null);
this.confermataDaId = other.optionalConfermataDaId().map(LongFilter::copy).orElse(null);
this.prenotazioneId = other.optionalPrenotazioneId().map(LongFilter::copy).orElse(null);
this.distinct = other.distinct;
}
@Override
public ConfermaCriteria copy() {
return new ConfermaCriteria(this);
}
public LongFilter getId() {
return id;
}
public Optional<LongFilter> optionalId() {
return Optional.ofNullable(id);
}
public LongFilter id() {
if (id == null) {
setId(new LongFilter());
}
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public StringFilter getMotivoConferma() {
return motivoConferma;
}
public Optional<StringFilter> optionalMotivoConferma() {
return Optional.ofNullable(motivoConferma);
}
public StringFilter motivoConferma() {
if (motivoConferma == null) {
setMotivoConferma(new StringFilter());
}
return motivoConferma;
}
public void setMotivoConferma(StringFilter motivoConferma) {
this.motivoConferma = motivoConferma;
}
public TipoConfermaFilter getTipoConferma() {
return tipoConferma;
}
public Optional<TipoConfermaFilter> optionalTipoConferma() {
return Optional.ofNullable(tipoConferma);
}
public TipoConfermaFilter tipoConferma() {
if (tipoConferma == null) {
setTipoConferma(new TipoConfermaFilter());
}
return tipoConferma;
}
public void setTipoConferma(TipoConfermaFilter tipoConferma) {
this.tipoConferma = tipoConferma;
}
public LongFilter getConfermataDaId() {
return confermataDaId;
}
public Optional<LongFilter> optionalConfermataDaId() {
return Optional.ofNullable(confermataDaId);
}
public LongFilter confermataDaId() {
if (confermataDaId == null) {
setConfermataDaId(new LongFilter());
}
return confermataDaId;
}
public void setConfermataDaId(LongFilter confermataDaId) {
this.confermataDaId = confermataDaId;
}
public LongFilter getPrenotazioneId() {
return prenotazioneId;
}
public Optional<LongFilter> optionalPrenotazioneId() {
return Optional.ofNullable(prenotazioneId);
}
public LongFilter prenotazioneId() {
if (prenotazioneId == null) {
setPrenotazioneId(new LongFilter());
}
return prenotazioneId;
}
public void setPrenotazioneId(LongFilter prenotazioneId) {
this.prenotazioneId = prenotazioneId;
}
public Boolean getDistinct() {
return distinct;
}
public Optional<Boolean> optionalDistinct() {
return Optional.ofNullable(distinct);
}
public Boolean distinct() {
if (distinct == null) {
setDistinct(true);
}
return distinct;
}
public void setDistinct(Boolean distinct) {
this.distinct = distinct;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ConfermaCriteria that = (ConfermaCriteria) o;
return (
Objects.equals(id, that.id) &&
Objects.equals(motivoConferma, that.motivoConferma) &&
Objects.equals(tipoConferma, that.tipoConferma) &&
Objects.equals(confermataDaId, that.confermataDaId) &&
Objects.equals(prenotazioneId, that.prenotazioneId) &&
Objects.equals(distinct, that.distinct)
);
}
@Override
public int hashCode() {
return Objects.hash(id, motivoConferma, tipoConferma, confermataDaId, prenotazioneId, distinct);
}
// prettier-ignore
@Override
public String toString() {
return "ConfermaCriteria{" +
optionalId().map(f -> "id=" + f + ", ").orElse("") +
optionalMotivoConferma().map(f -> "motivoConferma=" + f + ", ").orElse("") +
optionalTipoConferma().map(f -> "tipoConferma=" + f + ", ").orElse("") +
optionalConfermataDaId().map(f -> "confermataDaId=" + f + ", ").orElse("") +
optionalPrenotazioneId().map(f -> "prenotazioneId=" + f + ", ").orElse("") +
optionalDistinct().map(f -> "distinct=" + f + ", ").orElse("") +
"}";
}
}

View File

@@ -0,0 +1,337 @@
package it.sw.pa.comune.artegna.service.criteria;
import it.sw.pa.comune.artegna.domain.enumeration.TipoCanaleNotifica;
import it.sw.pa.comune.artegna.domain.enumeration.TipoEventoNotifica;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.springdoc.core.annotations.ParameterObject;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.*;
/**
* Criteria class for the {@link it.sw.pa.comune.artegna.domain.Notifica} entity. This class is used
* in {@link it.sw.pa.comune.artegna.web.rest.NotificaResource} to receive all the possible filtering options from
* the Http GET request parameters.
* For example the following could be a valid request:
* {@code /notificas?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
@ParameterObject
@SuppressWarnings("common-java:DuplicatedBlocks")
public class NotificaCriteria implements Serializable, Criteria {
/**
* Class for filtering TipoCanaleNotifica
*/
public static class TipoCanaleNotificaFilter extends Filter<TipoCanaleNotifica> {
public TipoCanaleNotificaFilter() {}
public TipoCanaleNotificaFilter(TipoCanaleNotificaFilter filter) {
super(filter);
}
@Override
public TipoCanaleNotificaFilter copy() {
return new TipoCanaleNotificaFilter(this);
}
}
/**
* Class for filtering TipoEventoNotifica
*/
public static class TipoEventoNotificaFilter extends Filter<TipoEventoNotifica> {
public TipoEventoNotificaFilter() {}
public TipoEventoNotificaFilter(TipoEventoNotificaFilter filter) {
super(filter);
}
@Override
public TipoEventoNotificaFilter copy() {
return new TipoEventoNotificaFilter(this);
}
}
@Serial
private static final long serialVersionUID = 1L;
private LongFilter id;
private TipoCanaleNotificaFilter tipoCanale;
private TipoEventoNotificaFilter tipoEvento;
private StringFilter messaggio;
private BooleanFilter inviata;
private InstantFilter inviataAt;
private StringFilter errore;
private InstantFilter createdAt;
private LongFilter confermaId;
private Boolean distinct;
public NotificaCriteria() {}
public NotificaCriteria(NotificaCriteria other) {
this.id = other.optionalId().map(LongFilter::copy).orElse(null);
this.tipoCanale = other.optionalTipoCanale().map(TipoCanaleNotificaFilter::copy).orElse(null);
this.tipoEvento = other.optionalTipoEvento().map(TipoEventoNotificaFilter::copy).orElse(null);
this.messaggio = other.optionalMessaggio().map(StringFilter::copy).orElse(null);
this.inviata = other.optionalInviata().map(BooleanFilter::copy).orElse(null);
this.inviataAt = other.optionalInviataAt().map(InstantFilter::copy).orElse(null);
this.errore = other.optionalErrore().map(StringFilter::copy).orElse(null);
this.createdAt = other.optionalCreatedAt().map(InstantFilter::copy).orElse(null);
this.confermaId = other.optionalConfermaId().map(LongFilter::copy).orElse(null);
this.distinct = other.distinct;
}
@Override
public NotificaCriteria copy() {
return new NotificaCriteria(this);
}
public LongFilter getId() {
return id;
}
public Optional<LongFilter> optionalId() {
return Optional.ofNullable(id);
}
public LongFilter id() {
if (id == null) {
setId(new LongFilter());
}
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public TipoCanaleNotificaFilter getTipoCanale() {
return tipoCanale;
}
public Optional<TipoCanaleNotificaFilter> optionalTipoCanale() {
return Optional.ofNullable(tipoCanale);
}
public TipoCanaleNotificaFilter tipoCanale() {
if (tipoCanale == null) {
setTipoCanale(new TipoCanaleNotificaFilter());
}
return tipoCanale;
}
public void setTipoCanale(TipoCanaleNotificaFilter tipoCanale) {
this.tipoCanale = tipoCanale;
}
public TipoEventoNotificaFilter getTipoEvento() {
return tipoEvento;
}
public Optional<TipoEventoNotificaFilter> optionalTipoEvento() {
return Optional.ofNullable(tipoEvento);
}
public TipoEventoNotificaFilter tipoEvento() {
if (tipoEvento == null) {
setTipoEvento(new TipoEventoNotificaFilter());
}
return tipoEvento;
}
public void setTipoEvento(TipoEventoNotificaFilter tipoEvento) {
this.tipoEvento = tipoEvento;
}
public StringFilter getMessaggio() {
return messaggio;
}
public Optional<StringFilter> optionalMessaggio() {
return Optional.ofNullable(messaggio);
}
public StringFilter messaggio() {
if (messaggio == null) {
setMessaggio(new StringFilter());
}
return messaggio;
}
public void setMessaggio(StringFilter messaggio) {
this.messaggio = messaggio;
}
public BooleanFilter getInviata() {
return inviata;
}
public Optional<BooleanFilter> optionalInviata() {
return Optional.ofNullable(inviata);
}
public BooleanFilter inviata() {
if (inviata == null) {
setInviata(new BooleanFilter());
}
return inviata;
}
public void setInviata(BooleanFilter inviata) {
this.inviata = inviata;
}
public InstantFilter getInviataAt() {
return inviataAt;
}
public Optional<InstantFilter> optionalInviataAt() {
return Optional.ofNullable(inviataAt);
}
public InstantFilter inviataAt() {
if (inviataAt == null) {
setInviataAt(new InstantFilter());
}
return inviataAt;
}
public void setInviataAt(InstantFilter inviataAt) {
this.inviataAt = inviataAt;
}
public StringFilter getErrore() {
return errore;
}
public Optional<StringFilter> optionalErrore() {
return Optional.ofNullable(errore);
}
public StringFilter errore() {
if (errore == null) {
setErrore(new StringFilter());
}
return errore;
}
public void setErrore(StringFilter errore) {
this.errore = errore;
}
public InstantFilter getCreatedAt() {
return createdAt;
}
public Optional<InstantFilter> optionalCreatedAt() {
return Optional.ofNullable(createdAt);
}
public InstantFilter createdAt() {
if (createdAt == null) {
setCreatedAt(new InstantFilter());
}
return createdAt;
}
public void setCreatedAt(InstantFilter createdAt) {
this.createdAt = createdAt;
}
public LongFilter getConfermaId() {
return confermaId;
}
public Optional<LongFilter> optionalConfermaId() {
return Optional.ofNullable(confermaId);
}
public LongFilter confermaId() {
if (confermaId == null) {
setConfermaId(new LongFilter());
}
return confermaId;
}
public void setConfermaId(LongFilter confermaId) {
this.confermaId = confermaId;
}
public Boolean getDistinct() {
return distinct;
}
public Optional<Boolean> optionalDistinct() {
return Optional.ofNullable(distinct);
}
public Boolean distinct() {
if (distinct == null) {
setDistinct(true);
}
return distinct;
}
public void setDistinct(Boolean distinct) {
this.distinct = distinct;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final NotificaCriteria that = (NotificaCriteria) o;
return (
Objects.equals(id, that.id) &&
Objects.equals(tipoCanale, that.tipoCanale) &&
Objects.equals(tipoEvento, that.tipoEvento) &&
Objects.equals(messaggio, that.messaggio) &&
Objects.equals(inviata, that.inviata) &&
Objects.equals(inviataAt, that.inviataAt) &&
Objects.equals(errore, that.errore) &&
Objects.equals(createdAt, that.createdAt) &&
Objects.equals(confermaId, that.confermaId) &&
Objects.equals(distinct, that.distinct)
);
}
@Override
public int hashCode() {
return Objects.hash(id, tipoCanale, tipoEvento, messaggio, inviata, inviataAt, errore, createdAt, confermaId, distinct);
}
// prettier-ignore
@Override
public String toString() {
return "NotificaCriteria{" +
optionalId().map(f -> "id=" + f + ", ").orElse("") +
optionalTipoCanale().map(f -> "tipoCanale=" + f + ", ").orElse("") +
optionalTipoEvento().map(f -> "tipoEvento=" + f + ", ").orElse("") +
optionalMessaggio().map(f -> "messaggio=" + f + ", ").orElse("") +
optionalInviata().map(f -> "inviata=" + f + ", ").orElse("") +
optionalInviataAt().map(f -> "inviataAt=" + f + ", ").orElse("") +
optionalErrore().map(f -> "errore=" + f + ", ").orElse("") +
optionalCreatedAt().map(f -> "createdAt=" + f + ", ").orElse("") +
optionalConfermaId().map(f -> "confermaId=" + f + ", ").orElse("") +
optionalDistinct().map(f -> "distinct=" + f + ", ").orElse("") +
"}";
}
}

View File

@@ -0,0 +1,355 @@
package it.sw.pa.comune.artegna.service.criteria;
import it.sw.pa.comune.artegna.domain.enumeration.StatoPrenotazione;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.springdoc.core.annotations.ParameterObject;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.*;
/**
* Criteria class for the {@link it.sw.pa.comune.artegna.domain.Prenotazione} entity. This class is used
* in {@link it.sw.pa.comune.artegna.web.rest.PrenotazioneResource} to receive all the possible filtering options from
* the Http GET request parameters.
* For example the following could be a valid request:
* {@code /prenotaziones?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
@ParameterObject
@SuppressWarnings("common-java:DuplicatedBlocks")
public class PrenotazioneCriteria implements Serializable, Criteria {
/**
* Class for filtering StatoPrenotazione
*/
public static class StatoPrenotazioneFilter extends Filter<StatoPrenotazione> {
public StatoPrenotazioneFilter() {}
public StatoPrenotazioneFilter(StatoPrenotazioneFilter filter) {
super(filter);
}
@Override
public StatoPrenotazioneFilter copy() {
return new StatoPrenotazioneFilter(this);
}
}
@Serial
private static final long serialVersionUID = 1L;
private LongFilter id;
private InstantFilter oraInizio;
private InstantFilter oraFine;
private StatoPrenotazioneFilter stato;
private StringFilter motivoEvento;
private IntegerFilter numeroPartecipanti;
private StringFilter noteUtente;
private LongFilter confermaId;
private LongFilter utenteId;
private LongFilter strutturaId;
private Boolean distinct;
public PrenotazioneCriteria() {}
public PrenotazioneCriteria(PrenotazioneCriteria other) {
this.id = other.optionalId().map(LongFilter::copy).orElse(null);
this.oraInizio = other.optionalOraInizio().map(InstantFilter::copy).orElse(null);
this.oraFine = other.optionalOraFine().map(InstantFilter::copy).orElse(null);
this.stato = other.optionalStato().map(StatoPrenotazioneFilter::copy).orElse(null);
this.motivoEvento = other.optionalMotivoEvento().map(StringFilter::copy).orElse(null);
this.numeroPartecipanti = other.optionalNumeroPartecipanti().map(IntegerFilter::copy).orElse(null);
this.noteUtente = other.optionalNoteUtente().map(StringFilter::copy).orElse(null);
this.confermaId = other.optionalConfermaId().map(LongFilter::copy).orElse(null);
this.utenteId = other.optionalUtenteId().map(LongFilter::copy).orElse(null);
this.strutturaId = other.optionalStrutturaId().map(LongFilter::copy).orElse(null);
this.distinct = other.distinct;
}
@Override
public PrenotazioneCriteria copy() {
return new PrenotazioneCriteria(this);
}
public LongFilter getId() {
return id;
}
public Optional<LongFilter> optionalId() {
return Optional.ofNullable(id);
}
public LongFilter id() {
if (id == null) {
setId(new LongFilter());
}
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public InstantFilter getOraInizio() {
return oraInizio;
}
public Optional<InstantFilter> optionalOraInizio() {
return Optional.ofNullable(oraInizio);
}
public InstantFilter oraInizio() {
if (oraInizio == null) {
setOraInizio(new InstantFilter());
}
return oraInizio;
}
public void setOraInizio(InstantFilter oraInizio) {
this.oraInizio = oraInizio;
}
public InstantFilter getOraFine() {
return oraFine;
}
public Optional<InstantFilter> optionalOraFine() {
return Optional.ofNullable(oraFine);
}
public InstantFilter oraFine() {
if (oraFine == null) {
setOraFine(new InstantFilter());
}
return oraFine;
}
public void setOraFine(InstantFilter oraFine) {
this.oraFine = oraFine;
}
public StatoPrenotazioneFilter getStato() {
return stato;
}
public Optional<StatoPrenotazioneFilter> optionalStato() {
return Optional.ofNullable(stato);
}
public StatoPrenotazioneFilter stato() {
if (stato == null) {
setStato(new StatoPrenotazioneFilter());
}
return stato;
}
public void setStato(StatoPrenotazioneFilter stato) {
this.stato = stato;
}
public StringFilter getMotivoEvento() {
return motivoEvento;
}
public Optional<StringFilter> optionalMotivoEvento() {
return Optional.ofNullable(motivoEvento);
}
public StringFilter motivoEvento() {
if (motivoEvento == null) {
setMotivoEvento(new StringFilter());
}
return motivoEvento;
}
public void setMotivoEvento(StringFilter motivoEvento) {
this.motivoEvento = motivoEvento;
}
public IntegerFilter getNumeroPartecipanti() {
return numeroPartecipanti;
}
public Optional<IntegerFilter> optionalNumeroPartecipanti() {
return Optional.ofNullable(numeroPartecipanti);
}
public IntegerFilter numeroPartecipanti() {
if (numeroPartecipanti == null) {
setNumeroPartecipanti(new IntegerFilter());
}
return numeroPartecipanti;
}
public void setNumeroPartecipanti(IntegerFilter numeroPartecipanti) {
this.numeroPartecipanti = numeroPartecipanti;
}
public StringFilter getNoteUtente() {
return noteUtente;
}
public Optional<StringFilter> optionalNoteUtente() {
return Optional.ofNullable(noteUtente);
}
public StringFilter noteUtente() {
if (noteUtente == null) {
setNoteUtente(new StringFilter());
}
return noteUtente;
}
public void setNoteUtente(StringFilter noteUtente) {
this.noteUtente = noteUtente;
}
public LongFilter getConfermaId() {
return confermaId;
}
public Optional<LongFilter> optionalConfermaId() {
return Optional.ofNullable(confermaId);
}
public LongFilter confermaId() {
if (confermaId == null) {
setConfermaId(new LongFilter());
}
return confermaId;
}
public void setConfermaId(LongFilter confermaId) {
this.confermaId = confermaId;
}
public LongFilter getUtenteId() {
return utenteId;
}
public Optional<LongFilter> optionalUtenteId() {
return Optional.ofNullable(utenteId);
}
public LongFilter utenteId() {
if (utenteId == null) {
setUtenteId(new LongFilter());
}
return utenteId;
}
public void setUtenteId(LongFilter utenteId) {
this.utenteId = utenteId;
}
public LongFilter getStrutturaId() {
return strutturaId;
}
public Optional<LongFilter> optionalStrutturaId() {
return Optional.ofNullable(strutturaId);
}
public LongFilter strutturaId() {
if (strutturaId == null) {
setStrutturaId(new LongFilter());
}
return strutturaId;
}
public void setStrutturaId(LongFilter strutturaId) {
this.strutturaId = strutturaId;
}
public Boolean getDistinct() {
return distinct;
}
public Optional<Boolean> optionalDistinct() {
return Optional.ofNullable(distinct);
}
public Boolean distinct() {
if (distinct == null) {
setDistinct(true);
}
return distinct;
}
public void setDistinct(Boolean distinct) {
this.distinct = distinct;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final PrenotazioneCriteria that = (PrenotazioneCriteria) o;
return (
Objects.equals(id, that.id) &&
Objects.equals(oraInizio, that.oraInizio) &&
Objects.equals(oraFine, that.oraFine) &&
Objects.equals(stato, that.stato) &&
Objects.equals(motivoEvento, that.motivoEvento) &&
Objects.equals(numeroPartecipanti, that.numeroPartecipanti) &&
Objects.equals(noteUtente, that.noteUtente) &&
Objects.equals(confermaId, that.confermaId) &&
Objects.equals(utenteId, that.utenteId) &&
Objects.equals(strutturaId, that.strutturaId) &&
Objects.equals(distinct, that.distinct)
);
}
@Override
public int hashCode() {
return Objects.hash(
id,
oraInizio,
oraFine,
stato,
motivoEvento,
numeroPartecipanti,
noteUtente,
confermaId,
utenteId,
strutturaId,
distinct
);
}
// prettier-ignore
@Override
public String toString() {
return "PrenotazioneCriteria{" +
optionalId().map(f -> "id=" + f + ", ").orElse("") +
optionalOraInizio().map(f -> "oraInizio=" + f + ", ").orElse("") +
optionalOraFine().map(f -> "oraFine=" + f + ", ").orElse("") +
optionalStato().map(f -> "stato=" + f + ", ").orElse("") +
optionalMotivoEvento().map(f -> "motivoEvento=" + f + ", ").orElse("") +
optionalNumeroPartecipanti().map(f -> "numeroPartecipanti=" + f + ", ").orElse("") +
optionalNoteUtente().map(f -> "noteUtente=" + f + ", ").orElse("") +
optionalConfermaId().map(f -> "confermaId=" + f + ", ").orElse("") +
optionalUtenteId().map(f -> "utenteId=" + f + ", ").orElse("") +
optionalStrutturaId().map(f -> "strutturaId=" + f + ", ").orElse("") +
optionalDistinct().map(f -> "distinct=" + f + ", ").orElse("") +
"}";
}
}

View File

@@ -0,0 +1,362 @@
package it.sw.pa.comune.artegna.service.criteria;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.springdoc.core.annotations.ParameterObject;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.*;
/**
* Criteria class for the {@link it.sw.pa.comune.artegna.domain.Struttura} entity. This class is used
* in {@link it.sw.pa.comune.artegna.web.rest.StrutturaResource} to receive all the possible filtering options from
* the Http GET request parameters.
* For example the following could be a valid request:
* {@code /strutturas?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
@ParameterObject
@SuppressWarnings("common-java:DuplicatedBlocks")
public class StrutturaCriteria implements Serializable, Criteria {
@Serial
private static final long serialVersionUID = 1L;
private LongFilter id;
private StringFilter nome;
private StringFilter descrizione;
private StringFilter indirizzo;
private IntegerFilter capienzaMax;
private BooleanFilter attiva;
private StringFilter fotoUrl;
private InstantFilter createdAt;
private InstantFilter updatedAt;
private LongFilter disponibilitaId;
private LongFilter moduliLiberatorieId;
private Boolean distinct;
public StrutturaCriteria() {}
public StrutturaCriteria(StrutturaCriteria other) {
this.id = other.optionalId().map(LongFilter::copy).orElse(null);
this.nome = other.optionalNome().map(StringFilter::copy).orElse(null);
this.descrizione = other.optionalDescrizione().map(StringFilter::copy).orElse(null);
this.indirizzo = other.optionalIndirizzo().map(StringFilter::copy).orElse(null);
this.capienzaMax = other.optionalCapienzaMax().map(IntegerFilter::copy).orElse(null);
this.attiva = other.optionalAttiva().map(BooleanFilter::copy).orElse(null);
this.fotoUrl = other.optionalFotoUrl().map(StringFilter::copy).orElse(null);
this.createdAt = other.optionalCreatedAt().map(InstantFilter::copy).orElse(null);
this.updatedAt = other.optionalUpdatedAt().map(InstantFilter::copy).orElse(null);
this.disponibilitaId = other.optionalDisponibilitaId().map(LongFilter::copy).orElse(null);
this.moduliLiberatorieId = other.optionalModuliLiberatorieId().map(LongFilter::copy).orElse(null);
this.distinct = other.distinct;
}
@Override
public StrutturaCriteria copy() {
return new StrutturaCriteria(this);
}
public LongFilter getId() {
return id;
}
public Optional<LongFilter> optionalId() {
return Optional.ofNullable(id);
}
public LongFilter id() {
if (id == null) {
setId(new LongFilter());
}
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public StringFilter getNome() {
return nome;
}
public Optional<StringFilter> optionalNome() {
return Optional.ofNullable(nome);
}
public StringFilter nome() {
if (nome == null) {
setNome(new StringFilter());
}
return nome;
}
public void setNome(StringFilter nome) {
this.nome = nome;
}
public StringFilter getDescrizione() {
return descrizione;
}
public Optional<StringFilter> optionalDescrizione() {
return Optional.ofNullable(descrizione);
}
public StringFilter descrizione() {
if (descrizione == null) {
setDescrizione(new StringFilter());
}
return descrizione;
}
public void setDescrizione(StringFilter descrizione) {
this.descrizione = descrizione;
}
public StringFilter getIndirizzo() {
return indirizzo;
}
public Optional<StringFilter> optionalIndirizzo() {
return Optional.ofNullable(indirizzo);
}
public StringFilter indirizzo() {
if (indirizzo == null) {
setIndirizzo(new StringFilter());
}
return indirizzo;
}
public void setIndirizzo(StringFilter indirizzo) {
this.indirizzo = indirizzo;
}
public IntegerFilter getCapienzaMax() {
return capienzaMax;
}
public Optional<IntegerFilter> optionalCapienzaMax() {
return Optional.ofNullable(capienzaMax);
}
public IntegerFilter capienzaMax() {
if (capienzaMax == null) {
setCapienzaMax(new IntegerFilter());
}
return capienzaMax;
}
public void setCapienzaMax(IntegerFilter capienzaMax) {
this.capienzaMax = capienzaMax;
}
public BooleanFilter getAttiva() {
return attiva;
}
public Optional<BooleanFilter> optionalAttiva() {
return Optional.ofNullable(attiva);
}
public BooleanFilter attiva() {
if (attiva == null) {
setAttiva(new BooleanFilter());
}
return attiva;
}
public void setAttiva(BooleanFilter attiva) {
this.attiva = attiva;
}
public StringFilter getFotoUrl() {
return fotoUrl;
}
public Optional<StringFilter> optionalFotoUrl() {
return Optional.ofNullable(fotoUrl);
}
public StringFilter fotoUrl() {
if (fotoUrl == null) {
setFotoUrl(new StringFilter());
}
return fotoUrl;
}
public void setFotoUrl(StringFilter fotoUrl) {
this.fotoUrl = fotoUrl;
}
public InstantFilter getCreatedAt() {
return createdAt;
}
public Optional<InstantFilter> optionalCreatedAt() {
return Optional.ofNullable(createdAt);
}
public InstantFilter createdAt() {
if (createdAt == null) {
setCreatedAt(new InstantFilter());
}
return createdAt;
}
public void setCreatedAt(InstantFilter createdAt) {
this.createdAt = createdAt;
}
public InstantFilter getUpdatedAt() {
return updatedAt;
}
public Optional<InstantFilter> optionalUpdatedAt() {
return Optional.ofNullable(updatedAt);
}
public InstantFilter updatedAt() {
if (updatedAt == null) {
setUpdatedAt(new InstantFilter());
}
return updatedAt;
}
public void setUpdatedAt(InstantFilter updatedAt) {
this.updatedAt = updatedAt;
}
public LongFilter getDisponibilitaId() {
return disponibilitaId;
}
public Optional<LongFilter> optionalDisponibilitaId() {
return Optional.ofNullable(disponibilitaId);
}
public LongFilter disponibilitaId() {
if (disponibilitaId == null) {
setDisponibilitaId(new LongFilter());
}
return disponibilitaId;
}
public void setDisponibilitaId(LongFilter disponibilitaId) {
this.disponibilitaId = disponibilitaId;
}
public LongFilter getModuliLiberatorieId() {
return moduliLiberatorieId;
}
public Optional<LongFilter> optionalModuliLiberatorieId() {
return Optional.ofNullable(moduliLiberatorieId);
}
public LongFilter moduliLiberatorieId() {
if (moduliLiberatorieId == null) {
setModuliLiberatorieId(new LongFilter());
}
return moduliLiberatorieId;
}
public void setModuliLiberatorieId(LongFilter moduliLiberatorieId) {
this.moduliLiberatorieId = moduliLiberatorieId;
}
public Boolean getDistinct() {
return distinct;
}
public Optional<Boolean> optionalDistinct() {
return Optional.ofNullable(distinct);
}
public Boolean distinct() {
if (distinct == null) {
setDistinct(true);
}
return distinct;
}
public void setDistinct(Boolean distinct) {
this.distinct = distinct;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final StrutturaCriteria that = (StrutturaCriteria) o;
return (
Objects.equals(id, that.id) &&
Objects.equals(nome, that.nome) &&
Objects.equals(descrizione, that.descrizione) &&
Objects.equals(indirizzo, that.indirizzo) &&
Objects.equals(capienzaMax, that.capienzaMax) &&
Objects.equals(attiva, that.attiva) &&
Objects.equals(fotoUrl, that.fotoUrl) &&
Objects.equals(createdAt, that.createdAt) &&
Objects.equals(updatedAt, that.updatedAt) &&
Objects.equals(disponibilitaId, that.disponibilitaId) &&
Objects.equals(moduliLiberatorieId, that.moduliLiberatorieId) &&
Objects.equals(distinct, that.distinct)
);
}
@Override
public int hashCode() {
return Objects.hash(
id,
nome,
descrizione,
indirizzo,
capienzaMax,
attiva,
fotoUrl,
createdAt,
updatedAt,
disponibilitaId,
moduliLiberatorieId,
distinct
);
}
// prettier-ignore
@Override
public String toString() {
return "StrutturaCriteria{" +
optionalId().map(f -> "id=" + f + ", ").orElse("") +
optionalNome().map(f -> "nome=" + f + ", ").orElse("") +
optionalDescrizione().map(f -> "descrizione=" + f + ", ").orElse("") +
optionalIndirizzo().map(f -> "indirizzo=" + f + ", ").orElse("") +
optionalCapienzaMax().map(f -> "capienzaMax=" + f + ", ").orElse("") +
optionalAttiva().map(f -> "attiva=" + f + ", ").orElse("") +
optionalFotoUrl().map(f -> "fotoUrl=" + f + ", ").orElse("") +
optionalCreatedAt().map(f -> "createdAt=" + f + ", ").orElse("") +
optionalUpdatedAt().map(f -> "updatedAt=" + f + ", ").orElse("") +
optionalDisponibilitaId().map(f -> "disponibilitaId=" + f + ", ").orElse("") +
optionalModuliLiberatorieId().map(f -> "moduliLiberatorieId=" + f + ", ").orElse("") +
optionalDistinct().map(f -> "distinct=" + f + ", ").orElse("") +
"}";
}
}

View File

@@ -0,0 +1,4 @@
/**
* This package file was generated by JHipster
*/
package it.sw.pa.comune.artegna.service.criteria;

View File

@@ -0,0 +1,130 @@
package it.sw.pa.comune.artegna.service.dto;
import it.sw.pa.comune.artegna.domain.enumeration.AzioneAudit;
import it.sw.pa.comune.artegna.domain.enumeration.TipoEntita;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.AuditLog} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class AuditLogDTO implements Serializable {
private Long id;
private TipoEntita entitaTipo;
private Long entitaId;
private AzioneAudit azione;
private String dettagli;
private String ipAddress;
private Instant createdAt;
private UtenteAppDTO utente;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public TipoEntita getEntitaTipo() {
return entitaTipo;
}
public void setEntitaTipo(TipoEntita entitaTipo) {
this.entitaTipo = entitaTipo;
}
public Long getEntitaId() {
return entitaId;
}
public void setEntitaId(Long entitaId) {
this.entitaId = entitaId;
}
public AzioneAudit getAzione() {
return azione;
}
public void setAzione(AzioneAudit azione) {
this.azione = azione;
}
public String getDettagli() {
return dettagli;
}
public void setDettagli(String dettagli) {
this.dettagli = dettagli;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public Instant getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public UtenteAppDTO getUtente() {
return utente;
}
public void setUtente(UtenteAppDTO utente) {
this.utente = utente;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof AuditLogDTO)) {
return false;
}
AuditLogDTO auditLogDTO = (AuditLogDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, auditLogDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "AuditLogDTO{" +
"id=" + getId() +
", entitaTipo='" + getEntitaTipo() + "'" +
", entitaId=" + getEntitaId() +
", azione='" + getAzione() + "'" +
", dettagli='" + getDettagli() + "'" +
", ipAddress='" + getIpAddress() + "'" +
", createdAt='" + getCreatedAt() + "'" +
", utente=" + getUtente() +
"}";
}
}

View File

@@ -0,0 +1,84 @@
package it.sw.pa.comune.artegna.service.dto;
import it.sw.pa.comune.artegna.domain.enumeration.TipoConferma;
import java.io.Serializable;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.Conferma} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class ConfermaDTO implements Serializable {
private Long id;
private String motivoConferma;
private TipoConferma tipoConferma;
private UtenteAppDTO confermataDa;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMotivoConferma() {
return motivoConferma;
}
public void setMotivoConferma(String motivoConferma) {
this.motivoConferma = motivoConferma;
}
public TipoConferma getTipoConferma() {
return tipoConferma;
}
public void setTipoConferma(TipoConferma tipoConferma) {
this.tipoConferma = tipoConferma;
}
public UtenteAppDTO getConfermataDa() {
return confermataDa;
}
public void setConfermataDa(UtenteAppDTO confermataDa) {
this.confermataDa = confermataDa;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ConfermaDTO)) {
return false;
}
ConfermaDTO confermaDTO = (ConfermaDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, confermaDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "ConfermaDTO{" +
"id=" + getId() +
", motivoConferma='" + getMotivoConferma() + "'" +
", tipoConferma='" + getTipoConferma() + "'" +
", confermataDa=" + getConfermataDa() +
"}";
}
}

View File

@@ -0,0 +1,153 @@
package it.sw.pa.comune.artegna.service.dto;
import it.sw.pa.comune.artegna.domain.enumeration.GiornoSettimana;
import it.sw.pa.comune.artegna.domain.enumeration.TipoDisponibilita;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDate;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.Disponibilita} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class DisponibilitaDTO implements Serializable {
private Long id;
private GiornoSettimana giornoSettimana;
private LocalDate dataSpecifica;
private Instant oraInizio;
private Instant oraFine;
private String orarioInizio;
private String orarioFine;
private TipoDisponibilita tipo;
private String note;
private StrutturaDTO struttura;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public GiornoSettimana getGiornoSettimana() {
return giornoSettimana;
}
public void setGiornoSettimana(GiornoSettimana giornoSettimana) {
this.giornoSettimana = giornoSettimana;
}
public LocalDate getDataSpecifica() {
return dataSpecifica;
}
public void setDataSpecifica(LocalDate dataSpecifica) {
this.dataSpecifica = dataSpecifica;
}
public Instant getOraInizio() {
return oraInizio;
}
public void setOraInizio(Instant oraInizio) {
this.oraInizio = oraInizio;
}
public Instant getOraFine() {
return oraFine;
}
public void setOraFine(Instant oraFine) {
this.oraFine = oraFine;
}
public String getOrarioInizio() {
return orarioInizio;
}
public void setOrarioInizio(String orarioInizio) {
this.orarioInizio = orarioInizio;
}
public String getOrarioFine() {
return orarioFine;
}
public void setOrarioFine(String orarioFine) {
this.orarioFine = orarioFine;
}
public TipoDisponibilita getTipo() {
return tipo;
}
public void setTipo(TipoDisponibilita tipo) {
this.tipo = tipo;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public StrutturaDTO getStruttura() {
return struttura;
}
public void setStruttura(StrutturaDTO struttura) {
this.struttura = struttura;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof DisponibilitaDTO)) {
return false;
}
DisponibilitaDTO disponibilitaDTO = (DisponibilitaDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, disponibilitaDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "DisponibilitaDTO{" +
"id=" + getId() +
", giornoSettimana='" + getGiornoSettimana() + "'" +
", dataSpecifica='" + getDataSpecifica() + "'" +
", oraInizio='" + getOraInizio() + "'" +
", oraFine='" + getOraFine() + "'" +
", orarioInizio='" + getOrarioInizio() + "'" +
", orarioFine='" + getOrarioFine() + "'" +
", tipo='" + getTipo() + "'" +
", note='" + getNote() + "'" +
", struttura=" + getStruttura() +
"}";
}
}

View File

@@ -0,0 +1,84 @@
package it.sw.pa.comune.artegna.service.dto;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.Liberatoria} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class LiberatoriaDTO implements Serializable {
private Long id;
private Instant accettata;
private UtenteAppDTO utente;
private ModelloLiberatoriaDTO modelloLiberatoria;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Instant getAccettata() {
return accettata;
}
public void setAccettata(Instant accettata) {
this.accettata = accettata;
}
public UtenteAppDTO getUtente() {
return utente;
}
public void setUtente(UtenteAppDTO utente) {
this.utente = utente;
}
public ModelloLiberatoriaDTO getModelloLiberatoria() {
return modelloLiberatoria;
}
public void setModelloLiberatoria(ModelloLiberatoriaDTO modelloLiberatoria) {
this.modelloLiberatoria = modelloLiberatoria;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof LiberatoriaDTO)) {
return false;
}
LiberatoriaDTO liberatoriaDTO = (LiberatoriaDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, liberatoriaDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "LiberatoriaDTO{" +
"id=" + getId() +
", accettata='" + getAccettata() + "'" +
", utente=" + getUtente() +
", modelloLiberatoria=" + getModelloLiberatoria() +
"}";
}
}

View File

@@ -0,0 +1,95 @@
package it.sw.pa.comune.artegna.service.dto;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.Messaggio} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class MessaggioDTO implements Serializable {
private Long id;
private Instant spedito;
private String testo;
private Instant letto;
private UtenteAppDTO utente;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Instant getSpedito() {
return spedito;
}
public void setSpedito(Instant spedito) {
this.spedito = spedito;
}
public String getTesto() {
return testo;
}
public void setTesto(String testo) {
this.testo = testo;
}
public Instant getLetto() {
return letto;
}
public void setLetto(Instant letto) {
this.letto = letto;
}
public UtenteAppDTO getUtente() {
return utente;
}
public void setUtente(UtenteAppDTO utente) {
this.utente = utente;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof MessaggioDTO)) {
return false;
}
MessaggioDTO messaggioDTO = (MessaggioDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, messaggioDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "MessaggioDTO{" +
"id=" + getId() +
", spedito='" + getSpedito() + "'" +
", testo='" + getTesto() + "'" +
", letto='" + getLetto() + "'" +
", utente=" + getUtente() +
"}";
}
}

View File

@@ -0,0 +1,129 @@
package it.sw.pa.comune.artegna.service.dto;
import jakarta.persistence.Lob;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.ModelloLiberatoria} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class ModelloLiberatoriaDTO implements Serializable {
private Long id;
private String nome;
private String testo;
@Lob
private byte[] documento;
private String documentoContentType;
private Instant validoDal;
private Instant validoAl;
private StrutturaDTO struttura;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getTesto() {
return testo;
}
public void setTesto(String testo) {
this.testo = testo;
}
public byte[] getDocumento() {
return documento;
}
public void setDocumento(byte[] documento) {
this.documento = documento;
}
public String getDocumentoContentType() {
return documentoContentType;
}
public void setDocumentoContentType(String documentoContentType) {
this.documentoContentType = documentoContentType;
}
public Instant getValidoDal() {
return validoDal;
}
public void setValidoDal(Instant validoDal) {
this.validoDal = validoDal;
}
public Instant getValidoAl() {
return validoAl;
}
public void setValidoAl(Instant validoAl) {
this.validoAl = validoAl;
}
public StrutturaDTO getStruttura() {
return struttura;
}
public void setStruttura(StrutturaDTO struttura) {
this.struttura = struttura;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ModelloLiberatoriaDTO)) {
return false;
}
ModelloLiberatoriaDTO modelloLiberatoriaDTO = (ModelloLiberatoriaDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, modelloLiberatoriaDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "ModelloLiberatoriaDTO{" +
"id=" + getId() +
", nome='" + getNome() + "'" +
", testo='" + getTesto() + "'" +
", documento='" + getDocumento() + "'" +
", validoDal='" + getValidoDal() + "'" +
", validoAl='" + getValidoAl() + "'" +
", struttura=" + getStruttura() +
"}";
}
}

View File

@@ -0,0 +1,141 @@
package it.sw.pa.comune.artegna.service.dto;
import it.sw.pa.comune.artegna.domain.enumeration.TipoCanaleNotifica;
import it.sw.pa.comune.artegna.domain.enumeration.TipoEventoNotifica;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.Notifica} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class NotificaDTO implements Serializable {
private Long id;
private TipoCanaleNotifica tipoCanale;
private TipoEventoNotifica tipoEvento;
private String messaggio;
private Boolean inviata;
private Instant inviataAt;
private String errore;
private Instant createdAt;
private ConfermaDTO conferma;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public TipoCanaleNotifica getTipoCanale() {
return tipoCanale;
}
public void setTipoCanale(TipoCanaleNotifica tipoCanale) {
this.tipoCanale = tipoCanale;
}
public TipoEventoNotifica getTipoEvento() {
return tipoEvento;
}
public void setTipoEvento(TipoEventoNotifica tipoEvento) {
this.tipoEvento = tipoEvento;
}
public String getMessaggio() {
return messaggio;
}
public void setMessaggio(String messaggio) {
this.messaggio = messaggio;
}
public Boolean getInviata() {
return inviata;
}
public void setInviata(Boolean inviata) {
this.inviata = inviata;
}
public Instant getInviataAt() {
return inviataAt;
}
public void setInviataAt(Instant inviataAt) {
this.inviataAt = inviataAt;
}
public String getErrore() {
return errore;
}
public void setErrore(String errore) {
this.errore = errore;
}
public Instant getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public ConfermaDTO getConferma() {
return conferma;
}
public void setConferma(ConfermaDTO conferma) {
this.conferma = conferma;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof NotificaDTO)) {
return false;
}
NotificaDTO notificaDTO = (NotificaDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, notificaDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "NotificaDTO{" +
"id=" + getId() +
", tipoCanale='" + getTipoCanale() + "'" +
", tipoEvento='" + getTipoEvento() + "'" +
", messaggio='" + getMessaggio() + "'" +
", inviata='" + getInviata() + "'" +
", inviataAt='" + getInviataAt() + "'" +
", errore='" + getErrore() + "'" +
", createdAt='" + getCreatedAt() + "'" +
", conferma=" + getConferma() +
"}";
}
}

View File

@@ -0,0 +1,151 @@
package it.sw.pa.comune.artegna.service.dto;
import it.sw.pa.comune.artegna.domain.enumeration.StatoPrenotazione;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.Prenotazione} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class PrenotazioneDTO implements Serializable {
private Long id;
private Instant oraInizio;
private Instant oraFine;
private StatoPrenotazione stato;
private String motivoEvento;
private Integer numeroPartecipanti;
private String noteUtente;
private ConfermaDTO conferma;
private UtenteAppDTO utente;
private StrutturaDTO struttura;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Instant getOraInizio() {
return oraInizio;
}
public void setOraInizio(Instant oraInizio) {
this.oraInizio = oraInizio;
}
public Instant getOraFine() {
return oraFine;
}
public void setOraFine(Instant oraFine) {
this.oraFine = oraFine;
}
public StatoPrenotazione getStato() {
return stato;
}
public void setStato(StatoPrenotazione stato) {
this.stato = stato;
}
public String getMotivoEvento() {
return motivoEvento;
}
public void setMotivoEvento(String motivoEvento) {
this.motivoEvento = motivoEvento;
}
public Integer getNumeroPartecipanti() {
return numeroPartecipanti;
}
public void setNumeroPartecipanti(Integer numeroPartecipanti) {
this.numeroPartecipanti = numeroPartecipanti;
}
public String getNoteUtente() {
return noteUtente;
}
public void setNoteUtente(String noteUtente) {
this.noteUtente = noteUtente;
}
public ConfermaDTO getConferma() {
return conferma;
}
public void setConferma(ConfermaDTO conferma) {
this.conferma = conferma;
}
public UtenteAppDTO getUtente() {
return utente;
}
public void setUtente(UtenteAppDTO utente) {
this.utente = utente;
}
public StrutturaDTO getStruttura() {
return struttura;
}
public void setStruttura(StrutturaDTO struttura) {
this.struttura = struttura;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PrenotazioneDTO)) {
return false;
}
PrenotazioneDTO prenotazioneDTO = (PrenotazioneDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, prenotazioneDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "PrenotazioneDTO{" +
"id=" + getId() +
", oraInizio='" + getOraInizio() + "'" +
", oraFine='" + getOraFine() + "'" +
", stato='" + getStato() + "'" +
", motivoEvento='" + getMotivoEvento() + "'" +
", numeroPartecipanti=" + getNumeroPartecipanti() +
", noteUtente='" + getNoteUtente() + "'" +
", conferma=" + getConferma() +
", utente=" + getUtente() +
", struttura=" + getStruttura() +
"}";
}
}

View File

@@ -0,0 +1,139 @@
package it.sw.pa.comune.artegna.service.dto;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.Struttura} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class StrutturaDTO implements Serializable {
private Long id;
private String nome;
private String descrizione;
private String indirizzo;
private Integer capienzaMax;
private Boolean attiva;
private String fotoUrl;
private Instant createdAt;
private Instant updatedAt;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getDescrizione() {
return descrizione;
}
public void setDescrizione(String descrizione) {
this.descrizione = descrizione;
}
public String getIndirizzo() {
return indirizzo;
}
public void setIndirizzo(String indirizzo) {
this.indirizzo = indirizzo;
}
public Integer getCapienzaMax() {
return capienzaMax;
}
public void setCapienzaMax(Integer capienzaMax) {
this.capienzaMax = capienzaMax;
}
public Boolean getAttiva() {
return attiva;
}
public void setAttiva(Boolean attiva) {
this.attiva = attiva;
}
public String getFotoUrl() {
return fotoUrl;
}
public void setFotoUrl(String fotoUrl) {
this.fotoUrl = fotoUrl;
}
public Instant getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public Instant getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Instant updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof StrutturaDTO)) {
return false;
}
StrutturaDTO strutturaDTO = (StrutturaDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, strutturaDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "StrutturaDTO{" +
"id=" + getId() +
", nome='" + getNome() + "'" +
", descrizione='" + getDescrizione() + "'" +
", indirizzo='" + getIndirizzo() + "'" +
", capienzaMax=" + getCapienzaMax() +
", attiva='" + getAttiva() + "'" +
", fotoUrl='" + getFotoUrl() + "'" +
", createdAt='" + getCreatedAt() + "'" +
", updatedAt='" + getUpdatedAt() + "'" +
"}";
}
}

View File

@@ -0,0 +1,221 @@
package it.sw.pa.comune.artegna.service.dto;
import it.sw.pa.comune.artegna.domain.enumeration.Ruolo;
import jakarta.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A DTO for the {@link it.sw.pa.comune.artegna.domain.UtenteApp} entity.
*/
@SuppressWarnings("common-java:DuplicatedBlocks")
public class UtenteAppDTO implements Serializable {
private Long id;
@NotNull
private String username;
@NotNull
private String email;
private String telefono;
@NotNull
private Ruolo ruolo;
@NotNull
private Boolean attivo;
private String nome;
private String cognome;
private String luogoNascita;
private String dataNascita;
private String residente;
private String societa;
private String sede;
private String codfiscale;
private String telefonoSoc;
private String emailSoc;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTelefono() {
return telefono;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
}
public Ruolo getRuolo() {
return ruolo;
}
public void setRuolo(Ruolo ruolo) {
this.ruolo = ruolo;
}
public Boolean getAttivo() {
return attivo;
}
public void setAttivo(Boolean attivo) {
this.attivo = attivo;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCognome() {
return cognome;
}
public void setCognome(String cognome) {
this.cognome = cognome;
}
public String getLuogoNascita() {
return luogoNascita;
}
public void setLuogoNascita(String luogoNascita) {
this.luogoNascita = luogoNascita;
}
public String getDataNascita() {
return dataNascita;
}
public void setDataNascita(String dataNascita) {
this.dataNascita = dataNascita;
}
public String getResidente() {
return residente;
}
public void setResidente(String residente) {
this.residente = residente;
}
public String getSocieta() {
return societa;
}
public void setSocieta(String societa) {
this.societa = societa;
}
public String getSede() {
return sede;
}
public void setSede(String sede) {
this.sede = sede;
}
public String getCodfiscale() {
return codfiscale;
}
public void setCodfiscale(String codfiscale) {
this.codfiscale = codfiscale;
}
public String getTelefonoSoc() {
return telefonoSoc;
}
public void setTelefonoSoc(String telefonoSoc) {
this.telefonoSoc = telefonoSoc;
}
public String getEmailSoc() {
return emailSoc;
}
public void setEmailSoc(String emailSoc) {
this.emailSoc = emailSoc;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof UtenteAppDTO)) {
return false;
}
UtenteAppDTO utenteAppDTO = (UtenteAppDTO) o;
if (this.id == null) {
return false;
}
return Objects.equals(this.id, utenteAppDTO.id);
}
@Override
public int hashCode() {
return Objects.hash(this.id);
}
// prettier-ignore
@Override
public String toString() {
return "UtenteAppDTO{" +
"id=" + getId() +
", username='" + getUsername() + "'" +
", email='" + getEmail() + "'" +
", telefono='" + getTelefono() + "'" +
", ruolo='" + getRuolo() + "'" +
", attivo='" + getAttivo() + "'" +
", nome='" + getNome() + "'" +
", cognome='" + getCognome() + "'" +
", luogoNascita='" + getLuogoNascita() + "'" +
", dataNascita='" + getDataNascita() + "'" +
", residente='" + getResidente() + "'" +
", societa='" + getSocieta() + "'" +
", sede='" + getSede() + "'" +
", codfiscale='" + getCodfiscale() + "'" +
", telefonoSoc='" + getTelefonoSoc() + "'" +
", emailSoc='" + getEmailSoc() + "'" +
"}";
}
}

View File

@@ -0,0 +1,81 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.AuditLog;
import it.sw.pa.comune.artegna.repository.AuditLogRepository;
import it.sw.pa.comune.artegna.service.AuditLogService;
import it.sw.pa.comune.artegna.service.dto.AuditLogDTO;
import it.sw.pa.comune.artegna.service.mapper.AuditLogMapper;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.AuditLog}.
*/
@Service
@Transactional
public class AuditLogServiceImpl implements AuditLogService {
private static final Logger LOG = LoggerFactory.getLogger(AuditLogServiceImpl.class);
private final AuditLogRepository auditLogRepository;
private final AuditLogMapper auditLogMapper;
public AuditLogServiceImpl(AuditLogRepository auditLogRepository, AuditLogMapper auditLogMapper) {
this.auditLogRepository = auditLogRepository;
this.auditLogMapper = auditLogMapper;
}
@Override
public AuditLogDTO save(AuditLogDTO auditLogDTO) {
LOG.debug("Request to save AuditLog : {}", auditLogDTO);
AuditLog auditLog = auditLogMapper.toEntity(auditLogDTO);
auditLog = auditLogRepository.save(auditLog);
return auditLogMapper.toDto(auditLog);
}
@Override
public AuditLogDTO update(AuditLogDTO auditLogDTO) {
LOG.debug("Request to update AuditLog : {}", auditLogDTO);
AuditLog auditLog = auditLogMapper.toEntity(auditLogDTO);
auditLog = auditLogRepository.save(auditLog);
return auditLogMapper.toDto(auditLog);
}
@Override
public Optional<AuditLogDTO> partialUpdate(AuditLogDTO auditLogDTO) {
LOG.debug("Request to partially update AuditLog : {}", auditLogDTO);
return auditLogRepository
.findById(auditLogDTO.getId())
.map(existingAuditLog -> {
auditLogMapper.partialUpdate(existingAuditLog, auditLogDTO);
return existingAuditLog;
})
.map(auditLogRepository::save)
.map(auditLogMapper::toDto);
}
public Page<AuditLogDTO> findAllWithEagerRelationships(Pageable pageable) {
return auditLogRepository.findAllWithEagerRelationships(pageable).map(auditLogMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<AuditLogDTO> findOne(Long id) {
LOG.debug("Request to get AuditLog : {}", id);
return auditLogRepository.findOneWithEagerRelationships(id).map(auditLogMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete AuditLog : {}", id);
auditLogRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,98 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.Conferma;
import it.sw.pa.comune.artegna.repository.ConfermaRepository;
import it.sw.pa.comune.artegna.service.ConfermaService;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import it.sw.pa.comune.artegna.service.mapper.ConfermaMapper;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.Conferma}.
*/
@Service
@Transactional
public class ConfermaServiceImpl implements ConfermaService {
private static final Logger LOG = LoggerFactory.getLogger(ConfermaServiceImpl.class);
private final ConfermaRepository confermaRepository;
private final ConfermaMapper confermaMapper;
public ConfermaServiceImpl(ConfermaRepository confermaRepository, ConfermaMapper confermaMapper) {
this.confermaRepository = confermaRepository;
this.confermaMapper = confermaMapper;
}
@Override
public ConfermaDTO save(ConfermaDTO confermaDTO) {
LOG.debug("Request to save Conferma : {}", confermaDTO);
Conferma conferma = confermaMapper.toEntity(confermaDTO);
conferma = confermaRepository.save(conferma);
return confermaMapper.toDto(conferma);
}
@Override
public ConfermaDTO update(ConfermaDTO confermaDTO) {
LOG.debug("Request to update Conferma : {}", confermaDTO);
Conferma conferma = confermaMapper.toEntity(confermaDTO);
conferma = confermaRepository.save(conferma);
return confermaMapper.toDto(conferma);
}
@Override
public Optional<ConfermaDTO> partialUpdate(ConfermaDTO confermaDTO) {
LOG.debug("Request to partially update Conferma : {}", confermaDTO);
return confermaRepository
.findById(confermaDTO.getId())
.map(existingConferma -> {
confermaMapper.partialUpdate(existingConferma, confermaDTO);
return existingConferma;
})
.map(confermaRepository::save)
.map(confermaMapper::toDto);
}
public Page<ConfermaDTO> findAllWithEagerRelationships(Pageable pageable) {
return confermaRepository.findAllWithEagerRelationships(pageable).map(confermaMapper::toDto);
}
/**
* Get all the confermas where Prenotazione is {@code null}.
* @return the list of entities.
*/
@Transactional(readOnly = true)
public List<ConfermaDTO> findAllWherePrenotazioneIsNull() {
LOG.debug("Request to get all confermas where Prenotazione is null");
return StreamSupport.stream(confermaRepository.findAll().spliterator(), false)
.filter(conferma -> conferma.getPrenotazione() == null)
.map(confermaMapper::toDto)
.collect(Collectors.toCollection(LinkedList::new));
}
@Override
@Transactional(readOnly = true)
public Optional<ConfermaDTO> findOne(Long id) {
LOG.debug("Request to get Conferma : {}", id);
return confermaRepository.findOneWithEagerRelationships(id).map(confermaMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete Conferma : {}", id);
confermaRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,88 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.Disponibilita;
import it.sw.pa.comune.artegna.repository.DisponibilitaRepository;
import it.sw.pa.comune.artegna.service.DisponibilitaService;
import it.sw.pa.comune.artegna.service.dto.DisponibilitaDTO;
import it.sw.pa.comune.artegna.service.mapper.DisponibilitaMapper;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.Disponibilita}.
*/
@Service
@Transactional
public class DisponibilitaServiceImpl implements DisponibilitaService {
private static final Logger LOG = LoggerFactory.getLogger(DisponibilitaServiceImpl.class);
private final DisponibilitaRepository disponibilitaRepository;
private final DisponibilitaMapper disponibilitaMapper;
public DisponibilitaServiceImpl(DisponibilitaRepository disponibilitaRepository, DisponibilitaMapper disponibilitaMapper) {
this.disponibilitaRepository = disponibilitaRepository;
this.disponibilitaMapper = disponibilitaMapper;
}
@Override
public DisponibilitaDTO save(DisponibilitaDTO disponibilitaDTO) {
LOG.debug("Request to save Disponibilita : {}", disponibilitaDTO);
Disponibilita disponibilita = disponibilitaMapper.toEntity(disponibilitaDTO);
disponibilita = disponibilitaRepository.save(disponibilita);
return disponibilitaMapper.toDto(disponibilita);
}
@Override
public DisponibilitaDTO update(DisponibilitaDTO disponibilitaDTO) {
LOG.debug("Request to update Disponibilita : {}", disponibilitaDTO);
Disponibilita disponibilita = disponibilitaMapper.toEntity(disponibilitaDTO);
disponibilita = disponibilitaRepository.save(disponibilita);
return disponibilitaMapper.toDto(disponibilita);
}
@Override
public Optional<DisponibilitaDTO> partialUpdate(DisponibilitaDTO disponibilitaDTO) {
LOG.debug("Request to partially update Disponibilita : {}", disponibilitaDTO);
return disponibilitaRepository
.findById(disponibilitaDTO.getId())
.map(existingDisponibilita -> {
disponibilitaMapper.partialUpdate(existingDisponibilita, disponibilitaDTO);
return existingDisponibilita;
})
.map(disponibilitaRepository::save)
.map(disponibilitaMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Page<DisponibilitaDTO> findAll(Pageable pageable) {
LOG.debug("Request to get all Disponibilitas");
return disponibilitaRepository.findAll(pageable).map(disponibilitaMapper::toDto);
}
public Page<DisponibilitaDTO> findAllWithEagerRelationships(Pageable pageable) {
return disponibilitaRepository.findAllWithEagerRelationships(pageable).map(disponibilitaMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<DisponibilitaDTO> findOne(Long id) {
LOG.debug("Request to get Disponibilita : {}", id);
return disponibilitaRepository.findOneWithEagerRelationships(id).map(disponibilitaMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete Disponibilita : {}", id);
disponibilitaRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,91 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.Liberatoria;
import it.sw.pa.comune.artegna.repository.LiberatoriaRepository;
import it.sw.pa.comune.artegna.service.LiberatoriaService;
import it.sw.pa.comune.artegna.service.dto.LiberatoriaDTO;
import it.sw.pa.comune.artegna.service.mapper.LiberatoriaMapper;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.Liberatoria}.
*/
@Service
@Transactional
public class LiberatoriaServiceImpl implements LiberatoriaService {
private static final Logger LOG = LoggerFactory.getLogger(LiberatoriaServiceImpl.class);
private final LiberatoriaRepository liberatoriaRepository;
private final LiberatoriaMapper liberatoriaMapper;
public LiberatoriaServiceImpl(LiberatoriaRepository liberatoriaRepository, LiberatoriaMapper liberatoriaMapper) {
this.liberatoriaRepository = liberatoriaRepository;
this.liberatoriaMapper = liberatoriaMapper;
}
@Override
public LiberatoriaDTO save(LiberatoriaDTO liberatoriaDTO) {
LOG.debug("Request to save Liberatoria : {}", liberatoriaDTO);
Liberatoria liberatoria = liberatoriaMapper.toEntity(liberatoriaDTO);
liberatoria = liberatoriaRepository.save(liberatoria);
return liberatoriaMapper.toDto(liberatoria);
}
@Override
public LiberatoriaDTO update(LiberatoriaDTO liberatoriaDTO) {
LOG.debug("Request to update Liberatoria : {}", liberatoriaDTO);
Liberatoria liberatoria = liberatoriaMapper.toEntity(liberatoriaDTO);
liberatoria = liberatoriaRepository.save(liberatoria);
return liberatoriaMapper.toDto(liberatoria);
}
@Override
public Optional<LiberatoriaDTO> partialUpdate(LiberatoriaDTO liberatoriaDTO) {
LOG.debug("Request to partially update Liberatoria : {}", liberatoriaDTO);
return liberatoriaRepository
.findById(liberatoriaDTO.getId())
.map(existingLiberatoria -> {
liberatoriaMapper.partialUpdate(existingLiberatoria, liberatoriaDTO);
return existingLiberatoria;
})
.map(liberatoriaRepository::save)
.map(liberatoriaMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public List<LiberatoriaDTO> findAll() {
LOG.debug("Request to get all Liberatorias");
return liberatoriaRepository.findAll().stream().map(liberatoriaMapper::toDto).collect(Collectors.toCollection(LinkedList::new));
}
public Page<LiberatoriaDTO> findAllWithEagerRelationships(Pageable pageable) {
return liberatoriaRepository.findAllWithEagerRelationships(pageable).map(liberatoriaMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<LiberatoriaDTO> findOne(Long id) {
LOG.debug("Request to get Liberatoria : {}", id);
return liberatoriaRepository.findOneWithEagerRelationships(id).map(liberatoriaMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete Liberatoria : {}", id);
liberatoriaRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,91 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.Messaggio;
import it.sw.pa.comune.artegna.repository.MessaggioRepository;
import it.sw.pa.comune.artegna.service.MessaggioService;
import it.sw.pa.comune.artegna.service.dto.MessaggioDTO;
import it.sw.pa.comune.artegna.service.mapper.MessaggioMapper;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.Messaggio}.
*/
@Service
@Transactional
public class MessaggioServiceImpl implements MessaggioService {
private static final Logger LOG = LoggerFactory.getLogger(MessaggioServiceImpl.class);
private final MessaggioRepository messaggioRepository;
private final MessaggioMapper messaggioMapper;
public MessaggioServiceImpl(MessaggioRepository messaggioRepository, MessaggioMapper messaggioMapper) {
this.messaggioRepository = messaggioRepository;
this.messaggioMapper = messaggioMapper;
}
@Override
public MessaggioDTO save(MessaggioDTO messaggioDTO) {
LOG.debug("Request to save Messaggio : {}", messaggioDTO);
Messaggio messaggio = messaggioMapper.toEntity(messaggioDTO);
messaggio = messaggioRepository.save(messaggio);
return messaggioMapper.toDto(messaggio);
}
@Override
public MessaggioDTO update(MessaggioDTO messaggioDTO) {
LOG.debug("Request to update Messaggio : {}", messaggioDTO);
Messaggio messaggio = messaggioMapper.toEntity(messaggioDTO);
messaggio = messaggioRepository.save(messaggio);
return messaggioMapper.toDto(messaggio);
}
@Override
public Optional<MessaggioDTO> partialUpdate(MessaggioDTO messaggioDTO) {
LOG.debug("Request to partially update Messaggio : {}", messaggioDTO);
return messaggioRepository
.findById(messaggioDTO.getId())
.map(existingMessaggio -> {
messaggioMapper.partialUpdate(existingMessaggio, messaggioDTO);
return existingMessaggio;
})
.map(messaggioRepository::save)
.map(messaggioMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public List<MessaggioDTO> findAll() {
LOG.debug("Request to get all Messaggios");
return messaggioRepository.findAll().stream().map(messaggioMapper::toDto).collect(Collectors.toCollection(LinkedList::new));
}
public Page<MessaggioDTO> findAllWithEagerRelationships(Pageable pageable) {
return messaggioRepository.findAllWithEagerRelationships(pageable).map(messaggioMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<MessaggioDTO> findOne(Long id) {
LOG.debug("Request to get Messaggio : {}", id);
return messaggioRepository.findOneWithEagerRelationships(id).map(messaggioMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete Messaggio : {}", id);
messaggioRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,92 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.ModelloLiberatoria;
import it.sw.pa.comune.artegna.repository.ModelloLiberatoriaRepository;
import it.sw.pa.comune.artegna.service.ModelloLiberatoriaService;
import it.sw.pa.comune.artegna.service.dto.ModelloLiberatoriaDTO;
import it.sw.pa.comune.artegna.service.mapper.ModelloLiberatoriaMapper;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.ModelloLiberatoria}.
*/
@Service
@Transactional
public class ModelloLiberatoriaServiceImpl implements ModelloLiberatoriaService {
private static final Logger LOG = LoggerFactory.getLogger(ModelloLiberatoriaServiceImpl.class);
private final ModelloLiberatoriaRepository modelloLiberatoriaRepository;
private final ModelloLiberatoriaMapper modelloLiberatoriaMapper;
public ModelloLiberatoriaServiceImpl(
ModelloLiberatoriaRepository modelloLiberatoriaRepository,
ModelloLiberatoriaMapper modelloLiberatoriaMapper
) {
this.modelloLiberatoriaRepository = modelloLiberatoriaRepository;
this.modelloLiberatoriaMapper = modelloLiberatoriaMapper;
}
@Override
public ModelloLiberatoriaDTO save(ModelloLiberatoriaDTO modelloLiberatoriaDTO) {
LOG.debug("Request to save ModelloLiberatoria : {}", modelloLiberatoriaDTO);
ModelloLiberatoria modelloLiberatoria = modelloLiberatoriaMapper.toEntity(modelloLiberatoriaDTO);
modelloLiberatoria = modelloLiberatoriaRepository.save(modelloLiberatoria);
return modelloLiberatoriaMapper.toDto(modelloLiberatoria);
}
@Override
public ModelloLiberatoriaDTO update(ModelloLiberatoriaDTO modelloLiberatoriaDTO) {
LOG.debug("Request to update ModelloLiberatoria : {}", modelloLiberatoriaDTO);
ModelloLiberatoria modelloLiberatoria = modelloLiberatoriaMapper.toEntity(modelloLiberatoriaDTO);
modelloLiberatoria = modelloLiberatoriaRepository.save(modelloLiberatoria);
return modelloLiberatoriaMapper.toDto(modelloLiberatoria);
}
@Override
public Optional<ModelloLiberatoriaDTO> partialUpdate(ModelloLiberatoriaDTO modelloLiberatoriaDTO) {
LOG.debug("Request to partially update ModelloLiberatoria : {}", modelloLiberatoriaDTO);
return modelloLiberatoriaRepository
.findById(modelloLiberatoriaDTO.getId())
.map(existingModelloLiberatoria -> {
modelloLiberatoriaMapper.partialUpdate(existingModelloLiberatoria, modelloLiberatoriaDTO);
return existingModelloLiberatoria;
})
.map(modelloLiberatoriaRepository::save)
.map(modelloLiberatoriaMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public List<ModelloLiberatoriaDTO> findAll() {
LOG.debug("Request to get all ModelloLiberatorias");
return modelloLiberatoriaRepository
.findAll()
.stream()
.map(modelloLiberatoriaMapper::toDto)
.collect(Collectors.toCollection(LinkedList::new));
}
@Override
@Transactional(readOnly = true)
public Optional<ModelloLiberatoriaDTO> findOne(Long id) {
LOG.debug("Request to get ModelloLiberatoria : {}", id);
return modelloLiberatoriaRepository.findById(id).map(modelloLiberatoriaMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete ModelloLiberatoria : {}", id);
modelloLiberatoriaRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,75 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.Notifica;
import it.sw.pa.comune.artegna.repository.NotificaRepository;
import it.sw.pa.comune.artegna.service.NotificaService;
import it.sw.pa.comune.artegna.service.dto.NotificaDTO;
import it.sw.pa.comune.artegna.service.mapper.NotificaMapper;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.Notifica}.
*/
@Service
@Transactional
public class NotificaServiceImpl implements NotificaService {
private static final Logger LOG = LoggerFactory.getLogger(NotificaServiceImpl.class);
private final NotificaRepository notificaRepository;
private final NotificaMapper notificaMapper;
public NotificaServiceImpl(NotificaRepository notificaRepository, NotificaMapper notificaMapper) {
this.notificaRepository = notificaRepository;
this.notificaMapper = notificaMapper;
}
@Override
public NotificaDTO save(NotificaDTO notificaDTO) {
LOG.debug("Request to save Notifica : {}", notificaDTO);
Notifica notifica = notificaMapper.toEntity(notificaDTO);
notifica = notificaRepository.save(notifica);
return notificaMapper.toDto(notifica);
}
@Override
public NotificaDTO update(NotificaDTO notificaDTO) {
LOG.debug("Request to update Notifica : {}", notificaDTO);
Notifica notifica = notificaMapper.toEntity(notificaDTO);
notifica = notificaRepository.save(notifica);
return notificaMapper.toDto(notifica);
}
@Override
public Optional<NotificaDTO> partialUpdate(NotificaDTO notificaDTO) {
LOG.debug("Request to partially update Notifica : {}", notificaDTO);
return notificaRepository
.findById(notificaDTO.getId())
.map(existingNotifica -> {
notificaMapper.partialUpdate(existingNotifica, notificaDTO);
return existingNotifica;
})
.map(notificaRepository::save)
.map(notificaMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<NotificaDTO> findOne(Long id) {
LOG.debug("Request to get Notifica : {}", id);
return notificaRepository.findById(id).map(notificaMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete Notifica : {}", id);
notificaRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,81 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.Prenotazione;
import it.sw.pa.comune.artegna.repository.PrenotazioneRepository;
import it.sw.pa.comune.artegna.service.PrenotazioneService;
import it.sw.pa.comune.artegna.service.dto.PrenotazioneDTO;
import it.sw.pa.comune.artegna.service.mapper.PrenotazioneMapper;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.Prenotazione}.
*/
@Service
@Transactional
public class PrenotazioneServiceImpl implements PrenotazioneService {
private static final Logger LOG = LoggerFactory.getLogger(PrenotazioneServiceImpl.class);
private final PrenotazioneRepository prenotazioneRepository;
private final PrenotazioneMapper prenotazioneMapper;
public PrenotazioneServiceImpl(PrenotazioneRepository prenotazioneRepository, PrenotazioneMapper prenotazioneMapper) {
this.prenotazioneRepository = prenotazioneRepository;
this.prenotazioneMapper = prenotazioneMapper;
}
@Override
public PrenotazioneDTO save(PrenotazioneDTO prenotazioneDTO) {
LOG.debug("Request to save Prenotazione : {}", prenotazioneDTO);
Prenotazione prenotazione = prenotazioneMapper.toEntity(prenotazioneDTO);
prenotazione = prenotazioneRepository.save(prenotazione);
return prenotazioneMapper.toDto(prenotazione);
}
@Override
public PrenotazioneDTO update(PrenotazioneDTO prenotazioneDTO) {
LOG.debug("Request to update Prenotazione : {}", prenotazioneDTO);
Prenotazione prenotazione = prenotazioneMapper.toEntity(prenotazioneDTO);
prenotazione = prenotazioneRepository.save(prenotazione);
return prenotazioneMapper.toDto(prenotazione);
}
@Override
public Optional<PrenotazioneDTO> partialUpdate(PrenotazioneDTO prenotazioneDTO) {
LOG.debug("Request to partially update Prenotazione : {}", prenotazioneDTO);
return prenotazioneRepository
.findById(prenotazioneDTO.getId())
.map(existingPrenotazione -> {
prenotazioneMapper.partialUpdate(existingPrenotazione, prenotazioneDTO);
return existingPrenotazione;
})
.map(prenotazioneRepository::save)
.map(prenotazioneMapper::toDto);
}
public Page<PrenotazioneDTO> findAllWithEagerRelationships(Pageable pageable) {
return prenotazioneRepository.findAllWithEagerRelationships(pageable).map(prenotazioneMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<PrenotazioneDTO> findOne(Long id) {
LOG.debug("Request to get Prenotazione : {}", id);
return prenotazioneRepository.findOneWithEagerRelationships(id).map(prenotazioneMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete Prenotazione : {}", id);
prenotazioneRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,75 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.Struttura;
import it.sw.pa.comune.artegna.repository.StrutturaRepository;
import it.sw.pa.comune.artegna.service.StrutturaService;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import it.sw.pa.comune.artegna.service.mapper.StrutturaMapper;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.Struttura}.
*/
@Service
@Transactional
public class StrutturaServiceImpl implements StrutturaService {
private static final Logger LOG = LoggerFactory.getLogger(StrutturaServiceImpl.class);
private final StrutturaRepository strutturaRepository;
private final StrutturaMapper strutturaMapper;
public StrutturaServiceImpl(StrutturaRepository strutturaRepository, StrutturaMapper strutturaMapper) {
this.strutturaRepository = strutturaRepository;
this.strutturaMapper = strutturaMapper;
}
@Override
public StrutturaDTO save(StrutturaDTO strutturaDTO) {
LOG.debug("Request to save Struttura : {}", strutturaDTO);
Struttura struttura = strutturaMapper.toEntity(strutturaDTO);
struttura = strutturaRepository.save(struttura);
return strutturaMapper.toDto(struttura);
}
@Override
public StrutturaDTO update(StrutturaDTO strutturaDTO) {
LOG.debug("Request to update Struttura : {}", strutturaDTO);
Struttura struttura = strutturaMapper.toEntity(strutturaDTO);
struttura = strutturaRepository.save(struttura);
return strutturaMapper.toDto(struttura);
}
@Override
public Optional<StrutturaDTO> partialUpdate(StrutturaDTO strutturaDTO) {
LOG.debug("Request to partially update Struttura : {}", strutturaDTO);
return strutturaRepository
.findById(strutturaDTO.getId())
.map(existingStruttura -> {
strutturaMapper.partialUpdate(existingStruttura, strutturaDTO);
return existingStruttura;
})
.map(strutturaRepository::save)
.map(strutturaMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<StrutturaDTO> findOne(Long id) {
LOG.debug("Request to get Struttura : {}", id);
return strutturaRepository.findById(id).map(strutturaMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete Struttura : {}", id);
strutturaRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,85 @@
package it.sw.pa.comune.artegna.service.impl;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.repository.UtenteAppRepository;
import it.sw.pa.comune.artegna.service.UtenteAppService;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import it.sw.pa.comune.artegna.service.mapper.UtenteAppMapper;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link it.sw.pa.comune.artegna.domain.UtenteApp}.
*/
@Service
@Transactional
public class UtenteAppServiceImpl implements UtenteAppService {
private static final Logger LOG = LoggerFactory.getLogger(UtenteAppServiceImpl.class);
private final UtenteAppRepository utenteAppRepository;
private final UtenteAppMapper utenteAppMapper;
public UtenteAppServiceImpl(UtenteAppRepository utenteAppRepository, UtenteAppMapper utenteAppMapper) {
this.utenteAppRepository = utenteAppRepository;
this.utenteAppMapper = utenteAppMapper;
}
@Override
public UtenteAppDTO save(UtenteAppDTO utenteAppDTO) {
LOG.debug("Request to save UtenteApp : {}", utenteAppDTO);
UtenteApp utenteApp = utenteAppMapper.toEntity(utenteAppDTO);
utenteApp = utenteAppRepository.save(utenteApp);
return utenteAppMapper.toDto(utenteApp);
}
@Override
public UtenteAppDTO update(UtenteAppDTO utenteAppDTO) {
LOG.debug("Request to update UtenteApp : {}", utenteAppDTO);
UtenteApp utenteApp = utenteAppMapper.toEntity(utenteAppDTO);
utenteApp = utenteAppRepository.save(utenteApp);
return utenteAppMapper.toDto(utenteApp);
}
@Override
public Optional<UtenteAppDTO> partialUpdate(UtenteAppDTO utenteAppDTO) {
LOG.debug("Request to partially update UtenteApp : {}", utenteAppDTO);
return utenteAppRepository
.findById(utenteAppDTO.getId())
.map(existingUtenteApp -> {
utenteAppMapper.partialUpdate(existingUtenteApp, utenteAppDTO);
return existingUtenteApp;
})
.map(utenteAppRepository::save)
.map(utenteAppMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public List<UtenteAppDTO> findAll() {
LOG.debug("Request to get all UtenteApps");
return utenteAppRepository.findAll().stream().map(utenteAppMapper::toDto).collect(Collectors.toCollection(LinkedList::new));
}
@Override
@Transactional(readOnly = true)
public Optional<UtenteAppDTO> findOne(Long id) {
LOG.debug("Request to get UtenteApp : {}", id);
return utenteAppRepository.findById(id).map(utenteAppMapper::toDto);
}
@Override
public void delete(Long id) {
LOG.debug("Request to delete UtenteApp : {}", id);
utenteAppRepository.deleteById(id);
}
}

View File

@@ -0,0 +1,4 @@
/**
* This package file was generated by JHipster
*/
package it.sw.pa.comune.artegna.service.impl;

View File

@@ -0,0 +1,22 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.AuditLog;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.service.dto.AuditLogDTO;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link AuditLog} and its DTO {@link AuditLogDTO}.
*/
@Mapper(componentModel = "spring")
public interface AuditLogMapper extends EntityMapper<AuditLogDTO, AuditLog> {
@Mapping(target = "utente", source = "utente", qualifiedByName = "utenteAppUsername")
AuditLogDTO toDto(AuditLog s);
@Named("utenteAppUsername")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
@Mapping(target = "username", source = "username")
UtenteAppDTO toDtoUtenteAppUsername(UtenteApp utenteApp);
}

View File

@@ -0,0 +1,22 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.Conferma;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Conferma} and its DTO {@link ConfermaDTO}.
*/
@Mapper(componentModel = "spring")
public interface ConfermaMapper extends EntityMapper<ConfermaDTO, Conferma> {
@Mapping(target = "confermataDa", source = "confermataDa", qualifiedByName = "utenteAppUsername")
ConfermaDTO toDto(Conferma s);
@Named("utenteAppUsername")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
@Mapping(target = "username", source = "username")
UtenteAppDTO toDtoUtenteAppUsername(UtenteApp utenteApp);
}

View File

@@ -0,0 +1,22 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.Disponibilita;
import it.sw.pa.comune.artegna.domain.Struttura;
import it.sw.pa.comune.artegna.service.dto.DisponibilitaDTO;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Disponibilita} and its DTO {@link DisponibilitaDTO}.
*/
@Mapper(componentModel = "spring")
public interface DisponibilitaMapper extends EntityMapper<DisponibilitaDTO, Disponibilita> {
@Mapping(target = "struttura", source = "struttura", qualifiedByName = "strutturaNome")
DisponibilitaDTO toDto(Disponibilita s);
@Named("strutturaNome")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
@Mapping(target = "nome", source = "nome")
StrutturaDTO toDtoStrutturaNome(Struttura struttura);
}

View File

@@ -0,0 +1,28 @@
package it.sw.pa.comune.artegna.service.mapper;
import java.util.List;
import org.mapstruct.BeanMapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.Named;
import org.mapstruct.NullValuePropertyMappingStrategy;
/**
* Contract for a generic dto to entity mapper.
*
* @param <D> - DTO type parameter.
* @param <E> - Entity type parameter.
*/
public interface EntityMapper<D, E> {
E toEntity(D dto);
D toDto(E entity);
List<E> toEntity(List<D> dtoList);
List<D> toDto(List<E> entityList);
@Named("partialUpdate")
@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
void partialUpdate(@MappingTarget E entity, D dto);
}

View File

@@ -0,0 +1,30 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.Liberatoria;
import it.sw.pa.comune.artegna.domain.ModelloLiberatoria;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.service.dto.LiberatoriaDTO;
import it.sw.pa.comune.artegna.service.dto.ModelloLiberatoriaDTO;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Liberatoria} and its DTO {@link LiberatoriaDTO}.
*/
@Mapper(componentModel = "spring")
public interface LiberatoriaMapper extends EntityMapper<LiberatoriaDTO, Liberatoria> {
@Mapping(target = "utente", source = "utente", qualifiedByName = "utenteAppUsername")
@Mapping(target = "modelloLiberatoria", source = "modelloLiberatoria", qualifiedByName = "modelloLiberatoriaId")
LiberatoriaDTO toDto(Liberatoria s);
@Named("utenteAppUsername")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
@Mapping(target = "username", source = "username")
UtenteAppDTO toDtoUtenteAppUsername(UtenteApp utenteApp);
@Named("modelloLiberatoriaId")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
ModelloLiberatoriaDTO toDtoModelloLiberatoriaId(ModelloLiberatoria modelloLiberatoria);
}

View File

@@ -0,0 +1,22 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.Messaggio;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.service.dto.MessaggioDTO;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Messaggio} and its DTO {@link MessaggioDTO}.
*/
@Mapper(componentModel = "spring")
public interface MessaggioMapper extends EntityMapper<MessaggioDTO, Messaggio> {
@Mapping(target = "utente", source = "utente", qualifiedByName = "utenteAppUsername")
MessaggioDTO toDto(Messaggio s);
@Named("utenteAppUsername")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
@Mapping(target = "username", source = "username")
UtenteAppDTO toDtoUtenteAppUsername(UtenteApp utenteApp);
}

View File

@@ -0,0 +1,21 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.ModelloLiberatoria;
import it.sw.pa.comune.artegna.domain.Struttura;
import it.sw.pa.comune.artegna.service.dto.ModelloLiberatoriaDTO;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link ModelloLiberatoria} and its DTO {@link ModelloLiberatoriaDTO}.
*/
@Mapper(componentModel = "spring")
public interface ModelloLiberatoriaMapper extends EntityMapper<ModelloLiberatoriaDTO, ModelloLiberatoria> {
@Mapping(target = "struttura", source = "struttura", qualifiedByName = "strutturaId")
ModelloLiberatoriaDTO toDto(ModelloLiberatoria s);
@Named("strutturaId")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
StrutturaDTO toDtoStrutturaId(Struttura struttura);
}

View File

@@ -0,0 +1,21 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.Conferma;
import it.sw.pa.comune.artegna.domain.Notifica;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import it.sw.pa.comune.artegna.service.dto.NotificaDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Notifica} and its DTO {@link NotificaDTO}.
*/
@Mapper(componentModel = "spring")
public interface NotificaMapper extends EntityMapper<NotificaDTO, Notifica> {
@Mapping(target = "conferma", source = "conferma", qualifiedByName = "confermaId")
NotificaDTO toDto(Notifica s);
@Named("confermaId")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
ConfermaDTO toDtoConfermaId(Conferma conferma);
}

View File

@@ -0,0 +1,39 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.Conferma;
import it.sw.pa.comune.artegna.domain.Prenotazione;
import it.sw.pa.comune.artegna.domain.Struttura;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import it.sw.pa.comune.artegna.service.dto.PrenotazioneDTO;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Prenotazione} and its DTO {@link PrenotazioneDTO}.
*/
@Mapper(componentModel = "spring")
public interface PrenotazioneMapper extends EntityMapper<PrenotazioneDTO, Prenotazione> {
@Mapping(target = "conferma", source = "conferma", qualifiedByName = "confermaId")
@Mapping(target = "utente", source = "utente", qualifiedByName = "utenteAppUsername")
@Mapping(target = "struttura", source = "struttura", qualifiedByName = "strutturaNome")
PrenotazioneDTO toDto(Prenotazione s);
@Named("confermaId")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
ConfermaDTO toDtoConfermaId(Conferma conferma);
@Named("utenteAppUsername")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
@Mapping(target = "username", source = "username")
UtenteAppDTO toDtoUtenteAppUsername(UtenteApp utenteApp);
@Named("strutturaNome")
@BeanMapping(ignoreByDefault = true)
@Mapping(target = "id", source = "id")
@Mapping(target = "nome", source = "nome")
StrutturaDTO toDtoStrutturaNome(Struttura struttura);
}

View File

@@ -0,0 +1,11 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.Struttura;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Struttura} and its DTO {@link StrutturaDTO}.
*/
@Mapper(componentModel = "spring")
public interface StrutturaMapper extends EntityMapper<StrutturaDTO, Struttura> {}

View File

@@ -0,0 +1,11 @@
package it.sw.pa.comune.artegna.service.mapper;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link UtenteApp} and its DTO {@link UtenteAppDTO}.
*/
@Mapper(componentModel = "spring")
public interface UtenteAppMapper extends EntityMapper<UtenteAppDTO, UtenteApp> {}

View File

@@ -0,0 +1,203 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.AuditLogRepository;
import it.sw.pa.comune.artegna.service.AuditLogQueryService;
import it.sw.pa.comune.artegna.service.AuditLogService;
import it.sw.pa.comune.artegna.service.criteria.AuditLogCriteria;
import it.sw.pa.comune.artegna.service.dto.AuditLogDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.AuditLog}.
*/
@RestController
@RequestMapping("/api/audit-logs")
public class AuditLogResource {
private static final Logger LOG = LoggerFactory.getLogger(AuditLogResource.class);
private static final String ENTITY_NAME = "auditLog";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final AuditLogService auditLogService;
private final AuditLogRepository auditLogRepository;
private final AuditLogQueryService auditLogQueryService;
public AuditLogResource(
AuditLogService auditLogService,
AuditLogRepository auditLogRepository,
AuditLogQueryService auditLogQueryService
) {
this.auditLogService = auditLogService;
this.auditLogRepository = auditLogRepository;
this.auditLogQueryService = auditLogQueryService;
}
/**
* {@code POST /audit-logs} : Create a new auditLog.
*
* @param auditLogDTO the auditLogDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new auditLogDTO, or with status {@code 400 (Bad Request)} if the auditLog has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<AuditLogDTO> createAuditLog(@RequestBody AuditLogDTO auditLogDTO) throws URISyntaxException {
LOG.debug("REST request to save AuditLog : {}", auditLogDTO);
if (auditLogDTO.getId() != null) {
throw new BadRequestAlertException("A new auditLog cannot already have an ID", ENTITY_NAME, "idexists");
}
auditLogDTO = auditLogService.save(auditLogDTO);
return ResponseEntity.created(new URI("/api/audit-logs/" + auditLogDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, auditLogDTO.getId().toString()))
.body(auditLogDTO);
}
/**
* {@code PUT /audit-logs/:id} : Updates an existing auditLog.
*
* @param id the id of the auditLogDTO to save.
* @param auditLogDTO the auditLogDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated auditLogDTO,
* or with status {@code 400 (Bad Request)} if the auditLogDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the auditLogDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<AuditLogDTO> updateAuditLog(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody AuditLogDTO auditLogDTO
) throws URISyntaxException {
LOG.debug("REST request to update AuditLog : {}, {}", id, auditLogDTO);
if (auditLogDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, auditLogDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!auditLogRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
auditLogDTO = auditLogService.update(auditLogDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, auditLogDTO.getId().toString()))
.body(auditLogDTO);
}
/**
* {@code PATCH /audit-logs/:id} : Partial updates given fields of an existing auditLog, field will ignore if it is null
*
* @param id the id of the auditLogDTO to save.
* @param auditLogDTO the auditLogDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated auditLogDTO,
* or with status {@code 400 (Bad Request)} if the auditLogDTO is not valid,
* or with status {@code 404 (Not Found)} if the auditLogDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the auditLogDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<AuditLogDTO> partialUpdateAuditLog(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody AuditLogDTO auditLogDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update AuditLog partially : {}, {}", id, auditLogDTO);
if (auditLogDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, auditLogDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!auditLogRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<AuditLogDTO> result = auditLogService.partialUpdate(auditLogDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, auditLogDTO.getId().toString())
);
}
/**
* {@code GET /audit-logs} : get all the auditLogs.
*
* @param pageable the pagination information.
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of auditLogs in body.
*/
@GetMapping("")
public ResponseEntity<List<AuditLogDTO>> getAllAuditLogs(
AuditLogCriteria criteria,
@org.springdoc.core.annotations.ParameterObject Pageable pageable
) {
LOG.debug("REST request to get AuditLogs by criteria: {}", criteria);
Page<AuditLogDTO> page = auditLogQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* {@code GET /audit-logs/count} : count all the auditLogs.
*
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body.
*/
@GetMapping("/count")
public ResponseEntity<Long> countAuditLogs(AuditLogCriteria criteria) {
LOG.debug("REST request to count AuditLogs by criteria: {}", criteria);
return ResponseEntity.ok().body(auditLogQueryService.countByCriteria(criteria));
}
/**
* {@code GET /audit-logs/:id} : get the "id" auditLog.
*
* @param id the id of the auditLogDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the auditLogDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<AuditLogDTO> getAuditLog(@PathVariable("id") Long id) {
LOG.debug("REST request to get AuditLog : {}", id);
Optional<AuditLogDTO> auditLogDTO = auditLogService.findOne(id);
return ResponseUtil.wrapOrNotFound(auditLogDTO);
}
/**
* {@code DELETE /audit-logs/:id} : delete the "id" auditLog.
*
* @param id the id of the auditLogDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteAuditLog(@PathVariable("id") Long id) {
LOG.debug("REST request to delete AuditLog : {}", id);
auditLogService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,203 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.ConfermaRepository;
import it.sw.pa.comune.artegna.service.ConfermaQueryService;
import it.sw.pa.comune.artegna.service.ConfermaService;
import it.sw.pa.comune.artegna.service.criteria.ConfermaCriteria;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.Conferma}.
*/
@RestController
@RequestMapping("/api/confermas")
public class ConfermaResource {
private static final Logger LOG = LoggerFactory.getLogger(ConfermaResource.class);
private static final String ENTITY_NAME = "conferma";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final ConfermaService confermaService;
private final ConfermaRepository confermaRepository;
private final ConfermaQueryService confermaQueryService;
public ConfermaResource(
ConfermaService confermaService,
ConfermaRepository confermaRepository,
ConfermaQueryService confermaQueryService
) {
this.confermaService = confermaService;
this.confermaRepository = confermaRepository;
this.confermaQueryService = confermaQueryService;
}
/**
* {@code POST /confermas} : Create a new conferma.
*
* @param confermaDTO the confermaDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new confermaDTO, or with status {@code 400 (Bad Request)} if the conferma has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<ConfermaDTO> createConferma(@RequestBody ConfermaDTO confermaDTO) throws URISyntaxException {
LOG.debug("REST request to save Conferma : {}", confermaDTO);
if (confermaDTO.getId() != null) {
throw new BadRequestAlertException("A new conferma cannot already have an ID", ENTITY_NAME, "idexists");
}
confermaDTO = confermaService.save(confermaDTO);
return ResponseEntity.created(new URI("/api/confermas/" + confermaDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, confermaDTO.getId().toString()))
.body(confermaDTO);
}
/**
* {@code PUT /confermas/:id} : Updates an existing conferma.
*
* @param id the id of the confermaDTO to save.
* @param confermaDTO the confermaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated confermaDTO,
* or with status {@code 400 (Bad Request)} if the confermaDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the confermaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<ConfermaDTO> updateConferma(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody ConfermaDTO confermaDTO
) throws URISyntaxException {
LOG.debug("REST request to update Conferma : {}, {}", id, confermaDTO);
if (confermaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, confermaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!confermaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
confermaDTO = confermaService.update(confermaDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, confermaDTO.getId().toString()))
.body(confermaDTO);
}
/**
* {@code PATCH /confermas/:id} : Partial updates given fields of an existing conferma, field will ignore if it is null
*
* @param id the id of the confermaDTO to save.
* @param confermaDTO the confermaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated confermaDTO,
* or with status {@code 400 (Bad Request)} if the confermaDTO is not valid,
* or with status {@code 404 (Not Found)} if the confermaDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the confermaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<ConfermaDTO> partialUpdateConferma(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody ConfermaDTO confermaDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update Conferma partially : {}, {}", id, confermaDTO);
if (confermaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, confermaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!confermaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<ConfermaDTO> result = confermaService.partialUpdate(confermaDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, confermaDTO.getId().toString())
);
}
/**
* {@code GET /confermas} : get all the confermas.
*
* @param pageable the pagination information.
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of confermas in body.
*/
@GetMapping("")
public ResponseEntity<List<ConfermaDTO>> getAllConfermas(
ConfermaCriteria criteria,
@org.springdoc.core.annotations.ParameterObject Pageable pageable
) {
LOG.debug("REST request to get Confermas by criteria: {}", criteria);
Page<ConfermaDTO> page = confermaQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* {@code GET /confermas/count} : count all the confermas.
*
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body.
*/
@GetMapping("/count")
public ResponseEntity<Long> countConfermas(ConfermaCriteria criteria) {
LOG.debug("REST request to count Confermas by criteria: {}", criteria);
return ResponseEntity.ok().body(confermaQueryService.countByCriteria(criteria));
}
/**
* {@code GET /confermas/:id} : get the "id" conferma.
*
* @param id the id of the confermaDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the confermaDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<ConfermaDTO> getConferma(@PathVariable("id") Long id) {
LOG.debug("REST request to get Conferma : {}", id);
Optional<ConfermaDTO> confermaDTO = confermaService.findOne(id);
return ResponseUtil.wrapOrNotFound(confermaDTO);
}
/**
* {@code DELETE /confermas/:id} : delete the "id" conferma.
*
* @param id the id of the confermaDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteConferma(@PathVariable("id") Long id) {
LOG.debug("REST request to delete Conferma : {}", id);
confermaService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,186 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.DisponibilitaRepository;
import it.sw.pa.comune.artegna.service.DisponibilitaService;
import it.sw.pa.comune.artegna.service.dto.DisponibilitaDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.Disponibilita}.
*/
@RestController
@RequestMapping("/api/disponibilitas")
public class DisponibilitaResource {
private static final Logger LOG = LoggerFactory.getLogger(DisponibilitaResource.class);
private static final String ENTITY_NAME = "disponibilita";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final DisponibilitaService disponibilitaService;
private final DisponibilitaRepository disponibilitaRepository;
public DisponibilitaResource(DisponibilitaService disponibilitaService, DisponibilitaRepository disponibilitaRepository) {
this.disponibilitaService = disponibilitaService;
this.disponibilitaRepository = disponibilitaRepository;
}
/**
* {@code POST /disponibilitas} : Create a new disponibilita.
*
* @param disponibilitaDTO the disponibilitaDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new disponibilitaDTO, or with status {@code 400 (Bad Request)} if the disponibilita has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<DisponibilitaDTO> createDisponibilita(@RequestBody DisponibilitaDTO disponibilitaDTO) throws URISyntaxException {
LOG.debug("REST request to save Disponibilita : {}", disponibilitaDTO);
if (disponibilitaDTO.getId() != null) {
throw new BadRequestAlertException("A new disponibilita cannot already have an ID", ENTITY_NAME, "idexists");
}
disponibilitaDTO = disponibilitaService.save(disponibilitaDTO);
return ResponseEntity.created(new URI("/api/disponibilitas/" + disponibilitaDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, disponibilitaDTO.getId().toString()))
.body(disponibilitaDTO);
}
/**
* {@code PUT /disponibilitas/:id} : Updates an existing disponibilita.
*
* @param id the id of the disponibilitaDTO to save.
* @param disponibilitaDTO the disponibilitaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated disponibilitaDTO,
* or with status {@code 400 (Bad Request)} if the disponibilitaDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the disponibilitaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<DisponibilitaDTO> updateDisponibilita(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody DisponibilitaDTO disponibilitaDTO
) throws URISyntaxException {
LOG.debug("REST request to update Disponibilita : {}, {}", id, disponibilitaDTO);
if (disponibilitaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, disponibilitaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!disponibilitaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
disponibilitaDTO = disponibilitaService.update(disponibilitaDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, disponibilitaDTO.getId().toString()))
.body(disponibilitaDTO);
}
/**
* {@code PATCH /disponibilitas/:id} : Partial updates given fields of an existing disponibilita, field will ignore if it is null
*
* @param id the id of the disponibilitaDTO to save.
* @param disponibilitaDTO the disponibilitaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated disponibilitaDTO,
* or with status {@code 400 (Bad Request)} if the disponibilitaDTO is not valid,
* or with status {@code 404 (Not Found)} if the disponibilitaDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the disponibilitaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<DisponibilitaDTO> partialUpdateDisponibilita(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody DisponibilitaDTO disponibilitaDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update Disponibilita partially : {}, {}", id, disponibilitaDTO);
if (disponibilitaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, disponibilitaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!disponibilitaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<DisponibilitaDTO> result = disponibilitaService.partialUpdate(disponibilitaDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, disponibilitaDTO.getId().toString())
);
}
/**
* {@code GET /disponibilitas} : get all the disponibilitas.
*
* @param pageable the pagination information.
* @param eagerload flag to eager load entities from relationships (This is applicable for many-to-many).
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of disponibilitas in body.
*/
@GetMapping("")
public ResponseEntity<List<DisponibilitaDTO>> getAllDisponibilitas(
@org.springdoc.core.annotations.ParameterObject Pageable pageable,
@RequestParam(name = "eagerload", required = false, defaultValue = "true") boolean eagerload
) {
LOG.debug("REST request to get a page of Disponibilitas");
Page<DisponibilitaDTO> page;
if (eagerload) {
page = disponibilitaService.findAllWithEagerRelationships(pageable);
} else {
page = disponibilitaService.findAll(pageable);
}
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* {@code GET /disponibilitas/:id} : get the "id" disponibilita.
*
* @param id the id of the disponibilitaDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the disponibilitaDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<DisponibilitaDTO> getDisponibilita(@PathVariable("id") Long id) {
LOG.debug("REST request to get Disponibilita : {}", id);
Optional<DisponibilitaDTO> disponibilitaDTO = disponibilitaService.findOne(id);
return ResponseUtil.wrapOrNotFound(disponibilitaDTO);
}
/**
* {@code DELETE /disponibilitas/:id} : delete the "id" disponibilita.
*
* @param id the id of the disponibilitaDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteDisponibilita(@PathVariable("id") Long id) {
LOG.debug("REST request to delete Disponibilita : {}", id);
disponibilitaService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,172 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.LiberatoriaRepository;
import it.sw.pa.comune.artegna.service.LiberatoriaService;
import it.sw.pa.comune.artegna.service.dto.LiberatoriaDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.Liberatoria}.
*/
@RestController
@RequestMapping("/api/liberatorias")
public class LiberatoriaResource {
private static final Logger LOG = LoggerFactory.getLogger(LiberatoriaResource.class);
private static final String ENTITY_NAME = "liberatoria";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final LiberatoriaService liberatoriaService;
private final LiberatoriaRepository liberatoriaRepository;
public LiberatoriaResource(LiberatoriaService liberatoriaService, LiberatoriaRepository liberatoriaRepository) {
this.liberatoriaService = liberatoriaService;
this.liberatoriaRepository = liberatoriaRepository;
}
/**
* {@code POST /liberatorias} : Create a new liberatoria.
*
* @param liberatoriaDTO the liberatoriaDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new liberatoriaDTO, or with status {@code 400 (Bad Request)} if the liberatoria has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<LiberatoriaDTO> createLiberatoria(@RequestBody LiberatoriaDTO liberatoriaDTO) throws URISyntaxException {
LOG.debug("REST request to save Liberatoria : {}", liberatoriaDTO);
if (liberatoriaDTO.getId() != null) {
throw new BadRequestAlertException("A new liberatoria cannot already have an ID", ENTITY_NAME, "idexists");
}
liberatoriaDTO = liberatoriaService.save(liberatoriaDTO);
return ResponseEntity.created(new URI("/api/liberatorias/" + liberatoriaDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, liberatoriaDTO.getId().toString()))
.body(liberatoriaDTO);
}
/**
* {@code PUT /liberatorias/:id} : Updates an existing liberatoria.
*
* @param id the id of the liberatoriaDTO to save.
* @param liberatoriaDTO the liberatoriaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated liberatoriaDTO,
* or with status {@code 400 (Bad Request)} if the liberatoriaDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the liberatoriaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<LiberatoriaDTO> updateLiberatoria(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody LiberatoriaDTO liberatoriaDTO
) throws URISyntaxException {
LOG.debug("REST request to update Liberatoria : {}, {}", id, liberatoriaDTO);
if (liberatoriaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, liberatoriaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!liberatoriaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
liberatoriaDTO = liberatoriaService.update(liberatoriaDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, liberatoriaDTO.getId().toString()))
.body(liberatoriaDTO);
}
/**
* {@code PATCH /liberatorias/:id} : Partial updates given fields of an existing liberatoria, field will ignore if it is null
*
* @param id the id of the liberatoriaDTO to save.
* @param liberatoriaDTO the liberatoriaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated liberatoriaDTO,
* or with status {@code 400 (Bad Request)} if the liberatoriaDTO is not valid,
* or with status {@code 404 (Not Found)} if the liberatoriaDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the liberatoriaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<LiberatoriaDTO> partialUpdateLiberatoria(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody LiberatoriaDTO liberatoriaDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update Liberatoria partially : {}, {}", id, liberatoriaDTO);
if (liberatoriaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, liberatoriaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!liberatoriaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<LiberatoriaDTO> result = liberatoriaService.partialUpdate(liberatoriaDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, liberatoriaDTO.getId().toString())
);
}
/**
* {@code GET /liberatorias} : get all the liberatorias.
*
* @param eagerload flag to eager load entities from relationships (This is applicable for many-to-many).
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of liberatorias in body.
*/
@GetMapping("")
public List<LiberatoriaDTO> getAllLiberatorias(
@RequestParam(name = "eagerload", required = false, defaultValue = "true") boolean eagerload
) {
LOG.debug("REST request to get all Liberatorias");
return liberatoriaService.findAll();
}
/**
* {@code GET /liberatorias/:id} : get the "id" liberatoria.
*
* @param id the id of the liberatoriaDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the liberatoriaDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<LiberatoriaDTO> getLiberatoria(@PathVariable("id") Long id) {
LOG.debug("REST request to get Liberatoria : {}", id);
Optional<LiberatoriaDTO> liberatoriaDTO = liberatoriaService.findOne(id);
return ResponseUtil.wrapOrNotFound(liberatoriaDTO);
}
/**
* {@code DELETE /liberatorias/:id} : delete the "id" liberatoria.
*
* @param id the id of the liberatoriaDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteLiberatoria(@PathVariable("id") Long id) {
LOG.debug("REST request to delete Liberatoria : {}", id);
liberatoriaService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,172 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.MessaggioRepository;
import it.sw.pa.comune.artegna.service.MessaggioService;
import it.sw.pa.comune.artegna.service.dto.MessaggioDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.Messaggio}.
*/
@RestController
@RequestMapping("/api/messaggios")
public class MessaggioResource {
private static final Logger LOG = LoggerFactory.getLogger(MessaggioResource.class);
private static final String ENTITY_NAME = "messaggio";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final MessaggioService messaggioService;
private final MessaggioRepository messaggioRepository;
public MessaggioResource(MessaggioService messaggioService, MessaggioRepository messaggioRepository) {
this.messaggioService = messaggioService;
this.messaggioRepository = messaggioRepository;
}
/**
* {@code POST /messaggios} : Create a new messaggio.
*
* @param messaggioDTO the messaggioDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new messaggioDTO, or with status {@code 400 (Bad Request)} if the messaggio has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<MessaggioDTO> createMessaggio(@RequestBody MessaggioDTO messaggioDTO) throws URISyntaxException {
LOG.debug("REST request to save Messaggio : {}", messaggioDTO);
if (messaggioDTO.getId() != null) {
throw new BadRequestAlertException("A new messaggio cannot already have an ID", ENTITY_NAME, "idexists");
}
messaggioDTO = messaggioService.save(messaggioDTO);
return ResponseEntity.created(new URI("/api/messaggios/" + messaggioDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, messaggioDTO.getId().toString()))
.body(messaggioDTO);
}
/**
* {@code PUT /messaggios/:id} : Updates an existing messaggio.
*
* @param id the id of the messaggioDTO to save.
* @param messaggioDTO the messaggioDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated messaggioDTO,
* or with status {@code 400 (Bad Request)} if the messaggioDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the messaggioDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<MessaggioDTO> updateMessaggio(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody MessaggioDTO messaggioDTO
) throws URISyntaxException {
LOG.debug("REST request to update Messaggio : {}, {}", id, messaggioDTO);
if (messaggioDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, messaggioDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!messaggioRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
messaggioDTO = messaggioService.update(messaggioDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, messaggioDTO.getId().toString()))
.body(messaggioDTO);
}
/**
* {@code PATCH /messaggios/:id} : Partial updates given fields of an existing messaggio, field will ignore if it is null
*
* @param id the id of the messaggioDTO to save.
* @param messaggioDTO the messaggioDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated messaggioDTO,
* or with status {@code 400 (Bad Request)} if the messaggioDTO is not valid,
* or with status {@code 404 (Not Found)} if the messaggioDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the messaggioDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<MessaggioDTO> partialUpdateMessaggio(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody MessaggioDTO messaggioDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update Messaggio partially : {}, {}", id, messaggioDTO);
if (messaggioDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, messaggioDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!messaggioRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<MessaggioDTO> result = messaggioService.partialUpdate(messaggioDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, messaggioDTO.getId().toString())
);
}
/**
* {@code GET /messaggios} : get all the messaggios.
*
* @param eagerload flag to eager load entities from relationships (This is applicable for many-to-many).
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of messaggios in body.
*/
@GetMapping("")
public List<MessaggioDTO> getAllMessaggios(
@RequestParam(name = "eagerload", required = false, defaultValue = "true") boolean eagerload
) {
LOG.debug("REST request to get all Messaggios");
return messaggioService.findAll();
}
/**
* {@code GET /messaggios/:id} : get the "id" messaggio.
*
* @param id the id of the messaggioDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the messaggioDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<MessaggioDTO> getMessaggio(@PathVariable("id") Long id) {
LOG.debug("REST request to get Messaggio : {}", id);
Optional<MessaggioDTO> messaggioDTO = messaggioService.findOne(id);
return ResponseUtil.wrapOrNotFound(messaggioDTO);
}
/**
* {@code DELETE /messaggios/:id} : delete the "id" messaggio.
*
* @param id the id of the messaggioDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteMessaggio(@PathVariable("id") Long id) {
LOG.debug("REST request to delete Messaggio : {}", id);
messaggioService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,173 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.ModelloLiberatoriaRepository;
import it.sw.pa.comune.artegna.service.ModelloLiberatoriaService;
import it.sw.pa.comune.artegna.service.dto.ModelloLiberatoriaDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.ModelloLiberatoria}.
*/
@RestController
@RequestMapping("/api/modello-liberatorias")
public class ModelloLiberatoriaResource {
private static final Logger LOG = LoggerFactory.getLogger(ModelloLiberatoriaResource.class);
private static final String ENTITY_NAME = "modelloLiberatoria";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final ModelloLiberatoriaService modelloLiberatoriaService;
private final ModelloLiberatoriaRepository modelloLiberatoriaRepository;
public ModelloLiberatoriaResource(
ModelloLiberatoriaService modelloLiberatoriaService,
ModelloLiberatoriaRepository modelloLiberatoriaRepository
) {
this.modelloLiberatoriaService = modelloLiberatoriaService;
this.modelloLiberatoriaRepository = modelloLiberatoriaRepository;
}
/**
* {@code POST /modello-liberatorias} : Create a new modelloLiberatoria.
*
* @param modelloLiberatoriaDTO the modelloLiberatoriaDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new modelloLiberatoriaDTO, or with status {@code 400 (Bad Request)} if the modelloLiberatoria has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<ModelloLiberatoriaDTO> createModelloLiberatoria(@RequestBody ModelloLiberatoriaDTO modelloLiberatoriaDTO)
throws URISyntaxException {
LOG.debug("REST request to save ModelloLiberatoria : {}", modelloLiberatoriaDTO);
if (modelloLiberatoriaDTO.getId() != null) {
throw new BadRequestAlertException("A new modelloLiberatoria cannot already have an ID", ENTITY_NAME, "idexists");
}
modelloLiberatoriaDTO = modelloLiberatoriaService.save(modelloLiberatoriaDTO);
return ResponseEntity.created(new URI("/api/modello-liberatorias/" + modelloLiberatoriaDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, modelloLiberatoriaDTO.getId().toString()))
.body(modelloLiberatoriaDTO);
}
/**
* {@code PUT /modello-liberatorias/:id} : Updates an existing modelloLiberatoria.
*
* @param id the id of the modelloLiberatoriaDTO to save.
* @param modelloLiberatoriaDTO the modelloLiberatoriaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated modelloLiberatoriaDTO,
* or with status {@code 400 (Bad Request)} if the modelloLiberatoriaDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the modelloLiberatoriaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<ModelloLiberatoriaDTO> updateModelloLiberatoria(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody ModelloLiberatoriaDTO modelloLiberatoriaDTO
) throws URISyntaxException {
LOG.debug("REST request to update ModelloLiberatoria : {}, {}", id, modelloLiberatoriaDTO);
if (modelloLiberatoriaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, modelloLiberatoriaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!modelloLiberatoriaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
modelloLiberatoriaDTO = modelloLiberatoriaService.update(modelloLiberatoriaDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, modelloLiberatoriaDTO.getId().toString()))
.body(modelloLiberatoriaDTO);
}
/**
* {@code PATCH /modello-liberatorias/:id} : Partial updates given fields of an existing modelloLiberatoria, field will ignore if it is null
*
* @param id the id of the modelloLiberatoriaDTO to save.
* @param modelloLiberatoriaDTO the modelloLiberatoriaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated modelloLiberatoriaDTO,
* or with status {@code 400 (Bad Request)} if the modelloLiberatoriaDTO is not valid,
* or with status {@code 404 (Not Found)} if the modelloLiberatoriaDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the modelloLiberatoriaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<ModelloLiberatoriaDTO> partialUpdateModelloLiberatoria(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody ModelloLiberatoriaDTO modelloLiberatoriaDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update ModelloLiberatoria partially : {}, {}", id, modelloLiberatoriaDTO);
if (modelloLiberatoriaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, modelloLiberatoriaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!modelloLiberatoriaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<ModelloLiberatoriaDTO> result = modelloLiberatoriaService.partialUpdate(modelloLiberatoriaDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, modelloLiberatoriaDTO.getId().toString())
);
}
/**
* {@code GET /modello-liberatorias} : get all the modelloLiberatorias.
*
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of modelloLiberatorias in body.
*/
@GetMapping("")
public List<ModelloLiberatoriaDTO> getAllModelloLiberatorias() {
LOG.debug("REST request to get all ModelloLiberatorias");
return modelloLiberatoriaService.findAll();
}
/**
* {@code GET /modello-liberatorias/:id} : get the "id" modelloLiberatoria.
*
* @param id the id of the modelloLiberatoriaDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the modelloLiberatoriaDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<ModelloLiberatoriaDTO> getModelloLiberatoria(@PathVariable("id") Long id) {
LOG.debug("REST request to get ModelloLiberatoria : {}", id);
Optional<ModelloLiberatoriaDTO> modelloLiberatoriaDTO = modelloLiberatoriaService.findOne(id);
return ResponseUtil.wrapOrNotFound(modelloLiberatoriaDTO);
}
/**
* {@code DELETE /modello-liberatorias/:id} : delete the "id" modelloLiberatoria.
*
* @param id the id of the modelloLiberatoriaDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteModelloLiberatoria(@PathVariable("id") Long id) {
LOG.debug("REST request to delete ModelloLiberatoria : {}", id);
modelloLiberatoriaService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,203 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.NotificaRepository;
import it.sw.pa.comune.artegna.service.NotificaQueryService;
import it.sw.pa.comune.artegna.service.NotificaService;
import it.sw.pa.comune.artegna.service.criteria.NotificaCriteria;
import it.sw.pa.comune.artegna.service.dto.NotificaDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.Notifica}.
*/
@RestController
@RequestMapping("/api/notificas")
public class NotificaResource {
private static final Logger LOG = LoggerFactory.getLogger(NotificaResource.class);
private static final String ENTITY_NAME = "notifica";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final NotificaService notificaService;
private final NotificaRepository notificaRepository;
private final NotificaQueryService notificaQueryService;
public NotificaResource(
NotificaService notificaService,
NotificaRepository notificaRepository,
NotificaQueryService notificaQueryService
) {
this.notificaService = notificaService;
this.notificaRepository = notificaRepository;
this.notificaQueryService = notificaQueryService;
}
/**
* {@code POST /notificas} : Create a new notifica.
*
* @param notificaDTO the notificaDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new notificaDTO, or with status {@code 400 (Bad Request)} if the notifica has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<NotificaDTO> createNotifica(@RequestBody NotificaDTO notificaDTO) throws URISyntaxException {
LOG.debug("REST request to save Notifica : {}", notificaDTO);
if (notificaDTO.getId() != null) {
throw new BadRequestAlertException("A new notifica cannot already have an ID", ENTITY_NAME, "idexists");
}
notificaDTO = notificaService.save(notificaDTO);
return ResponseEntity.created(new URI("/api/notificas/" + notificaDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, notificaDTO.getId().toString()))
.body(notificaDTO);
}
/**
* {@code PUT /notificas/:id} : Updates an existing notifica.
*
* @param id the id of the notificaDTO to save.
* @param notificaDTO the notificaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated notificaDTO,
* or with status {@code 400 (Bad Request)} if the notificaDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the notificaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<NotificaDTO> updateNotifica(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody NotificaDTO notificaDTO
) throws URISyntaxException {
LOG.debug("REST request to update Notifica : {}, {}", id, notificaDTO);
if (notificaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, notificaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!notificaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
notificaDTO = notificaService.update(notificaDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, notificaDTO.getId().toString()))
.body(notificaDTO);
}
/**
* {@code PATCH /notificas/:id} : Partial updates given fields of an existing notifica, field will ignore if it is null
*
* @param id the id of the notificaDTO to save.
* @param notificaDTO the notificaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated notificaDTO,
* or with status {@code 400 (Bad Request)} if the notificaDTO is not valid,
* or with status {@code 404 (Not Found)} if the notificaDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the notificaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<NotificaDTO> partialUpdateNotifica(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody NotificaDTO notificaDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update Notifica partially : {}, {}", id, notificaDTO);
if (notificaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, notificaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!notificaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<NotificaDTO> result = notificaService.partialUpdate(notificaDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, notificaDTO.getId().toString())
);
}
/**
* {@code GET /notificas} : get all the notificas.
*
* @param pageable the pagination information.
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of notificas in body.
*/
@GetMapping("")
public ResponseEntity<List<NotificaDTO>> getAllNotificas(
NotificaCriteria criteria,
@org.springdoc.core.annotations.ParameterObject Pageable pageable
) {
LOG.debug("REST request to get Notificas by criteria: {}", criteria);
Page<NotificaDTO> page = notificaQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* {@code GET /notificas/count} : count all the notificas.
*
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body.
*/
@GetMapping("/count")
public ResponseEntity<Long> countNotificas(NotificaCriteria criteria) {
LOG.debug("REST request to count Notificas by criteria: {}", criteria);
return ResponseEntity.ok().body(notificaQueryService.countByCriteria(criteria));
}
/**
* {@code GET /notificas/:id} : get the "id" notifica.
*
* @param id the id of the notificaDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the notificaDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<NotificaDTO> getNotifica(@PathVariable("id") Long id) {
LOG.debug("REST request to get Notifica : {}", id);
Optional<NotificaDTO> notificaDTO = notificaService.findOne(id);
return ResponseUtil.wrapOrNotFound(notificaDTO);
}
/**
* {@code DELETE /notificas/:id} : delete the "id" notifica.
*
* @param id the id of the notificaDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteNotifica(@PathVariable("id") Long id) {
LOG.debug("REST request to delete Notifica : {}", id);
notificaService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,203 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.PrenotazioneRepository;
import it.sw.pa.comune.artegna.service.PrenotazioneQueryService;
import it.sw.pa.comune.artegna.service.PrenotazioneService;
import it.sw.pa.comune.artegna.service.criteria.PrenotazioneCriteria;
import it.sw.pa.comune.artegna.service.dto.PrenotazioneDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.Prenotazione}.
*/
@RestController
@RequestMapping("/api/prenotaziones")
public class PrenotazioneResource {
private static final Logger LOG = LoggerFactory.getLogger(PrenotazioneResource.class);
private static final String ENTITY_NAME = "prenotazione";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final PrenotazioneService prenotazioneService;
private final PrenotazioneRepository prenotazioneRepository;
private final PrenotazioneQueryService prenotazioneQueryService;
public PrenotazioneResource(
PrenotazioneService prenotazioneService,
PrenotazioneRepository prenotazioneRepository,
PrenotazioneQueryService prenotazioneQueryService
) {
this.prenotazioneService = prenotazioneService;
this.prenotazioneRepository = prenotazioneRepository;
this.prenotazioneQueryService = prenotazioneQueryService;
}
/**
* {@code POST /prenotaziones} : Create a new prenotazione.
*
* @param prenotazioneDTO the prenotazioneDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new prenotazioneDTO, or with status {@code 400 (Bad Request)} if the prenotazione has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<PrenotazioneDTO> createPrenotazione(@RequestBody PrenotazioneDTO prenotazioneDTO) throws URISyntaxException {
LOG.debug("REST request to save Prenotazione : {}", prenotazioneDTO);
if (prenotazioneDTO.getId() != null) {
throw new BadRequestAlertException("A new prenotazione cannot already have an ID", ENTITY_NAME, "idexists");
}
prenotazioneDTO = prenotazioneService.save(prenotazioneDTO);
return ResponseEntity.created(new URI("/api/prenotaziones/" + prenotazioneDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, prenotazioneDTO.getId().toString()))
.body(prenotazioneDTO);
}
/**
* {@code PUT /prenotaziones/:id} : Updates an existing prenotazione.
*
* @param id the id of the prenotazioneDTO to save.
* @param prenotazioneDTO the prenotazioneDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated prenotazioneDTO,
* or with status {@code 400 (Bad Request)} if the prenotazioneDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the prenotazioneDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<PrenotazioneDTO> updatePrenotazione(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody PrenotazioneDTO prenotazioneDTO
) throws URISyntaxException {
LOG.debug("REST request to update Prenotazione : {}, {}", id, prenotazioneDTO);
if (prenotazioneDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, prenotazioneDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!prenotazioneRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
prenotazioneDTO = prenotazioneService.update(prenotazioneDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, prenotazioneDTO.getId().toString()))
.body(prenotazioneDTO);
}
/**
* {@code PATCH /prenotaziones/:id} : Partial updates given fields of an existing prenotazione, field will ignore if it is null
*
* @param id the id of the prenotazioneDTO to save.
* @param prenotazioneDTO the prenotazioneDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated prenotazioneDTO,
* or with status {@code 400 (Bad Request)} if the prenotazioneDTO is not valid,
* or with status {@code 404 (Not Found)} if the prenotazioneDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the prenotazioneDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<PrenotazioneDTO> partialUpdatePrenotazione(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody PrenotazioneDTO prenotazioneDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update Prenotazione partially : {}, {}", id, prenotazioneDTO);
if (prenotazioneDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, prenotazioneDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!prenotazioneRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<PrenotazioneDTO> result = prenotazioneService.partialUpdate(prenotazioneDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, prenotazioneDTO.getId().toString())
);
}
/**
* {@code GET /prenotaziones} : get all the prenotaziones.
*
* @param pageable the pagination information.
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of prenotaziones in body.
*/
@GetMapping("")
public ResponseEntity<List<PrenotazioneDTO>> getAllPrenotaziones(
PrenotazioneCriteria criteria,
@org.springdoc.core.annotations.ParameterObject Pageable pageable
) {
LOG.debug("REST request to get Prenotaziones by criteria: {}", criteria);
Page<PrenotazioneDTO> page = prenotazioneQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* {@code GET /prenotaziones/count} : count all the prenotaziones.
*
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body.
*/
@GetMapping("/count")
public ResponseEntity<Long> countPrenotaziones(PrenotazioneCriteria criteria) {
LOG.debug("REST request to count Prenotaziones by criteria: {}", criteria);
return ResponseEntity.ok().body(prenotazioneQueryService.countByCriteria(criteria));
}
/**
* {@code GET /prenotaziones/:id} : get the "id" prenotazione.
*
* @param id the id of the prenotazioneDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the prenotazioneDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<PrenotazioneDTO> getPrenotazione(@PathVariable("id") Long id) {
LOG.debug("REST request to get Prenotazione : {}", id);
Optional<PrenotazioneDTO> prenotazioneDTO = prenotazioneService.findOne(id);
return ResponseUtil.wrapOrNotFound(prenotazioneDTO);
}
/**
* {@code DELETE /prenotaziones/:id} : delete the "id" prenotazione.
*
* @param id the id of the prenotazioneDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deletePrenotazione(@PathVariable("id") Long id) {
LOG.debug("REST request to delete Prenotazione : {}", id);
prenotazioneService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,203 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.StrutturaRepository;
import it.sw.pa.comune.artegna.service.StrutturaQueryService;
import it.sw.pa.comune.artegna.service.StrutturaService;
import it.sw.pa.comune.artegna.service.criteria.StrutturaCriteria;
import it.sw.pa.comune.artegna.service.dto.StrutturaDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.Struttura}.
*/
@RestController
@RequestMapping("/api/strutturas")
public class StrutturaResource {
private static final Logger LOG = LoggerFactory.getLogger(StrutturaResource.class);
private static final String ENTITY_NAME = "struttura";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final StrutturaService strutturaService;
private final StrutturaRepository strutturaRepository;
private final StrutturaQueryService strutturaQueryService;
public StrutturaResource(
StrutturaService strutturaService,
StrutturaRepository strutturaRepository,
StrutturaQueryService strutturaQueryService
) {
this.strutturaService = strutturaService;
this.strutturaRepository = strutturaRepository;
this.strutturaQueryService = strutturaQueryService;
}
/**
* {@code POST /strutturas} : Create a new struttura.
*
* @param strutturaDTO the strutturaDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new strutturaDTO, or with status {@code 400 (Bad Request)} if the struttura has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<StrutturaDTO> createStruttura(@RequestBody StrutturaDTO strutturaDTO) throws URISyntaxException {
LOG.debug("REST request to save Struttura : {}", strutturaDTO);
if (strutturaDTO.getId() != null) {
throw new BadRequestAlertException("A new struttura cannot already have an ID", ENTITY_NAME, "idexists");
}
strutturaDTO = strutturaService.save(strutturaDTO);
return ResponseEntity.created(new URI("/api/strutturas/" + strutturaDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, strutturaDTO.getId().toString()))
.body(strutturaDTO);
}
/**
* {@code PUT /strutturas/:id} : Updates an existing struttura.
*
* @param id the id of the strutturaDTO to save.
* @param strutturaDTO the strutturaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated strutturaDTO,
* or with status {@code 400 (Bad Request)} if the strutturaDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the strutturaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<StrutturaDTO> updateStruttura(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody StrutturaDTO strutturaDTO
) throws URISyntaxException {
LOG.debug("REST request to update Struttura : {}, {}", id, strutturaDTO);
if (strutturaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, strutturaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!strutturaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
strutturaDTO = strutturaService.update(strutturaDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, strutturaDTO.getId().toString()))
.body(strutturaDTO);
}
/**
* {@code PATCH /strutturas/:id} : Partial updates given fields of an existing struttura, field will ignore if it is null
*
* @param id the id of the strutturaDTO to save.
* @param strutturaDTO the strutturaDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated strutturaDTO,
* or with status {@code 400 (Bad Request)} if the strutturaDTO is not valid,
* or with status {@code 404 (Not Found)} if the strutturaDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the strutturaDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<StrutturaDTO> partialUpdateStruttura(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody StrutturaDTO strutturaDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update Struttura partially : {}, {}", id, strutturaDTO);
if (strutturaDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, strutturaDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!strutturaRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<StrutturaDTO> result = strutturaService.partialUpdate(strutturaDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, strutturaDTO.getId().toString())
);
}
/**
* {@code GET /strutturas} : get all the strutturas.
*
* @param pageable the pagination information.
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of strutturas in body.
*/
@GetMapping("")
public ResponseEntity<List<StrutturaDTO>> getAllStrutturas(
StrutturaCriteria criteria,
@org.springdoc.core.annotations.ParameterObject Pageable pageable
) {
LOG.debug("REST request to get Strutturas by criteria: {}", criteria);
Page<StrutturaDTO> page = strutturaQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* {@code GET /strutturas/count} : count all the strutturas.
*
* @param criteria the criteria which the requested entities should match.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body.
*/
@GetMapping("/count")
public ResponseEntity<Long> countStrutturas(StrutturaCriteria criteria) {
LOG.debug("REST request to count Strutturas by criteria: {}", criteria);
return ResponseEntity.ok().body(strutturaQueryService.countByCriteria(criteria));
}
/**
* {@code GET /strutturas/:id} : get the "id" struttura.
*
* @param id the id of the strutturaDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the strutturaDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<StrutturaDTO> getStruttura(@PathVariable("id") Long id) {
LOG.debug("REST request to get Struttura : {}", id);
Optional<StrutturaDTO> strutturaDTO = strutturaService.findOne(id);
return ResponseUtil.wrapOrNotFound(strutturaDTO);
}
/**
* {@code DELETE /strutturas/:id} : delete the "id" struttura.
*
* @param id the id of the strutturaDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteStruttura(@PathVariable("id") Long id) {
LOG.debug("REST request to delete Struttura : {}", id);
strutturaService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,171 @@
package it.sw.pa.comune.artegna.web.rest;
import it.sw.pa.comune.artegna.repository.UtenteAppRepository;
import it.sw.pa.comune.artegna.service.UtenteAppService;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import it.sw.pa.comune.artegna.web.rest.errors.BadRequestAlertException;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link it.sw.pa.comune.artegna.domain.UtenteApp}.
*/
@RestController
@RequestMapping("/api/utente-apps")
public class UtenteAppResource {
private static final Logger LOG = LoggerFactory.getLogger(UtenteAppResource.class);
private static final String ENTITY_NAME = "utenteApp";
@Value("${jhipster.clientApp.name:smartbooking}")
private String applicationName;
private final UtenteAppService utenteAppService;
private final UtenteAppRepository utenteAppRepository;
public UtenteAppResource(UtenteAppService utenteAppService, UtenteAppRepository utenteAppRepository) {
this.utenteAppService = utenteAppService;
this.utenteAppRepository = utenteAppRepository;
}
/**
* {@code POST /utente-apps} : Create a new utenteApp.
*
* @param utenteAppDTO the utenteAppDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new utenteAppDTO, or with status {@code 400 (Bad Request)} if the utenteApp has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("")
public ResponseEntity<UtenteAppDTO> createUtenteApp(@Valid @RequestBody UtenteAppDTO utenteAppDTO) throws URISyntaxException {
LOG.debug("REST request to save UtenteApp : {}", utenteAppDTO);
if (utenteAppDTO.getId() != null) {
throw new BadRequestAlertException("A new utenteApp cannot already have an ID", ENTITY_NAME, "idexists");
}
utenteAppDTO = utenteAppService.save(utenteAppDTO);
return ResponseEntity.created(new URI("/api/utente-apps/" + utenteAppDTO.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, utenteAppDTO.getId().toString()))
.body(utenteAppDTO);
}
/**
* {@code PUT /utente-apps/:id} : Updates an existing utenteApp.
*
* @param id the id of the utenteAppDTO to save.
* @param utenteAppDTO the utenteAppDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated utenteAppDTO,
* or with status {@code 400 (Bad Request)} if the utenteAppDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the utenteAppDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/{id}")
public ResponseEntity<UtenteAppDTO> updateUtenteApp(
@PathVariable(value = "id", required = false) final Long id,
@Valid @RequestBody UtenteAppDTO utenteAppDTO
) throws URISyntaxException {
LOG.debug("REST request to update UtenteApp : {}, {}", id, utenteAppDTO);
if (utenteAppDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, utenteAppDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!utenteAppRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
utenteAppDTO = utenteAppService.update(utenteAppDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, utenteAppDTO.getId().toString()))
.body(utenteAppDTO);
}
/**
* {@code PATCH /utente-apps/:id} : Partial updates given fields of an existing utenteApp, field will ignore if it is null
*
* @param id the id of the utenteAppDTO to save.
* @param utenteAppDTO the utenteAppDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated utenteAppDTO,
* or with status {@code 400 (Bad Request)} if the utenteAppDTO is not valid,
* or with status {@code 404 (Not Found)} if the utenteAppDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the utenteAppDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/{id}", consumes = { "application/json", "application/merge-patch+json" })
public ResponseEntity<UtenteAppDTO> partialUpdateUtenteApp(
@PathVariable(value = "id", required = false) final Long id,
@NotNull @RequestBody UtenteAppDTO utenteAppDTO
) throws URISyntaxException {
LOG.debug("REST request to partial update UtenteApp partially : {}, {}", id, utenteAppDTO);
if (utenteAppDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, utenteAppDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!utenteAppRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<UtenteAppDTO> result = utenteAppService.partialUpdate(utenteAppDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, utenteAppDTO.getId().toString())
);
}
/**
* {@code GET /utente-apps} : get all the utenteApps.
*
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of utenteApps in body.
*/
@GetMapping("")
public List<UtenteAppDTO> getAllUtenteApps() {
LOG.debug("REST request to get all UtenteApps");
return utenteAppService.findAll();
}
/**
* {@code GET /utente-apps/:id} : get the "id" utenteApp.
*
* @param id the id of the utenteAppDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the utenteAppDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/{id}")
public ResponseEntity<UtenteAppDTO> getUtenteApp(@PathVariable("id") Long id) {
LOG.debug("REST request to get UtenteApp : {}", id);
Optional<UtenteAppDTO> utenteAppDTO = utenteAppService.findOne(id);
return ResponseUtil.wrapOrNotFound(utenteAppDTO);
}
/**
* {@code DELETE /utente-apps/:id} : delete the "id" utenteApp.
*
* @param id the id of the utenteAppDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteUtenteApp(@PathVariable("id") Long id) {
LOG.debug("REST request to delete UtenteApp : {}", id);
utenteAppService.delete(id);
return ResponseEntity.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity AuditLog.
-->
<changeSet id="20251210161121-1" author="jhipster">
<createTable tableName="audit_log">
<column name="id" type="bigint">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="entita_tipo" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="entita_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="azione" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="dettagli" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="ip_address" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="created_at" type="${datetimeType}">
<constraints nullable="true" />
</column>
<column name="utente_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="audit_log" columnName="created_at" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20251210161121-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/audit_log.csv"
separator=";"
tableName="audit_log"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="entita_tipo" type="string"/>
<column name="entita_id" type="numeric"/>
<column name="azione" type="string"/>
<column name="dettagli" type="string"/>
<column name="ip_address" type="string"/>
<column name="created_at" type="date"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity AuditLog.
-->
<changeSet id="20251210161121-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="utente_id"
baseTableName="audit_log"
constraintName="fk_audit_log__utente_id"
referencedColumnNames="id"
referencedTableName="utente_app"
/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity Disponibilita.
-->
<changeSet id="20251210161122-1" author="jhipster">
<createTable tableName="disponibilita">
<column name="id" type="bigint">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="giorno_settimana" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="data_specifica" type="date">
<constraints nullable="true" />
</column>
<column name="ora_inizio" type="${datetimeType}">
<constraints nullable="true" />
</column>
<column name="ora_fine" type="${datetimeType}">
<constraints nullable="true" />
</column>
<column name="orario_inizio" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="orario_fine" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="tipo" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="note" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="struttura_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="disponibilita" columnName="ora_inizio" columnDataType="${datetimeType}"/>
<dropDefaultValue tableName="disponibilita" columnName="ora_fine" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20251210161122-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/disponibilita.csv"
separator=";"
tableName="disponibilita"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="giorno_settimana" type="string"/>
<column name="data_specifica" type="date"/>
<column name="ora_inizio" type="date"/>
<column name="ora_fine" type="date"/>
<column name="orario_inizio" type="string"/>
<column name="orario_fine" type="string"/>
<column name="tipo" type="string"/>
<column name="note" type="string"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity Disponibilita.
-->
<changeSet id="20251210161122-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="struttura_id"
baseTableName="disponibilita"
constraintName="fk_disponibilita__struttura_id"
referencedColumnNames="id"
referencedTableName="struttura"
/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity Notifica.
-->
<changeSet id="20251210161123-1" author="jhipster">
<createTable tableName="notifica">
<column name="id" type="bigint">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="tipo_canale" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="tipo_evento" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="messaggio" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="inviata" type="boolean">
<constraints nullable="true" />
</column>
<column name="inviata_at" type="${datetimeType}">
<constraints nullable="true" />
</column>
<column name="errore" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="created_at" type="${datetimeType}">
<constraints nullable="true" />
</column>
<column name="conferma_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="notifica" columnName="inviata_at" columnDataType="${datetimeType}"/>
<dropDefaultValue tableName="notifica" columnName="created_at" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20251210161123-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/notifica.csv"
separator=";"
tableName="notifica"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="tipo_canale" type="string"/>
<column name="tipo_evento" type="string"/>
<column name="messaggio" type="string"/>
<column name="inviata" type="boolean"/>
<column name="inviata_at" type="date"/>
<column name="errore" type="string"/>
<column name="created_at" type="date"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity Notifica.
-->
<changeSet id="20251210161123-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="conferma_id"
baseTableName="notifica"
constraintName="fk_notifica__conferma_id"
referencedColumnNames="id"
referencedTableName="conferma"
/>
</changeSet>
</databaseChangeLog>

Some files were not shown because too many files have changed in this diff Show More