package it.sw.pa.comune.artegna.domain;

import static org.assertj.core.api.Assertions.assertThat;

public class PrenotazioneAsserts {

    /**
     * Asserts that the entity has all properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertPrenotazioneAllPropertiesEquals(Prenotazione expected, Prenotazione actual) {
        assertPrenotazioneAutoGeneratedPropertiesEquals(expected, actual);
        assertPrenotazioneAllUpdatablePropertiesEquals(expected, actual);
    }

    /**
     * Asserts that the entity has all updatable properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertPrenotazioneAllUpdatablePropertiesEquals(Prenotazione expected, Prenotazione actual) {
        assertPrenotazioneUpdatableFieldsEquals(expected, actual);
        assertPrenotazioneUpdatableRelationshipsEquals(expected, actual);
    }

    /**
     * Asserts that the entity has all the auto generated properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertPrenotazioneAutoGeneratedPropertiesEquals(Prenotazione expected, Prenotazione actual) {
        assertThat(actual)
            .as("Verify Prenotazione auto generated properties")
            .satisfies(a -> assertThat(a.getId()).as("check id").isEqualTo(expected.getId()));
    }

    /**
     * Asserts that the entity has all the updatable fields set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertPrenotazioneUpdatableFieldsEquals(Prenotazione expected, Prenotazione actual) {
        assertThat(actual)
            .as("Verify Prenotazione relevant properties")
            .satisfies(a -> assertThat(a.getOraInizio()).as("check oraInizio").isEqualTo(expected.getOraInizio()))
            .satisfies(a -> assertThat(a.getOraFine()).as("check oraFine").isEqualTo(expected.getOraFine()))
            .satisfies(a -> assertThat(a.getStato()).as("check stato").isEqualTo(expected.getStato()))
            .satisfies(a -> assertThat(a.getMotivoEvento()).as("check motivoEvento").isEqualTo(expected.getMotivoEvento()))
            .satisfies(a ->
                assertThat(a.getNumeroPartecipanti()).as("check numeroPartecipanti").isEqualTo(expected.getNumeroPartecipanti())
            )
            .satisfies(a -> assertThat(a.getNoteUtente()).as("check noteUtente").isEqualTo(expected.getNoteUtente()));
    }

    /**
     * Asserts that the entity has all the updatable relationships set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertPrenotazioneUpdatableRelationshipsEquals(Prenotazione expected, Prenotazione actual) {
        assertThat(actual)
            .as("Verify Prenotazione relationships")
            .satisfies(a -> assertThat(a.getConferma()).as("check conferma").isEqualTo(expected.getConferma()))
            .satisfies(a -> assertThat(a.getUtente()).as("check utente").isEqualTo(expected.getUtente()))
            .satisfies(a -> assertThat(a.getStruttura()).as("check struttura").isEqualTo(expected.getStruttura()));
    }
}
