create order and change order status

This commit is contained in:
Patryk
2025-05-20 22:25:00 +02:00
parent 65524d0f25
commit c642f6f87b
9 changed files with 145 additions and 5 deletions

View File

@@ -0,0 +1,43 @@
package _11.asktpk.artisanconnectbackend.entities;
import _11.asktpk.artisanconnectbackend.utils.Enums;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Entity
@Table(name = "orders")
@Getter
@Setter
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JoinColumn(name = "id_client")
private Client client;
@ManyToOne
@JoinColumn(name = "id_notice")
private Notice notice;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private Enums.OrderType orderType;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private Enums.OrderStatus status;
@Column(nullable = false)
private Double amount;
@Column(nullable = false)
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}