Skip to content

Commit

Permalink
Handle fc 8 (#142)
Browse files Browse the repository at this point in the history
* Add mapping for tracking event FC 08

* Improve exception message for invalid TRACKING_STATUS

* Add mapping for tracking event FC 09
  • Loading branch information
georgeyk authored and jllorencetti committed Feb 15, 2019
1 parent 680c921 commit a2f1d8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions correios/models/data.py
Expand Up @@ -979,6 +979,12 @@
'Objeto será devolvido ao remetente',
'Acompanhar o retorno do objeto ao remetente.',
),
('FC', 8): (
'shipped',
'Área com distribuição sujeita a prazo diferenciado',
'Restrição de entrega domiciliar temporária',
'Acompanhar',
),
('BDE', 9): (
'lost',
'Objeto não localizado',
Expand All @@ -1003,6 +1009,12 @@
'',
'Acompanhar',
),
('FC', 9): (
'delivery_unsuccessful',
'Remetente não retirou objeto na Unidade dos Correios',
'',
'Acompanhar',
),
('LDE', 9): (
'shipped',
'Objeto saiu para entrega ao remetente',
Expand Down
2 changes: 1 addition & 1 deletion correios/models/posting.py
Expand Up @@ -88,7 +88,7 @@ def _get_event_status_data(self, event_type, status_code):
try:
return TRACKING_STATUS[event_type, status_code]
except KeyError:
raise exceptions.InvalidEventStatusError("{} is not valid".format(event_type))
raise exceptions.InvalidEventStatusError("{}/{} is not valid".format(event_type, status_code))

@property
def display_event_type(self):
Expand Down

0 comments on commit a2f1d8b

Please sign in to comment.