Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
Remove owner como obrigatoriedade do Seller (#98)
Browse files Browse the repository at this point in the history
* altera exemplo

* altera testes

* altera campos do business seller

* fmt
  • Loading branch information
rodrigondec committed Aug 24, 2020
1 parent be41560 commit 4f0602f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 38 deletions.
20 changes: 10 additions & 10 deletions examples/data/add_business_seller.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "8818dc0cbe1843cc8140f0bb362620c7",
"id": "a482a4d33d3741b287071132bb3225af",
"status": "pending",
"resource": "seller",
"type": "business",
Expand All @@ -14,7 +14,7 @@
"business_opening_date": "0000-00-00",
"business_facebook": null,
"business_twitter": null,
"ein": "70722684542436",
"ein": "16535515052002",
"statement_descriptor": null,
"mcc": null,
"business_address": {
Expand All @@ -28,12 +28,12 @@
"country_code": "BR"
},
"owner": {
"first_name": "foo",
"last_name": "foo",
"email": "foo",
"phone_number": "foo",
"taxpayer_id": "19642334372",
"birthdate": "0000-00-00",
"first_name": null,
"last_name": null,
"email": null,
"phone_number": null,
"taxpayer_id": null,
"birthdate": null,
"address": {
"line1": null,
"line2": null,
Expand All @@ -58,6 +58,6 @@
"uri": "/v1/marketplaces/foo/sellers/businesses/",
"marketplace_id": "foo",
"metadata": {},
"created_at": "2020-05-13T21:00:30+00:00",
"updated_at": "2020-05-13T21:00:30+00:00"
"created_at": "2020-08-24T17:22:06+00:00",
"updated_at": "2020-08-24T17:22:07+00:00"
}
20 changes: 1 addition & 19 deletions examples/seller/add_business_seller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pycpfcnpj import gen

from zoop_wrapper import ZoopWrapper, Seller, Address, Person
from zoop_wrapper import ZoopWrapper, Seller, Address
from examples.utils import dump_response

"""
Expand Down Expand Up @@ -31,24 +31,6 @@
business_phone="foo",
business_website="foo",
ein=gen.cnpj(),
owner=Person(
birthdate="foo",
email="foo",
first_name="foo",
last_name="foo",
phone_number="foo",
taxpayer_id=gen.cpf(),
address=Address(
city="Natal",
country_code="BR",
line1="foo",
line2="123",
line3="barbar",
neighborhood="fooofoo",
postal_code="59100000",
state="RN",
),
),
)


Expand Down
8 changes: 3 additions & 5 deletions tests/models/test_seller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def test_non_required_fields(self):
"decline_on_fail_security_code",
"decline_on_fail_zipcode",
"is_mobile",
"mcc",
"merchant_code",
"show_profile_online",
"statement_descriptor",
"terminal_code",
"type",
"merchant_code",
"mcc",
},
Seller.get_non_required_fields(),
)
Expand All @@ -46,14 +46,13 @@ def test_business_required_fields(self):
"business_phone",
"business_website",
"ein",
"owner",
},
Seller.get_business_required_fields(),
)

def test_business_non_required_fields(self):
self.assertIsSubSet(
{"business_description", "business_facebook", "business_twitter"},
{"owner", "business_description", "business_facebook", "business_twitter"},
Seller.get_business_non_required_fields(),
)

Expand Down Expand Up @@ -101,7 +100,6 @@ def test_business_get_validation_fields(self):
"business_opening_date",
"business_phone",
"business_website",
"owner",
},
instance.get_validation_fields(),
)
Expand Down
7 changes: 3 additions & 4 deletions zoop_wrapper/models/seller.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ def get_non_required_fields(cls):
"decline_on_fail_security_code",
"decline_on_fail_zipcode",
"is_mobile",
"mcc",
"merchant_code",
"show_profile_online",
"statement_descriptor",
"terminal_code",
"type",
"merchant_code",
"mcc",
},
)

Expand All @@ -130,7 +130,7 @@ def get_business_non_required_fields(cls):
fields = cls.get_non_required_fields()
return fields.union(
super().get_business_non_required_fields(),
{"business_description", "business_facebook", "business_twitter"},
{"owner", "business_description", "business_facebook", "business_twitter"},
)

@classmethod
Expand All @@ -151,7 +151,6 @@ def get_business_required_fields(cls):
"business_opening_date",
"business_phone",
"business_website",
"owner",
},
)

Expand Down

0 comments on commit 4f0602f

Please sign in to comment.