package de.cannamanage.service.model.report;

import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDate;
import java.util.List;
import java.util.UUID;

/**
 * Recall report data model.
 * Traces all distributions from a specific batch back to affected members.
 * Critical for CanG §26 compliance — enables rapid member notification on contamination.
 */
public class RecallReport {

    private UUID batchId;
    private String strainName;
    private String batchNumber;
    private LocalDate receivedDate;
    private BigDecimal totalGramsDistributed;
    private List<AffectedMember> affectedMembers;

    public UUID getBatchId() { return batchId; }
    public void setBatchId(UUID batchId) { this.batchId = batchId; }

    public String getStrainName() { return strainName; }
    public void setStrainName(String strainName) { this.strainName = strainName; }

    public String getBatchNumber() { return batchNumber; }
    public void setBatchNumber(String batchNumber) { this.batchNumber = batchNumber; }

    public LocalDate getReceivedDate() { return receivedDate; }
    public void setReceivedDate(LocalDate receivedDate) { this.receivedDate = receivedDate; }

    public BigDecimal getTotalGramsDistributed() { return totalGramsDistributed; }
    public void setTotalGramsDistributed(BigDecimal totalGramsDistributed) { this.totalGramsDistributed = totalGramsDistributed; }

    public List<AffectedMember> getAffectedMembers() { return affectedMembers; }
    public void setAffectedMembers(List<AffectedMember> affectedMembers) { this.affectedMembers = affectedMembers; }

    /**
     * A member who received cannabis from the recalled batch.
     */
    public static class AffectedMember {
        private UUID memberId;
        private String firstName;
        private String lastName;
        private Instant distributionDate;
        private BigDecimal grams;

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

        public String getFirstName() { return firstName; }
        public void setFirstName(String firstName) { this.firstName = firstName; }

        public String getLastName() { return lastName; }
        public void setLastName(String lastName) { this.lastName = lastName; }

        public Instant getDistributionDate() { return distributionDate; }
        public void setDistributionDate(Instant distributionDate) { this.distributionDate = distributionDate; }

        public BigDecimal getGrams() { return grams; }
        public void setGrams(BigDecimal grams) { this.grams = grams; }
    }
}
