package fr.titionfire.ffsaf.data.model;

import io.quarkus.runtime.annotations.RegisterForReflection;
import jakarta.persistence.*;
import lombok.*;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

import java.util.Date;
import java.util.List;

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@RegisterForReflection

@Entity
@Table(name = "checkout")
public class CheckoutModel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Schema(description = "Identifiant du checkout", example = "42")
    Long id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "membre", referencedColumnName = "id")
    MembreModel membre;

    Date creationDate = new Date();

    List<Long> licenseIds;

    Integer checkoutId;

    PaymentStatus paymentStatus;

    public enum PaymentStatus {
        PENDING, AUTHORIZED, REFUSED, UNKNOW, REGISTERED, REFUNDING, REFUNDED, CONTESTED
    }
}
