Skip to content

Commit 29f2a6b

Browse files
[LOG1-1026] New dimensions min and max (#194)
* fix new dimensions limit min and max * bump version and reformatation by black
1 parent 7ffbe4e commit 29f2a6b

File tree

7 files changed

+31
-36
lines changed

7 files changed

+31
-36
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 6.4.2
2+
current_version = 6.4.3
33
commit = True
44
tag = True
55
tag_name = {new_version}

correios/data/posting_list_schema.xsd

+7-7
Original file line numberDiff line numberDiff line change
@@ -401,26 +401,26 @@
401401
<xs:element name="dimensao_altura">
402402
<xs:simpleType>
403403
<xs:restriction base="xs:int">
404-
<xs:minInclusive value="2"/>
405-
<xs:maxInclusive value="105"/>
404+
<xs:minInclusive value="1"/>
405+
<xs:maxInclusive value="100"/>
406406
</xs:restriction>
407407
</xs:simpleType>
408408
</xs:element>
409409

410410
<xs:element name="dimensao_largura">
411411
<xs:simpleType>
412412
<xs:restriction base="xs:int">
413-
<xs:minInclusive value="11"/>
414-
<xs:maxInclusive value="105"/>
413+
<xs:minInclusive value="10"/>
414+
<xs:maxInclusive value="100"/>
415415
</xs:restriction>
416416
</xs:simpleType>
417417
</xs:element>
418418

419419
<xs:element name="dimensao_comprimento">
420420
<xs:simpleType>
421421
<xs:restriction base="xs:int">
422-
<xs:minInclusive value="16"/>
423-
<xs:maxInclusive value="105"/>
422+
<xs:minInclusive value="15"/>
423+
<xs:maxInclusive value="100"/>
424424
</xs:restriction>
425425
</xs:simpleType>
426426
</xs:element>
@@ -429,7 +429,7 @@
429429
<xs:simpleType>
430430
<xs:restriction base="xs:int">
431431
<xs:minInclusive value="0"/>
432-
<xs:maxInclusive value="105"/>
432+
<xs:maxInclusive value="100"/>
433433
</xs:restriction>
434434
</xs:simpleType>
435435
</xs:element>

correios/models/data.py

+13-18
Original file line numberDiff line numberDiff line change
@@ -680,12 +680,7 @@
680680
"Em tratamento, aguarde.",
681681
"Acompanhar",
682682
),
683-
("FC", 29): (
684-
"shipped",
685-
"Objeto encaminhado para apreensão",
686-
"Em tratamento, aguarde.",
687-
"Acompanhar",
688-
),
683+
("FC", 29): ("shipped", "Objeto encaminhado para apreensão", "Em tratamento, aguarde.", "Acompanhar",),
689684
("IDC", 1): ("lost", "Objeto não localizado", "Houve indenização dos valores correspondentes", "Acompanhar"),
690685
("LDI", 1): (
691686
"waiting_retrieval",
@@ -1650,19 +1645,19 @@
16501645
"delivered",
16511646
"Objeto entregue ao contratante",
16521647
"Contingência COVID-19",
1653-
"Finalizar a entrega. Não é mais necessário prosseguir com o acompanhamento."
1648+
"Finalizar a entrega. Não é mais necessário prosseguir com o acompanhamento.",
16541649
),
16551650
("BDI", 79): (
16561651
"delivered",
16571652
"Objeto entregue ao contratante",
16581653
"Contingência COVID-19",
1659-
"Finalizar a entrega. Não é mais necessário prosseguir com o acompanhamento."
1654+
"Finalizar a entrega. Não é mais necessário prosseguir com o acompanhamento.",
16601655
),
16611656
("BDR", 79): (
16621657
"delivered",
16631658
"Objeto entregue ao contratante",
16641659
"Contingência COVID-19",
1665-
"Finalizar a entrega. Não é mais necessário prosseguir com o acompanhamento."
1660+
"Finalizar a entrega. Não é mais necessário prosseguir com o acompanhamento.",
16661661
),
16671662
("BDE", 80): ("lost", "Objeto extraviado", "", "Acionar a CAC dos Correios"),
16681663
("BDI", 80): ("lost", "Objeto extraviado", "", "Acionar a CAC dos Correios"),
@@ -1722,18 +1717,18 @@
17221717
-12: "Comprimento inválido.",
17231718
-13: "Largura inválida.",
17241719
-14: "Altura inválida.",
1725-
-15: "O comprimento não pode ser maior que 105 cm.",
1726-
-16: "A largura não pode ser maior que 105 cm.",
1727-
-17: "A altura não pode ser maior que 105 cm.",
1728-
-18: "A altura não pode ser inferior a 2 cm.",
1729-
-20: "A largura não pode ser inferior a 11 cm.",
1730-
-22: "O comprimento não pode ser inferior a 16 cm.",
1720+
-15: "O comprimento não pode ser maior que 100 cm.",
1721+
-16: "A largura não pode ser maior que 100 cm.",
1722+
-17: "A altura não pode ser maior que 100 cm.",
1723+
-18: "A altura não pode ser inferior a 1 cm.",
1724+
-20: "A largura não pode ser inferior a 10 cm.",
1725+
-22: "O comprimento não pode ser inferior a 15 cm.",
17311726
-23: "A soma resultante do comprimento + largura + altura não deve superar a 200 cm.",
17321727
-24: "Comprimento inválido.",
17331728
-25: "Diâmetro inválido",
17341729
-26: "Informe o comprimento.",
17351730
-27: "Informe o diâmetro.",
1736-
-28: "O comprimento não pode ser maior que 105 cm.",
1731+
-28: "O comprimento não pode ser maior que 100 cm.",
17371732
-29: "O diâmetro não pode ser maior que 91 cm.",
17381733
-30: "O comprimento não pode ser inferior a 18 cm.",
17391734
-31: "O diâmetro não pode ser inferior a 5 cm.",
@@ -1750,9 +1745,9 @@
17501745
"largura e altura do objeto em centimetros (cm)."
17511746
),
17521747
-41: "O comprimento nao pode ser maior que 60 cm.",
1753-
-42: "O comprimento nao pode ser inferior a 16 cm.",
1748+
-42: "O comprimento nao pode ser inferior a 15 cm.",
17541749
-43: "A soma resultante do comprimento + largura nao deve superar a 120 cm.",
1755-
-44: "A largura nao pode ser inferior a 11 cm.",
1750+
-44: "A largura nao pode ser inferior a 10 cm.",
17561751
-45: "A largura nao pode ser maior que 60 cm.",
17571752
-888: "Erro ao calcular a tarifa",
17581753
6: "Localidade de origem não abrange o serviço informado",

correios/models/posting.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
VOLUMETRIC_WEIGHT_THRESHOLD = 5000 # g
5252

5353
MIN_WEIGHT, MAX_WEIGHT = 1, 30000 # g
54-
MIN_WIDTH, MAX_WIDTH = 11, 105 # cm
55-
MIN_HEIGHT, MAX_HEIGHT = 2, 105 # cm
56-
MIN_LENGTH, MAX_LENGTH = 16, 105 # cm
54+
MIN_WIDTH, MAX_WIDTH = 10, 100 # cm
55+
MIN_HEIGHT, MAX_HEIGHT = 1, 100 # cm
56+
MIN_LENGTH, MAX_LENGTH = 15, 100 # cm
5757
MIN_DIAMETER, MAX_DIAMETER = 5, 91 # cm
58-
MIN_CYLINDER_LENGTH, MAX_CYLINDER_LENGTH = 18, 105 # cm
59-
MIN_SIZE, MAX_SIZE = 29, 200 # cm
58+
MIN_CYLINDER_LENGTH, MAX_CYLINDER_LENGTH = 18, 100 # cm
59+
MIN_SIZE, MAX_SIZE = 26, 200 # cm
6060
MIN_CYLINDER_SIZE, MAX_CYLINDER_SIZE = 28, 200 # cm
6161
MIN_TOTAL_DIMENSIONS, MAX_TOTAL_DIMENSIONS = 0, 200 # cm
6262

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 120
3-
target-version = ["py37"]
3+
target-version = ["py38"]
44

55
[tool.isort]
66
line_length = 120

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def load_requirements(filename):
3939

4040
setup(
4141
name="correios",
42-
version="6.4.2",
42+
version="6.4.3",
4343
url="https://github.com/osantana/correios",
4444
author="Osvaldo Santana Neto",
4545
author_email="correiospy@osantana.me",

tests/test_posting_models.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,13 @@ def test_package_posting_weight_calculation(weight, width, height, length, posti
392392
(posting.Package.TYPE_ENVELOPE, 0, 0, 0, 1, exceptions.InvalidPackageDimensionsError),
393393
(posting.Package.TYPE_ENVELOPE, 1, 1, 1, 1, exceptions.InvalidPackageDimensionsError),
394394
(posting.Package.TYPE_BOX, 11, 2, 16, 1, exceptions.InvalidPackageDimensionsError), # invalid diameter
395-
(posting.Package.TYPE_BOX, 110, 2, 16, 0, exceptions.InvalidMaxPackageDimensionsError), # max width=105
395+
(posting.Package.TYPE_BOX, 110, 2, 16, 0, exceptions.InvalidMaxPackageDimensionsError), # max width=100
396396
(posting.Package.TYPE_BOX, 11, 110, 16, 0, exceptions.InvalidMaxPackageDimensionsError), # max height=110
397397
(posting.Package.TYPE_BOX, 11, 2, 110, 0, exceptions.InvalidMaxPackageDimensionsError), # max length=110
398-
(posting.Package.TYPE_BOX, 105, 105, 105, 0, exceptions.InvalidMaxPackageDimensionsError), # sum > 200
398+
(posting.Package.TYPE_BOX, 100, 100, 100, 0, exceptions.InvalidMaxPackageDimensionsError), # sum > 200
399399
(posting.Package.TYPE_CYLINDER, 1, 0, 18, 16, exceptions.InvalidPackageDimensionsError), # invalid width
400400
(posting.Package.TYPE_CYLINDER, 0, 1, 18, 16, exceptions.InvalidPackageDimensionsError), # invalid height
401-
(posting.Package.TYPE_CYLINDER, 0, 0, 110, 16, exceptions.InvalidMaxPackageDimensionsError), # max length=105
401+
(posting.Package.TYPE_CYLINDER, 0, 0, 110, 16, exceptions.InvalidMaxPackageDimensionsError), # max length=100
402402
(posting.Package.TYPE_CYLINDER, 0, 0, 18, 110, exceptions.InvalidMaxPackageDimensionsError), # max diameter=91
403403
(
404404
posting.Package.TYPE_CYLINDER,

0 commit comments

Comments
 (0)