Skip to content

Commit b4e99b5

Browse files
Add despatchAdvice (#167)
1 parent 5610163 commit b4e99b5

File tree

25 files changed

+1095
-41
lines changed

25 files changed

+1095
-41
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import io.github.project.openubl.xbuilder.content.models.common.Firmante;
20+
import io.github.project.openubl.xbuilder.content.models.common.Proveedor;
21+
import io.swagger.v3.oas.annotations.media.ArraySchema;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import lombok.AllArgsConstructor;
24+
import lombok.Builder;
25+
import lombok.Data;
26+
import lombok.NoArgsConstructor;
27+
import lombok.Singular;
28+
import lombok.extern.jackson.Jacksonized;
29+
30+
import java.time.LocalDate;
31+
import java.time.LocalTime;
32+
import java.util.List;
33+
34+
@Jacksonized
35+
@Data
36+
@Builder
37+
@NoArgsConstructor
38+
@AllArgsConstructor
39+
public class DespatchAdvice {
40+
/**
41+
* Serie del comprobante
42+
*/
43+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, minLength = 4, pattern = "^[T|t|V|v].*$")
44+
private String serie;
45+
46+
/**
47+
* Número del comprobante
48+
*/
49+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, minimum = "1", maximum = "99999999")
50+
private Integer numero;
51+
52+
/**
53+
* Fecha de emisión del comprobante. Ejemplo 2022-12-25 (YYYY-MM-SS)
54+
*/
55+
@Schema(description = "Format: \"YYYY-MM-SS\". Ejemplo: 2022-12-25", pattern = "^\\d{4}-\\d{2}-\\d{2}$")
56+
private LocalDate fechaEmision;
57+
58+
/**
59+
* Hora de emisión del comprobante. Ejemplo 12:00:00 (HH:MM:SS)
60+
*/
61+
@Schema(description = "Format: \"HH:MM:SS\". Ejemplo 12:00:00", pattern = "^\\d{2}:\\d{2}:\\d{2}$")
62+
private LocalTime horaEmision;
63+
64+
@Schema(description = "Catalogo 01")
65+
private String tipoComprobante;
66+
67+
private String observaciones;
68+
69+
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED)
70+
private DocumentoBaja documentoBaja;
71+
72+
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED)
73+
private DocumentoRelacionado documentoRelacionado;
74+
75+
@Schema(description = "Persona que firma electrónicamente el comprobante. Si NULL los datos del proveedor son usados.")
76+
private Firmante firmante;
77+
78+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
79+
private Remitente remitente;
80+
81+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
82+
private Destinatario destinatario;
83+
84+
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED)
85+
private Proveedor proveedor;
86+
87+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
88+
private Envio envio;
89+
90+
@Singular
91+
@ArraySchema(minItems = 1, schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED))
92+
private List<DespatchAdviceItem> detalles;
93+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import lombok.AllArgsConstructor;
20+
import lombok.Builder;
21+
import lombok.Data;
22+
import lombok.NoArgsConstructor;
23+
import lombok.extern.jackson.Jacksonized;
24+
25+
import java.math.BigDecimal;
26+
27+
@Jacksonized
28+
@Data
29+
@Builder
30+
@NoArgsConstructor
31+
@AllArgsConstructor
32+
public class DespatchAdviceItem {
33+
private String unidadMedida;
34+
private BigDecimal cantidad;
35+
36+
private String descripcion;
37+
private String codigo;
38+
private String codigoSunat;
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import io.swagger.v3.oas.annotations.media.Schema;
20+
import lombok.AllArgsConstructor;
21+
import lombok.Builder;
22+
import lombok.Data;
23+
import lombok.NoArgsConstructor;
24+
25+
@Data
26+
@Builder
27+
@NoArgsConstructor
28+
@AllArgsConstructor
29+
public class Destinatario {
30+
31+
@Schema(description = "Catalogo 06", requiredMode = Schema.RequiredMode.REQUIRED)
32+
private String tipoDocumentoIdentidad;
33+
34+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
35+
private String numeroDocumentoIdentidad;
36+
37+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
38+
private String nombre;
39+
}

core/src/main/java/io/github/project/openubl/xbuilder/content/models/standard/guia/info.java renamed to core/src/main/java/io/github/project/openubl/xbuilder/content/models/standard/guia/Destino.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@
1616
*/
1717
package io.github.project.openubl.xbuilder.content.models.standard.guia;
1818

19+
import lombok.AllArgsConstructor;
20+
import lombok.Builder;
1921
import lombok.Data;
22+
import lombok.NoArgsConstructor;
2023

2124
@Data
22-
public class info {
25+
@Builder
26+
@NoArgsConstructor
27+
@AllArgsConstructor
28+
public class Destino {
29+
private String ubigeo;
30+
private String direccion;
2331
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import io.swagger.v3.oas.annotations.media.Schema;
20+
import lombok.AllArgsConstructor;
21+
import lombok.Builder;
22+
import lombok.Data;
23+
import lombok.NoArgsConstructor;
24+
25+
@Data
26+
@Builder
27+
@NoArgsConstructor
28+
@AllArgsConstructor
29+
public class DocumentoBaja {
30+
31+
@Schema(description = "Catalog 01", requiredMode = Schema.RequiredMode.REQUIRED)
32+
private String tipoDocumento;
33+
34+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
35+
private String serieNumero;
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import io.swagger.v3.oas.annotations.media.Schema;
20+
import lombok.AllArgsConstructor;
21+
import lombok.Builder;
22+
import lombok.Data;
23+
import lombok.NoArgsConstructor;
24+
25+
@Data
26+
@Builder
27+
@NoArgsConstructor
28+
@AllArgsConstructor
29+
public class DocumentoRelacionado {
30+
31+
@Schema(description = "Catalog 21", requiredMode = Schema.RequiredMode.REQUIRED)
32+
private String tipoDocumento;
33+
34+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
35+
private String serieNumero;
36+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import io.swagger.v3.oas.annotations.media.Schema;
20+
import lombok.AllArgsConstructor;
21+
import lombok.Builder;
22+
import lombok.Data;
23+
import lombok.NoArgsConstructor;
24+
25+
import java.math.BigDecimal;
26+
import java.time.LocalDate;
27+
28+
@Data
29+
@Builder
30+
@NoArgsConstructor
31+
@AllArgsConstructor
32+
public class Envio {
33+
34+
@Schema(description = "Catalog 20", requiredMode = Schema.RequiredMode.REQUIRED)
35+
private String tipoTraslado;
36+
private String motivoTraslado;
37+
38+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
39+
private BigDecimal pesoTotal;
40+
41+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
42+
private String pesoTotalUnidadMedida;
43+
44+
private Integer numeroDeBultos;
45+
private boolean transbordoProgramado;
46+
47+
@Schema(description = "Catalog 18", requiredMode = Schema.RequiredMode.REQUIRED)
48+
private String tipoModalidadTraslado;
49+
50+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
51+
private LocalDate fechaTraslado;
52+
53+
private String numeroDeContenedor;
54+
private String codigoDePuerto;
55+
56+
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED)
57+
private Transportista transportista;
58+
59+
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED)
60+
private Partida partida;
61+
62+
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED)
63+
private Destino destino;
64+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import lombok.AllArgsConstructor;
20+
import lombok.Builder;
21+
import lombok.Data;
22+
import lombok.NoArgsConstructor;
23+
24+
@Data
25+
@Builder
26+
@NoArgsConstructor
27+
@AllArgsConstructor
28+
public class Partida {
29+
private String ubigeo;
30+
private String direccion;
31+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.github.project.openubl.xbuilder.content.models.standard.guia;
18+
19+
import io.swagger.v3.oas.annotations.media.Schema;
20+
import lombok.AllArgsConstructor;
21+
import lombok.Builder;
22+
import lombok.Data;
23+
import lombok.NoArgsConstructor;
24+
25+
@Data
26+
@Builder
27+
@NoArgsConstructor
28+
@AllArgsConstructor
29+
public class Proveedor {
30+
31+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, minLength = 11, maxLength = 11, pattern = "[0-9]+")
32+
private String ruc;
33+
34+
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
35+
private String razonSocial;
36+
}

0 commit comments

Comments
 (0)