content: package com.food.ordering.system.payment.service.dataaccess.outbox.entity;
  
  import com.food.ordering.system.domain.valueobject.PaymentStatus;
  import com.food.ordering.system.outbox.OutboxStatus;
  import lombok.*;
  
  import javax.persistence.*;
  import java.time.ZonedDateTime;
  import java.util.Objects;
  import java.util.UUID;
  
  @Getter
  @Setter
  @Builder
  @NoArgsConstructor
  @AllArgsConstructor
  @Table(name = "order_outbox")
  @Entity
  public class OrderOutboxEntity {
  
      @Id
      private UUID id;
      private UUID sagaId;
      private ZonedDateTime createdAt;
      private ZonedDateTime processedAt;
      private String type;
      private String payload;
      @Enumerated(EnumType.STRING)
      private OutboxStatus outboxStatus;
      @Enumerated(EnumType.STRING)
      private PaymentStatus paymentStatus;
      @Version
      private int version;
  
  
      @Override
      public boolean equals(Object o) {
          if (this == o) return true;
          if (o == null || getClass() != o.getClass()) return false;
          OrderOutboxEntity that = (OrderOutboxEntity) o;
          return id.equals(that.id);
      }
  
      @Override
      public int hashCode() {
          return Objects.hash(id);
      }
  }
  
  