otrs-somconnexio 0.4.4__py2.py3-none-any.whl → 0.7.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/client.py +110 -42
- otrs_somconnexio/exceptions.py +44 -11
- otrs_somconnexio/otrs_models/abstract_article.py +3 -0
- otrs_somconnexio/otrs_models/adsl_data.py +7 -37
- otrs_somconnexio/otrs_models/adsl_dynamic_fields.py +5 -4
- otrs_somconnexio/otrs_models/adsl_ticket.py +9 -5
- otrs_somconnexio/otrs_models/configurations/changes/__init__.py +0 -0
- otrs_somconnexio/otrs_models/configurations/changes/add_data.py +13 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_email.py +16 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_iban.py +8 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_owner.py +19 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_pack.py +6 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_shared_bond.py +7 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_tariff.py +29 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_tariff_adsl.py +20 -0
- otrs_somconnexio/otrs_models/configurations/changes/change_tariff_fiber.py +11 -0
- otrs_somconnexio/otrs_models/configurations/provision/__init__.py +0 -0
- otrs_somconnexio/otrs_models/configurations/{adsl_ticket.py → provision/adsl_ticket.py} +2 -2
- otrs_somconnexio/otrs_models/configurations/{fiber_ticket.py → provision/fiber_ticket.py} +6 -3
- otrs_somconnexio/otrs_models/configurations/provision/mobile_ticket.py +44 -0
- otrs_somconnexio/otrs_models/configurations/provision/router_4G_ticket.py +8 -0
- otrs_somconnexio/otrs_models/configurations/provision/switchboard_ticket.py +10 -0
- otrs_somconnexio/otrs_models/configurations/querys/__init__.py +0 -0
- otrs_somconnexio/otrs_models/configurations/querys/check_coverage.py +16 -0
- otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py +26 -0
- otrs_somconnexio/otrs_models/coverage/adsl.py +1 -1
- otrs_somconnexio/otrs_models/coverage/asociatel_fiber.py +6 -0
- otrs_somconnexio/otrs_models/coverage/mm_fiber.py +7 -0
- otrs_somconnexio/otrs_models/coverage/orange_fiber.py +5 -0
- otrs_somconnexio/otrs_models/coverage/vdf_fiber.py +8 -0
- otrs_somconnexio/otrs_models/coverage_article.py +20 -4
- otrs_somconnexio/otrs_models/coverage_ticket.py +1 -0
- otrs_somconnexio/otrs_models/customer_data.py +15 -3
- otrs_somconnexio/otrs_models/customer_user.py +3 -9
- otrs_somconnexio/otrs_models/fiber_data.py +17 -33
- otrs_somconnexio/otrs_models/fiber_dynamic_fields.py +58 -4
- otrs_somconnexio/otrs_models/fiber_ticket.py +9 -5
- otrs_somconnexio/otrs_models/internet_data.py +79 -0
- otrs_somconnexio/otrs_models/internet_dynamic_fields.py +65 -26
- otrs_somconnexio/otrs_models/mobile_data.py +49 -5
- otrs_somconnexio/otrs_models/mobile_dynamic_fields.py +50 -8
- otrs_somconnexio/otrs_models/mobile_ticket.py +20 -4
- otrs_somconnexio/otrs_models/process_ticket/internet.py +40 -97
- otrs_somconnexio/otrs_models/process_ticket/mobile.py +63 -43
- otrs_somconnexio/otrs_models/process_ticket/process_ticket.py +74 -0
- otrs_somconnexio/otrs_models/providers.py +4 -3
- otrs_somconnexio/otrs_models/provision_article.py +7 -5
- otrs_somconnexio/otrs_models/provision_dynamic_fields.py +76 -11
- otrs_somconnexio/otrs_models/provision_ticket.py +52 -28
- otrs_somconnexio/otrs_models/responsible_data.py +6 -0
- otrs_somconnexio/otrs_models/router_4G_data.py +8 -0
- otrs_somconnexio/otrs_models/router_4G_dynamic_fields.py +9 -0
- otrs_somconnexio/otrs_models/router_4G_ticket.py +26 -0
- otrs_somconnexio/otrs_models/service.py +41 -12
- otrs_somconnexio/otrs_models/switchboard_data.py +58 -0
- otrs_somconnexio/otrs_models/switchboard_dynamic_fields.py +94 -0
- otrs_somconnexio/otrs_models/switchboard_header_data.py +18 -0
- otrs_somconnexio/otrs_models/switchboard_header_dynamic_fields.py +80 -0
- otrs_somconnexio/otrs_models/switchboard_header_ticket.py +30 -0
- otrs_somconnexio/otrs_models/switchboard_ticket.py +35 -0
- otrs_somconnexio/otrs_models/telecom_company.py +69 -69
- otrs_somconnexio/otrs_models/ticket_factory.py +34 -11
- otrs_somconnexio/otrs_models/ticket_types/__init__.py +0 -0
- otrs_somconnexio/otrs_models/ticket_types/add_data_ticket.py +36 -0
- otrs_somconnexio/otrs_models/ticket_types/base_change_tariff_ba_ticket.py +23 -0
- otrs_somconnexio/otrs_models/ticket_types/base_change_ticket.py +33 -0
- otrs_somconnexio/otrs_models/ticket_types/base_customer_ticket.py +24 -0
- otrs_somconnexio/otrs_models/ticket_types/base_ticket.py +147 -0
- otrs_somconnexio/otrs_models/ticket_types/change_email_ticket.py +40 -0
- otrs_somconnexio/otrs_models/ticket_types/change_iban_ticket.py +39 -0
- otrs_somconnexio/otrs_models/ticket_types/change_owner_ticket.py +132 -0
- otrs_somconnexio/otrs_models/ticket_types/change_pack_not_shared_data.py +36 -0
- otrs_somconnexio/otrs_models/ticket_types/change_personal_email_ticket.py +31 -0
- otrs_somconnexio/otrs_models/ticket_types/change_shared_bond_ticket.py +35 -0
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_adsl_landline_ticket.py +30 -0
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_adsl_out_landline_ticket.py +30 -0
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_adsl_ticket.py +42 -0
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_fiber_ticket.py +43 -0
- otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket.py +87 -0
- 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 +22 -0
- otrs_somconnexio/otrs_models/ticket_types/check_coverage_ticket.py +52 -0
- otrs_somconnexio/otrs_models/ticket_types/we_call_you_ticket.py +53 -0
- otrs_somconnexio/otrs_models/vf_provisioning_article.py +4 -2
- otrs_somconnexio/responses/ticket_creation.py +5 -4
- otrs_somconnexio/services/activate_change_tarriff_mobile_tickets.py +13 -0
- otrs_somconnexio/services/base_get_ticket_by_number.py +22 -0
- otrs_somconnexio/services/change_to_confirm_ticket.py +45 -0
- otrs_somconnexio/services/get_mobile_related_tickets.py +11 -0
- otrs_somconnexio/services/get_sharing_data_mobile_tickets.py +65 -0
- otrs_somconnexio/services/get_ticket_title.py +26 -0
- otrs_somconnexio/services/mapping_mobile_minutes.py +5 -5
- otrs_somconnexio/services/mapping_services.py +8 -6
- otrs_somconnexio/services/move_sharing_data_mobile_tickets.py +13 -0
- otrs_somconnexio/services/search_tickets_mobile_change_tariff.py +25 -0
- otrs_somconnexio/services/search_tickets_service.py +57 -0
- otrs_somconnexio/services/set_SIM_recieved_mobile_ticket.py +107 -0
- otrs_somconnexio/services/set_SIM_returned_mobile_ticket.py +37 -0
- otrs_somconnexio/services/set_fiber_contract_code_mobile_ticket.py +21 -0
- otrs_somconnexio/services/unblock_mobile_pack_ticket.py +48 -0
- otrs_somconnexio/services/update_process_ticket_with_coverage_tickets_info_service.py +10 -10
- otrs_somconnexio/services/update_ticket_DF.py +18 -0
- otrs_somconnexio/services/update_ticket_with_provider_info.py +2 -3
- otrs_somconnexio/user_management_client/client.py +15 -27
- otrs_somconnexio/user_management_client/user_management_response.py +2 -3
- {otrs_somconnexio-0.4.4.dist-info → otrs_somconnexio-0.7.3.dist-info}/METADATA +19 -4
- otrs_somconnexio-0.7.3.dist-info/RECORD +202 -0
- {otrs_somconnexio-0.4.4.dist-info → otrs_somconnexio-0.7.3.dist-info}/WHEEL +1 -1
- tests/data/otrs_raw_responses.py +12 -6
- tests/integration/test_change_customer_language.py +14 -19
- tests/integration/test_ticket_factory.py +383 -106
- tests/integration/test_update_ticket_with_coverage_data.py +53 -27
- tests/otrs_models/common_helper.py +9 -0
- tests/otrs_models/configuration/changes/__init__.py +0 -0
- tests/otrs_models/configuration/changes/test_change_tariff_ticket.py +91 -0
- tests/otrs_models/configuration/provision/__init__.py +0 -0
- tests/otrs_models/configuration/provision/test_adsl_ticket.py +30 -0
- tests/otrs_models/configuration/provision/test_fiber_ticket.py +32 -0
- tests/otrs_models/configuration/provision/test_mobile_ticket.py +62 -0
- tests/otrs_models/process_ticket/test_internet_process_ticket.py +54 -60
- tests/otrs_models/process_ticket/test_mobile_process_ticket.py +56 -33
- tests/otrs_models/test_abstract_article.py +3 -2
- tests/otrs_models/test_adsl_data.py +11 -4
- tests/otrs_models/test_adsl_dynamic_fields.py +217 -100
- tests/otrs_models/test_adsl_ticket.py +78 -83
- tests/otrs_models/test_coverage_article.py +9 -7
- tests/otrs_models/test_coverage_ticket.py +4 -2
- tests/otrs_models/test_customer_user.py +23 -20
- tests/otrs_models/test_fiber_data.py +20 -4
- tests/otrs_models/test_fiber_dynamic_fields.py +458 -134
- tests/otrs_models/test_fiber_ticket.py +113 -79
- tests/otrs_models/test_mobile_data.py +14 -3
- tests/otrs_models/test_mobile_dynamic_fields.py +335 -74
- tests/otrs_models/test_mobile_paused_ticket.py +35 -0
- tests/otrs_models/test_mobile_ticket.py +82 -96
- tests/otrs_models/test_provision_article.py +49 -0
- tests/otrs_models/test_router_4G_data.py +43 -0
- tests/otrs_models/test_router_4G_dynamic_fields.py +619 -0
- tests/otrs_models/test_router_4G_ticket.py +135 -0
- tests/otrs_models/test_service.py +58 -14
- tests/otrs_models/test_switchboard_data.py +37 -0
- tests/otrs_models/test_switchboard_dynamic_fields.py +197 -0
- tests/otrs_models/test_switchboard_header_data.py +18 -0
- tests/otrs_models/test_switchboard_header_dynamic_fields.py +119 -0
- tests/otrs_models/test_switchboard_header_ticket.py +127 -0
- tests/otrs_models/test_switchboard_ticket.py +147 -0
- tests/otrs_models/test_telecom_company.py +16 -16
- tests/otrs_models/test_ticket_factory.py +73 -16
- tests/otrs_models/test_vf_provisioning_article.py +6 -5
- tests/otrs_models/ticket_types/__init__.py +0 -0
- tests/otrs_models/ticket_types/test_add_data.py +79 -0
- tests/otrs_models/ticket_types/test_change_email.py +163 -0
- tests/otrs_models/ticket_types/test_change_iban.py +82 -0
- tests/otrs_models/ticket_types/test_change_owner.py +277 -0
- tests/otrs_models/ticket_types/test_change_pack_not_shared_data.py +77 -0
- tests/otrs_models/ticket_types/test_change_personal_email.py +81 -0
- tests/otrs_models/ticket_types/test_change_tariff.py +435 -0
- tests/otrs_models/ticket_types/test_change_tariff_adsl_landline.py +115 -0
- tests/otrs_models/ticket_types/test_change_tariff_adsl_out_landline.py +115 -0
- tests/otrs_models/ticket_types/test_change_tariff_fiber.py +175 -0
- tests/otrs_models/ticket_types/test_change_tariff_mobile_pack.py +151 -0
- tests/otrs_models/ticket_types/test_change_tariff_shared_bonds.py +65 -0
- tests/otrs_models/ticket_types/test_check_coverage.py +106 -0
- tests/otrs_models/ticket_types/test_shared_bond.py +80 -0
- tests/otrs_models/ticket_types/test_we_call_you.py +108 -0
- tests/responses/test_ticket_creation.py +4 -4
- tests/services/test_activate_change_tariff_mobile_tickets.py +45 -0
- tests/services/test_change_to_confirm_ticket.py +80 -0
- tests/services/test_get_mobile_related_tickets.py +39 -0
- tests/services/test_get_sharing_data_mobile_tickets.py +127 -0
- tests/services/test_mapping_mobile_minutes.py +8 -8
- tests/services/{test_mappint_services.py → test_mapping_services.py} +9 -9
- tests/services/test_move_sharing_data_mobile_tickets.py +43 -0
- tests/services/test_search_tickets_mobile_change_tariff.py +84 -0
- tests/services/test_search_tickets_service.py +166 -0
- tests/services/test_set_SIM_recieved_mobile_ticket_service.py +211 -0
- tests/services/test_set_SIM_returned_mobile_ticket_service.py +59 -0
- tests/services/test_set_fiber_contract_code_mobile_ticket_service.py +47 -0
- tests/services/test_unblock_mobile_pack_ticket.py +224 -0
- tests/services/test_update_process_ticket_with_VF_provisioning.py +15 -14
- tests/services/test_update_process_ticket_with_coverage_tickets_info_service.py +22 -10
- tests/services/test_update_ticket_with_provider_info.py +16 -15
- tests/user_management_client/test_client.py +41 -58
- tests/user_management_client/test_user_management_response.py +13 -26
- otrs_somconnexio/otrs_models/configurations/mobile_ticket.py +0 -17
- otrs_somconnexio/otrs_models/coverage/mm_fibre.py +0 -7
- otrs_somconnexio/otrs_models/coverage/vdf_fibre.py +0 -8
- otrs_somconnexio-0.4.4.dist-info/RECORD +0 -95
- tests/otrs_models/configuration/test_adsl_ticket.py +0 -45
- tests/otrs_models/configuration/test_fiber_ticket.py +0 -45
- tests/otrs_models/configuration/test_mobile_ticket.py +0 -45
- {otrs_somconnexio-0.4.4.dist-info → otrs_somconnexio-0.7.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
from otrs_somconnexio.otrs_models.provision_ticket import ProvisionTicket
|
|
3
|
+
from otrs_somconnexio.otrs_models.switchboard_dynamic_fields import (
|
|
4
|
+
SwitchboardDynamicFields,
|
|
5
|
+
)
|
|
6
|
+
from otrs_somconnexio.otrs_models.configurations.provision.switchboard_ticket import (
|
|
7
|
+
SwitchboardTicketConfiguration,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SwitchboardTicket(ProvisionTicket):
|
|
12
|
+
def __init__(self, service_data, customer_data, responsible_data):
|
|
13
|
+
super(SwitchboardTicket, self).__init__(responsible_data)
|
|
14
|
+
self.service_data = service_data
|
|
15
|
+
self.customer_data = customer_data
|
|
16
|
+
self.otrs_configuration = SwitchboardTicketConfiguration()
|
|
17
|
+
|
|
18
|
+
def service_type(self):
|
|
19
|
+
return "switchboard"
|
|
20
|
+
|
|
21
|
+
def _build_dynamic_fields(self):
|
|
22
|
+
return SwitchboardDynamicFields(
|
|
23
|
+
self.service_data,
|
|
24
|
+
self.customer_data,
|
|
25
|
+
self._ticket_process_id(),
|
|
26
|
+
self._ticket_activity_id(),
|
|
27
|
+
).all()
|
|
28
|
+
|
|
29
|
+
def _ticket_title(self):
|
|
30
|
+
if self.service_data.landline:
|
|
31
|
+
return "Alta número de fix (CV)"
|
|
32
|
+
elif self.service_data.mobile_phone_number:
|
|
33
|
+
return "Alta mòbil agent (CV)"
|
|
34
|
+
else:
|
|
35
|
+
return "Provisió centraleta virtual (CV)"
|
|
@@ -4,74 +4,74 @@ from future.utils import bytes_to_native_str as n
|
|
|
4
4
|
|
|
5
5
|
class TelecomCompany:
|
|
6
6
|
TELECOM_COMPANIES = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
"internet": {
|
|
8
|
+
"Euskaltel": "Euskaltel",
|
|
9
|
+
"Jazztel": "Jazztel",
|
|
10
|
+
"MasMovil": "Más Móvil",
|
|
11
|
+
"Movistar": "Movistar",
|
|
12
|
+
"Aire / Nubip": "Nubip",
|
|
13
|
+
"Ono": "Ono",
|
|
14
|
+
"Orange": "Orange",
|
|
15
|
+
"Parlem": "Parlem",
|
|
16
|
+
"PepePhone": "PepePhone",
|
|
17
|
+
"Som Connexió": "SomConnexio",
|
|
18
|
+
"Vodafone": "Vodafone",
|
|
19
|
+
"Vodafone-Ono": "VodafoneOno",
|
|
20
|
+
"Yoigo": "Yoigo",
|
|
21
|
+
},
|
|
22
|
+
"mobile": {
|
|
23
|
+
"Aire / Nubip": "AireNubip",
|
|
24
|
+
"Amena": "Amena",
|
|
25
|
+
"BT": "BT",
|
|
26
|
+
"Cable Móvil": "CableMovil",
|
|
27
|
+
"Carref": "Carrefour",
|
|
28
|
+
"DIGI Spain Telecom": "DIGI",
|
|
29
|
+
" E-Plus España (KPN-Bankinter)": "EPLUS",
|
|
30
|
+
"Eroski": "Eroski",
|
|
31
|
+
"Euskaltel (Europa)": "Euskaltel",
|
|
32
|
+
"Fonyou": "Fonyou",
|
|
33
|
+
"GT Mobile": "GTMobil",
|
|
34
|
+
"Happy Móvil": "HappyMovil",
|
|
35
|
+
"Hits": "Hits",
|
|
36
|
+
"IOS -Pinger-Alow-Vozelia-KNET-SUOAireNubipP": "IOS",
|
|
37
|
+
"Ibercom": "Ibercom",
|
|
38
|
+
"Icatel": "Icatel",
|
|
39
|
+
"Infotelecom": "Infotelecom",
|
|
40
|
+
"Jazztel": "Jazztel",
|
|
41
|
+
"Least Cost Routing Telecom": "LeastCostRoutingTelecom",
|
|
42
|
+
"Lebara": "Lebara",
|
|
43
|
+
"Llamaya": "Llamaya",
|
|
44
|
+
"Lowi (Vodafone Enabler)": "Lowi",
|
|
45
|
+
"Lycamobile": "Lycamobile",
|
|
46
|
+
"Más Móvil": "MasMovil",
|
|
47
|
+
"More Minutes": "MoreMinutes",
|
|
48
|
+
"movistar": "Movistar",
|
|
49
|
+
"Neo Sky": "NeoSky",
|
|
50
|
+
"Oceane": "Oceane",
|
|
51
|
+
"Ono": "Ono",
|
|
52
|
+
"Orange": "Orange",
|
|
53
|
+
"Orbitel": "Orbitel",
|
|
54
|
+
"Parlem": "Parlem",
|
|
55
|
+
"Pepephone 4G": "Pepephone4G",
|
|
56
|
+
"Procono PTV Telecom": "Procono",
|
|
57
|
+
"RACC": "RACC",
|
|
58
|
+
"R Cable y Telecomunicaciones": "RCable",
|
|
59
|
+
"República Móvil": "RepublicaMovil",
|
|
60
|
+
"Sarnet": "Sarnet",
|
|
61
|
+
"Simyo": "Simyo",
|
|
62
|
+
"Som Connexió": "SomConnexio",
|
|
63
|
+
"Suop (IO S)": "Suop",
|
|
64
|
+
"Telecable Móvil": "TelecableMovil",
|
|
65
|
+
"The Phone House": "ThePhoneHouse",
|
|
66
|
+
"Tuenti": "Tuenti",
|
|
67
|
+
"Viva Mobile": "VivaMobile",
|
|
68
|
+
"Vivazzi": "Vivazzi",
|
|
69
|
+
"Vodafone-Ono": "VodafoneOno",
|
|
70
|
+
"Voz Telecom": "VozTelecom",
|
|
71
|
+
"Xphera Móviles": "XpheraMoviles",
|
|
72
|
+
"Yoigo": "Yoigo",
|
|
73
|
+
"You Mobile": "YouMobil",
|
|
21
74
|
},
|
|
22
|
-
'mobile': {
|
|
23
|
-
'Aire / Nubip': 'AireNubip',
|
|
24
|
-
'Amena': 'Amena',
|
|
25
|
-
'BT': 'BT',
|
|
26
|
-
'Cable Móvil': 'CableMovil',
|
|
27
|
-
'Carref': 'Carrefour',
|
|
28
|
-
'DIGI Spain Telecom': 'DIGI',
|
|
29
|
-
' E-Plus España (KPN-Bankinter)': 'EPLUS',
|
|
30
|
-
'Eroski': 'Eroski',
|
|
31
|
-
'Euskaltel (Europa)': 'Euskaltel',
|
|
32
|
-
'Fonyou': 'Fonyou',
|
|
33
|
-
'GT Mobile': 'GTMobil',
|
|
34
|
-
'Happy Móvil': 'HappyMovil',
|
|
35
|
-
'Hits': 'Hits',
|
|
36
|
-
'IOS -Pinger-Alow-Vozelia-KNET-SUOAireNubipP': 'IOS',
|
|
37
|
-
'Ibercom': 'Ibercom',
|
|
38
|
-
'Icatel': 'Icatel',
|
|
39
|
-
'Infotelecom': 'Infotelecom',
|
|
40
|
-
'Jazztel': 'Jazztel',
|
|
41
|
-
'Least Cost Routing Telecom': 'LeastCostRoutingTelecom',
|
|
42
|
-
'Lebara': 'Lebara',
|
|
43
|
-
'Llamaya': 'Llamaya',
|
|
44
|
-
'Lowi (Vodafone Enabler)': 'Lowi',
|
|
45
|
-
'Lycamobile': 'Lycamobile',
|
|
46
|
-
'Más Móvil': 'MasMovil',
|
|
47
|
-
'More Minutes': 'MoreMinutes',
|
|
48
|
-
'movistar': 'Movistar',
|
|
49
|
-
'Neo Sky': 'NeoSky',
|
|
50
|
-
'Oceane': 'Oceane',
|
|
51
|
-
'Ono': 'Ono',
|
|
52
|
-
'Orange': 'Orange',
|
|
53
|
-
'Orbitel': 'Orbitel',
|
|
54
|
-
'Parlem': 'Parlem',
|
|
55
|
-
'Pepephone 4G': 'Pepephone4G',
|
|
56
|
-
'Procono PTV Telecom': 'Procono',
|
|
57
|
-
'RACC': 'RACC',
|
|
58
|
-
'R Cable y Telecomunicaciones': 'RCable',
|
|
59
|
-
'República Móvil': 'RepublicaMovil',
|
|
60
|
-
'Sarnet': 'Sarnet',
|
|
61
|
-
'Simyo': 'Simyo',
|
|
62
|
-
'Som Connexió': 'SomConnexio',
|
|
63
|
-
'Suop (IO S)': 'Suop',
|
|
64
|
-
'Telecable Móvil': 'TelecableMovil',
|
|
65
|
-
'The Phone House': 'ThePhoneHouse',
|
|
66
|
-
'Tuenti': 'Tuenti',
|
|
67
|
-
'Viva Mobile': 'VivaMobile',
|
|
68
|
-
'Vivazzi': 'Vivazzi',
|
|
69
|
-
'Vodafone-Ono': 'VodafoneOno',
|
|
70
|
-
'Voz Telecom': 'VozTelecom',
|
|
71
|
-
'Xphera Móviles': 'XpheraMoviles',
|
|
72
|
-
'Yoigo': 'Yoigo',
|
|
73
|
-
'You Mobile': 'YouMobil',
|
|
74
|
-
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
def __init__(self, type, company):
|
|
@@ -79,10 +79,10 @@ class TelecomCompany:
|
|
|
79
79
|
self.company = company
|
|
80
80
|
|
|
81
81
|
if not self.company:
|
|
82
|
-
self.name =
|
|
82
|
+
self.name = "None"
|
|
83
83
|
else:
|
|
84
84
|
telecom_companies_by_type = self.TELECOM_COMPANIES.get(self.type, {})
|
|
85
|
-
erp_name = n(self.company.name.encode(
|
|
85
|
+
erp_name = n(self.company.name.encode("utf8"))
|
|
86
86
|
self.name = telecom_companies_by_type.get(erp_name, "Other")
|
|
87
87
|
|
|
88
88
|
def __str__(self):
|
|
@@ -1,29 +1,52 @@
|
|
|
1
1
|
from otrs_somconnexio.otrs_models.adsl_ticket import ADSLTicket
|
|
2
2
|
from otrs_somconnexio.otrs_models.fiber_ticket import FiberTicket
|
|
3
|
-
from otrs_somconnexio.otrs_models.mobile_ticket import MobileTicket
|
|
3
|
+
from otrs_somconnexio.otrs_models.mobile_ticket import MobileTicket, MobilePausedTicket
|
|
4
|
+
from otrs_somconnexio.otrs_models.router_4G_ticket import Router4GTicket
|
|
5
|
+
from otrs_somconnexio.otrs_models.switchboard_ticket import SwitchboardTicket
|
|
6
|
+
from otrs_somconnexio.otrs_models.switchboard_header_ticket import (
|
|
7
|
+
SwitchboardHeaderTicket,
|
|
8
|
+
)
|
|
4
9
|
from otrs_somconnexio.exceptions import ServiceTypeNotAllowedError
|
|
5
10
|
|
|
6
11
|
|
|
7
12
|
class TicketFactory(object):
|
|
8
|
-
"""
|
|
9
|
-
|
|
13
|
+
"""This factory is to generate the concrete ticket with his internal logic based on
|
|
14
|
+
the service of the EticomContract.
|
|
10
15
|
"""
|
|
11
|
-
|
|
16
|
+
|
|
17
|
+
def __init__(self, service_data, customer_data, responsible_data=None):
|
|
12
18
|
self.service_data = service_data
|
|
13
19
|
self.customer_data = customer_data
|
|
20
|
+
self.responsible_data = responsible_data
|
|
14
21
|
|
|
15
22
|
def build(self):
|
|
16
|
-
"""
|
|
17
|
-
|
|
23
|
+
"""Create a OTRS Process Ticket with the information of the ServiceData and return it."""
|
|
24
|
+
|
|
25
|
+
if self.service_data.service_type == "adsl":
|
|
18
26
|
TicketClass = ADSLTicket
|
|
19
|
-
elif self.service_data.
|
|
27
|
+
elif self.service_data.service_type == "fiber":
|
|
20
28
|
TicketClass = FiberTicket
|
|
21
|
-
elif self.service_data.
|
|
22
|
-
|
|
29
|
+
elif self.service_data.service_type == "mobile":
|
|
30
|
+
if self.service_data.is_grouped_with_fiber and (
|
|
31
|
+
self.service_data.type == "portability"
|
|
32
|
+
or self.service_data.is_from_pack
|
|
33
|
+
):
|
|
34
|
+
TicketClass = MobilePausedTicket
|
|
35
|
+
else:
|
|
36
|
+
TicketClass = MobileTicket
|
|
37
|
+
elif self.service_data.service_type == "4G":
|
|
38
|
+
TicketClass = Router4GTicket
|
|
39
|
+
elif self.service_data.service_type == "header_switchboard":
|
|
40
|
+
TicketClass = SwitchboardHeaderTicket
|
|
41
|
+
elif self.service_data.service_type == "switchboard":
|
|
42
|
+
TicketClass = SwitchboardTicket
|
|
23
43
|
else:
|
|
24
|
-
raise ServiceTypeNotAllowedError(
|
|
44
|
+
raise ServiceTypeNotAllowedError(
|
|
45
|
+
self.service_data.order_id, self.service_data.service_type
|
|
46
|
+
)
|
|
25
47
|
|
|
26
48
|
return TicketClass(
|
|
27
49
|
service_data=self.service_data,
|
|
28
|
-
customer_data=self.customer_data
|
|
50
|
+
customer_data=self.customer_data,
|
|
51
|
+
responsible_data=self.responsible_data,
|
|
29
52
|
)
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.add_data import (
|
|
2
|
+
AddDataTicketConfiguration,
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import (
|
|
6
|
+
BaseCustomerTicket,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AddDataTicket(BaseCustomerTicket):
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
username,
|
|
14
|
+
customer_code,
|
|
15
|
+
fields_dict,
|
|
16
|
+
override_ticket_ids=[],
|
|
17
|
+
fallback_path="/tmp/tickets/",
|
|
18
|
+
):
|
|
19
|
+
super(AddDataTicket, self).__init__(
|
|
20
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
21
|
+
)
|
|
22
|
+
self.configuration = AddDataTicketConfiguration()
|
|
23
|
+
|
|
24
|
+
def _get_subject(self):
|
|
25
|
+
return self.configuration.subject
|
|
26
|
+
|
|
27
|
+
def _get_queue_id(self):
|
|
28
|
+
return self.configuration.queue_id
|
|
29
|
+
|
|
30
|
+
def _get_dynamic_fields(self):
|
|
31
|
+
return {
|
|
32
|
+
"liniaMobil": self.fields["phone_number"],
|
|
33
|
+
"productAbonamentDadesAddicionals": self.fields["new_product_code"],
|
|
34
|
+
"correuElectronic": self.fields["subscription_email"],
|
|
35
|
+
"idioma": self.fields["language"],
|
|
36
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import BaseCustomerTicket
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class BaseChangeTariffTicketBA(BaseCustomerTicket):
|
|
5
|
+
|
|
6
|
+
def _get_specfic_dynamic_fields(self):
|
|
7
|
+
raise NotImplementedError(
|
|
8
|
+
"Tickets to change tariff BA must implement _get_specfic_dynamic_fields"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
def _get_dynamic_fields(self):
|
|
12
|
+
result = {
|
|
13
|
+
**{
|
|
14
|
+
"refOdooContract": self.fields["ref_contract"],
|
|
15
|
+
"telefonFixVell": self.fields["landline_number"],
|
|
16
|
+
"direccioServei": self.fields["service_address"],
|
|
17
|
+
"poblacioServei": self.fields["service_city"],
|
|
18
|
+
"CPservei": self.fields["service_zip"],
|
|
19
|
+
"provinciaServei": self.fields["service_state"],
|
|
20
|
+
},
|
|
21
|
+
**self._get_specfic_dynamic_fields(),
|
|
22
|
+
}
|
|
23
|
+
return result
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import (
|
|
3
|
+
BaseCustomerTicket,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BaseChangeTicket(BaseCustomerTicket):
|
|
8
|
+
def update(self, ticket_id):
|
|
9
|
+
super().update(
|
|
10
|
+
ticket_id,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
def _new_value(self):
|
|
14
|
+
return self.fields["new_value"]
|
|
15
|
+
|
|
16
|
+
def _get_attribute_dynamic_field_name(self):
|
|
17
|
+
raise NotImplementedError(
|
|
18
|
+
"ChangeTickets must implement _get_attribute_dynamic_field_name"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def _get_dynamic_fields(self):
|
|
22
|
+
result = {
|
|
23
|
+
"IDOV": str(uuid.uuid4()),
|
|
24
|
+
"idioma": self.fields["language"],
|
|
25
|
+
"refOdooContract": ";".join(self.fields["selected_subscriptions"]),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
result[self._get_attribute_dynamic_field_name()] = self._new_value()
|
|
29
|
+
|
|
30
|
+
return result
|
|
31
|
+
|
|
32
|
+
def _get_update_dynamic_fields(self):
|
|
33
|
+
return {"enviatOdooOV": True}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from .base_ticket import BaseTicket
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class BaseCustomerTicket(BaseTicket):
|
|
5
|
+
def _get_process_management_dynamic_fields(self):
|
|
6
|
+
result = {
|
|
7
|
+
"ProcessManagementProcessID": self._get_process_id(),
|
|
8
|
+
"ProcessManagementActivityID": self._get_activity_id(),
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
for k, v in dict(result).items():
|
|
12
|
+
if v is None:
|
|
13
|
+
del result[k]
|
|
14
|
+
|
|
15
|
+
return result
|
|
16
|
+
|
|
17
|
+
def _get_type(self):
|
|
18
|
+
return "Petición"
|
|
19
|
+
|
|
20
|
+
def _get_activity_id(self):
|
|
21
|
+
return self.configuration.activity_id
|
|
22
|
+
|
|
23
|
+
def _get_process_id(self):
|
|
24
|
+
return self.configuration.process_id
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import uuid
|
|
4
|
+
|
|
5
|
+
from pyotrs import Attachment, Ticket, Article
|
|
6
|
+
from pyotrs.lib import DynamicField
|
|
7
|
+
|
|
8
|
+
from otrs_somconnexio.client import OTRSClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BaseTicket:
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
username,
|
|
15
|
+
customer_code,
|
|
16
|
+
fields_dict,
|
|
17
|
+
override_ticket_ids=[],
|
|
18
|
+
fallback_path="/tmp/tickets/",
|
|
19
|
+
):
|
|
20
|
+
self.username = username
|
|
21
|
+
self.customer_code = customer_code
|
|
22
|
+
self.fields = fields_dict
|
|
23
|
+
self.client = None
|
|
24
|
+
self.override_ticket_ids = override_ticket_ids
|
|
25
|
+
self.fallback_path = fallback_path
|
|
26
|
+
|
|
27
|
+
def _get_subject(self):
|
|
28
|
+
raise NotImplementedError("Tickets must implement _get_subject")
|
|
29
|
+
|
|
30
|
+
def _get_body(self):
|
|
31
|
+
return "-"
|
|
32
|
+
|
|
33
|
+
def _get_docs(self):
|
|
34
|
+
return None
|
|
35
|
+
|
|
36
|
+
def _get_update_article_content(self):
|
|
37
|
+
return None
|
|
38
|
+
|
|
39
|
+
def _get_update_docs(self):
|
|
40
|
+
return None
|
|
41
|
+
|
|
42
|
+
def _get_state(self):
|
|
43
|
+
return "new"
|
|
44
|
+
|
|
45
|
+
def _get_priority(self):
|
|
46
|
+
return "3 normal"
|
|
47
|
+
|
|
48
|
+
def _get_service(self):
|
|
49
|
+
return False
|
|
50
|
+
|
|
51
|
+
def _get_queue_id(self):
|
|
52
|
+
raise NotImplementedError("Tickets must implement _get_queue_id")
|
|
53
|
+
|
|
54
|
+
def _get_dynamic_fields(self):
|
|
55
|
+
raise NotImplementedError("Tickets must implement _get_dynamic_fields")
|
|
56
|
+
|
|
57
|
+
def _get_update_dynamic_fields(self):
|
|
58
|
+
# TODO reiew raise NotImplementedError("Tickets must implement _get_update_dynamic_fields")
|
|
59
|
+
return []
|
|
60
|
+
|
|
61
|
+
def _dict_to_dynamic_fields(self, d):
|
|
62
|
+
return [DynamicField(key, d[key]) for key in d if d[key]]
|
|
63
|
+
|
|
64
|
+
def _docs_to_Attachments(self, docs):
|
|
65
|
+
return [Attachment(doc) for doc in docs] if docs else None
|
|
66
|
+
|
|
67
|
+
def send_ticket(self):
|
|
68
|
+
subject = self._get_subject()
|
|
69
|
+
body = self._get_body()
|
|
70
|
+
queue_id = self._get_queue_id()
|
|
71
|
+
docs = self._get_docs()
|
|
72
|
+
|
|
73
|
+
article = Article({"Subject": subject, "Body": body})
|
|
74
|
+
new_ticket = Ticket(
|
|
75
|
+
{
|
|
76
|
+
"Title": subject,
|
|
77
|
+
"QueueID": queue_id,
|
|
78
|
+
"State": self._get_state(),
|
|
79
|
+
"Type": self._get_type(),
|
|
80
|
+
"Priority": self._get_priority(),
|
|
81
|
+
"CustomerUser": self.customer_code,
|
|
82
|
+
"CustomerID": self.customer_code,
|
|
83
|
+
"Service": self._get_service(),
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
dynamic_fields = self._dict_to_dynamic_fields(
|
|
88
|
+
self._get_process_management_dynamic_fields()
|
|
89
|
+
) + self._dict_to_dynamic_fields(self._get_dynamic_fields())
|
|
90
|
+
|
|
91
|
+
attachments = self._docs_to_Attachments(docs)
|
|
92
|
+
|
|
93
|
+
return self._client().create_otrs_process_ticket(
|
|
94
|
+
new_ticket,
|
|
95
|
+
article=article,
|
|
96
|
+
dynamic_fields=dynamic_fields,
|
|
97
|
+
attachments=attachments,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def _transform_boolean_df(self, boolean):
|
|
101
|
+
# Transform boolean DF into '0'/'1' value
|
|
102
|
+
return "1" if bool(boolean) else "0"
|
|
103
|
+
|
|
104
|
+
def store_ticket(self):
|
|
105
|
+
ticket_path = os.path.join(self.fallback_path, str(uuid.uuid4()) + ".json")
|
|
106
|
+
|
|
107
|
+
# ensure ticket fallback path exists
|
|
108
|
+
if not os.path.exists(self.fallback_path):
|
|
109
|
+
os.makedirs(self.fallback_path)
|
|
110
|
+
|
|
111
|
+
with open(ticket_path, "w") as f:
|
|
112
|
+
json.dump({"customer_code": self.customer_code, "fields": self.fields}, f)
|
|
113
|
+
|
|
114
|
+
def create(self):
|
|
115
|
+
return self.send_ticket()
|
|
116
|
+
|
|
117
|
+
def get_by_IDOV(self, idov):
|
|
118
|
+
"""Get a ticket searching by IDOV DynamicField, generated by uuid4."""
|
|
119
|
+
ticket = self._client().client.ticket_search(
|
|
120
|
+
dynamic_fields=[DynamicField("IDOV", search_patterns=idov)]
|
|
121
|
+
)
|
|
122
|
+
if ticket:
|
|
123
|
+
return self._client().client.ticket_get_by_id(ticket_id=ticket[0])
|
|
124
|
+
|
|
125
|
+
def update(self, ticket_id, state=None):
|
|
126
|
+
docs = self._get_update_docs()
|
|
127
|
+
article_content = self._get_update_article_content()
|
|
128
|
+
|
|
129
|
+
article = Article(article_content) if article_content else None
|
|
130
|
+
attachments = self._docs_to_Attachments(docs)
|
|
131
|
+
dynamic_fields = self._dict_to_dynamic_fields(self._get_update_dynamic_fields())
|
|
132
|
+
|
|
133
|
+
self._client().client.ticket_update(
|
|
134
|
+
ticket_id,
|
|
135
|
+
article=article,
|
|
136
|
+
dynamic_fields=dynamic_fields,
|
|
137
|
+
State=state,
|
|
138
|
+
attachments=attachments,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
def _client(self):
|
|
142
|
+
if self.client:
|
|
143
|
+
return self.client
|
|
144
|
+
|
|
145
|
+
self.client = OTRSClient()
|
|
146
|
+
|
|
147
|
+
return self.client
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_email import (
|
|
2
|
+
ChangeEmailContractsConfiguration,
|
|
3
|
+
)
|
|
4
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_change_ticket import (
|
|
5
|
+
BaseChangeTicket,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ChangeEmailTicket(BaseChangeTicket):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
username,
|
|
13
|
+
customer_code,
|
|
14
|
+
fields_dict,
|
|
15
|
+
override_ticket_ids=[],
|
|
16
|
+
fallback_path="/tmp/tickets/",
|
|
17
|
+
):
|
|
18
|
+
super(ChangeEmailTicket, self).__init__(
|
|
19
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
20
|
+
)
|
|
21
|
+
self.configuration = ChangeEmailContractsConfiguration
|
|
22
|
+
|
|
23
|
+
def _get_queue_id(self):
|
|
24
|
+
return self.configuration.queue_id
|
|
25
|
+
|
|
26
|
+
def _get_subject(self):
|
|
27
|
+
return self.configuration.subject
|
|
28
|
+
|
|
29
|
+
def _attribute_to_change(self):
|
|
30
|
+
return "email"
|
|
31
|
+
|
|
32
|
+
def _get_attribute_dynamic_field_name(self):
|
|
33
|
+
return "nouEmail"
|
|
34
|
+
|
|
35
|
+
def _get_dynamic_fields(self):
|
|
36
|
+
result = super()._get_dynamic_fields()
|
|
37
|
+
|
|
38
|
+
result.update({"flagContracts": True})
|
|
39
|
+
|
|
40
|
+
return result
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_iban import (
|
|
2
|
+
ChangeIbanTicketConfiguration,
|
|
3
|
+
)
|
|
4
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_change_ticket import (
|
|
5
|
+
BaseChangeTicket,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ChangeIbanTicket(BaseChangeTicket):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
username,
|
|
13
|
+
customer_code,
|
|
14
|
+
fields_dict,
|
|
15
|
+
override_ticket_ids=[],
|
|
16
|
+
fallback_path="/tmp/tickets/",
|
|
17
|
+
):
|
|
18
|
+
super(ChangeIbanTicket, self).__init__(
|
|
19
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
20
|
+
)
|
|
21
|
+
self.configuration = ChangeIbanTicketConfiguration()
|
|
22
|
+
|
|
23
|
+
def _get_activity_id(self):
|
|
24
|
+
return self.configuration.activity_id
|
|
25
|
+
|
|
26
|
+
def _get_process_id(self):
|
|
27
|
+
return self.configuration.process_id
|
|
28
|
+
|
|
29
|
+
def _get_queue_id(self):
|
|
30
|
+
return self.configuration.queue_id
|
|
31
|
+
|
|
32
|
+
def _get_subject(self):
|
|
33
|
+
return self.configuration.subject
|
|
34
|
+
|
|
35
|
+
def _attribute_to_change(self):
|
|
36
|
+
return "IBAN"
|
|
37
|
+
|
|
38
|
+
def _get_attribute_dynamic_field_name(self):
|
|
39
|
+
return "nouIBAN"
|