Skip to content

Commit

Permalink
Merge pull request #109 from baloise/feature/BABEL-1305-api-implement…
Browse files Browse the repository at this point in the history
…-sved

[BABEL-1305] - change Cancellation entity to accept Identifier identi…
  • Loading branch information
lazaki committed May 6, 2020
2 parents bf02cef + ad84c36 commit 86d9bf4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 69 deletions.
20 changes: 5 additions & 15 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -976,24 +976,14 @@
}
},
"Cancellation" : {
"required" : [ "contractId", "effectiveDate", "reasonCode" ],
"required" : [ "action", "identifier" ],
"type" : "object",
"properties" : {
"contractId" : {
"maxLength" : 20,
"minLength" : 0,
"type" : "string",
"description" : "Id given by SaaS provider. Identifies the contract which should be cancelled"
},
"effectiveDate" : {
"type" : "string",
"description" : "effecitve date of cancellation",
"format" : "date"
"identifier" : {
"$ref" : "#/components/schemas/Identifier"
},
"reasonCode" : {
"type" : "integer",
"description" : "A code uniquely identifying the cancellation reason",
"format" : "int32"
"action" : {
"$ref" : "#/components/schemas/Action"
}
}
}
Expand Down
23 changes: 6 additions & 17 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,27 +464,16 @@
},
"Cancellation": {
"properties": {
"contractId": {
"description": "Id given by SaaS provider. Identifies the contract which should be cancelled",
"maxLength": 20,
"minLength": 0,
"type": "string"
},
"effectiveDate": {
"description": "effecitve date of cancellation",
"format": "date",
"type": "string"
"action": {
"$ref": "#/definitions/Action"
},
"reasonCode": {
"description": "A code uniquely identifying the cancellation reason",
"format": "int32",
"type": "integer"
"identifier": {
"$ref": "#/definitions/Identifier"
}
},
"required": [
"contractId",
"effectiveDate",
"reasonCode"
"action",
"identifier"
],
"type": "object"
},
Expand Down
57 changes: 20 additions & 37 deletions src/main/java/ch/baloise/corellia/api/entities/Cancellation.java
Original file line number Diff line number Diff line change
@@ -1,52 +1,35 @@
package ch.baloise.corellia.api.entities;

import static ch.baloise.corellia.api.constraints.SizeConstraint.CONTRACT_ID_MAX_SIZE;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import java.io.Serializable;
import java.time.LocalDate;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

public class Cancellation implements Serializable {

private static final long serialVersionUID = 10;

@NotNull
@Size(max = CONTRACT_ID_MAX_SIZE)
@JsonPropertyDescription(
"Id given by SaaS provider. Identifies the contract which should be cancelled")
private String contractId;

@NotNull
@JsonPropertyDescription("effecitve date of cancellation")
private LocalDate effectiveDate;
private static final long serialVersionUID = 10;

@NotNull
@JsonPropertyDescription("A code uniquely identifying the cancellation reason")
private Integer reasonCode;
@NotNull
@Valid
private Identifier identifier;

public String getContractId() {
return contractId;
}
@NotNull
@Valid
private Action action;

public void setContractId(String contractId) {
this.contractId = contractId;
}
public Identifier getIdentifier() {
return identifier;
}

public LocalDate getEffectiveDate() {
return effectiveDate;
}
public void setIdentifier(Identifier identifier) {
this.identifier = identifier;
}

public void setEffectiveDate(LocalDate effectiveDate) {
this.effectiveDate = effectiveDate;
}
public Action getAction() {
return action;
}

public Integer getReasonCode() {
return reasonCode;
}
public void setAction(Action action) {
this.action = action;
}

public void setReasonCode(Integer reasonCode) {
this.reasonCode = reasonCode;
}
}

0 comments on commit 86d9bf4

Please sign in to comment.