Skip to content

Commit 6946209

Browse files
Merge pull request #18 from LeandroDeJesus-S/feature/domain-split
feature: Project structure separated by domain
2 parents 9bb27e9 + 97b1f1e commit 6946209

22 files changed

Lines changed: 45 additions & 32 deletions

abacatepay/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
More examples found on https://abacatepay.readme.io/
1818
"""
1919

20-
from .billing import BillingClient
20+
from .billings import BillingClient
2121
from .customers import CustomerClient
2222

2323
class AbacatePay:

abacatepay/base/___init___.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
Module responsible for managing all objects that serve as a foundation for other objects.
3+
"""
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import requests
22
from typing import Literal
3-
from ._constants import USER_AGENT
4-
from .utils._exceptions import raise_for_status, APITimeoutError, APIConnectionError
3+
from ..constants import USER_AGENT
4+
from ..utils.exceptions import raise_for_status, APITimeoutError, APIConnectionError
55

66

77
class BaseClient:

abacatepay/billings/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .client import BillingClient
2+
from .models import BillingResponse
3+
4+
__all__ = ["BillingClient", "BillingResponse"]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
from ._constants import (
1+
from ..constants import (
22
BASE_URL,
33
BILLING_KINDS,
44
BILLING_METHODS,
55
)
6+
from ..products import Product
67
from .models import (
7-
Product,
88
BillingResponse,
99
Customer,
1010
)
11-
from ._base_client import BaseClient
11+
from ..base.client import BaseClient
1212
from logging import getLogger
1313

1414
logger = getLogger(__name__)
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import List, Union
2-
from .._constants import BILLING_STATUS, BILLING_METHODS, BILLING_KINDS
3-
from .customer import Customer
2+
from ..constants import BILLING_STATUS, BILLING_METHODS, BILLING_KINDS
3+
from ..customers.models import Customer
4+
45

56
class BillingResponse:
67
def __init__(self, data: dict):
@@ -29,4 +30,4 @@ def _format_json(self, data: dict):
2930
self.account_id: str = billing_data.get("accountId")
3031
self.store_id: str = billing_data.get("storeId")
3132
self.created_at: str = billing_data.get("createdAt")
32-
self.updated_at: str = billing_data.get("updatedAt")
33+
self.updated_at: str = billing_data.get("updatedAt")

abacatepay/customers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .client import CustomerClient
2+
from .models import Customer
3+
4+
__all__ = ["Customer", "CustomerClient"]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from ._constants import (
1+
from ..constants import (
22
BASE_URL,
33
)
44
from .models import Customer
5-
from ._base_client import BaseClient
5+
from ..base.client import BaseClient
66
from logging import getLogger
77

88
logger = getLogger(__name__)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pydantic import BaseModel
22

3+
34
class Customer(BaseModel):
45
"""
56
Customer model
@@ -27,4 +28,4 @@ def from_dict(cls, data: dict):
2728
name=metadata.get("name"),
2829
email=metadata.get("email"),
2930
cellphone=metadata.get("cellphone"),
30-
)
31+
)

0 commit comments

Comments
 (0)