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,132 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_owner import (
|
|
2
|
+
ChangeOwnerPackTicketConfiguration,
|
|
3
|
+
ChangeOwnerTicketConfiguration,
|
|
4
|
+
)
|
|
5
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_change_ticket import (
|
|
6
|
+
BaseChangeTicket,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BaseChangeOwnerTicket(BaseChangeTicket):
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
username,
|
|
14
|
+
customer_code,
|
|
15
|
+
fields_dict,
|
|
16
|
+
configuration,
|
|
17
|
+
override_ticket_ids=[],
|
|
18
|
+
fallback_path="/tmp/tickets/",
|
|
19
|
+
):
|
|
20
|
+
super(BaseChangeOwnerTicket, self).__init__(
|
|
21
|
+
username,
|
|
22
|
+
customer_code,
|
|
23
|
+
fields_dict,
|
|
24
|
+
override_ticket_ids,
|
|
25
|
+
fallback_path,
|
|
26
|
+
)
|
|
27
|
+
self.configuration = configuration()
|
|
28
|
+
|
|
29
|
+
def _get_activity_id(self):
|
|
30
|
+
return self.configuration.activity_id
|
|
31
|
+
|
|
32
|
+
def _get_process_id(self):
|
|
33
|
+
return self.configuration.process_id
|
|
34
|
+
|
|
35
|
+
def _get_queue_id(self):
|
|
36
|
+
return self.configuration.queue_id
|
|
37
|
+
|
|
38
|
+
def _get_subject(self):
|
|
39
|
+
return self.configuration.subject
|
|
40
|
+
|
|
41
|
+
def _get_attribute_dynamic_field_name(self):
|
|
42
|
+
return "nouEmail"
|
|
43
|
+
|
|
44
|
+
def _get_docs(self):
|
|
45
|
+
return [self._get_attachment_content(doc) for doc in self.fields["docs"]]
|
|
46
|
+
|
|
47
|
+
def _get_body(self):
|
|
48
|
+
return self.configuration.body
|
|
49
|
+
|
|
50
|
+
def _get_update_dynamic_fields(self):
|
|
51
|
+
dynamic_fields = super()._get_update_dynamic_fields()
|
|
52
|
+
dynamic_fields.update(
|
|
53
|
+
[
|
|
54
|
+
# common fields
|
|
55
|
+
("situacioNovaTitular", self.fields["role_new_owner"]),
|
|
56
|
+
("definicioNovaTitular", self.fields["legal_entity"]),
|
|
57
|
+
("nomSoci", self.fields["name_new_owner"]),
|
|
58
|
+
("NIFNIENovaTitular", self.fields["vat_new_owner"]),
|
|
59
|
+
("correuElectronic", self.fields["email_new_owner"]),
|
|
60
|
+
("IBAN", self.fields["iban_new_owner"]),
|
|
61
|
+
# new user fields
|
|
62
|
+
("idiomaNovaTitular", self.fields.get("lang")),
|
|
63
|
+
("telefonContacte", self.fields.get("phone_contact")),
|
|
64
|
+
("adrecaNovaTitular", self.fields.get("address_street_contact")),
|
|
65
|
+
("localitatNovaTitular", self.fields.get("address_city_contact")),
|
|
66
|
+
("cpNovaTitular", self.fields.get("address_zip_code_contact")),
|
|
67
|
+
("codiProvinciaServei", self.fields.get("address_state_contact")),
|
|
68
|
+
# new partner fields
|
|
69
|
+
("IBANaportacio", self.fields.get("iban_new_partner")),
|
|
70
|
+
("fraccionarPagament", self.fields.get("pays_in_ten_terms")),
|
|
71
|
+
# new sponsorship fields
|
|
72
|
+
("NIFNIESoci", self.fields.get("sponsor_vat")),
|
|
73
|
+
("codiApadrinament", self.fields.get("sponsor_code")),
|
|
74
|
+
]
|
|
75
|
+
)
|
|
76
|
+
return dynamic_fields
|
|
77
|
+
|
|
78
|
+
def _get_update_article_content(self):
|
|
79
|
+
return {
|
|
80
|
+
"Subject": self.configuration.update_subject,
|
|
81
|
+
"Body": self.configuration.update_body,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
def _get_update_docs(self):
|
|
85
|
+
return [
|
|
86
|
+
self._get_attachment_content(doc) for doc in self.fields["next_owner_docs"]
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
def _get_attachment_content(self, doc):
|
|
90
|
+
return {
|
|
91
|
+
"Content": doc["content"],
|
|
92
|
+
"ContentType": doc["file_type"],
|
|
93
|
+
"Filename": doc["file_name"],
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class ChangeOwnerTicket(BaseChangeOwnerTicket):
|
|
98
|
+
def __init__(
|
|
99
|
+
self,
|
|
100
|
+
username,
|
|
101
|
+
customer_code,
|
|
102
|
+
fields_dict,
|
|
103
|
+
override_ticket_ids=[],
|
|
104
|
+
fallback_path="/tmp/tickets/",
|
|
105
|
+
):
|
|
106
|
+
super(ChangeOwnerTicket, self).__init__(
|
|
107
|
+
username,
|
|
108
|
+
customer_code,
|
|
109
|
+
fields_dict,
|
|
110
|
+
ChangeOwnerTicketConfiguration,
|
|
111
|
+
override_ticket_ids,
|
|
112
|
+
fallback_path,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class ChangeOwnerPackTicket(BaseChangeOwnerTicket):
|
|
117
|
+
def __init__(
|
|
118
|
+
self,
|
|
119
|
+
username,
|
|
120
|
+
customer_code,
|
|
121
|
+
fields_dict,
|
|
122
|
+
override_ticket_ids=[],
|
|
123
|
+
fallback_path="/tmp/tickets/",
|
|
124
|
+
):
|
|
125
|
+
super(ChangeOwnerPackTicket, self).__init__(
|
|
126
|
+
username,
|
|
127
|
+
customer_code,
|
|
128
|
+
fields_dict,
|
|
129
|
+
ChangeOwnerPackTicketConfiguration,
|
|
130
|
+
override_ticket_ids,
|
|
131
|
+
fallback_path,
|
|
132
|
+
)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_pack import (
|
|
2
|
+
ChangePackNotSharedDataTicketConfiguration,
|
|
3
|
+
)
|
|
4
|
+
from .base_customer_ticket import BaseCustomerTicket
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ChangePackNotSharedDataTicket(BaseCustomerTicket):
|
|
8
|
+
def __init__(
|
|
9
|
+
self,
|
|
10
|
+
username,
|
|
11
|
+
customer_code,
|
|
12
|
+
fields_dict,
|
|
13
|
+
override_ticket_ids=[],
|
|
14
|
+
fallback_path="/tmp/tickets/",
|
|
15
|
+
):
|
|
16
|
+
super(ChangePackNotSharedDataTicket, self).__init__(
|
|
17
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
18
|
+
)
|
|
19
|
+
self.configuration = ChangePackNotSharedDataTicketConfiguration()
|
|
20
|
+
|
|
21
|
+
def _get_queue_id(self):
|
|
22
|
+
return self.configuration.queue_id
|
|
23
|
+
|
|
24
|
+
def _get_subject(self):
|
|
25
|
+
return self.configuration.subject
|
|
26
|
+
|
|
27
|
+
def _get_service(self):
|
|
28
|
+
return self.configuration.service
|
|
29
|
+
|
|
30
|
+
def _get_dynamic_fields(self):
|
|
31
|
+
return {
|
|
32
|
+
"refOdooContract": ";".join(self.fields["selected_subscriptions"]),
|
|
33
|
+
"fibraSenseFix": self._transform_boolean_df(
|
|
34
|
+
self.fields["fiber_without_landline"]
|
|
35
|
+
),
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_email import ChangeEmailPersonalConfiguration
|
|
3
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import BaseCustomerTicket
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChangePersonalEmailTicket(BaseCustomerTicket):
|
|
7
|
+
def __init__(
|
|
8
|
+
self,
|
|
9
|
+
username,
|
|
10
|
+
customer_code,
|
|
11
|
+
fields_dict,
|
|
12
|
+
override_ticket_ids=[],
|
|
13
|
+
fallback_path="/tmp/tickets/",
|
|
14
|
+
):
|
|
15
|
+
super(ChangePersonalEmailTicket, self).__init__(
|
|
16
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
17
|
+
)
|
|
18
|
+
self.configuration = ChangeEmailPersonalConfiguration
|
|
19
|
+
|
|
20
|
+
def _get_queue_id(self):
|
|
21
|
+
return self.configuration.queue_id
|
|
22
|
+
|
|
23
|
+
def _get_subject(self):
|
|
24
|
+
return self.configuration.subject
|
|
25
|
+
|
|
26
|
+
def _get_dynamic_fields(self):
|
|
27
|
+
return {
|
|
28
|
+
"flagPartner": True,
|
|
29
|
+
"IDOV": str(uuid.uuid4()),
|
|
30
|
+
"nouEmail": self.fields["email"],
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_shared_bond import (
|
|
2
|
+
ChangeSharedBondTicketConfiguration,
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
from .base_customer_ticket import BaseCustomerTicket
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ChangeSharedBondTicket(BaseCustomerTicket):
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
username,
|
|
12
|
+
customer_code,
|
|
13
|
+
fields_dict,
|
|
14
|
+
override_ticket_ids=[],
|
|
15
|
+
fallback_path="/tmp/tickets/",
|
|
16
|
+
):
|
|
17
|
+
super(ChangeSharedBondTicket, self).__init__(
|
|
18
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
19
|
+
)
|
|
20
|
+
self.configuration = ChangeSharedBondTicketConfiguration()
|
|
21
|
+
|
|
22
|
+
def _get_subject(self):
|
|
23
|
+
return "Sol·licitud Canvi d'abonament compartit oficina virtual"
|
|
24
|
+
|
|
25
|
+
def _get_queue_id(self):
|
|
26
|
+
return self.configuration.queue_id
|
|
27
|
+
|
|
28
|
+
def _get_dynamic_fields(self):
|
|
29
|
+
return {
|
|
30
|
+
"liniaMobil": self.fields["phone_number"],
|
|
31
|
+
"productMobil": self.fields["new_product_code"],
|
|
32
|
+
"IDAbonamentCompartit": self.fields["new_shared_bond"],
|
|
33
|
+
"OdooContractRefRelacionat": self.fields["fiber_linked"],
|
|
34
|
+
"TecDelServei": "Mobil",
|
|
35
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_tariff_adsl import (
|
|
2
|
+
ChangeTariffTicketAdslLandlineConfig,
|
|
3
|
+
)
|
|
4
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_adsl_ticket import (
|
|
5
|
+
ChangeTariffTicketADSL,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ChangeTariffLandLineADSL(ChangeTariffTicketADSL):
|
|
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(ChangeTariffLandLineADSL, self).__init__(
|
|
19
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
20
|
+
)
|
|
21
|
+
self.configuration = ChangeTariffTicketAdslLandlineConfig
|
|
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 _get_productBA(self):
|
|
30
|
+
return self.configuration.code_fiber
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_tariff_adsl import (
|
|
2
|
+
ChangeTariffTicketAdslOutLandlineConfig,
|
|
3
|
+
)
|
|
4
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_adsl_ticket import (
|
|
5
|
+
ChangeTariffTicketADSL,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ChangeTariffOutLandLineADSL(ChangeTariffTicketADSL):
|
|
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(ChangeTariffOutLandLineADSL, self).__init__(
|
|
19
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
20
|
+
)
|
|
21
|
+
self.configuration = ChangeTariffTicketAdslOutLandlineConfig
|
|
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 _get_productBA(self):
|
|
30
|
+
return self.configuration.code_fiber
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_change_tariff_ba_ticket import (
|
|
2
|
+
BaseChangeTariffTicketBA,
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChangeTariffTicketADSL(BaseChangeTariffTicketBA):
|
|
7
|
+
def _get_specfic_dynamic_fields(self):
|
|
8
|
+
complete_last_name = "%s %s" % (
|
|
9
|
+
self.fields["sur_name"],
|
|
10
|
+
self.fields["last_name"],
|
|
11
|
+
)
|
|
12
|
+
return {
|
|
13
|
+
"serveiPrevi": "ADSL",
|
|
14
|
+
"productBA": self._get_productBA(),
|
|
15
|
+
"nomSoci": self.fields["name"],
|
|
16
|
+
"titular": self.fields["name"],
|
|
17
|
+
"cognom1": complete_last_name,
|
|
18
|
+
"cognom1Titular": complete_last_name,
|
|
19
|
+
"nomCognomSociAntic": self.fields["complete_name"],
|
|
20
|
+
"NIFNIESoci": self.fields["vat_number"],
|
|
21
|
+
"NIFNIEtitular": self.fields["vat_number"],
|
|
22
|
+
"IBAN": self.fields["iban"],
|
|
23
|
+
"telefonFixAntic": self.fields["landline_number"],
|
|
24
|
+
"IDContracte": "-",
|
|
25
|
+
"correuElectronic": self.fields["customer_email"],
|
|
26
|
+
"direccioServeiAntic": "%s - %s %s %s"
|
|
27
|
+
% (
|
|
28
|
+
self.fields["service_address"],
|
|
29
|
+
self.fields["service_zip"],
|
|
30
|
+
self.fields["service_city"],
|
|
31
|
+
self.fields["service_state"],
|
|
32
|
+
),
|
|
33
|
+
"codiProvinciaServei": self.fields["service_state_code"],
|
|
34
|
+
"telefonContacte": self.fields["customer_phone"],
|
|
35
|
+
"canviUbicacioMateixTitular": "yes",
|
|
36
|
+
"TecDelServei": "ADSL",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
def _get_productBA(self):
|
|
40
|
+
raise NotImplementedError(
|
|
41
|
+
"Tickets to change tariff BA ADSL must implement _get_productBA"
|
|
42
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_tariff_fiber import (
|
|
2
|
+
ChangeTariffTicketFiberConfiguration,
|
|
3
|
+
)
|
|
4
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_change_tariff_ba_ticket import (
|
|
5
|
+
BaseChangeTariffTicketBA,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ChangeTariffTicketFiber(BaseChangeTariffTicketBA):
|
|
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(ChangeTariffTicketFiber, self).__init__(
|
|
19
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
20
|
+
)
|
|
21
|
+
self.configuration = ChangeTariffTicketFiberConfiguration
|
|
22
|
+
|
|
23
|
+
def _get_subject(self):
|
|
24
|
+
return self.configuration.subject
|
|
25
|
+
|
|
26
|
+
def _get_queue_id(self):
|
|
27
|
+
return self.configuration.queue_id
|
|
28
|
+
|
|
29
|
+
def _get_specfic_dynamic_fields(self):
|
|
30
|
+
return {
|
|
31
|
+
"serveiPrevi": "Fibra",
|
|
32
|
+
"productBA": self._get_product_ba(),
|
|
33
|
+
"dataExecucioCanviTarifa": self.fields["effective_date"],
|
|
34
|
+
"TecDelServei": "Fibra",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
def _get_product_ba(self):
|
|
38
|
+
return (
|
|
39
|
+
self.configuration.code_fiber_100
|
|
40
|
+
if self.fields["previous_service"]
|
|
41
|
+
== self.configuration.code_fiber_100_landline
|
|
42
|
+
else self.configuration.code_fiber_300
|
|
43
|
+
)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.changes.change_tariff import (
|
|
2
|
+
ChangeTariffExceptionalTicketConfiguration,
|
|
3
|
+
ChangeTariffSharedBondTicketConfiguration,
|
|
4
|
+
ChangeTariffTicketConfiguration,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
from .base_customer_ticket import BaseCustomerTicket
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ChangeTariffTicket(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(ChangeTariffTicket, self).__init__(
|
|
20
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
21
|
+
)
|
|
22
|
+
self.configuration = ChangeTariffTicketConfiguration()
|
|
23
|
+
|
|
24
|
+
def _get_subject(self):
|
|
25
|
+
return "Sol·licitud Canvi de tarifa oficina virtual"
|
|
26
|
+
|
|
27
|
+
def _get_queue_id(self):
|
|
28
|
+
return self.configuration.queue_id
|
|
29
|
+
|
|
30
|
+
def _get_dynamic_fields(self):
|
|
31
|
+
return {
|
|
32
|
+
"renovaCanviTarifa": self._transform_boolean_df(self.override_ticket_ids),
|
|
33
|
+
"liniaMobil": self.fields["phone_number"],
|
|
34
|
+
"productMobil": self.fields["new_product_code"],
|
|
35
|
+
"tarifaAntiga": self.fields["current_product_code"],
|
|
36
|
+
"dataExecucioCanviTarifa": self.fields["effective_date"],
|
|
37
|
+
"OdooContractRefRelacionat": self.fields["fiber_linked"],
|
|
38
|
+
"correuElectronic": self.fields["subscription_email"],
|
|
39
|
+
"idioma": self.fields["language"],
|
|
40
|
+
"enviarNotificacio": self._transform_boolean_df(
|
|
41
|
+
self.fields.get("send_notification", "1")
|
|
42
|
+
),
|
|
43
|
+
"TecDelServei": "Mobil",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ChangeTariffExceptionalTicket(ChangeTariffTicket):
|
|
48
|
+
def __init__(self, service_data, customer_data, otrs_configuration=None):
|
|
49
|
+
super().__init__(service_data, customer_data, otrs_configuration)
|
|
50
|
+
self.configuration = ChangeTariffExceptionalTicketConfiguration()
|
|
51
|
+
|
|
52
|
+
def _get_subject(self):
|
|
53
|
+
return "Sol·licitud Canvi de tarifa excepcional"
|
|
54
|
+
|
|
55
|
+
|
|
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):
|
|
69
|
+
def __init__(
|
|
70
|
+
self,
|
|
71
|
+
username,
|
|
72
|
+
customer_code,
|
|
73
|
+
fields_dict,
|
|
74
|
+
override_ticket_ids=[],
|
|
75
|
+
):
|
|
76
|
+
super().__init__(username, customer_code, fields_dict, override_ticket_ids)
|
|
77
|
+
self.configuration = ChangeTariffSharedBondTicketConfiguration()
|
|
78
|
+
|
|
79
|
+
def _get_subject(self):
|
|
80
|
+
return "Sol·licitud canvi de tarifa pack amb dades compartides"
|
|
81
|
+
|
|
82
|
+
def _get_dynamic_fields(self):
|
|
83
|
+
dynamic_fields = super()._get_dynamic_fields()
|
|
84
|
+
dynamic_fields.update(
|
|
85
|
+
{"IDAbonamentCompartit": self.fields.get("shared_bond_id", "")}
|
|
86
|
+
)
|
|
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
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket_mobile_pack import (
|
|
2
|
+
ChangeTariffTicketMobilePack,
|
|
3
|
+
)
|
|
4
|
+
from otrs_somconnexio.otrs_models.ticket_types.change_tariff_ticket import (
|
|
5
|
+
ChangeTariffSharedBondTicket,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ChangeTariffTicketSharedBond(ChangeTariffTicketMobilePack):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
username,
|
|
13
|
+
customer_code,
|
|
14
|
+
fields_dict,
|
|
15
|
+
override_ticket_ids=[],
|
|
16
|
+
# TODO: Can we remove this field?
|
|
17
|
+
fallback_path="/tmp/tickets/",
|
|
18
|
+
):
|
|
19
|
+
super(ChangeTariffTicketSharedBond, self).__init__(
|
|
20
|
+
username, customer_code, fields_dict, override_ticket_ids, fallback_path
|
|
21
|
+
)
|
|
22
|
+
self.TicketClass = ChangeTariffSharedBondTicket
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.querys.check_coverage import (
|
|
2
|
+
CheckCoverageCATConfiguration,
|
|
3
|
+
CheckCoverageESConfiguration,
|
|
4
|
+
)
|
|
5
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import (
|
|
6
|
+
BaseCustomerTicket,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CheckCoverageTicket(BaseCustomerTicket):
|
|
11
|
+
def __init__(self, username, customer_code, fields_dict, *args):
|
|
12
|
+
super(CheckCoverageTicket, self).__init__(
|
|
13
|
+
username, customer_code, fields_dict, *args
|
|
14
|
+
)
|
|
15
|
+
self.configuration = (
|
|
16
|
+
CheckCoverageCATConfiguration
|
|
17
|
+
if fields_dict["language"] == "ca_ES"
|
|
18
|
+
else CheckCoverageESConfiguration
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def _get_activity_id(self):
|
|
22
|
+
return self.configuration.activity_id
|
|
23
|
+
|
|
24
|
+
def _get_process_id(self):
|
|
25
|
+
return self.configuration.process_id
|
|
26
|
+
|
|
27
|
+
def _get_queue_id(self):
|
|
28
|
+
return self.configuration.queue_id
|
|
29
|
+
|
|
30
|
+
def _get_subject(self):
|
|
31
|
+
return self.configuration.subject
|
|
32
|
+
|
|
33
|
+
def _get_dynamic_fields(self):
|
|
34
|
+
return {
|
|
35
|
+
"nomSoci": self.fields["name"],
|
|
36
|
+
"cognom1": self.fields["surnames"],
|
|
37
|
+
"correuElectronic": self.fields["email"],
|
|
38
|
+
"telefonContacte": self.fields["phone"],
|
|
39
|
+
"idioma": self.fields["contact_lang"],
|
|
40
|
+
"tipusVia": self.fields["road_type"],
|
|
41
|
+
"nomVia": self.fields["road_name"],
|
|
42
|
+
"numero": self.fields["road_number"],
|
|
43
|
+
"bloc": self.fields["block"],
|
|
44
|
+
"portal": self.fields["doorway"],
|
|
45
|
+
"pis": self.fields["floor"],
|
|
46
|
+
"escala": self.fields["scale"],
|
|
47
|
+
"porta": self.fields["door"],
|
|
48
|
+
"altresCobertura": self.fields["other_information"],
|
|
49
|
+
"poblacioServei": self.fields["locality"],
|
|
50
|
+
"provinciaServei": self.fields["state"],
|
|
51
|
+
"CPservei": self.fields["zip_code"],
|
|
52
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.querys.we_call_you import (
|
|
2
|
+
WeCallYouCATConfiguration,
|
|
3
|
+
WeCallYouCompanyCATConfiguration,
|
|
4
|
+
WeCallYouCompanyESConfiguration,
|
|
5
|
+
WeCallYouESConfiguration,
|
|
6
|
+
)
|
|
7
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import (
|
|
8
|
+
BaseCustomerTicket,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class WeCallYouTicket(BaseCustomerTicket):
|
|
13
|
+
def __init__(self, username, customer_code, fields_dict, *args):
|
|
14
|
+
super(WeCallYouTicket, self).__init__(
|
|
15
|
+
username, customer_code, fields_dict, *args
|
|
16
|
+
)
|
|
17
|
+
self.configuration = self._get_congifuration(
|
|
18
|
+
fields_dict["language"], fields_dict["is_company"]
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def _get_activity_id(self):
|
|
22
|
+
return self.configuration.activity_id
|
|
23
|
+
|
|
24
|
+
def _get_process_id(self):
|
|
25
|
+
return self.configuration.process_id
|
|
26
|
+
|
|
27
|
+
def _get_queue_id(self):
|
|
28
|
+
return self.configuration.queue_id
|
|
29
|
+
|
|
30
|
+
def _get_subject(self):
|
|
31
|
+
return self.configuration.subject
|
|
32
|
+
|
|
33
|
+
def _get_dynamic_fields(self):
|
|
34
|
+
return {
|
|
35
|
+
"personaContacte": self.fields["name"],
|
|
36
|
+
"horariTrucada": self.fields["schedule"],
|
|
37
|
+
"telefonContacte": self.fields.get("phone", "").replace(" ", ""),
|
|
38
|
+
"motiuTrucada": self.fields["reason"],
|
|
39
|
+
"referral": self.fields.get("referral"),
|
|
40
|
+
"rgpd": "1",
|
|
41
|
+
"nouEmail": self.fields.get("email"),
|
|
42
|
+
"midaEmpresa": self.fields.get("company_size"),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
def _get_congifuration(self, lang, is_company):
|
|
46
|
+
if lang == "ca_ES":
|
|
47
|
+
if is_company:
|
|
48
|
+
return WeCallYouCompanyCATConfiguration
|
|
49
|
+
return WeCallYouCATConfiguration
|
|
50
|
+
else:
|
|
51
|
+
if is_company:
|
|
52
|
+
return WeCallYouCompanyESConfiguration
|
|
53
|
+
return WeCallYouESConfiguration
|
|
@@ -4,7 +4,9 @@ from otrs_somconnexio.otrs_models.abstract_article import AbstractArticle
|
|
|
4
4
|
|
|
5
5
|
class VfProvisioningArticle(AbstractArticle):
|
|
6
6
|
def __init__(self, provisioning_ticket):
|
|
7
|
-
self.subject = "Aprovisionament del tiquet de Vodafone {}".format(
|
|
7
|
+
self.subject = "Aprovisionament del tiquet de Vodafone {}".format(
|
|
8
|
+
provisioning_ticket["ticket"]
|
|
9
|
+
)
|
|
8
10
|
self.body = self._body_from_dict(provisioning_ticket)
|
|
9
11
|
|
|
10
12
|
def _body_from_dict(self, dct):
|
|
@@ -13,6 +15,6 @@ class VfProvisioningArticle(AbstractArticle):
|
|
|
13
15
|
for field in sorted(dct):
|
|
14
16
|
value = dct[field]
|
|
15
17
|
if value:
|
|
16
|
-
body =
|
|
18
|
+
body = "{}{}: {}\n".format(body, field, value)
|
|
17
19
|
|
|
18
20
|
return body
|