Skip to content

Commit

Permalink
enrich unified models
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Oct 22, 2020
1 parent da9ffaf commit c3a2946
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion purplship/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""PurplShip Universal API."""
"""Purplship Universal API."""
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
6 changes: 3 additions & 3 deletions purplship/api/gateway.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""PurplShip API Gateway modules."""
"""Purplship API Gateway modules."""

import attr
import pkgutil
Expand Down Expand Up @@ -31,7 +31,7 @@ def create(self, settings: dict) -> Gateway:
class _ProviderMapper:
@property
def providers(self):
# Register PurplShip mappers
# Register Purplship mappers
return {
name: __import__(f"{mappers.__name__}.{name}", fromlist=[name])
for _, name, _ in pkgutil.iter_modules(mappers.__path__)
Expand Down Expand Up @@ -62,7 +62,7 @@ def initializer(settings: Union[Settings, dict]) -> Gateway:
gateway = _ProviderMapper()
logger.info(
f"""
PurplShip default gateway mapper initialized.
Purplship default gateway mapper initialized.
Registered providers: {','.join(gateway.providers)}
"""
)
2 changes: 1 addition & 1 deletion purplship/api/mapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""PurplShip Mapper base class definition module."""
"""Purplship Mapper base class definition module."""

import attr
from abc import ABC
Expand Down
2 changes: 1 addition & 1 deletion purplship/api/proxy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""PurplShip Proxy base class definition module."""
"""Purplship Proxy base class definition module."""

import attr
from abc import ABC
Expand Down
2 changes: 1 addition & 1 deletion purplship/core/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""PurplShip Custom Errors(Exception) definition modules"""
"""Purplship Custom Errors(Exception) definition modules"""
import warnings
from enum import Enum
from typing import Dict
Expand Down
14 changes: 3 additions & 11 deletions purplship/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ class Parcel:
dimension_unit: str = None


@attr.s(auto_attribs=True)
class Invoice:
"""invoice type."""

date: str
identifier: str = None
type: str = None
copies: int = None


@attr.s(auto_attribs=True)
class Card:
"""Credit Card type."""
Expand All @@ -92,6 +82,7 @@ class Payment:
account_number: str = None
credit_card: Card = JStruct[Card]
contact: Address = JStruct[Address]
id: str = None


@attr.s(auto_attribs=True)
Expand All @@ -105,12 +96,13 @@ class Customs:
content_type: str = None
content_description: str = None
incoterm: str = None
invoice: str = None
certificate_number: str = None
commodities: List[Commodity] = JList[Commodity]
duty: Payment = JStruct[Payment]
invoice: Invoice = JStruct[Invoice]
commercial_invoice: bool = False
options: Dict = {}
id: str = None


@attr.s(auto_attribs=True)
Expand Down
2 changes: 1 addition & 1 deletion purplship/core/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""PurplShip Settings base class definition"""
"""Purplship Settings base class definition"""

import attr
from typing import Optional
Expand Down
2 changes: 1 addition & 1 deletion purplship/core/utils/xml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""PurplShip lxml typing and utilities wrappers"""
"""Purplship lxml typing and utilities wrappers"""

from lxml import etree

Expand Down

0 comments on commit c3a2946

Please sign in to comment.