Skip to content

Commit

Permalink
Remove required and @NotNull on optional fields
Browse files Browse the repository at this point in the history
  • Loading branch information
NghiNg committed Jan 4, 2024
1 parent 95fad2f commit 31b84ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ Payment information for an invoice
| paymentId | String | yes | Unique id to reference the payment with third party |
| paymentStatus | String | yes | A status a given payment is in. ISO20022 payment statuses can be used |
| paymentTime | ZonedDateTime | yes | When the payment is done |
| debtorAccount | String | yes | The debtor account for the payment. Exactly 11 digits |
| debtorAccount | String | no | The debtor account for the payment. Exactly 11 digits |
| debtorAccountName | String | no | Optional name of the account |
| paymentChannel | String | yes | Name the third party performing the payment |
| paymentBank | [Bank](#invoicepaymentbank) | yes | The bank payment is registered with |
| paymentBank | [Bank](#invoicepaymentbank) | no | The bank payment is registered with |
| paymentScheduledDate | LocalDate | no | When the payment is scheduled to be paid |
| remittanceInformation | String | no | Optional reference number user inputted when invoice was missing KID number |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package no.digipost.api.datatypes.types.invoice;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
Expand Down Expand Up @@ -38,7 +37,7 @@ public class InvoicePayment implements DataType {
@Description("When the payment is done")
ZonedDateTime paymentTime;

@XmlElement(required = true, name = "debtor-account")
@XmlElement(name = "debtor-account")
@Description("The debtor account for the payment. Exactly 11 digits")
@Size(min = 11, max = 11)
String debtorAccount;
Expand All @@ -51,9 +50,8 @@ public class InvoicePayment implements DataType {
@Description("Name the third party performing the payment")
String paymentChannel;

@XmlElement(required = true, name = "payment-bank")
@XmlElement(name = "payment-bank")
@Description("The bank payment is registered with")
@NotNull
Bank paymentBank;

@XmlElement(name = "payment-scheduled-date")
Expand Down

0 comments on commit 31b84ea

Please sign in to comment.