# Path: mollie/api/objects/organization.py
# class Organization(ObjectBase):
#     @classmethod
#     def get_resource_class(cls, client):
#         from ..resources.organizations import Organizations
# 
#         return Organizations(client)
# 
#     @property
#     def id(self):
#         return self._get_property("id")
# 
#     @property
#     def name(self):
#         return self._get_property("name")
# 
#     @property
#     def email(self):
#         return self._get_property("email")
# 
#     @property
#     def locale(self):
#         return self._get_property("locale")
# 
#     @property
#     def address(self):
#         return self._get_property("address")
# 
#     @property
#     def registration_number(self):
#         return self._get_property("registrationNumber")
# 
#     @property
#     def vat_number(self):
#         return self._get_property("vatNumber")
# 
#     @property
#     def vat_regulation(self):
#         return self._get_property("vatRegulation")
# 
#     @property
#     def dashboard(self):
#         return self._get_link("dashboard")


from mollie.api.objects.organization import Organization

ORGANIZATION_ID = "org_12345678"


def test_get_organization(oauth_client, response):
    """Retrieve a single organization."""
    response.get(f"https://api.mollie.com/v2/organizations/{ORGANIZATION_ID}", "organization_single")

    organization = oauth_client.organizations.get(ORGANIZATION_ID)
    assert isinstance(organization, Organization)
    assert organization.id == ORGANIZATION_ID
    assert organization.name == "Mollie B.V."
    assert organization.email == "info@mollie.com"
    assert organization.locale == "nl_NL"
    assert organization.vat_number == "NL815839091B01"
    assert organization.vat_regulation == "dutch"
    assert organization.registration_number == "30204462"
    assert organization.address == {
        "city": "Amsterdam",
        "country": "NL",
        "postalCode": "1016 EE",
        "streetAndNumber": "Keizersgracht 313",
    }


def test_get_current_organization(oauth_client, response):
    """Retrieve a current organization."""
    response.get("https://api.mollie.com/v2/organizations/me", "organization_current")

    organization = oauth_client.organizations.get("me")

# Path: mollie/api/objects/organization.py
# class Organization(ObjectBase):
#     @classmethod
#     def get_resource_class(cls, client):
#         from ..resources.organizations import Organizations
# 
#         return Organizations(client)
# 
#     @property
#     def id(self):
#         return self._get_property("id")
# 
#     @property
#     def name(self):
#         return self._get_property("name")
# 
#     @property
#     def email(self):
#         return self._get_property("email")
# 
#     @property
#     def locale(self):
#         return self._get_property("locale")
# 
#     @property
#     def address(self):
#         return self._get_property("address")
# 
#     @property
#     def registration_number(self):
#         return self._get_property("registrationNumber")
# 
#     @property
#     def vat_number(self):
#         return self._get_property("vatNumber")
# 
#     @property
#     def vat_regulation(self):
#         return self._get_property("vatRegulation")
# 
#     @property
#     def dashboard(self):
#         return self._get_link("dashboard")


# Path: tests/test_organizations.py
from mollie.api.objects.organization import Organization


ORGANIZATION_ID = "org_12345678"


def test_get_organization(oauth_client, response):
    """Retrieve a single organization."""
    response.get(f"https://api.mollie.com/v2/organizations/{ORGANIZATION_ID}", "organization_single")

    organization = oauth_client.organizations.get(ORGANIZATION_ID)
    assert isinstance(organization, Organization)
    assert organization.id == ORGANIZATION_ID
    assert organization.name == "Mollie B.V."
    assert organization.email == "info@mollie.com"
    assert organization.locale == "nl_NL"
    assert organization.vat_number == "NL815839091B01"
    assert organization.vat_regulation == "dutch"
    assert organization.registration_number == "30204462"
    assert organization.address == {
        "city": "Amsterdam",
        "country": "NL",
        "postalCode": "1016 EE",
        "streetAndNumber": "Keizersgracht 313",
    }


def test_get_current_organization(oauth_client, response):
    """Retrieve a current organization."""
    response.get("https://api.mollie.com/v2/organizations/me", "organization_current")

    organization = oauth_client.organizations.get("me")

    assert isinstance(organization, Organization)