Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve validation #4

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.RequiredArgsConstructor;
import org.dcsa.issuance.domain.persistence.entity.enums.IssuanceRequestState;
Expand All @@ -14,6 +15,7 @@
record ChangeStateTO(
@NotNull
@Size(max = 20)
@Pattern(regexp = "^\\S+(\\s+\\S+)*$")
String transportDocumentReference,

@NotNull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.dcsa.issuance.controller.unofficial;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.RequiredArgsConstructor;
import org.dcsa.issuance.service.IssueRequestResponseService;
Expand All @@ -11,6 +12,7 @@
record PendingIssuanceRequestResponseTO(
@NotNull
@Size(max = 20)
@Pattern(regexp = "^\\S+(\\s+\\S+)*$")
String transportDocumentReference
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class IssueParty {
@Column(name = "location_of_registration", length = 2)
private String locationOfRegistration;


@Column(name = "tax_reference", length = 100)
private String taxReference;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package org.dcsa.issuance.transferobjects;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Builder;
import org.dcsa.issuance.transferobjects.enums.IssuanceResponseCodeTO;

public record IssuanceRequestResponseTO(
@NotNull
@Size(max = 20)
@Pattern(regexp = "^\\S+(\\s+\\S+)*$")
String transportDocumentReference,
@NotNull
IssuanceResponseCodeTO issuanceResponseCode,
@Size(max = 255)
@Pattern(regexp = "^\\S+(\\s+\\S+)*$")
String reason

) {
Expand Down
Loading