Skip to content

Commit

Permalink
legger på størrelsesbegrensning på felter i inkasso
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Strandenæs committed Nov 28, 2019
1 parent c783330 commit d31a735
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion datatypes-examples.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</link>
<due-date>2019-12-10T00:00:00+01:00</due-date>
<sum>42</sum>
<account>012354243209523583</account>
<account>01235424320</account>
<kid>1435025439583420243982723</kid>
</inkasso>

Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ A debt collection payment
|link|[ExternalLink](#inkassoexternallink)|no|A link to more information, or further actions that can be taken|
|dueDate|ZonedDateTime|yes|When the payment falls due|
|sum|BigDecimal|no|The sum to be payed|
|account|String|no|The creditor account for the payment|
|kid|String|no|The customer identification number|
|account|String|no|The creditor account for the payment. Exactly 11 digits|
|kid|String|no|The customer identification number. Max length 25 chars|

### Inkasso.ExternalLink

Expand All @@ -309,7 +309,7 @@ A debt collection payment
</link>
<due-date>2019-12-10T00:00:00+01:00</due-date>
<sum>42</sum>
<account>012354243209523583</account>
<account>01235424320</account>
<kid>1435025439583420243982723</kid>
</inkasso>
```
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/no/digipost/api/datatypes/types/Inkasso.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import no.digipost.api.datatypes.DataType;
import no.digipost.api.datatypes.documentation.Description;

import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.math.BigDecimal;
Expand All @@ -31,14 +32,16 @@ public class Inkasso implements DataType {
@Description("The sum to be payed")
BigDecimal sum;
@XmlElement
@Description("The creditor account for the payment")
@Description("The creditor account for the payment. Exactly 11 digits")
@Size(min = 11, max = 11)
String account;
@XmlElement
@Description("The customer identification number")
@Description("The customer identification number. Max length 25 chars")
@Size(max = 25)
String kid;

public static Inkasso EXAMPLE = new Inkasso(ExternalLink.EXAMPLE_NO_DEADLINE,
ZonedDateTime.of(2019, 12, 10, 0, 0, 0, 0, ZoneId.systemDefault()),
BigDecimal.valueOf(42), "012354243209523583", "1435025439583420243982723");
BigDecimal.valueOf(42), "01235424320", "1435025439583420243982723");

}

0 comments on commit d31a735

Please sign in to comment.