Skip to content

Commit

Permalink
Merge pull request #96 from Edvinas9/feature/AVB-821-ticket-zone
Browse files Browse the repository at this point in the history
AVB-821 Ticket.priceZone
  • Loading branch information
tomrutherford-livestyled authored Jul 29, 2024
2 parents 81940c8 + 700d441 commit 5f1870a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion livestyled/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.4.11'
__version__ = '1.4.12'
4 changes: 4 additions & 0 deletions livestyled/models/tests/test_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_ticket_difference():
external_event_id=282848348,
price_code='GBP',
price_type='Full price',
price_zone='Some price zone',
barcode=83736474849494,
sector_name='C',
section='20',
Expand Down Expand Up @@ -55,6 +56,7 @@ def test_ticket_difference():
external_event_id=282848348,
price_code='GBP',
price_type='Full price',
price_zone='Some price zone',
barcode=83736474849494,
sector_name='C',
section='20',
Expand Down Expand Up @@ -108,6 +110,7 @@ def test_ticket_difference_with_empty_ticket_additional_fields():
external_event_id=282848348,
price_code='GBP',
price_type='Full price',
price_zone='Some price zone',
barcode=83736474849494,
sector_name='C',
section='20',
Expand Down Expand Up @@ -142,6 +145,7 @@ def test_ticket_difference_with_empty_ticket_additional_fields():
external_event_id=282848348,
price_code='GBP',
price_type='Full price',
price_zone='Some price zone',
barcode=83736474849494,
sector_name='C',
section='20',
Expand Down
7 changes: 6 additions & 1 deletion livestyled/models/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
row,
price_code,
price_type,
price_zone,
created_at,
updated_at,
user_id,
Expand Down Expand Up @@ -88,6 +89,7 @@ def __init__(
self.row = row
self.price_code = price_code
self.price_type = price_type
self.price_zone = price_zone
if user_id:
self._user = User.placeholder(id=user_id)
else:
Expand Down Expand Up @@ -204,6 +206,7 @@ def placeholder(
row=None,
price_code=None,
price_type=None,
price_zone=None,
created_at=None,
updated_at=None,
user_id=None,
Expand Down Expand Up @@ -260,6 +263,7 @@ def create_new(
external_customer_ref=None,
price_code=None,
price_type=None,
price_zone=None,
entrance=None,
status=None,
can_share=False,
Expand Down Expand Up @@ -315,6 +319,7 @@ def create_new(
row=row,
price_code=price_code,
price_type=price_type,
price_zone=price_zone,
user_id=None,
status=status,
can_share=can_share,
Expand Down Expand Up @@ -407,7 +412,7 @@ def diff(self, existing):
'client_email', 'price', 'status', 'can_share', 'sharer_email', 'redeemed_at', 'redeemer_id', 'share_code',
'redeemer_email', 'parent_ticket', 'shared_at', 'legal_long_text', 'legal_short_text', 'map_url',
'map_image_url', 'ticket_integration', 'entrance', 'row', 'section', 'price_code', 'price_type',
'external_customer_ref', 'venue', 'event', 'event_date', 'currency', 'external_card_ref',
'price_zone', 'external_customer_ref', 'venue', 'event', 'event_date', 'currency', 'external_card_ref',
'additional_fields', 'printed', 'timezone', 'ticket_type', 'aisle'
)
for field in fields:
Expand Down
5 changes: 5 additions & 0 deletions livestyled/schemas/tests/test_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_deserialize_ticket():
'price': 199,
'price_code': None,
'price_type': None,
'price_zone': None,
'qr_code_url': '',
'redeemer_email': None,
'redeemer_id': None,
Expand Down Expand Up @@ -116,6 +117,7 @@ def test_deserialize_ticket_shared():
'price': 199,
'price_code': None,
'price_type': None,
'price_zone': None,
'qr_code_url': '',
'redeemer_email': None,
'redeemer_id': None,
Expand Down Expand Up @@ -177,6 +179,7 @@ def test_deserialize_ticket_shared_redeemed():
'price': 199,
'price_code': None,
'price_type': None,
'price_zone': None,
'qr_code_url': '',
'redeemer_email': '[email protected]',
'redeemer_id': 1234,
Expand Down Expand Up @@ -238,6 +241,7 @@ def test_deserialize_ticket_with_event_and_venue():
'price': None,
'price_code': 'LÄKTARE 1 LÅNGSIDA,',
'price_type': None,
'price_zone': None,
'qr_code_url': 'http://api-staging.livestyled.com/v3/web/tickets/qr-code/224199046363003230328509.png',
'redeemer_email': None,
'redeemer_id': None,
Expand Down Expand Up @@ -321,6 +325,7 @@ def test_serialize_ticket():
'seat': None,
'price': 0,
'priceType': None,
'priceZone': None,
'externalCustomerRef': None,
'sessionDate': None,
'redeemerEmail': None,
Expand Down
1 change: 1 addition & 0 deletions livestyled/schemas/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class Meta:
status = fields.String(required=False, missing=None)
price_code = fields.String(data_key='priceCode', required=False, missing=None)
price_type = fields.String(data_key='priceType', required=False, missing=None)
price_zone = fields.String(data_key='priceZone', required=False, missing=None)
created_at = fields.AwareDateTime(data_key='createdAt', allow_none=False)
updated_at = fields.AwareDateTime(data_key='updatedAt', allow_none=False)
user_id = RelatedResourceLinkField(schema=UserSchema, required=False, missing=None, data_key='user', microservice_aware=False)
Expand Down
3 changes: 3 additions & 0 deletions livestyled/tests/test_resource_client_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_get_ticket(requests_mock):
assert ticket.price == 199
assert ticket.price_code is None
assert ticket.price_type is None
assert ticket.price_zone is None
assert ticket.redeemer_email is None
assert ticket.redeemer_id is None
assert ticket.redeemer is None
Expand Down Expand Up @@ -89,6 +90,7 @@ def test_get_ticket_shared(requests_mock):
assert ticket.price == 199
assert ticket.price_code is None
assert ticket.price_type is None
assert ticket.price_zone is None
assert ticket.redeemer_email is None
assert ticket.redeemer_id is None
assert ticket.redeemer is None
Expand Down Expand Up @@ -137,6 +139,7 @@ def test_get_ticket_shared_redeemed(requests_mock):
assert ticket.price == 199
assert ticket.price_code is None
assert ticket.price_type is None
assert ticket.price_zone is None
assert ticket.redeemer_email == '[email protected]'
assert ticket.redeemer_id == 1234
assert isinstance(ticket.redeemer, User)
Expand Down

0 comments on commit 5f1870a

Please sign in to comment.