Skip to content

Commit

Permalink
Merge pull request #88 from shipping7/fix-stub-preco-prazo#87
Browse files Browse the repository at this point in the history
Atualiza stub de calculador de preço e prazo
  • Loading branch information
douglascampos committed Jul 25, 2017
2 parents 1a1cf34 + 40f55ea commit d5cb6eb
Show file tree
Hide file tree
Showing 30 changed files with 90 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.0.21-BETA
version=0.0.22-BETA
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public EstimativaComPrazo convert(CServico servico) {
estimativa.setEntregaAosSabados(booleanStringfier.convertToBoolean(servico.getEntregaSabado()));
estimativa.setCodigoErro(servico.getErro());
estimativa.setMensagemErro(servico.getMsgErro());
estimativa.setDataMaximaEntrega(servico.getDataMaxEntrega());
estimativa.setHoraMaximaEntrega(servico.getHoraMaxEntrega());

return estimativa;
}
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/br/com/correios/estimativa/EstimativaComPrazo.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public class EstimativaComPrazo {
*/
private String mensagemErro;

/**
* Data maxima que a entrega pode chegar.
*/
private String dataMaximaEntrega;

/**
* Hora maxima que a entrega pode chegar.
*/
private String horaMaximaEntrega;

public String getCodigoServico() {
return codigoServico;
}
Expand Down Expand Up @@ -94,6 +104,22 @@ public void setMensagemErro(String mensagemErro) {
this.mensagemErro = mensagemErro;
}

public String getDataMaximaEntrega() {
return dataMaximaEntrega;
}

public void setDataMaximaEntrega(String dataMaximaEntrega) {
this.dataMaximaEntrega = dataMaximaEntrega;
}

public String getHoraMaximaEntrega() {
return horaMaximaEntrega;
}

public void setHoraMaximaEntrega(String horaMaximaEntrega) {
this.horaMaximaEntrega = horaMaximaEntrega;
}

/**
* @return se uma estimativa esta valida, ou seja, possui um prazo de entrega valido
*/
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* <element name="MsgErro" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="ValorSemAdicionais" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="obsFim" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="DataMaxEntrega" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="HoraMaxEntrega" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
Expand All @@ -50,7 +52,9 @@
"erro",
"msgErro",
"valorSemAdicionais",
"obsFim"
"obsFim",
"dataMaxEntrega",
"horaMaxEntrega"
})
public class CServico {

Expand All @@ -77,6 +81,10 @@ public class CServico {
@XmlElement(name = "ValorSemAdicionais")
protected String valorSemAdicionais;
protected String obsFim;
@XmlElement(name = "DataMaxEntrega")
protected String dataMaxEntrega;
@XmlElement(name = "HoraMaxEntrega")
protected String horaMaxEntrega;

/**
* Gets the value of the codigo property.
Expand Down Expand Up @@ -358,4 +366,52 @@ public void setObsFim(String value) {
this.obsFim = value;
}

/**
* Gets the value of the dataMaxEntrega property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDataMaxEntrega() {
return dataMaxEntrega;
}

/**
* Sets the value of the dataMaxEntrega property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDataMaxEntrega(String value) {
this.dataMaxEntrega = value;
}

/**
* Gets the value of the horaMaxEntrega property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getHoraMaxEntrega() {
return horaMaxEntrega;
}

/**
* Sets the value of the horaMaxEntrega property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHoraMaxEntrega(String value) {
this.horaMaxEntrega = value;
}

}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public void deveriaConverterServicoEmEstimativaComPrazo() {
servico.setPrazoEntrega("5");
servico.setErro("0");
servico.setMsgErro(null);
servico.setDataMaxEntrega("20/10/2017");
servico.setHoraMaxEntrega("10:30:00");

EstimativaComPrazo estimativa = converter.convert(servico);

Expand All @@ -38,6 +40,8 @@ public void deveriaConverterServicoEmEstimativaComPrazo() {
assertFalse(estimativa.isEntregaAosSabados());
assertEquals("0", estimativa.getCodigoErro());
assertNull(estimativa.getMensagemErro());
assertEquals("20/10/2017", estimativa.getDataMaximaEntrega());
assertEquals("10:30:00", estimativa.getHoraMaximaEntrega());
}

@Test
Expand Down

0 comments on commit d5cb6eb

Please sign in to comment.