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

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

public class ConfermaAsserts {

    /**
     * Asserts that the entity has all properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertConfermaAllPropertiesEquals(Conferma expected, Conferma actual) {
        assertConfermaAutoGeneratedPropertiesEquals(expected, actual);
        assertConfermaAllUpdatablePropertiesEquals(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 assertConfermaAllUpdatablePropertiesEquals(Conferma expected, Conferma actual) {
        assertConfermaUpdatableFieldsEquals(expected, actual);
        assertConfermaUpdatableRelationshipsEquals(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 assertConfermaAutoGeneratedPropertiesEquals(Conferma expected, Conferma actual) {
        assertThat(actual)
            .as("Verify Conferma 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 assertConfermaUpdatableFieldsEquals(Conferma expected, Conferma actual) {
        assertThat(actual)
            .as("Verify Conferma relevant properties")
            .satisfies(a -> assertThat(a.getMotivoConferma()).as("check motivoConferma").isEqualTo(expected.getMotivoConferma()))
            .satisfies(a -> assertThat(a.getTipoConferma()).as("check tipoConferma").isEqualTo(expected.getTipoConferma()));
    }

    /**
     * Asserts that the entity has all the updatable relationships set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertConfermaUpdatableRelationshipsEquals(Conferma expected, Conferma actual) {
        assertThat(actual)
            .as("Verify Conferma relationships")
            .satisfies(a -> assertThat(a.getConfermataDa()).as("check confermataDa").isEqualTo(expected.getConfermataDa()));
    }
}
