# Path: mollie/api/objects/onboarding.py
# class Onboarding(ObjectBase):
#     @classmethod
#     def get_resource_class(cls, client):
#         from ..resources.onboarding import Onboarding as OnboardingResource
# 
#         return OnboardingResource(client)
# 
#     STATUS_NEEDS_DATA = "needs-data"
#     STATUS_IN_REVIEW = "in-review"  # Waiting for a valid mandate.
#     STATUS_COMPLETED = "completed"
# 
#     @property
#     def resource(self):
#         return self._get_property("resource")
# 
#     @property
#     def name(self):
#         return self._get_property("name")
# 
#     @property
#     def signed_up_at(self):
#         return self._get_property("signedUpAt")
# 
#     @property
#     def status(self):
#         return self._get_property("status")
# 
#     @property
#     def can_receive_payments(self):
#         return self._get_property("canReceivePayments")
# 
#     @property
#     def can_receive_settlements(self):
#         return self._get_property("canReceiveSettlements")
# 
#     @property
#     def organization(self):
#         """Retrieve organization for an onboarding."""
#         url = self._get_link("organization")
#         if url:
#             return self.client.organizations.from_url(url)
# 
#     def is_needs_data(self):
#         return self.status == self.STATUS_NEEDS_DATA
# 
#     def is_in_review(self):
#         return self.status == self.STATUS_IN_REVIEW
# 
#     def is_completed(self):
#         return self.status == self.STATUS_COMPLETED
# 
# 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.onboarding import Onboarding
from mollie.api.objects.organization import Organization

ORGANIZATION_ID = "org_12345678"


def test_get_onboarding(oauth_client, response):
    """Retrieve onboarding."""
    response.get("https://api.mollie.com/v2/onboarding/me", "onboarding_me")

    onboarding = oauth_client.onboarding.get("me")
    assert isinstance(onboarding, Onboarding)

    assert onboarding.resource == "onboarding"
    assert onboarding.name == "Mollie B.V."
    assert onboarding.signed_up_at == "2018-12-20T10:49:08+00:00"
    assert onboarding.status == "completed"
    assert onboarding.can_receive_payments is True
    assert onboarding.can_receive_settlements is True

    assert onboarding.is_needs_data() is False
    assert onboarding.is_in_review() is False
    assert onboarding.is_completed() is True


def test_create_onboarding(oauth_client, response):
    """Create onboarding."""
    response.post("https://api.mollie.com/v2/onboarding/me", "empty", 204)

    data = {"profile": {"categoryCode": "6012"}}

    onboarding = oauth_client.onboarding.create(resource_id="me", data=data)

# Path: mollie/api/objects/onboarding.py
# class Onboarding(ObjectBase):
#     @classmethod
#     def get_resource_class(cls, client):
#         from ..resources.onboarding import Onboarding as OnboardingResource
# 
#         return OnboardingResource(client)
# 
#     STATUS_NEEDS_DATA = "needs-data"
#     STATUS_IN_REVIEW = "in-review"  # Waiting for a valid mandate.
#     STATUS_COMPLETED = "completed"
# 
#     @property
#     def resource(self):
#         return self._get_property("resource")
# 
#     @property
#     def name(self):
#         return self._get_property("name")
# 
#     @property
#     def signed_up_at(self):
#         return self._get_property("signedUpAt")
# 
#     @property
#     def status(self):
#         return self._get_property("status")
# 
#     @property
#     def can_receive_payments(self):
#         return self._get_property("canReceivePayments")
# 
#     @property
#     def can_receive_settlements(self):
#         return self._get_property("canReceiveSettlements")
# 
#     @property
#     def organization(self):
#         """Retrieve organization for an onboarding."""
#         url = self._get_link("organization")
#         if url:
#             return self.client.organizations.from_url(url)
# 
#     def is_needs_data(self):
#         return self.status == self.STATUS_NEEDS_DATA
# 
#     def is_in_review(self):
#         return self.status == self.STATUS_IN_REVIEW
# 
#     def is_completed(self):
#         return self.status == self.STATUS_COMPLETED
# 
# 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_onboarding.py
from mollie.api.objects.onboarding import Onboarding
from mollie.api.objects.organization import Organization


ORGANIZATION_ID = "org_12345678"


def test_get_onboarding(oauth_client, response):
    """Retrieve onboarding."""
    response.get("https://api.mollie.com/v2/onboarding/me", "onboarding_me")

    onboarding = oauth_client.onboarding.get("me")
    assert isinstance(onboarding, Onboarding)

    assert onboarding.resource == "onboarding"
    assert onboarding.name == "Mollie B.V."
    assert onboarding.signed_up_at == "2018-12-20T10:49:08+00:00"
    assert onboarding.status == "completed"
    assert onboarding.can_receive_payments is True
    assert onboarding.can_receive_settlements is True

    assert onboarding.is_needs_data() is False
    assert onboarding.is_in_review() is False
    assert onboarding.is_completed() is True


def test_create_onboarding(oauth_client, response):
    """Create onboarding."""
    response.post("https://api.mollie.com/v2/onboarding/me", "empty", 204)

    data = {"profile": {"categoryCode": "6012"}}

    onboarding = oauth_client.onboarding.create(resource_id="me", data=data)

    assert isinstance(onboarding, Onboarding)