otrs-somconnexio 0.6.1__py2.py3-none-any.whl → 0.6.3__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py +12 -1
- otrs_somconnexio/otrs_models/fiber_dynamic_fields.py +0 -4
- otrs_somconnexio/otrs_models/mobile_data.py +2 -0
- otrs_somconnexio/otrs_models/mobile_dynamic_fields.py +0 -4
- otrs_somconnexio/otrs_models/provision_dynamic_fields.py +4 -0
- otrs_somconnexio/otrs_models/ticket_factory.py +1 -1
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket.py +17 -3
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket_mobile_pack.py +51 -0
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket_shared_bonds.py +6 -38
- otrs_somconnexio/otrs_models/ticket_types/we_call_you_ticket.py +18 -5
- {otrs_somconnexio-0.6.1.dist-info → otrs_somconnexio-0.6.3.dist-info}/METADATA +1 -1
- {otrs_somconnexio-0.6.1.dist-info → otrs_somconnexio-0.6.3.dist-info}/RECORD +21 -19
- tests/integration/test_ticket_factory.py +5 -2
- tests/otrs_models/test_switchboard_dynamic_fields.py +6 -0
- tests/otrs_models/test_ticket_factory.py +14 -1
- tests/otrs_models/ticket_types/test_change_tariff.py +104 -7
- tests/otrs_models/ticket_types/test_change_tariff_mobile_pack.py +151 -0
- tests/otrs_models/ticket_types/test_change_tariff_shared_bonds.py +5 -91
- tests/otrs_models/ticket_types/test_we_call_you.py +35 -10
- {otrs_somconnexio-0.6.1.dist-info → otrs_somconnexio-0.6.3.dist-info}/WHEEL +0 -0
- {otrs_somconnexio-0.6.1.dist-info → otrs_somconnexio-0.6.3.dist-info}/top_level.txt +0 -0
|
@@ -4,12 +4,23 @@ class WeCallYouConfiguration:
|
|
|
4
4
|
type = "Petición"
|
|
5
5
|
state = "new"
|
|
6
6
|
priority = "3 normal"
|
|
7
|
-
subject = "Formulari 'Vols que et truquem?'"
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class WeCallYouCATConfiguration(WeCallYouConfiguration):
|
|
11
10
|
queue_id = 144
|
|
11
|
+
subject = "Formulari 'Vols que et truquem?' (CAT)"
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class WeCallYouESConfiguration(WeCallYouConfiguration):
|
|
15
15
|
queue_id = 145
|
|
16
|
+
subject = "Formulari 'Vols que et truquem?' (ES)"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class WeCallYouCompanyCATConfiguration(WeCallYouConfiguration):
|
|
20
|
+
queue_id = 230
|
|
21
|
+
subject = "Formulari 'Vols que et truquem?' - Empreses (CAT)"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class WeCallYouCompanyESConfiguration(WeCallYouConfiguration):
|
|
25
|
+
queue_id = 231
|
|
26
|
+
subject = "Formulari 'Vols que et truquem?' - Empreses (ES)"
|
|
@@ -15,7 +15,6 @@ class FiberDynamicFields(InternetDynamicFields):
|
|
|
15
15
|
self._df_mobile_pack_contracts(),
|
|
16
16
|
self._df_all_grouped_SIMS_recieved(),
|
|
17
17
|
self._df_has_previous_owner_with_mobile_pack_contracts(),
|
|
18
|
-
self._df_has_documentation(),
|
|
19
18
|
self._df_product_ba_mm(),
|
|
20
19
|
self._keep_landline_number(),
|
|
21
20
|
]
|
|
@@ -60,9 +59,6 @@ class FiberDynamicFields(InternetDynamicFields):
|
|
|
60
59
|
value=has_grouped_mobile_with_previous_owner,
|
|
61
60
|
)
|
|
62
61
|
|
|
63
|
-
def _df_has_documentation(self):
|
|
64
|
-
return DynamicField(name="flagDocumentacio", value="0")
|
|
65
|
-
|
|
66
62
|
def _df_product_ba_mm(self):
|
|
67
63
|
return DynamicField(name="productBAMM", value=self.service_data.product_ba_mm)
|
|
68
64
|
|
|
@@ -27,6 +27,7 @@ class MobileData:
|
|
|
27
27
|
activation_notes="",
|
|
28
28
|
notes="",
|
|
29
29
|
is_grouped_with_fiber=False,
|
|
30
|
+
is_from_pack=False,
|
|
30
31
|
fiber_linked="",
|
|
31
32
|
shared_bond_id="",
|
|
32
33
|
):
|
|
@@ -53,6 +54,7 @@ class MobileData:
|
|
|
53
54
|
self.activation_notes = activation_notes
|
|
54
55
|
self.notes = notes
|
|
55
56
|
self.is_grouped_with_fiber = is_grouped_with_fiber
|
|
57
|
+
self.is_from_pack = is_from_pack
|
|
56
58
|
self.fiber_linked = fiber_linked
|
|
57
59
|
self.shared_bond_id = shared_bond_id
|
|
58
60
|
self.contact_phone = contact_phone
|
|
@@ -27,7 +27,6 @@ class MobileDynamicFields(ProvisionDynamicFields):
|
|
|
27
27
|
self._delivery_state(),
|
|
28
28
|
self._fiber_linked(),
|
|
29
29
|
self._shared_bond_id(),
|
|
30
|
-
self._has_documentation(),
|
|
31
30
|
self._confirm_doc(),
|
|
32
31
|
]
|
|
33
32
|
|
|
@@ -114,8 +113,5 @@ class MobileDynamicFields(ProvisionDynamicFields):
|
|
|
114
113
|
name="IDAbonamentCompartit", value=self.service_data.shared_bond_id
|
|
115
114
|
)
|
|
116
115
|
|
|
117
|
-
def _has_documentation(self):
|
|
118
|
-
return DynamicField(name="flagDocumentacio", value="0")
|
|
119
|
-
|
|
120
116
|
def _confirm_doc(self):
|
|
121
117
|
return DynamicField(name="confirmDoc", value="no")
|
|
@@ -27,6 +27,7 @@ class ProvisionDynamicFields:
|
|
|
27
27
|
self._service_technology(),
|
|
28
28
|
self._sales_team(),
|
|
29
29
|
self._has_active_contracts(),
|
|
30
|
+
self._has_documentation(),
|
|
30
31
|
self._lang(),
|
|
31
32
|
]
|
|
32
33
|
dynamic_fields += self._build_specific_dynamic_fields()
|
|
@@ -96,3 +97,6 @@ class ProvisionDynamicFields:
|
|
|
96
97
|
name="equipVendes",
|
|
97
98
|
value=sales_team_dct.get(self.service_data.sales_team, ""),
|
|
98
99
|
)
|
|
100
|
+
|
|
101
|
+
def _has_documentation(self):
|
|
102
|
+
return DynamicField(name="flagDocumentacio", value="0")
|
|
@@ -25,7 +25,7 @@ class TicketFactory(object):
|
|
|
25
25
|
elif self.service_data.service_type == "mobile":
|
|
26
26
|
if self.service_data.is_grouped_with_fiber and (
|
|
27
27
|
self.service_data.type == "portability"
|
|
28
|
-
or self.service_data.
|
|
28
|
+
or self.service_data.is_from_pack
|
|
29
29
|
):
|
|
30
30
|
TicketClass = MobilePausedTicket
|
|
31
31
|
else:
|
|
@@ -40,7 +40,6 @@ class ChangeTariffTicket(BaseCustomerTicket):
|
|
|
40
40
|
"enviarNotificacio": self._transform_boolean_df(
|
|
41
41
|
self.fields.get("send_notification", "1")
|
|
42
42
|
),
|
|
43
|
-
"IDAbonamentCompartit": self.fields.get("shared_bond_id", ""),
|
|
44
43
|
"TecDelServei": "Mobil",
|
|
45
44
|
}
|
|
46
45
|
|
|
@@ -54,7 +53,19 @@ class ChangeTariffExceptionalTicket(ChangeTariffTicket):
|
|
|
54
53
|
return "Sol·licitud Canvi de tarifa excepcional"
|
|
55
54
|
|
|
56
55
|
|
|
57
|
-
class
|
|
56
|
+
class ChangeTariffMobilePackTicket(ChangeTariffTicket):
|
|
57
|
+
def _get_subject(self):
|
|
58
|
+
return "Sol·licitud canvi de tarifa pack apinyades"
|
|
59
|
+
|
|
60
|
+
def _get_dynamic_fields(self):
|
|
61
|
+
dynamic_fields = super()._get_dynamic_fields()
|
|
62
|
+
dynamic_fields.update(
|
|
63
|
+
{"creadorAbonament": bool(self.fields.get("pack_creator", False))}
|
|
64
|
+
)
|
|
65
|
+
return dynamic_fields
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class ChangeTariffSharedBondTicket(ChangeTariffMobilePackTicket):
|
|
58
69
|
def __init__(
|
|
59
70
|
self,
|
|
60
71
|
username,
|
|
@@ -65,9 +76,12 @@ class ChangeTariffSharedBondTicket(ChangeTariffTicket):
|
|
|
65
76
|
super().__init__(username, customer_code, fields_dict, override_ticket_ids)
|
|
66
77
|
self.configuration = ChangeTariffSharedBondTicketConfiguration()
|
|
67
78
|
|
|
79
|
+
def _get_subject(self):
|
|
80
|
+
return "Sol·licitud canvi de tarifa pack amb dades compartides"
|
|
81
|
+
|
|
68
82
|
def _get_dynamic_fields(self):
|
|
69
83
|
dynamic_fields = super()._get_dynamic_fields()
|
|
70
84
|
dynamic_fields.update(
|
|
71
|
-
{"
|
|
85
|
+
{"IDAbonamentCompartit": self.fields.get("shared_bond_id", "")}
|
|
72
86
|
)
|
|
73
87
|
return dynamic_fields
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from otrs_somconnexio.client import OTRSClient
|
|
2
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket import (
|
|
3
|
+
ChangeTariffMobilePackTicket,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ChangeTariffTicketMobilePack:
|
|
8
|
+
def __init__(
|
|
9
|
+
self,
|
|
10
|
+
username,
|
|
11
|
+
customer_code,
|
|
12
|
+
fields_dict,
|
|
13
|
+
override_ticket_ids=[],
|
|
14
|
+
# TODO: Can we remove this field?
|
|
15
|
+
fallback_path="/tmp/tickets/",
|
|
16
|
+
):
|
|
17
|
+
self.username = username
|
|
18
|
+
self.customer_code = customer_code
|
|
19
|
+
self.fields = fields_dict
|
|
20
|
+
self.override_ticket_ids = override_ticket_ids
|
|
21
|
+
self.TicketClass = ChangeTariffMobilePackTicket
|
|
22
|
+
|
|
23
|
+
def create(self):
|
|
24
|
+
fields = self.fields
|
|
25
|
+
contracts = fields.pop("contracts")
|
|
26
|
+
otrs_client = OTRSClient()
|
|
27
|
+
|
|
28
|
+
fields_creator = fields.copy()
|
|
29
|
+
fields_creator.update({"pack_creator": True})
|
|
30
|
+
ticket_creator = self._create_ticket(
|
|
31
|
+
fields_creator, contracts.pop(0), self.override_ticket_ids
|
|
32
|
+
)
|
|
33
|
+
for contract in contracts:
|
|
34
|
+
ticket = self._create_ticket(fields, contract, self.override_ticket_ids)
|
|
35
|
+
otrs_client.link_tickets(
|
|
36
|
+
ticket_creator.id, ticket.id, link_type="ParentChild"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def _create_ticket(self, fields, contract, override_ticket_ids):
|
|
40
|
+
fields["phone_number"] = contract["phone_number"]
|
|
41
|
+
fields["current_product_code"] = contract["current_product_code"]
|
|
42
|
+
fields["subscription_email"] = contract["subscription_email"]
|
|
43
|
+
|
|
44
|
+
return self.TicketClass(
|
|
45
|
+
self.username, self.customer_code, fields, override_ticket_ids
|
|
46
|
+
).create()
|
|
47
|
+
|
|
48
|
+
def update(self, ticket_id, article=None, dynamic_fields=None, state=None):
|
|
49
|
+
self.TicketClass(self.username, self.customer_code, {}).update(
|
|
50
|
+
ticket_id, article, dynamic_fields, state
|
|
51
|
+
)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
from otrs_somconnexio.
|
|
2
|
-
|
|
3
|
-
ChangeTariffSharedBondTicketConfiguration,
|
|
1
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_mobile_pack import (
|
|
2
|
+
ChangeTariffTicketMobilePack,
|
|
4
3
|
)
|
|
5
4
|
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket import (
|
|
6
5
|
ChangeTariffSharedBondTicket,
|
|
7
6
|
)
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
class ChangeTariffTicketSharedBond:
|
|
9
|
+
class ChangeTariffTicketSharedBond(ChangeTariffTicketMobilePack):
|
|
11
10
|
def __init__(
|
|
12
11
|
self,
|
|
13
12
|
username,
|
|
@@ -17,38 +16,7 @@ class ChangeTariffTicketSharedBond:
|
|
|
17
16
|
# TODO: Can we remove this field?
|
|
18
17
|
fallback_path="/tmp/tickets/",
|
|
19
18
|
):
|
|
20
|
-
self.
|
|
21
|
-
|
|
22
|
-
self.fields = fields_dict
|
|
23
|
-
self.override_ticket_ids = override_ticket_ids
|
|
24
|
-
self.configuration = ChangeTariffSharedBondTicketConfiguration()
|
|
25
|
-
|
|
26
|
-
def create(self):
|
|
27
|
-
fields = self.fields
|
|
28
|
-
contracts = fields.pop("contracts")
|
|
29
|
-
otrs_client = OTRSClient()
|
|
30
|
-
|
|
31
|
-
fields_creator = fields.copy()
|
|
32
|
-
fields_creator.update({"shared_bond_creator": True})
|
|
33
|
-
ticket_creator = self._create_ticket(
|
|
34
|
-
fields_creator, contracts.pop(0), self.override_ticket_ids
|
|
19
|
+
super(ChangeTariffTicketSharedBond, self).__init__(
|
|
20
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
35
21
|
)
|
|
36
|
-
|
|
37
|
-
ticket = self._create_ticket(fields, contract, self.override_ticket_ids)
|
|
38
|
-
otrs_client.link_tickets(
|
|
39
|
-
ticket_creator.id, ticket.id, link_type="ParentChild"
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
def _create_ticket(self, fields, contract, override_ticket_ids):
|
|
43
|
-
fields["phone_number"] = contract["phone_number"]
|
|
44
|
-
fields["current_product_code"] = contract["current_product_code"]
|
|
45
|
-
fields["subscription_email"] = contract["subscription_email"]
|
|
46
|
-
|
|
47
|
-
return ChangeTariffSharedBondTicket(
|
|
48
|
-
self.username, self.customer_code, fields, override_ticket_ids
|
|
49
|
-
).create()
|
|
50
|
-
|
|
51
|
-
def update(self, ticket_id, article=None, dynamic_fields=None, state=None):
|
|
52
|
-
ChangeTariffSharedBondTicket(
|
|
53
|
-
self.username, self.customer_code, {}
|
|
54
|
-
).update(ticket_id, article, dynamic_fields, state)
|
|
22
|
+
self.TicketClass = ChangeTariffSharedBondTicket
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
from otrs_somconnexio.otrs_models.configurations.querys.we_call_you import (
|
|
2
2
|
WeCallYouCATConfiguration,
|
|
3
|
+
WeCallYouCompanyCATConfiguration,
|
|
4
|
+
WeCallYouCompanyESConfiguration,
|
|
3
5
|
WeCallYouESConfiguration,
|
|
4
6
|
)
|
|
5
|
-
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import
|
|
7
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import (
|
|
8
|
+
BaseCustomerTicket,
|
|
9
|
+
)
|
|
6
10
|
|
|
7
11
|
|
|
8
12
|
class WeCallYouTicket(BaseCustomerTicket):
|
|
@@ -10,10 +14,8 @@ class WeCallYouTicket(BaseCustomerTicket):
|
|
|
10
14
|
super(WeCallYouTicket, self).__init__(
|
|
11
15
|
username, customer_code, fields_dict, *args
|
|
12
16
|
)
|
|
13
|
-
self.configuration = (
|
|
14
|
-
|
|
15
|
-
if fields_dict["language"] == "ca_ES"
|
|
16
|
-
else WeCallYouESConfiguration
|
|
17
|
+
self.configuration = self._get_congifuration(
|
|
18
|
+
fields_dict["language"], fields_dict["is_company"]
|
|
17
19
|
)
|
|
18
20
|
|
|
19
21
|
def _get_activity_id(self):
|
|
@@ -34,4 +36,15 @@ class WeCallYouTicket(BaseCustomerTicket):
|
|
|
34
36
|
"horariTrucada": self.fields["schedule"],
|
|
35
37
|
"telefonContacte": self.fields["phone"],
|
|
36
38
|
"motiuTrucada": self.fields["reason"],
|
|
39
|
+
"midaEmpresa": self.fields.get("company_size"),
|
|
37
40
|
}
|
|
41
|
+
|
|
42
|
+
def _get_congifuration(self, lang, is_company):
|
|
43
|
+
if lang == "ca_ES":
|
|
44
|
+
if is_company:
|
|
45
|
+
return WeCallYouCompanyCATConfiguration
|
|
46
|
+
return WeCallYouCATConfiguration
|
|
47
|
+
else:
|
|
48
|
+
if is_company:
|
|
49
|
+
return WeCallYouCompanyESConfiguration
|
|
50
|
+
return WeCallYouESConfiguration
|
|
@@ -11,16 +11,16 @@ otrs_somconnexio/otrs_models/coverage_ticket.py,sha256=np7dzWjpqZEdB8n6wpN4qOiOG
|
|
|
11
11
|
otrs_somconnexio/otrs_models/customer_data.py,sha256=nWTot_N78UIdZ3D7BQ2LomRF65xWL_OakpdrYLq1V4I,563
|
|
12
12
|
otrs_somconnexio/otrs_models/customer_user.py,sha256=9LRUxWQS4gxoBoyFwU_wLb9zXiTEbd0V6yU4F051KI8,913
|
|
13
13
|
otrs_somconnexio/otrs_models/fiber_data.py,sha256=b8OVbAPBBUUzcQQP5HXRjzm7fvdqlM8keNlGsAF6t9c,576
|
|
14
|
-
otrs_somconnexio/otrs_models/fiber_dynamic_fields.py,sha256=
|
|
14
|
+
otrs_somconnexio/otrs_models/fiber_dynamic_fields.py,sha256=nJzi-vjWhRyWsvH85KxzQ8FjOHkRJFsikkpDLLXZHjA,2559
|
|
15
15
|
otrs_somconnexio/otrs_models/fiber_ticket.py,sha256=MvhegKUXkJFqWWZZsJ6JksRwvY5cZAZNM1yY9DuNuH8,846
|
|
16
16
|
otrs_somconnexio/otrs_models/internet_data.py,sha256=5fYV8jTInYJSLjFSAJsnwClzB3MB029KQJXwAyAYqZo,2627
|
|
17
17
|
otrs_somconnexio/otrs_models/internet_dynamic_fields.py,sha256=rsYuGQ8dEyBAqIgyqNVA-76WgCb0y67c3e-Kx9F6MsQ,5018
|
|
18
|
-
otrs_somconnexio/otrs_models/mobile_data.py,sha256=
|
|
19
|
-
otrs_somconnexio/otrs_models/mobile_dynamic_fields.py,sha256=
|
|
18
|
+
otrs_somconnexio/otrs_models/mobile_data.py,sha256=vnJpFAyBFdG84iMsw5VPN-8LUDp7RQVyInvvBVPFBqI,1829
|
|
19
|
+
otrs_somconnexio/otrs_models/mobile_dynamic_fields.py,sha256=tPRieBkGskBVySuSJ6Zob_ublrAB3h-eofqcfRz-rxY,3884
|
|
20
20
|
otrs_somconnexio/otrs_models/mobile_ticket.py,sha256=NQb809r71CYg76jWvsI55-KdM1Oiysg9zhSCuS67fYU,1171
|
|
21
21
|
otrs_somconnexio/otrs_models/providers.py,sha256=Jy5lm_gCuwy_BhpNE5JJ5-TrE8aFQpZvMiYZ-PTlgqs,181
|
|
22
22
|
otrs_somconnexio/otrs_models/provision_article.py,sha256=jONH4lHzjg2jyx_mxjghw503oUT9VI9QwZrJ25HdOS0,469
|
|
23
|
-
otrs_somconnexio/otrs_models/provision_dynamic_fields.py,sha256=
|
|
23
|
+
otrs_somconnexio/otrs_models/provision_dynamic_fields.py,sha256=Xdpn8HhxMpW-BKEINJnK-tK7zm4aZe8j0Zte6TIaFIU,3445
|
|
24
24
|
otrs_somconnexio/otrs_models/provision_ticket.py,sha256=g8URtZbUQpwxNfybWhEoxtf9JyYJRHKjO_MU4MWgd7I,2449
|
|
25
25
|
otrs_somconnexio/otrs_models/router_4G_data.py,sha256=EQIVxVstFswmEcOHzzV1ZyDYaadiU7lbunb5CJg6xAM,194
|
|
26
26
|
otrs_somconnexio/otrs_models/router_4G_dynamic_fields.py,sha256=NVrfwD2Mj1TTzOC8NYna1XQYXEN6ffAfovlP9VAIHh4,403
|
|
@@ -30,7 +30,7 @@ otrs_somconnexio/otrs_models/switchboard_data.py,sha256=7aFvhrFTjxXH0rT1TK2EI02J
|
|
|
30
30
|
otrs_somconnexio/otrs_models/switchboard_dynamic_fields.py,sha256=cc1-niTz38YofTF-1uUDSnu8FDSB-0gY1uFbTP38erA,2281
|
|
31
31
|
otrs_somconnexio/otrs_models/switchboard_ticket.py,sha256=jWkXS2WKBdcx-vgZKU8w_iez4bsl6s9nAtNfALxio-E,860
|
|
32
32
|
otrs_somconnexio/otrs_models/telecom_company.py,sha256=yh8wIE7-AjWESdFsE479WWZ-3uFz_ljUBKF8GK44oow,3077
|
|
33
|
-
otrs_somconnexio/otrs_models/ticket_factory.py,sha256=
|
|
33
|
+
otrs_somconnexio/otrs_models/ticket_factory.py,sha256=F_T8KJhOm44Xz4mV9M_6hCLygalUtMF6dwmAG8ek9LY,1859
|
|
34
34
|
otrs_somconnexio/otrs_models/vf_provisioning_article.py,sha256=AZbtXePA-FA3ufHJsngaXzUL4npJgUqMqvrMSUmCd9o,599
|
|
35
35
|
otrs_somconnexio/otrs_models/configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
otrs_somconnexio/otrs_models/configurations/changes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -50,7 +50,7 @@ otrs_somconnexio/otrs_models/configurations/provision/router_4G_ticket.py,sha256
|
|
|
50
50
|
otrs_somconnexio/otrs_models/configurations/provision/switchboard_ticket.py,sha256=ZVLqodwES2-VbJlzDzkIunm3Fbb7xStuV_gd0M_krx4,329
|
|
51
51
|
otrs_somconnexio/otrs_models/configurations/querys/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
52
|
otrs_somconnexio/otrs_models/configurations/querys/check_coverage.py,sha256=KD-T-NFSbMNW-MM4xXlonJWZz1ZM17brAb9N2-GNswg,479
|
|
53
|
-
otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py,sha256=
|
|
53
|
+
otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py,sha256=xUvm__IH-eAPa5gXHXlzYtC7LA37n5Xm5S_t4pyHVLM,783
|
|
54
54
|
otrs_somconnexio/otrs_models/coverage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
otrs_somconnexio/otrs_models/coverage/adsl.py,sha256=ZiLbEEKSlwCl3smHkEAnHrG6BRDWBuNXOouC5LpYRgM,476
|
|
56
56
|
otrs_somconnexio/otrs_models/coverage/asociatel_fiber.py,sha256=TXk5WChGupb8X2i5cBj7kG5TTDix36vdW5i-Hlk5-g8,165
|
|
@@ -76,10 +76,11 @@ otrs_somconnexio/otrs_models/ticket_types/change_tariff_adsl_landline_ticket.py,
|
|
|
76
76
|
otrs_somconnexio/otrs_models/ticket_types/change_tariff_adsl_out_landline_ticket.py,sha256=phONS7s2YkUMzRnraQ2AuCu0R17T2dbe1KatSaBmn2o,920
|
|
77
77
|
otrs_somconnexio/otrs_models/ticket_types/change_tariff_adsl_ticket.py,sha256=A8S30pfn6Co3DlfN6BcQioG_RlaRwUlG887u7yxgeAA,1642
|
|
78
78
|
otrs_somconnexio/otrs_models/ticket_types/change_tariff_fiber_ticket.py,sha256=DWHsB3pl-4AtpzST5fmAMZjmHqAgI_JrSrqv3oFAc20,1362
|
|
79
|
-
otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket.py,sha256=
|
|
80
|
-
otrs_somconnexio/otrs_models/ticket_types/
|
|
79
|
+
otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket.py,sha256=2oncxRb_U184cYbIdTF8mZN8iFeUdyiE73NF38L0lmk,3074
|
|
80
|
+
otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket_mobile_pack.py,sha256=pu8QItdaICaX2DMvZ7h29Ii_HJVsKWC2lm6UKl145FQ,1844
|
|
81
|
+
otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket_shared_bonds.py,sha256=CTesCN0NVD6lfTQMKC7nR6RXGjktfYVWFsthg69EnaQ,731
|
|
81
82
|
otrs_somconnexio/otrs_models/ticket_types/check_coverage_ticket.py,sha256=mHMx4eNo8rq0b5kf8ay0tTcziweS82D2O4N-atNWYv4,1866
|
|
82
|
-
otrs_somconnexio/otrs_models/ticket_types/we_call_you_ticket.py,sha256=
|
|
83
|
+
otrs_somconnexio/otrs_models/ticket_types/we_call_you_ticket.py,sha256=GMSYnV7_8yKZZMNNpac1kL93C_yYZEaZGq0K3c7TFp8,1654
|
|
83
84
|
otrs_somconnexio/responses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
84
85
|
otrs_somconnexio/responses/ticket_creation.py,sha256=32Iigeg2TO422M2XYaiei57KpimnkB1tgnIexiEhi-E,735
|
|
85
86
|
otrs_somconnexio/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -109,7 +110,7 @@ tests/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
109
110
|
tests/data/otrs_raw_responses.py,sha256=hrd6ubWHpm61Epdrpgjr2uLniKj9AFioQ4xnDdNSKzw,1380
|
|
110
111
|
tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
111
112
|
tests/integration/test_change_customer_language.py,sha256=m3hp56hP49ugSvaN7Ic5dRA4NAs3Nk4AkxWz0oQ_kmw,1245
|
|
112
|
-
tests/integration/test_ticket_factory.py,sha256=
|
|
113
|
+
tests/integration/test_ticket_factory.py,sha256=vgPE7wdKtyalaD74i29v9w4MsNTUDepIT9taLyI0p9U,13786
|
|
113
114
|
tests/integration/test_update_ticket_with_coverage_data.py,sha256=19XaaitAaj-mkSpSRFWML47bDfcmuQwuF_r1NVE_eZw,2919
|
|
114
115
|
tests/otrs_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
115
116
|
tests/otrs_models/common_helper.py,sha256=WAd7aenHTfHvxjZMlwFfr32ajaF285Y75eifMjrAQeA,251
|
|
@@ -133,9 +134,9 @@ tests/otrs_models/test_router_4G_dynamic_fields.py,sha256=EEZHfAxQ8bPTrotGuyxcLx
|
|
|
133
134
|
tests/otrs_models/test_router_4G_ticket.py,sha256=BMdnhAdnmvYfjyxvRN0dcCyS1hMFESV8EgAsCdHbFAo,4496
|
|
134
135
|
tests/otrs_models/test_service.py,sha256=fLFyJ5wE8jszrD9sZlSOebjioR8dv8z2SeGZVcA3r5U,6833
|
|
135
136
|
tests/otrs_models/test_switchboard_data.py,sha256=1DZq9EyB2Ym-v4WdMfScPejqGerczT6Flc0IfDX4M2M,1170
|
|
136
|
-
tests/otrs_models/test_switchboard_dynamic_fields.py,sha256=
|
|
137
|
+
tests/otrs_models/test_switchboard_dynamic_fields.py,sha256=tOq0aW0y4ZzPRkivccDi16_c-ZBmH8cNoK1x_WYxm7Q,4508
|
|
137
138
|
tests/otrs_models/test_telecom_company.py,sha256=nC4uBleU2Lr3qHr5VDo-6kbcTVwKgguC85TcbhTOn1c,1450
|
|
138
|
-
tests/otrs_models/test_ticket_factory.py,sha256=
|
|
139
|
+
tests/otrs_models/test_ticket_factory.py,sha256=cA5Abc7tQdTDyAlPED1ROw_UD6dWOlOOCZBHBvdjpxw,2949
|
|
139
140
|
tests/otrs_models/test_vf_provisioning_article.py,sha256=Yj8vtaowhxP12K_-FMcJNW-5re3yyCCfGLRHCPYgrVA,897
|
|
140
141
|
tests/otrs_models/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
141
142
|
tests/otrs_models/configuration/changes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -153,14 +154,15 @@ tests/otrs_models/ticket_types/test_change_email.py,sha256=eJOCwvhB6Rs0wA4nThJt4
|
|
|
153
154
|
tests/otrs_models/ticket_types/test_change_iban.py,sha256=dXyDyd7PaDC3M0haV7dJ8K3XLa6TO7YVcRTGk9A7oqU,3168
|
|
154
155
|
tests/otrs_models/ticket_types/test_change_owner.py,sha256=eebQERzW09vNZ2dkP2wXCS0U5SD0GGXPmlqelAUdKEo,9858
|
|
155
156
|
tests/otrs_models/ticket_types/test_change_personal_email.py,sha256=RA_9_lFMPMoORbIrJqxGqL2Fq_IAZzRT1Vh8qDixTpc,3083
|
|
156
|
-
tests/otrs_models/ticket_types/test_change_tariff.py,sha256=
|
|
157
|
+
tests/otrs_models/ticket_types/test_change_tariff.py,sha256=11lmITvkbXn4ZqkdH5wGwWFp0KazhViFFjhwPoOkL8I,17289
|
|
157
158
|
tests/otrs_models/ticket_types/test_change_tariff_adsl_landline.py,sha256=bBZw0zi7jqEgCaqEQPsbQeteFVWQCCNrtpficlgKAaA,4592
|
|
158
159
|
tests/otrs_models/ticket_types/test_change_tariff_adsl_out_landline.py,sha256=c0dO23z3wnEFYQVU27yi9s8tRsB1aUf4YIxWEG48GGc,4609
|
|
159
160
|
tests/otrs_models/ticket_types/test_change_tariff_fiber.py,sha256=K_1qFai00CopyQTEFgltupBYN2rhMh5tJDA_DC01624,6741
|
|
160
|
-
tests/otrs_models/ticket_types/
|
|
161
|
+
tests/otrs_models/ticket_types/test_change_tariff_mobile_pack.py,sha256=mOitwISCTIKVafY-g5xAnL-tZdCHcL61CCfedxiXSl4,5416
|
|
162
|
+
tests/otrs_models/ticket_types/test_change_tariff_shared_bonds.py,sha256=Mmuai3rMTaBHCmWZCYeDFtx0tH1DiIxwYMUN4pSZFdo,2136
|
|
161
163
|
tests/otrs_models/ticket_types/test_check_coverage.py,sha256=o6fVO52WxvrVahIQNscP7LhcQIe2iEK7q0yI9JT3-3Q,4158
|
|
162
164
|
tests/otrs_models/ticket_types/test_shared_bond.py,sha256=Ha1sCIOkov-u7r7nijNqlSZsXYYNoOGV3pm7Fqx1YcU,3177
|
|
163
|
-
tests/otrs_models/ticket_types/test_we_call_you.py,sha256=
|
|
165
|
+
tests/otrs_models/ticket_types/test_we_call_you.py,sha256=0IwtSGLK97iBug6G_0VlYJt6KE8qseqHcKbgdYL2FKc,3698
|
|
164
166
|
tests/responses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
165
167
|
tests/responses/test_ticket_creation.py,sha256=i7Yzps-Kz25Ie1ylr3YAEsUYDMIZTFOvQIpSM2k7lNY,1068
|
|
166
168
|
tests/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -183,7 +185,7 @@ tests/services/test_update_ticket_with_provider_info.py,sha256=cZUg-hNV4BoMwafbp
|
|
|
183
185
|
tests/user_management_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
184
186
|
tests/user_management_client/test_client.py,sha256=088q9H1yf8Hii7zUF17KULqOO-JCxJLsR7vQ8lGHiqg,4410
|
|
185
187
|
tests/user_management_client/test_user_management_response.py,sha256=HCCG7i2f6-ytrRpTzYZHODKCdW-X5GJn-BMVegd5FXg,1539
|
|
186
|
-
otrs_somconnexio-0.6.
|
|
187
|
-
otrs_somconnexio-0.6.
|
|
188
|
-
otrs_somconnexio-0.6.
|
|
189
|
-
otrs_somconnexio-0.6.
|
|
188
|
+
otrs_somconnexio-0.6.3.dist-info/METADATA,sha256=YwOdh-jX6Udis8W6iR2qo-ma_KJ2fz38XzGvCUBWMdo,3458
|
|
189
|
+
otrs_somconnexio-0.6.3.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
|
|
190
|
+
otrs_somconnexio-0.6.3.dist-info/top_level.txt,sha256=gvMaHGNwusWpSIy-PVyb0CKDIA4-4fXmEVER_2a-OnE,23
|
|
191
|
+
otrs_somconnexio-0.6.3.dist-info/RECORD,,
|
|
@@ -55,6 +55,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
55
55
|
"activation_notes",
|
|
56
56
|
"technology",
|
|
57
57
|
"sales_team",
|
|
58
|
+
"is_from_pack",
|
|
58
59
|
"fiber_linked",
|
|
59
60
|
"shared_bond_id",
|
|
60
61
|
]
|
|
@@ -105,6 +106,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
105
106
|
"activation_notes",
|
|
106
107
|
"technology",
|
|
107
108
|
"sales_team",
|
|
109
|
+
"is_from_pack",
|
|
108
110
|
"fiber_linked",
|
|
109
111
|
"shared_bond_id",
|
|
110
112
|
]
|
|
@@ -131,7 +133,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
131
133
|
self.assertIsInstance(ticket, MobilePausedTicket)
|
|
132
134
|
|
|
133
135
|
@patch("otrs_somconnexio.otrs_models.provision_ticket.OTRSClient")
|
|
134
|
-
def
|
|
136
|
+
def test_create_mobile_is_from_pack_paused_ticket_factory(self, MockOTRSClient):
|
|
135
137
|
mobile_data = Mock(
|
|
136
138
|
spec=[
|
|
137
139
|
"order_id",
|
|
@@ -158,14 +160,15 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
158
160
|
"activation_notes",
|
|
159
161
|
"technology",
|
|
160
162
|
"sales_team",
|
|
163
|
+
"is_from_pack",
|
|
161
164
|
"fiber_linked",
|
|
162
165
|
"shared_bond_id",
|
|
163
166
|
]
|
|
164
167
|
)
|
|
165
168
|
|
|
166
169
|
mobile_data.service_type = "mobile"
|
|
167
|
-
mobile_data.product = "SE_SC_REC_MOBILE_PACK_UNL_20480"
|
|
168
170
|
mobile_data.is_grouped_with_fiber = True
|
|
171
|
+
mobile_data.is_from_pack = True
|
|
169
172
|
|
|
170
173
|
otrs_process_ticket = Mock(spec=["id"])
|
|
171
174
|
otrs_process_ticket.id = 234
|
|
@@ -140,3 +140,9 @@ class SwitchboardDynamicFieldsTestCase(unittest.TestCase):
|
|
|
140
140
|
self.dynamic_fields_dct["provinciaEnviament"],
|
|
141
141
|
self.service_data.shipment_subdivision,
|
|
142
142
|
)
|
|
143
|
+
|
|
144
|
+
def test_documentation(self):
|
|
145
|
+
self.assertEqual(
|
|
146
|
+
self.dynamic_fields_dct["flagDocumentacio"],
|
|
147
|
+
"0",
|
|
148
|
+
)
|
|
@@ -23,7 +23,7 @@ class TicketFactoryTestCase(unittest.TestCase):
|
|
|
23
23
|
)
|
|
24
24
|
|
|
25
25
|
@patch("otrs_somconnexio.otrs_models.ticket_factory.MobilePausedTicket")
|
|
26
|
-
def
|
|
26
|
+
def test_build_mobile_paused_ticket_portability(self, MockMobilePausedTicket):
|
|
27
27
|
self.service_data.service_type = "mobile"
|
|
28
28
|
self.service_data.type = "portability"
|
|
29
29
|
self.service_data.is_grouped_with_fiber = True
|
|
@@ -34,6 +34,19 @@ class TicketFactoryTestCase(unittest.TestCase):
|
|
|
34
34
|
service_data=self.service_data, customer_data=self.customer_data
|
|
35
35
|
)
|
|
36
36
|
|
|
37
|
+
@patch("otrs_somconnexio.otrs_models.ticket_factory.MobilePausedTicket")
|
|
38
|
+
def test_build_mobile_paused_ticket_fiber_linked(self, MockMobilePausedTicket):
|
|
39
|
+
self.service_data.service_type = "mobile"
|
|
40
|
+
self.service_data.type = "new"
|
|
41
|
+
self.service_data.is_grouped_with_fiber = True
|
|
42
|
+
self.service_data.is_from_pack = True
|
|
43
|
+
|
|
44
|
+
TicketFactory(self.service_data, self.customer_data).build()
|
|
45
|
+
|
|
46
|
+
MockMobilePausedTicket.assert_called_once_with(
|
|
47
|
+
service_data=self.service_data, customer_data=self.customer_data
|
|
48
|
+
)
|
|
49
|
+
|
|
37
50
|
@patch("otrs_somconnexio.otrs_models.ticket_factory.ADSLTicket")
|
|
38
51
|
def test_build_adsl_ticket(self, MockADSLTicket):
|
|
39
52
|
self.service_data.service_type = "adsl"
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket import (
|
|
2
2
|
ChangeTariffTicket,
|
|
3
3
|
ChangeTariffExceptionalTicket,
|
|
4
|
+
ChangeTariffMobilePackTicket,
|
|
5
|
+
ChangeTariffSharedBondTicket,
|
|
4
6
|
)
|
|
5
7
|
from otrs_somconnexio.otrs_models.configurations.changes.change_tariff import (
|
|
6
8
|
ChangeTariffTicketConfiguration,
|
|
7
9
|
ChangeTariffExceptionalTicketConfiguration,
|
|
10
|
+
ChangeTariffSharedBondTicketConfiguration,
|
|
8
11
|
)
|
|
9
12
|
|
|
10
13
|
|
|
@@ -248,7 +251,9 @@ class TestCaseChangeTariffExceptionalTicket:
|
|
|
248
251
|
attachments=None,
|
|
249
252
|
)
|
|
250
253
|
|
|
251
|
-
|
|
254
|
+
|
|
255
|
+
class TestCaseChangeTariffMobilePackTicket:
|
|
256
|
+
def test_create(self, mocker):
|
|
252
257
|
username = "7456787G"
|
|
253
258
|
customer_code = "1234"
|
|
254
259
|
|
|
@@ -275,7 +280,7 @@ class TestCaseChangeTariffExceptionalTicket:
|
|
|
275
280
|
)
|
|
276
281
|
|
|
277
282
|
expected_ticket_data = {
|
|
278
|
-
"Title": "Sol·licitud
|
|
283
|
+
"Title": "Sol·licitud canvi de tarifa pack apinyades",
|
|
279
284
|
"QueueID": ChangeTariffTicketConfiguration.queue_id,
|
|
280
285
|
"State": ChangeTariffTicketConfiguration.state,
|
|
281
286
|
"Type": ChangeTariffTicketConfiguration.type,
|
|
@@ -284,7 +289,7 @@ class TestCaseChangeTariffExceptionalTicket:
|
|
|
284
289
|
"CustomerID": customer_code,
|
|
285
290
|
}
|
|
286
291
|
expected_article_data = {
|
|
287
|
-
"Subject": "Sol·licitud
|
|
292
|
+
"Subject": "Sol·licitud canvi de tarifa pack apinyades",
|
|
288
293
|
"Body": "-",
|
|
289
294
|
}
|
|
290
295
|
|
|
@@ -297,16 +302,18 @@ class TestCaseChangeTariffExceptionalTicket:
|
|
|
297
302
|
"subscription_email": "fakeemail@email.coop",
|
|
298
303
|
"language": "ca_ES",
|
|
299
304
|
"send_notification": False,
|
|
300
|
-
"shared_bond_id": "C03457456M",
|
|
301
305
|
}
|
|
302
306
|
|
|
303
|
-
ticket =
|
|
307
|
+
ticket = ChangeTariffMobilePackTicket(
|
|
308
|
+
username, customer_code, fields_dict
|
|
309
|
+
).create()
|
|
304
310
|
|
|
305
311
|
TicketMock.assert_called_once_with(expected_ticket_data)
|
|
306
312
|
ArticleMock.assert_called_once_with(expected_article_data)
|
|
307
313
|
calls = [
|
|
308
314
|
mocker.call(
|
|
309
|
-
"ProcessManagementProcessID",
|
|
315
|
+
"ProcessManagementProcessID",
|
|
316
|
+
ChangeTariffTicketConfiguration.process_id,
|
|
310
317
|
),
|
|
311
318
|
mocker.call(
|
|
312
319
|
"ProcessManagementActivityID",
|
|
@@ -320,9 +327,99 @@ class TestCaseChangeTariffExceptionalTicket:
|
|
|
320
327
|
mocker.call("correuElectronic", "fakeemail@email.coop"),
|
|
321
328
|
mocker.call("idioma", "ca_ES"),
|
|
322
329
|
mocker.call("enviarNotificacio", "0"),
|
|
323
|
-
mocker.call("IDAbonamentCompartit", "C03457456M"),
|
|
324
330
|
mocker.call("TecDelServei", "Mobil"),
|
|
325
331
|
]
|
|
332
|
+
|
|
333
|
+
DynamicFieldMock.assert_has_calls(calls)
|
|
334
|
+
OTRSClientMock.return_value.create_otrs_process_ticket.assert_called_once_with( # noqa
|
|
335
|
+
TicketMock.return_value,
|
|
336
|
+
article=ArticleMock.return_value,
|
|
337
|
+
dynamic_fields=[mocker.ANY for call in calls],
|
|
338
|
+
attachments=None,
|
|
339
|
+
)
|
|
340
|
+
assert ticket.id == "1"
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
class TestCaseChangeTariffSharedBondTicket:
|
|
344
|
+
def test_create_with_shared_bond_id(self, mocker):
|
|
345
|
+
username = "7456787G"
|
|
346
|
+
customer_code = "1234"
|
|
347
|
+
|
|
348
|
+
OTRSClientMock = mocker.patch(
|
|
349
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.OTRSClient",
|
|
350
|
+
return_value=mocker.Mock(),
|
|
351
|
+
)
|
|
352
|
+
OTRSClientMock.return_value.create_otrs_process_ticket.return_value = (
|
|
353
|
+
mocker.Mock(spec=["id"])
|
|
354
|
+
)
|
|
355
|
+
OTRSClientMock.return_value.create_otrs_process_ticket.return_value.id = "1"
|
|
356
|
+
|
|
357
|
+
TicketMock = mocker.patch(
|
|
358
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.Ticket",
|
|
359
|
+
return_value=mocker.Mock(),
|
|
360
|
+
)
|
|
361
|
+
ArticleMock = mocker.patch(
|
|
362
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.Article",
|
|
363
|
+
return_value=mocker.Mock(),
|
|
364
|
+
)
|
|
365
|
+
DynamicFieldMock = mocker.patch(
|
|
366
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.DynamicField",
|
|
367
|
+
return_value=mocker.Mock(),
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
expected_ticket_data = {
|
|
371
|
+
"Title": "Sol·licitud canvi de tarifa pack amb dades compartides",
|
|
372
|
+
"QueueID": ChangeTariffSharedBondTicketConfiguration.queue_id,
|
|
373
|
+
"State": ChangeTariffSharedBondTicketConfiguration.state,
|
|
374
|
+
"Type": ChangeTariffSharedBondTicketConfiguration.type,
|
|
375
|
+
"Priority": ChangeTariffSharedBondTicketConfiguration.priority,
|
|
376
|
+
"CustomerUser": customer_code,
|
|
377
|
+
"CustomerID": customer_code,
|
|
378
|
+
}
|
|
379
|
+
expected_article_data = {
|
|
380
|
+
"Subject": "Sol·licitud canvi de tarifa pack amb dades compartides",
|
|
381
|
+
"Body": "-",
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
fields_dict = {
|
|
385
|
+
"phone_number": "666666666",
|
|
386
|
+
"new_product_code": "NEW_PRODUCT_CODE",
|
|
387
|
+
"current_product_code": "CURRENT_PRODUCT_CODE",
|
|
388
|
+
"effective_date": "tomorrow",
|
|
389
|
+
"fiber_linked": "",
|
|
390
|
+
"subscription_email": "fakeemail@email.coop",
|
|
391
|
+
"language": "ca_ES",
|
|
392
|
+
"send_notification": False,
|
|
393
|
+
"shared_bond_id": "C03457456M",
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
ticket = ChangeTariffSharedBondTicket(
|
|
397
|
+
username, customer_code, fields_dict
|
|
398
|
+
).create()
|
|
399
|
+
|
|
400
|
+
TicketMock.assert_called_once_with(expected_ticket_data)
|
|
401
|
+
ArticleMock.assert_called_once_with(expected_article_data)
|
|
402
|
+
calls = [
|
|
403
|
+
mocker.call(
|
|
404
|
+
"ProcessManagementProcessID",
|
|
405
|
+
ChangeTariffSharedBondTicketConfiguration.process_id,
|
|
406
|
+
),
|
|
407
|
+
mocker.call(
|
|
408
|
+
"ProcessManagementActivityID",
|
|
409
|
+
ChangeTariffSharedBondTicketConfiguration.activity_id,
|
|
410
|
+
),
|
|
411
|
+
mocker.call("renovaCanviTarifa", "0"),
|
|
412
|
+
mocker.call("liniaMobil", "666666666"),
|
|
413
|
+
mocker.call("productMobil", "NEW_PRODUCT_CODE"),
|
|
414
|
+
mocker.call("tarifaAntiga", "CURRENT_PRODUCT_CODE"),
|
|
415
|
+
mocker.call("dataExecucioCanviTarifa", "tomorrow"),
|
|
416
|
+
mocker.call("correuElectronic", "fakeemail@email.coop"),
|
|
417
|
+
mocker.call("idioma", "ca_ES"),
|
|
418
|
+
mocker.call("enviarNotificacio", "0"),
|
|
419
|
+
mocker.call("TecDelServei", "Mobil"),
|
|
420
|
+
mocker.call("IDAbonamentCompartit", "C03457456M"),
|
|
421
|
+
]
|
|
422
|
+
|
|
326
423
|
DynamicFieldMock.assert_has_calls(calls)
|
|
327
424
|
OTRSClientMock.return_value.create_otrs_process_ticket.assert_called_once_with( # noqa
|
|
328
425
|
TicketMock.return_value,
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket import (
|
|
2
|
+
ChangeTariffMobilePackTicket,
|
|
3
|
+
)
|
|
4
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_mobile_pack import (
|
|
5
|
+
ChangeTariffTicketMobilePack,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestCaseChangeTariffTicketMobilePack:
|
|
10
|
+
def test_create(self, mocker):
|
|
11
|
+
username = "7456787G"
|
|
12
|
+
customer_code = "1234"
|
|
13
|
+
ticket_creator_id = "1"
|
|
14
|
+
ticket_id = "2"
|
|
15
|
+
|
|
16
|
+
OTRSClientMock = mocker.patch(
|
|
17
|
+
"otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_mobile_pack.OTRSClient",
|
|
18
|
+
return_value=mocker.Mock(),
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
ticket_mock = mocker.Mock(spec=["create"])
|
|
22
|
+
ticket_mock.create.return_value = mocker.Mock(spec=["id"])
|
|
23
|
+
ticket_mock.create.return_value.id = ticket_id
|
|
24
|
+
ticket_creator_mock = mocker.Mock(spec=["create"])
|
|
25
|
+
ticket_creator_mock.create.return_value = mocker.Mock(spec=["id"])
|
|
26
|
+
ticket_creator_mock.create.return_value.id = ticket_creator_id
|
|
27
|
+
|
|
28
|
+
def side_effect(uname, customer_c, fields, override):
|
|
29
|
+
if fields.get("pack_creator"):
|
|
30
|
+
return ticket_creator_mock
|
|
31
|
+
else:
|
|
32
|
+
return ticket_mock
|
|
33
|
+
|
|
34
|
+
ChangeTariffMobilePackTicketMock = mocker.patch(
|
|
35
|
+
"otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_mobile_pack.ChangeTariffMobilePackTicket",
|
|
36
|
+
side_effect=side_effect,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
fields_dict = {
|
|
40
|
+
"contracts": [
|
|
41
|
+
{
|
|
42
|
+
"phone_number": "666666666",
|
|
43
|
+
"current_product_code": "CURRENT_PRODUCT_CODE",
|
|
44
|
+
"subscription_email": "fakeemail@email.coop",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"phone_number": "777777777",
|
|
48
|
+
"current_product_code": "CURRENT_PRODUCT_CODE",
|
|
49
|
+
"subscription_email": "fakeemail@email.coop",
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
"phone_number": "666666666",
|
|
53
|
+
"new_product_code": "NEW_PRODUCT_CODE",
|
|
54
|
+
"effective_date": "tomorrow",
|
|
55
|
+
"fiber_linked": "28",
|
|
56
|
+
"language": "ca_ES",
|
|
57
|
+
"send_notification": True,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ChangeTariffTicketMobilePack(username, customer_code, fields_dict).create()
|
|
61
|
+
|
|
62
|
+
assert ChangeTariffMobilePackTicketMock.call_count == 2
|
|
63
|
+
ticket_mock.create.assert_called_once_with()
|
|
64
|
+
ticket_creator_mock.create.assert_called_once_with()
|
|
65
|
+
OTRSClientMock.return_value.link_tickets.assert_called_once_with(
|
|
66
|
+
ticket_creator_id,
|
|
67
|
+
ticket_id,
|
|
68
|
+
link_type="ParentChild",
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def test_update(self, mocker):
|
|
72
|
+
username = "7456787G"
|
|
73
|
+
customer_code = "1234"
|
|
74
|
+
ticket_id = "2"
|
|
75
|
+
article = "article"
|
|
76
|
+
dynamic_fields = "dynamic_fields"
|
|
77
|
+
state = "state"
|
|
78
|
+
ChangeTariffMobilePackTicketMock = mocker.patch(
|
|
79
|
+
"otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_mobile_pack.ChangeTariffMobilePackTicket",
|
|
80
|
+
return_value=mocker.Mock(spec=["update"]),
|
|
81
|
+
)
|
|
82
|
+
ChangeTariffTicketMobilePack(username, customer_code, {}).update(
|
|
83
|
+
ticket_id, article, dynamic_fields, state
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
ChangeTariffMobilePackTicketMock.assert_called_once_with(
|
|
87
|
+
username, customer_code, {}
|
|
88
|
+
)
|
|
89
|
+
ChangeTariffMobilePackTicketMock.return_value.update.assert_called_once_with(
|
|
90
|
+
ticket_id, article, dynamic_fields, state
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class TestCaseChangeTariffMobilePackTicket:
|
|
95
|
+
def test_create(self, mocker):
|
|
96
|
+
username = "7456787G"
|
|
97
|
+
customer_code = "1234"
|
|
98
|
+
fields_dict = {
|
|
99
|
+
"phone_number": "777777777",
|
|
100
|
+
"current_product_code": "CURRENT_PRODUCT_CODE",
|
|
101
|
+
"subscription_email": "fakeemail@email.coop",
|
|
102
|
+
"new_product_code": "NEW_PRODUCT_CODE",
|
|
103
|
+
"effective_date": "tomorrow",
|
|
104
|
+
"fiber_linked": "28",
|
|
105
|
+
"language": "ca_ES",
|
|
106
|
+
"send_notification": True,
|
|
107
|
+
"pack_creator": True,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
ticket_mock = mocker.Mock(spec=["id"])
|
|
111
|
+
ticket_mock.id = "11223344"
|
|
112
|
+
OTRSClientMock = mocker.patch(
|
|
113
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.OTRSClient",
|
|
114
|
+
return_value=mocker.Mock(),
|
|
115
|
+
)
|
|
116
|
+
OTRSClientMock.return_value.create_otrs_process_ticket.return_value = (
|
|
117
|
+
ticket_mock
|
|
118
|
+
)
|
|
119
|
+
DynamicFieldMock = mocker.patch(
|
|
120
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.DynamicField",
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
ticket = ChangeTariffMobilePackTicket(
|
|
124
|
+
username, customer_code, fields_dict
|
|
125
|
+
).create()
|
|
126
|
+
|
|
127
|
+
assert ticket.id == ticket_mock.id
|
|
128
|
+
OTRSClientMock.return_value.create_otrs_process_ticket.assert_called_once_with(
|
|
129
|
+
mocker.ANY,
|
|
130
|
+
article=mocker.ANY,
|
|
131
|
+
dynamic_fields=[
|
|
132
|
+
mocker.ANY,
|
|
133
|
+
mocker.ANY,
|
|
134
|
+
mocker.ANY,
|
|
135
|
+
mocker.ANY,
|
|
136
|
+
mocker.ANY,
|
|
137
|
+
mocker.ANY,
|
|
138
|
+
mocker.ANY,
|
|
139
|
+
mocker.ANY,
|
|
140
|
+
mocker.ANY,
|
|
141
|
+
mocker.ANY,
|
|
142
|
+
mocker.ANY,
|
|
143
|
+
mocker.ANY,
|
|
144
|
+
mocker.ANY,
|
|
145
|
+
],
|
|
146
|
+
attachments=None,
|
|
147
|
+
)
|
|
148
|
+
DynamicFieldMock.assert_called_with(
|
|
149
|
+
"creadorAbonament",
|
|
150
|
+
True,
|
|
151
|
+
)
|
|
@@ -1,94 +1,6 @@
|
|
|
1
1
|
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket import (
|
|
2
2
|
ChangeTariffSharedBondTicket,
|
|
3
3
|
)
|
|
4
|
-
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_shared_bonds import (
|
|
5
|
-
ChangeTariffTicketSharedBond,
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class TestCaseChangeTariffTicketSharedBonds:
|
|
10
|
-
def test_create(self, mocker):
|
|
11
|
-
username = "7456787G"
|
|
12
|
-
customer_code = "1234"
|
|
13
|
-
ticket_creator_id = "1"
|
|
14
|
-
ticket_id = "2"
|
|
15
|
-
|
|
16
|
-
OTRSClientMock = mocker.patch(
|
|
17
|
-
"otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_shared_bonds.OTRSClient",
|
|
18
|
-
return_value=mocker.Mock(),
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
ticket_mock = mocker.Mock(spec=["create"])
|
|
22
|
-
ticket_mock.create.return_value = mocker.Mock(spec=["id"])
|
|
23
|
-
ticket_mock.create.return_value.id = ticket_id
|
|
24
|
-
ticket_creator_mock = mocker.Mock(spec=["create"])
|
|
25
|
-
ticket_creator_mock.create.return_value = mocker.Mock(spec=["id"])
|
|
26
|
-
ticket_creator_mock.create.return_value.id = ticket_creator_id
|
|
27
|
-
|
|
28
|
-
def side_effect(uname, customer_c, fields, override):
|
|
29
|
-
if fields.get("shared_bond_creator"):
|
|
30
|
-
return ticket_creator_mock
|
|
31
|
-
else:
|
|
32
|
-
return ticket_mock
|
|
33
|
-
|
|
34
|
-
ChangeTariffSharedBondTicketMock = mocker.patch(
|
|
35
|
-
"otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_shared_bonds.ChangeTariffSharedBondTicket",
|
|
36
|
-
side_effect=side_effect,
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
fields_dict = {
|
|
40
|
-
"contracts": [
|
|
41
|
-
{
|
|
42
|
-
"phone_number": "666666666",
|
|
43
|
-
"current_product_code": "CURRENT_PRODUCT_CODE",
|
|
44
|
-
"subscription_email": "fakeemail@email.coop",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"phone_number": "777777777",
|
|
48
|
-
"current_product_code": "CURRENT_PRODUCT_CODE",
|
|
49
|
-
"subscription_email": "fakeemail@email.coop",
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
"phone_number": "666666666",
|
|
53
|
-
"new_product_code": "NEW_PRODUCT_CODE",
|
|
54
|
-
"effective_date": "tomorrow",
|
|
55
|
-
"fiber_linked": "28",
|
|
56
|
-
"language": "ca_ES",
|
|
57
|
-
"send_notification": True,
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
ChangeTariffTicketSharedBond(username, customer_code, fields_dict).create()
|
|
61
|
-
|
|
62
|
-
assert ChangeTariffSharedBondTicketMock.call_count == 2
|
|
63
|
-
ticket_mock.create.assert_called_once_with()
|
|
64
|
-
ticket_creator_mock.create.assert_called_once_with()
|
|
65
|
-
OTRSClientMock.return_value.link_tickets.assert_called_once_with(
|
|
66
|
-
ticket_creator_id,
|
|
67
|
-
ticket_id,
|
|
68
|
-
link_type="ParentChild",
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
def test_update(self, mocker):
|
|
72
|
-
username = "7456787G"
|
|
73
|
-
customer_code = "1234"
|
|
74
|
-
ticket_id = "2"
|
|
75
|
-
article = "article"
|
|
76
|
-
dynamic_fields = "dynamic_fields"
|
|
77
|
-
state = "state"
|
|
78
|
-
ChangeTariffSharedBondTicketMock = mocker.patch(
|
|
79
|
-
"otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_shared_bonds.ChangeTariffSharedBondTicket",
|
|
80
|
-
return_value=mocker.Mock(spec=["update"]),
|
|
81
|
-
)
|
|
82
|
-
ChangeTariffTicketSharedBond(username, customer_code, {}).update(
|
|
83
|
-
ticket_id, article, dynamic_fields, state
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
ChangeTariffSharedBondTicketMock.assert_called_once_with(
|
|
87
|
-
username, customer_code, {}
|
|
88
|
-
)
|
|
89
|
-
ChangeTariffSharedBondTicketMock.return_value.update.assert_called_once_with(
|
|
90
|
-
ticket_id, article, dynamic_fields, state
|
|
91
|
-
)
|
|
92
4
|
|
|
93
5
|
|
|
94
6
|
class TestCaseChangeTariffSharedBondTicket:
|
|
@@ -104,7 +16,8 @@ class TestCaseChangeTariffSharedBondTicket:
|
|
|
104
16
|
"fiber_linked": "28",
|
|
105
17
|
"language": "ca_ES",
|
|
106
18
|
"send_notification": True,
|
|
107
|
-
"
|
|
19
|
+
"pack_creator": True,
|
|
20
|
+
"shared_bond_id": "123456",
|
|
108
21
|
}
|
|
109
22
|
|
|
110
23
|
ticket_mock = mocker.Mock(spec=["id"])
|
|
@@ -142,10 +55,11 @@ class TestCaseChangeTariffSharedBondTicket:
|
|
|
142
55
|
mocker.ANY,
|
|
143
56
|
mocker.ANY,
|
|
144
57
|
mocker.ANY,
|
|
58
|
+
mocker.ANY,
|
|
145
59
|
],
|
|
146
60
|
attachments=None,
|
|
147
61
|
)
|
|
148
62
|
DynamicFieldMock.assert_called_with(
|
|
149
|
-
"
|
|
150
|
-
|
|
63
|
+
"IDAbonamentCompartit",
|
|
64
|
+
fields_dict["shared_bond_id"],
|
|
151
65
|
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from otrs_somconnexio.otrs_models.configurations.querys.we_call_you import (
|
|
2
2
|
WeCallYouCATConfiguration,
|
|
3
|
+
WeCallYouCompanyCATConfiguration,
|
|
4
|
+
WeCallYouCompanyESConfiguration,
|
|
3
5
|
WeCallYouESConfiguration,
|
|
4
6
|
)
|
|
5
7
|
from otrs_somconnexio.otrs_models.ticket_types.we_call_you_ticket import WeCallYouTicket
|
|
@@ -9,19 +11,40 @@ class TestCaseWeCallYou:
|
|
|
9
11
|
fields_dict = {
|
|
10
12
|
"name": "name surname",
|
|
11
13
|
"schedule": "12h-14h",
|
|
12
|
-
"language": "ca_ES",
|
|
13
14
|
"phone": "642525377",
|
|
14
15
|
"reason": "call me baby",
|
|
16
|
+
"language": "ca_ES",
|
|
17
|
+
"is_company": False,
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
def test_create_CAT(self, mocker):
|
|
18
|
-
self._execute_and_assert_create(
|
|
21
|
+
self._execute_and_assert_create(
|
|
22
|
+
mocker, WeCallYouCATConfiguration, self.fields_dict
|
|
23
|
+
)
|
|
19
24
|
|
|
20
25
|
def test_create_ES(self, mocker):
|
|
21
|
-
self.fields_dict
|
|
22
|
-
|
|
26
|
+
dict = {**self.fields_dict}
|
|
27
|
+
dict["language"] = "es_ES"
|
|
28
|
+
self._execute_and_assert_create(mocker, WeCallYouESConfiguration, dict)
|
|
29
|
+
|
|
30
|
+
def test_create_company_CAT(self, mocker):
|
|
31
|
+
dict = {**self.fields_dict}
|
|
32
|
+
dict["is_company"] = True
|
|
33
|
+
dict["company_size"] = "1"
|
|
34
|
+
self._execute_and_assert_create(
|
|
35
|
+
mocker, WeCallYouCompanyCATConfiguration, dict, True
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def test_create_company_ES(self, mocker):
|
|
39
|
+
dict = {**self.fields_dict}
|
|
40
|
+
dict["language"] = "es_ES"
|
|
41
|
+
dict["is_company"] = True
|
|
42
|
+
dict["company_size"] = "1"
|
|
43
|
+
self._execute_and_assert_create(
|
|
44
|
+
mocker, WeCallYouCompanyESConfiguration, dict, True
|
|
45
|
+
)
|
|
23
46
|
|
|
24
|
-
def _execute_and_assert_create(self, mocker, config):
|
|
47
|
+
def _execute_and_assert_create(self, mocker, config, dict, is_company=False):
|
|
25
48
|
OTRSClientMock = mocker.patch(
|
|
26
49
|
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.OTRSClient",
|
|
27
50
|
return_value=mocker.Mock(),
|
|
@@ -58,13 +81,15 @@ class TestCaseWeCallYou:
|
|
|
58
81
|
"ProcessManagementActivityID",
|
|
59
82
|
config.activity_id,
|
|
60
83
|
),
|
|
61
|
-
mocker.call("personaContacte",
|
|
62
|
-
mocker.call("horariTrucada",
|
|
63
|
-
mocker.call("telefonContacte",
|
|
64
|
-
mocker.call("motiuTrucada",
|
|
84
|
+
mocker.call("personaContacte", dict["name"]),
|
|
85
|
+
mocker.call("horariTrucada", dict["schedule"]),
|
|
86
|
+
mocker.call("telefonContacte", dict["phone"]),
|
|
87
|
+
mocker.call("motiuTrucada", dict["reason"]),
|
|
65
88
|
]
|
|
89
|
+
if is_company:
|
|
90
|
+
calls.append(mocker.call("midaEmpresa", dict["company_size"]))
|
|
66
91
|
|
|
67
|
-
WeCallYouTicket(None, "customer",
|
|
92
|
+
WeCallYouTicket(None, "customer", dict, [], "").create()
|
|
68
93
|
|
|
69
94
|
TicketMock.assert_called_once_with(expected_ticket_data)
|
|
70
95
|
ArticleMock.assert_called_once_with(expected_article_data)
|
|
File without changes
|
|
File without changes
|