From 812eca9d3879ab326258e17bf8b387da773ecea4 Mon Sep 17 00:00:00 2001 From: Edvinas Ilcenko Date: Mon, 29 Jul 2024 11:49:05 +0300 Subject: [PATCH 1/2] AVB-821 Ticket.priceZone --- livestyled/models/tests/test_ticket.py | 4 ++++ livestyled/models/ticket.py | 7 ++++++- livestyled/schemas/tests/test_ticket.py | 5 +++++ livestyled/schemas/ticket.py | 1 + livestyled/tests/test_resource_client_ticket.py | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/livestyled/models/tests/test_ticket.py b/livestyled/models/tests/test_ticket.py index 651aef0..f88b904 100644 --- a/livestyled/models/tests/test_ticket.py +++ b/livestyled/models/tests/test_ticket.py @@ -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', @@ -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', @@ -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', @@ -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', diff --git a/livestyled/models/ticket.py b/livestyled/models/ticket.py index 3e4424e..3873f08 100644 --- a/livestyled/models/ticket.py +++ b/livestyled/models/ticket.py @@ -31,6 +31,7 @@ def __init__( row, price_code, price_type, + price_zone, created_at, updated_at, user_id, @@ -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: @@ -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, @@ -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, @@ -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, @@ -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: diff --git a/livestyled/schemas/tests/test_ticket.py b/livestyled/schemas/tests/test_ticket.py index 20b2597..541afb6 100644 --- a/livestyled/schemas/tests/test_ticket.py +++ b/livestyled/schemas/tests/test_ticket.py @@ -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, @@ -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, @@ -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': 'someoneelse@livestyled.com', 'redeemer_id': 1234, @@ -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, @@ -321,6 +325,7 @@ def test_serialize_ticket(): 'seat': None, 'price': 0, 'priceType': None, + 'priceZone': None, 'externalCustomerRef': None, 'sessionDate': None, 'redeemerEmail': None, diff --git a/livestyled/schemas/ticket.py b/livestyled/schemas/ticket.py index b0dc02b..4a221b6 100644 --- a/livestyled/schemas/ticket.py +++ b/livestyled/schemas/ticket.py @@ -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) diff --git a/livestyled/tests/test_resource_client_ticket.py b/livestyled/tests/test_resource_client_ticket.py index 609cb4a..2957375 100644 --- a/livestyled/tests/test_resource_client_ticket.py +++ b/livestyled/tests/test_resource_client_ticket.py @@ -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 @@ -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 @@ -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 == 'someoneelse@livestyled.com' assert ticket.redeemer_id == 1234 assert isinstance(ticket.redeemer, User) From 700d44191eb07dab1087de8eda4ef8596b3890d6 Mon Sep 17 00:00:00 2001 From: Edvinas Ilcenko Date: Mon, 29 Jul 2024 11:50:11 +0300 Subject: [PATCH 2/2] AVB-821 Bump-up version to 1.4.12 --- livestyled/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/livestyled/__init__.py b/livestyled/__init__.py index a314565..14895e4 100644 --- a/livestyled/__init__.py +++ b/livestyled/__init__.py @@ -1 +1 @@ -__version__ = '1.4.11' +__version__ = '1.4.12'