package com.snp.batch.global.model; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import jakarta.persistence.*; import java.time.LocalDate; import java.time.LocalDateTime; @Entity @Getter @Setter @NoArgsConstructor @Table(name = "BATCH_LAST_EXECUTION") @EntityListeners(AuditingEntityListener.class) public class BatchLastExecution { @Id @Column(name = "API_KEY", length = 50) private String apiKey; @Column(name = "LAST_SUCCESS_DATE", nullable = false) private LocalDate lastSuccessDate; @CreatedDate @Column(name = "CREATED_AT", updatable = false, nullable = false) private LocalDateTime createdAt; @LastModifiedDate @Column(name = "UPDATED_AT", nullable = false) private LocalDateTime updatedAt; public BatchLastExecution(String apiKey, LocalDate lastSuccessDate) { this.apiKey = apiKey; this.lastSuccessDate = lastSuccessDate; } }