mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-12 16:38:48 +00:00
119 lines
2.7 KiB
Java
119 lines
2.7 KiB
Java
package com.imprimelibros.erp.pedidos;
|
|
|
|
import jakarta.persistence.*;
|
|
import java.time.LocalDateTime;
|
|
|
|
import com.imprimelibros.erp.presupuesto.dto.Presupuesto;
|
|
|
|
@Entity
|
|
@Table(name = "pedidos_lineas")
|
|
public class PedidoLinea {
|
|
|
|
public enum Estado {
|
|
aprobado("pedido.estado.aprobado", 1),
|
|
maquetacion("pedido.estado.maquetacion", 2),
|
|
haciendo_ferro("pedido.estado.haciendo_ferro", 3),
|
|
produccion("pedido.estado.produccion", 4),
|
|
cancelado("pedido.estado.cancelado", 5);
|
|
|
|
private final String messageKey;
|
|
private final int priority;
|
|
|
|
Estado(String messageKey, int priority) {
|
|
this.messageKey = messageKey;
|
|
this.priority = priority;
|
|
}
|
|
|
|
public String getMessageKey() {
|
|
return messageKey;
|
|
}
|
|
|
|
public int getPriority() {
|
|
return priority;
|
|
}
|
|
}
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
|
@JoinColumn(name = "pedido_id", nullable = false)
|
|
private Pedido pedido;
|
|
|
|
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
|
@JoinColumn(name = "presupuesto_id", nullable = false)
|
|
private Presupuesto presupuesto;
|
|
|
|
@Enumerated(EnumType.STRING)
|
|
@Column(name = "estado", nullable = false)
|
|
private Estado estado = Estado.aprobado;
|
|
|
|
@Column(name = "estado_manual", nullable = false)
|
|
private Boolean estadoManual;
|
|
|
|
@Column(name = "created_at")
|
|
private LocalDateTime createdAt;
|
|
|
|
@Column(name = "created_by", nullable = false)
|
|
private Long createdBy;
|
|
|
|
// --- Getters y setters ---
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public Pedido getPedido() {
|
|
return pedido;
|
|
}
|
|
|
|
public void setPedido(Pedido pedido) {
|
|
this.pedido = pedido;
|
|
}
|
|
|
|
public Presupuesto getPresupuesto() {
|
|
return presupuesto;
|
|
}
|
|
|
|
public void setPresupuesto(Presupuesto presupuesto) {
|
|
this.presupuesto = presupuesto;
|
|
}
|
|
|
|
public Estado getEstado() {
|
|
return estado;
|
|
}
|
|
|
|
public void setEstado(Estado estado) {
|
|
this.estado = estado;
|
|
}
|
|
|
|
public Boolean getEstadoManual() {
|
|
return estadoManual;
|
|
}
|
|
|
|
public void setEstadoManual(Boolean estadoManual) {
|
|
this.estadoManual = estadoManual;
|
|
}
|
|
|
|
public LocalDateTime getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
public void setCreatedAt(LocalDateTime createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public Long getCreatedBy() {
|
|
return createdBy;
|
|
}
|
|
|
|
public void setCreatedBy(Long createdBy) {
|
|
this.createdBy = createdBy;
|
|
}
|
|
}
|