package de.cannamanage.domain.entity;

import jakarta.persistence.*;

import java.time.Instant;
import java.time.LocalDate;
import java.util.UUID;

/**
 * Links a member to a specific fee schedule with a validity period.
 * A member can have only one active assignment at a time (validTo = null).
 */
@Entity
@Table(name = "member_fee_assignments")
public class MemberFeeAssignment extends AbstractTenantEntity {

    @Column(name = "member_id", nullable = false)
    private UUID memberId;

    @Column(name = "club_id", nullable = false)
    private UUID clubId;

    @Column(name = "fee_schedule_id", nullable = false)
    private UUID feeScheduleId;

    @Column(name = "valid_from", nullable = false)
    private LocalDate validFrom;

    @Column(name = "valid_to")
    private LocalDate validTo;

    // Getters and setters

    public UUID getMemberId() { return memberId; }
    public void setMemberId(UUID memberId) { this.memberId = memberId; }

    public UUID getClubId() { return clubId; }
    public void setClubId(UUID clubId) { this.clubId = clubId; }

    public UUID getFeeScheduleId() { return feeScheduleId; }
    public void setFeeScheduleId(UUID feeScheduleId) { this.feeScheduleId = feeScheduleId; }

    public LocalDate getValidFrom() { return validFrom; }
    public void setValidFrom(LocalDate validFrom) { this.validFrom = validFrom; }

    public LocalDate getValidTo() { return validTo; }
    public void setValidTo(LocalDate validTo) { this.validTo = validTo; }
}
