package de.accso.flexinale.ticketing.api_contract.event.model;

import de.accso.flexinale.common.shared_kernel.*;
import org.apache.commons.lang3.builder.EqualsBuilder;

import java.io.Serializable;

@SuppressWarnings("unused")
public record OnlineKontingentTO(Id id, Version version,
                                 Id vorfuehrungId, RestKontingent neuesOnlineRestKontingent)
        implements Identifiable, Versionable, EqualsByContent, Serializable
{
    public record RestKontingent(Integer raw) implements RawWrapper<Integer> {}

    @Override
    public boolean equalsByContent(final Object o) {
        if (this == o) {return true;}

        if (o == null || getClass() != o.getClass()) {return false;}

        OnlineKontingentTO that = (OnlineKontingentTO) o;

        return new EqualsBuilder()
                .append(id, that.id)
                .append(vorfuehrungId, that.vorfuehrungId)
                .append(neuesOnlineRestKontingent, that.neuesOnlineRestKontingent)
                .isEquals();
    }
}
