
package dev.sonpx.loyalty.mcp.reward.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import dev.sonpx.loyalty.mcp.enums.EntityLevel;
import dev.sonpx.loyalty.mcp.enums.ExpiryPolicy;
import dev.sonpx.loyalty.mcp.reward.enums.PoolType;
import dev.sonpx.loyalty.mcp.reward.enums.PrecisionOfBalance;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.util.List;
import lombok.Getter;
import lombok.Setter;

/**
 * Created by SonPhung on Monday, 20-Jul-2026
 */
@Getter
@Setter
public class PoolDefinition extends Fw {

    @NotBlank
    private String poolId;

    @NotBlank
    private String poolName;

    private String description;

    private PoolType poolType;

    private ExpiryPolicy expiryPolicy;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Integer expiryPolicyParam;

    private LocalDate fixedDate;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Integer ripeningPeriod;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Integer dayOfMonth;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Integer monthOfYear;

    private ReferenceData pcrCode;

    private Boolean allowNegativeBalance;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private PrecisionOfBalance precisionOfBalance;

    private ReferenceData atgGroupId;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Integer gracePeriod;

    private EntityLevel entityLevel;

    // submodules
    @Valid
    private List<PaTypeExpiry> paTypeExpiries;

    @Valid
    private List<VelocityControl> velocityControls;
}
