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

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

public class ModelloLiberatoriaAsserts {

    /**
     * Asserts that the entity has all properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertModelloLiberatoriaAllPropertiesEquals(ModelloLiberatoria expected, ModelloLiberatoria actual) {
        assertModelloLiberatoriaAutoGeneratedPropertiesEquals(expected, actual);
        assertModelloLiberatoriaAllUpdatablePropertiesEquals(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 assertModelloLiberatoriaAllUpdatablePropertiesEquals(ModelloLiberatoria expected, ModelloLiberatoria actual) {
        assertModelloLiberatoriaUpdatableFieldsEquals(expected, actual);
        assertModelloLiberatoriaUpdatableRelationshipsEquals(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 assertModelloLiberatoriaAutoGeneratedPropertiesEquals(ModelloLiberatoria expected, ModelloLiberatoria actual) {
        assertThat(actual)
            .as("Verify ModelloLiberatoria 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 assertModelloLiberatoriaUpdatableFieldsEquals(ModelloLiberatoria expected, ModelloLiberatoria actual) {
        assertThat(actual)
            .as("Verify ModelloLiberatoria relevant properties")
            .satisfies(a -> assertThat(a.getNome()).as("check nome").isEqualTo(expected.getNome()))
            .satisfies(a -> assertThat(a.getTesto()).as("check testo").isEqualTo(expected.getTesto()))
            .satisfies(a -> assertThat(a.getDocumento()).as("check documento").isEqualTo(expected.getDocumento()))
            .satisfies(a ->
                assertThat(a.getDocumentoContentType()).as("check documento content type").isEqualTo(expected.getDocumentoContentType())
            )
            .satisfies(a -> assertThat(a.getValidoDal()).as("check validoDal").isEqualTo(expected.getValidoDal()))
            .satisfies(a -> assertThat(a.getValidoAl()).as("check validoAl").isEqualTo(expected.getValidoAl()));
    }

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