diff --git a/pom.xml b/pom.xml index c942c046..51ec4713 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ digipost-data-types - 0.28-SNAPSHOT + LOCAL-SNAPSHOT Digipost Data Types Data types for Digipost messages diff --git a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java index 241c0dd7..1bead773 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java +++ b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java @@ -5,8 +5,10 @@ import lombok.NoArgsConstructor; import lombok.Value; import lombok.With; +import no.digipost.api.datatypes.ComplementedBy; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; +import no.digipost.api.datatypes.types.invoice.InvoicePayment; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlElement; @@ -21,6 +23,7 @@ @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) @With @Description("A debt collection payment") +@ComplementedBy({InvoicePayment.class}) public class Inkasso implements DataType { @XmlElement @Description("A link to more information, or further actions that can be taken") diff --git a/src/test/java/no/digipost/api/datatypes/ComplementByTest.java b/src/test/java/no/digipost/api/datatypes/ComplementByTest.java index e70992f0..40180524 100644 --- a/src/test/java/no/digipost/api/datatypes/ComplementByTest.java +++ b/src/test/java/no/digipost/api/datatypes/ComplementByTest.java @@ -1,6 +1,9 @@ package no.digipost.api.datatypes; import no.digipost.api.datatypes.types.Appointment; +import no.digipost.api.datatypes.types.Inkasso; +import no.digipost.api.datatypes.types.invoice.Invoice; +import no.digipost.api.datatypes.types.invoice.InvoicePayment; import no.digipost.api.datatypes.types.pickup.PickupNotice; import no.digipost.api.datatypes.types.pickup.PickupNoticeStatus; import org.junit.jupiter.api.Test; @@ -32,4 +35,10 @@ void kan_IKKE_complementere_seg_selv_med_mindre_eksplisitt_definert() { assertThat(Appointment.EXAMPLE, whereNot(s -> s.getTypeIdentifier().canBeComplementedBy(Appointment.EXAMPLE))); assertThat(PickupNotice.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(PickupNotice.EXAMPLE))); } + + @Test + void kan_komplementere_fakturadomene() { + assertThat(Invoice.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(InvoicePayment.EXAMPLE))); + assertThat(Inkasso.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(InvoicePayment.EXAMPLE))); + } }