otrs-somconnexio 0.5.12__py2.py3-none-any.whl → 0.6.1__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/provision/mobile_ticket.py +2 -0
- otrs_somconnexio/otrs_models/configurations/provision/switchboard_ticket.py +10 -0
- otrs_somconnexio/otrs_models/internet_dynamic_fields.py +2 -2
- otrs_somconnexio/otrs_models/provision_dynamic_fields.py +0 -3
- otrs_somconnexio/otrs_models/switchboard_data.py +54 -0
- otrs_somconnexio/otrs_models/switchboard_dynamic_fields.py +68 -0
- otrs_somconnexio/otrs_models/switchboard_ticket.py +26 -0
- otrs_somconnexio/otrs_models/ticket_factory.py +3 -0
- otrs_somconnexio/services/get_ticket_title.py +1 -0
- {otrs_somconnexio-0.5.12.dist-info → otrs_somconnexio-0.6.1.dist-info}/METADATA +1 -1
- {otrs_somconnexio-0.5.12.dist-info → otrs_somconnexio-0.6.1.dist-info}/RECORD +23 -16
- tests/integration/test_ticket_factory.py +124 -71
- tests/otrs_models/common_helper.py +9 -0
- tests/otrs_models/test_adsl_dynamic_fields.py +1 -12
- tests/otrs_models/test_fiber_dynamic_fields.py +1 -12
- tests/otrs_models/test_mobile_dynamic_fields.py +1 -12
- tests/otrs_models/test_mobile_paused_ticket.py +2 -3
- tests/otrs_models/test_mobile_ticket.py +2 -2
- tests/otrs_models/test_router_4G_dynamic_fields.py +1 -12
- tests/otrs_models/test_switchboard_data.py +36 -0
- tests/otrs_models/test_switchboard_dynamic_fields.py +142 -0
- {otrs_somconnexio-0.5.12.dist-info → otrs_somconnexio-0.6.1.dist-info}/WHEEL +0 -0
- {otrs_somconnexio-0.5.12.dist-info → otrs_somconnexio-0.6.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
class SwitchboardTicketConfiguration:
|
|
3
|
+
process_id = "Process-340f0714fca27d563373adda18b505d9"
|
|
4
|
+
activity_id = "Activity-cbf9c1acfd068e164d7e7c53cbd6a137"
|
|
5
|
+
type = "Petición"
|
|
6
|
+
SLA = "No pendent resposta"
|
|
7
|
+
service = "Centraleta Virtual"
|
|
8
|
+
queue_id = 242
|
|
9
|
+
state = "new"
|
|
10
|
+
priority = "3 normal"
|
|
@@ -8,7 +8,7 @@ from otrs_somconnexio.otrs_models.provision_dynamic_fields import ProvisionDynam
|
|
|
8
8
|
class InternetDynamicFields(ProvisionDynamicFields):
|
|
9
9
|
def _build_specific_dynamic_fields(self):
|
|
10
10
|
dynamic_fields = [
|
|
11
|
-
self.
|
|
11
|
+
self._contract_id(),
|
|
12
12
|
self._previous_service(),
|
|
13
13
|
self._previous_provider(),
|
|
14
14
|
self._previous_contract_address(),
|
|
@@ -35,7 +35,7 @@ class InternetDynamicFields(ProvisionDynamicFields):
|
|
|
35
35
|
dynamic_fields += self._build_specific_broadband_service_dynamic_fields()
|
|
36
36
|
return dynamic_fields
|
|
37
37
|
|
|
38
|
-
def
|
|
38
|
+
def _contract_id(self):
|
|
39
39
|
return DynamicField(name="IDContracte", value=self.service_data.order_id)
|
|
40
40
|
|
|
41
41
|
def _previous_service(self):
|
|
@@ -43,9 +43,6 @@ class ProvisionDynamicFields:
|
|
|
43
43
|
name="ProcessManagementActivityID", value=self.otrs_activity_id
|
|
44
44
|
)
|
|
45
45
|
|
|
46
|
-
def _econtract_id(self):
|
|
47
|
-
return DynamicField(name="IDContracte", value=self.service_data.order_id)
|
|
48
|
-
|
|
49
46
|
def _first_name(self):
|
|
50
47
|
return DynamicField("nomSoci", self.customer_data.first_name)
|
|
51
48
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
class SwitchboardData:
|
|
2
|
+
service_type = "switchboard"
|
|
3
|
+
|
|
4
|
+
def __init__(
|
|
5
|
+
self,
|
|
6
|
+
order_id,
|
|
7
|
+
iban,
|
|
8
|
+
email,
|
|
9
|
+
contact_phone,
|
|
10
|
+
product,
|
|
11
|
+
technology,
|
|
12
|
+
sales_team,
|
|
13
|
+
type,
|
|
14
|
+
landline,
|
|
15
|
+
landline_2,
|
|
16
|
+
icc,
|
|
17
|
+
has_sim,
|
|
18
|
+
extension,
|
|
19
|
+
agent_name,
|
|
20
|
+
agent_email,
|
|
21
|
+
previous_owner_vat,
|
|
22
|
+
previous_owner_name,
|
|
23
|
+
previous_owner_surname,
|
|
24
|
+
shipment_address,
|
|
25
|
+
shipment_city,
|
|
26
|
+
shipment_zip,
|
|
27
|
+
shipment_subdivision,
|
|
28
|
+
activation_notes="",
|
|
29
|
+
notes="",
|
|
30
|
+
):
|
|
31
|
+
self.order_id = order_id
|
|
32
|
+
self.iban = iban
|
|
33
|
+
self.email = email
|
|
34
|
+
self.contact_phone = contact_phone
|
|
35
|
+
self.product = product
|
|
36
|
+
self.technology = technology
|
|
37
|
+
self.sales_team = sales_team
|
|
38
|
+
self.type = type
|
|
39
|
+
self.landline = landline
|
|
40
|
+
self.landline_2 = landline_2
|
|
41
|
+
self.icc = icc
|
|
42
|
+
self.has_sim = has_sim
|
|
43
|
+
self.extension = extension
|
|
44
|
+
self.agent_name = agent_name
|
|
45
|
+
self.agent_email = agent_email
|
|
46
|
+
self.previous_owner_vat = previous_owner_vat
|
|
47
|
+
self.previous_owner_name = previous_owner_name
|
|
48
|
+
self.previous_owner_surname = previous_owner_surname
|
|
49
|
+
self.shipment_address = shipment_address
|
|
50
|
+
self.shipment_city = shipment_city
|
|
51
|
+
self.shipment_zip = shipment_zip
|
|
52
|
+
self.shipment_subdivision = shipment_subdivision
|
|
53
|
+
self.activation_notes = activation_notes
|
|
54
|
+
self.notes = notes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
from pyotrs.lib import DynamicField
|
|
3
|
+
from otrs_somconnexio.otrs_models.provision_dynamic_fields import ProvisionDynamicFields
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SwitchboardDynamicFields(ProvisionDynamicFields):
|
|
7
|
+
def _build_specific_dynamic_fields(self):
|
|
8
|
+
dynamic_fields = [
|
|
9
|
+
self._type(),
|
|
10
|
+
self._landline(),
|
|
11
|
+
self._landline_2(),
|
|
12
|
+
self._icc(),
|
|
13
|
+
self._sim_received(),
|
|
14
|
+
self._extension(),
|
|
15
|
+
self._agent_name(),
|
|
16
|
+
self._agent_email(),
|
|
17
|
+
self._shipment_address(),
|
|
18
|
+
self._shipment_city(),
|
|
19
|
+
self._shipment_zip(),
|
|
20
|
+
self._shipment_subdivision(),
|
|
21
|
+
]
|
|
22
|
+
return dynamic_fields
|
|
23
|
+
|
|
24
|
+
def _type(self):
|
|
25
|
+
return DynamicField(name="tipusServeiCV", value=self.service_data.type)
|
|
26
|
+
|
|
27
|
+
def _product(self):
|
|
28
|
+
return DynamicField(name="productCV", value=self.service_data.product)
|
|
29
|
+
|
|
30
|
+
def _landline(self):
|
|
31
|
+
return DynamicField(name="portaFixCV1", value=self.service_data.landline)
|
|
32
|
+
|
|
33
|
+
def _landline_2(self):
|
|
34
|
+
return DynamicField(name="portaFixCV2", value=self.service_data.landline_2)
|
|
35
|
+
|
|
36
|
+
def _icc(self):
|
|
37
|
+
return DynamicField(name="ICCSC", value=self.service_data.icc)
|
|
38
|
+
|
|
39
|
+
def _sim_received(self):
|
|
40
|
+
sim_recieved = "1" if self.service_data.has_sim else "0"
|
|
41
|
+
return DynamicField("SIMrebuda", sim_recieved)
|
|
42
|
+
|
|
43
|
+
def _extension(self):
|
|
44
|
+
return DynamicField(name="extensio", value=self.service_data.extension)
|
|
45
|
+
|
|
46
|
+
def _agent_name(self):
|
|
47
|
+
return DynamicField(name="nomAgentCV", value=self.service_data.agent_name)
|
|
48
|
+
|
|
49
|
+
def _agent_email(self):
|
|
50
|
+
return DynamicField(name="correuAgentCV", value=self.service_data.agent_email)
|
|
51
|
+
|
|
52
|
+
def _shipment_address(self):
|
|
53
|
+
return DynamicField(
|
|
54
|
+
name="direccioEnviament", value=self.service_data.shipment_address
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def _shipment_city(self):
|
|
58
|
+
return DynamicField(
|
|
59
|
+
name="poblacioEnviament", value=self.service_data.shipment_city
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
def _shipment_zip(self):
|
|
63
|
+
return DynamicField(name="CPenviament", value=self.service_data.shipment_zip)
|
|
64
|
+
|
|
65
|
+
def _shipment_subdivision(self):
|
|
66
|
+
return DynamicField(
|
|
67
|
+
name="provinciaEnviament", value=self.service_data.shipment_subdivision
|
|
68
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
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):
|
|
13
|
+
self.service_data = service_data
|
|
14
|
+
self.customer_data = customer_data
|
|
15
|
+
self.otrs_configuration = SwitchboardTicketConfiguration()
|
|
16
|
+
|
|
17
|
+
def service_type(self):
|
|
18
|
+
return "switchboard"
|
|
19
|
+
|
|
20
|
+
def _build_dynamic_fields(self):
|
|
21
|
+
return SwitchboardDynamicFields(
|
|
22
|
+
self.service_data,
|
|
23
|
+
self.customer_data,
|
|
24
|
+
self._ticket_process_id(),
|
|
25
|
+
self._ticket_activity_id(),
|
|
26
|
+
).all()
|
|
@@ -2,6 +2,7 @@ from otrs_somconnexio.otrs_models.adsl_ticket import ADSLTicket
|
|
|
2
2
|
from otrs_somconnexio.otrs_models.fiber_ticket import FiberTicket
|
|
3
3
|
from otrs_somconnexio.otrs_models.mobile_ticket import MobileTicket, MobilePausedTicket
|
|
4
4
|
from otrs_somconnexio.otrs_models.router_4G_ticket import Router4GTicket
|
|
5
|
+
from otrs_somconnexio.otrs_models.switchboard_ticket import SwitchboardTicket
|
|
5
6
|
from otrs_somconnexio.exceptions import ServiceTypeNotAllowedError
|
|
6
7
|
|
|
7
8
|
|
|
@@ -31,6 +32,8 @@ class TicketFactory(object):
|
|
|
31
32
|
TicketClass = MobileTicket
|
|
32
33
|
elif self.service_data.service_type == "4G":
|
|
33
34
|
TicketClass = Router4GTicket
|
|
35
|
+
elif self.service_data.service_type == "switchboard":
|
|
36
|
+
TicketClass = SwitchboardTicket
|
|
34
37
|
else:
|
|
35
38
|
raise ServiceTypeNotAllowedError(
|
|
36
39
|
self.service_data.order_id, self.service_data.service_type
|
|
@@ -14,20 +14,23 @@ otrs_somconnexio/otrs_models/fiber_data.py,sha256=b8OVbAPBBUUzcQQP5HXRjzm7fvdqlM
|
|
|
14
14
|
otrs_somconnexio/otrs_models/fiber_dynamic_fields.py,sha256=xoCCRHyNqauVUwlwAP2aQ0dkNCrA3dy3sNO6LBdHPfU,2703
|
|
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
|
-
otrs_somconnexio/otrs_models/internet_dynamic_fields.py,sha256=
|
|
17
|
+
otrs_somconnexio/otrs_models/internet_dynamic_fields.py,sha256=rsYuGQ8dEyBAqIgyqNVA-76WgCb0y67c3e-Kx9F6MsQ,5018
|
|
18
18
|
otrs_somconnexio/otrs_models/mobile_data.py,sha256=Ao6Y6ubRVSvBx8S5jmABMO9zaKr2MZGHYY-SDKEteGI,1760
|
|
19
19
|
otrs_somconnexio/otrs_models/mobile_dynamic_fields.py,sha256=TOb77bw9BmX01kZdfnbg1XnyYcYcn8P4dIY6cWHlzIY,4022
|
|
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=AVf0en4nooznhGGZMz18-EOWsZkXjn56MsxRcirNyX0,3307
|
|
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
|
|
27
27
|
otrs_somconnexio/otrs_models/router_4G_ticket.py,sha256=xxXoqlf95KDQEcKrdU6I7Oda0hZqY-alaBTu0ZZfcX8,883
|
|
28
28
|
otrs_somconnexio/otrs_models/service.py,sha256=EwxTSe6hPS33KbbPGNYzofhEhB4O4d71P9KkpOEjakA,2121
|
|
29
|
+
otrs_somconnexio/otrs_models/switchboard_data.py,sha256=7aFvhrFTjxXH0rT1TK2EI02Jgb1m92Efs-WGsvJM8Uk,1530
|
|
30
|
+
otrs_somconnexio/otrs_models/switchboard_dynamic_fields.py,sha256=cc1-niTz38YofTF-1uUDSnu8FDSB-0gY1uFbTP38erA,2281
|
|
31
|
+
otrs_somconnexio/otrs_models/switchboard_ticket.py,sha256=jWkXS2WKBdcx-vgZKU8w_iez4bsl6s9nAtNfALxio-E,860
|
|
29
32
|
otrs_somconnexio/otrs_models/telecom_company.py,sha256=yh8wIE7-AjWESdFsE479WWZ-3uFz_ljUBKF8GK44oow,3077
|
|
30
|
-
otrs_somconnexio/otrs_models/ticket_factory.py,sha256=
|
|
33
|
+
otrs_somconnexio/otrs_models/ticket_factory.py,sha256=6rjIlyBlFH6G4o1tSUhEe8XgM6LMNjxWGdoCMGQGPxc,1891
|
|
31
34
|
otrs_somconnexio/otrs_models/vf_provisioning_article.py,sha256=AZbtXePA-FA3ufHJsngaXzUL4npJgUqMqvrMSUmCd9o,599
|
|
32
35
|
otrs_somconnexio/otrs_models/configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
36
|
otrs_somconnexio/otrs_models/configurations/changes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -42,8 +45,9 @@ otrs_somconnexio/otrs_models/configurations/changes/change_tariff_fiber.py,sha25
|
|
|
42
45
|
otrs_somconnexio/otrs_models/configurations/provision/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
46
|
otrs_somconnexio/otrs_models/configurations/provision/adsl_ticket.py,sha256=dJ80rfURNCViVTb8h8leFLzHWIVe4eo27VYsPLZP4DI,809
|
|
44
47
|
otrs_somconnexio/otrs_models/configurations/provision/fiber_ticket.py,sha256=NsFSeq2-Y_vdBex9ycDks_nEWVkemUcwkHfaYu8YKw8,940
|
|
45
|
-
otrs_somconnexio/otrs_models/configurations/provision/mobile_ticket.py,sha256=
|
|
48
|
+
otrs_somconnexio/otrs_models/configurations/provision/mobile_ticket.py,sha256=bhT3xVI_fABKu0Vb0SN_aE72-iRNUdyfHLHWhjdPjkA,1567
|
|
46
49
|
otrs_somconnexio/otrs_models/configurations/provision/router_4G_ticket.py,sha256=hkDaHFAAMFI8gnCZBVns9GLgEb_Cz3BlkoStPt3UZjw,259
|
|
50
|
+
otrs_somconnexio/otrs_models/configurations/provision/switchboard_ticket.py,sha256=ZVLqodwES2-VbJlzDzkIunm3Fbb7xStuV_gd0M_krx4,329
|
|
47
51
|
otrs_somconnexio/otrs_models/configurations/querys/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
52
|
otrs_somconnexio/otrs_models/configurations/querys/check_coverage.py,sha256=KD-T-NFSbMNW-MM4xXlonJWZz1ZM17brAb9N2-GNswg,479
|
|
49
53
|
otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py,sha256=suuTDHY7cK3iiTX9Bjql2wpCXBpALhLf0lXJ7r0bWZA,423
|
|
@@ -84,7 +88,7 @@ otrs_somconnexio/services/base_get_ticket_by_number.py,sha256=oaJCx5bHslCd-3-68E
|
|
|
84
88
|
otrs_somconnexio/services/change_to_confirm_ticket.py,sha256=apV5BYxotNQdDVfmeQXA1GBwT6R6faOu_IiWqGVEhK4,1420
|
|
85
89
|
otrs_somconnexio/services/get_mobile_related_tickets.py,sha256=uUU0XF6cCUgfgbaVHsjSzyjhdKqsGNRtFBHZHPCox3I,402
|
|
86
90
|
otrs_somconnexio/services/get_sharing_data_mobile_tickets.py,sha256=HlFGEf2eMgMv45I0rqJQUCiT32wU2C5ed_8JYHjahw8,2358
|
|
87
|
-
otrs_somconnexio/services/get_ticket_title.py,sha256=
|
|
91
|
+
otrs_somconnexio/services/get_ticket_title.py,sha256=QCQHkKBFunAk_iIyWsbfftYyFVa-0fTWPRWQsRo-u_o,790
|
|
88
92
|
otrs_somconnexio/services/mapping_mobile_minutes.py,sha256=mxwAU5PREiqm2K8oFebggI52X_sPwch4XujXd9Ixtlc,255
|
|
89
93
|
otrs_somconnexio/services/mapping_services.py,sha256=nuZkkD0tSdm7R-wGoKIdRXW8SgZOYpNMTjxdpdJCea4,342
|
|
90
94
|
otrs_somconnexio/services/move_sharing_data_mobile_tickets.py,sha256=aho3B2RKBKrP1ot5En2KhZEkGAirwqS2tRMjVCvr2Ew,334
|
|
@@ -105,28 +109,31 @@ tests/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
105
109
|
tests/data/otrs_raw_responses.py,sha256=hrd6ubWHpm61Epdrpgjr2uLniKj9AFioQ4xnDdNSKzw,1380
|
|
106
110
|
tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
111
|
tests/integration/test_change_customer_language.py,sha256=m3hp56hP49ugSvaN7Ic5dRA4NAs3Nk4AkxWz0oQ_kmw,1245
|
|
108
|
-
tests/integration/test_ticket_factory.py,sha256=
|
|
112
|
+
tests/integration/test_ticket_factory.py,sha256=fmAExstOba0GVip9P78IKBZzGKD29ky-b0Tbr75uZ34,13714
|
|
109
113
|
tests/integration/test_update_ticket_with_coverage_data.py,sha256=19XaaitAaj-mkSpSRFWML47bDfcmuQwuF_r1NVE_eZw,2919
|
|
110
114
|
tests/otrs_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
115
|
+
tests/otrs_models/common_helper.py,sha256=WAd7aenHTfHvxjZMlwFfr32ajaF285Y75eifMjrAQeA,251
|
|
111
116
|
tests/otrs_models/test_abstract_article.py,sha256=udzIihoP0h8Ien20JFz1jLm5Sv2b3wO6f2JZK6zRTKQ,861
|
|
112
117
|
tests/otrs_models/test_adsl_data.py,sha256=_NGpe5mStNyKPhZ5xFVS62jMdMr5vkzp9SusHmFh4r4,1484
|
|
113
|
-
tests/otrs_models/test_adsl_dynamic_fields.py,sha256=
|
|
118
|
+
tests/otrs_models/test_adsl_dynamic_fields.py,sha256=c2vM0q0EyJ2Ruwjdn82b7jQwceo0UtDZ71eUQouZNFI,19867
|
|
114
119
|
tests/otrs_models/test_adsl_ticket.py,sha256=nc3lVMoS1jdl7tZdK-sSM_p8JKgn4rjg-d--hUPiLBo,4445
|
|
115
120
|
tests/otrs_models/test_coverage_article.py,sha256=O_wm0l75m6sBWEcMdLOvBWDNSVXJ89IkL4IijIgiuPk,1519
|
|
116
121
|
tests/otrs_models/test_coverage_ticket.py,sha256=0W4f28BMhtZDvPm71d7YPJuiVi9jUI6WJBbjh3xs0mg,1019
|
|
117
122
|
tests/otrs_models/test_customer_user.py,sha256=9TDojrOsQBqd4kdC8SxvG5Ub18AXkJ_tsYuUeHALZnc,2227
|
|
118
123
|
tests/otrs_models/test_fiber_data.py,sha256=rdFbcqzI49PV2m30vqnBOmZr2rn_MBqC0bJd0K0dcbI,1833
|
|
119
|
-
tests/otrs_models/test_fiber_dynamic_fields.py,sha256=
|
|
124
|
+
tests/otrs_models/test_fiber_dynamic_fields.py,sha256=jq71ZVWulA8sag-j5IQf95NwqqnI3N9kDVJcL_lfwlo,26549
|
|
120
125
|
tests/otrs_models/test_fiber_ticket.py,sha256=FllA26ncrzWmWIAeB86ZI-Qk6AGBy2V70IuEtTEVW58,6023
|
|
121
126
|
tests/otrs_models/test_mobile_data.py,sha256=EBtwJL9kUaThhnKuqpUk6GFv0KS7RhyCF6dJNgr1-m8,1110
|
|
122
|
-
tests/otrs_models/test_mobile_dynamic_fields.py,sha256=
|
|
123
|
-
tests/otrs_models/test_mobile_paused_ticket.py,sha256=
|
|
124
|
-
tests/otrs_models/test_mobile_ticket.py,sha256=
|
|
127
|
+
tests/otrs_models/test_mobile_dynamic_fields.py,sha256=Ir-_s2oiLu29SiC4rHgyZQ1M0ZQSZXAXolIXu4fz4YQ,19288
|
|
128
|
+
tests/otrs_models/test_mobile_paused_ticket.py,sha256=JiSJudIgW9vFezEnrx7KgL0rXi6-uHwhzbqpgZI7lOE,1256
|
|
129
|
+
tests/otrs_models/test_mobile_ticket.py,sha256=6KAMXFMK-hnpbY26RoavTsYojT7cbDO901RCMRUOcfk,4607
|
|
125
130
|
tests/otrs_models/test_provision_article.py,sha256=SwTA96si0tundnu6lGCJGQcaOpnkRnKUYRKO9NcsflI,1773
|
|
126
131
|
tests/otrs_models/test_router_4G_data.py,sha256=3zKZzWd21j8q4oXFG-Pl1Ugtkp4J0_RZx8HtHRzpfKM,1443
|
|
127
|
-
tests/otrs_models/test_router_4G_dynamic_fields.py,sha256=
|
|
132
|
+
tests/otrs_models/test_router_4G_dynamic_fields.py,sha256=EEZHfAxQ8bPTrotGuyxcLxkO9DrEzJd5a1VvF5FIBow,20975
|
|
128
133
|
tests/otrs_models/test_router_4G_ticket.py,sha256=BMdnhAdnmvYfjyxvRN0dcCyS1hMFESV8EgAsCdHbFAo,4496
|
|
129
134
|
tests/otrs_models/test_service.py,sha256=fLFyJ5wE8jszrD9sZlSOebjioR8dv8z2SeGZVcA3r5U,6833
|
|
135
|
+
tests/otrs_models/test_switchboard_data.py,sha256=1DZq9EyB2Ym-v4WdMfScPejqGerczT6Flc0IfDX4M2M,1170
|
|
136
|
+
tests/otrs_models/test_switchboard_dynamic_fields.py,sha256=ctptSKUANXNvFwAITEuYubD2nHcszpy5XZ4itlh9cmo,4363
|
|
130
137
|
tests/otrs_models/test_telecom_company.py,sha256=nC4uBleU2Lr3qHr5VDo-6kbcTVwKgguC85TcbhTOn1c,1450
|
|
131
138
|
tests/otrs_models/test_ticket_factory.py,sha256=BJ32OcK2XgO43pkKIdTK4xOZNi7JZBllUdb022AHKsc,2371
|
|
132
139
|
tests/otrs_models/test_vf_provisioning_article.py,sha256=Yj8vtaowhxP12K_-FMcJNW-5re3yyCCfGLRHCPYgrVA,897
|
|
@@ -176,7 +183,7 @@ tests/services/test_update_ticket_with_provider_info.py,sha256=cZUg-hNV4BoMwafbp
|
|
|
176
183
|
tests/user_management_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
177
184
|
tests/user_management_client/test_client.py,sha256=088q9H1yf8Hii7zUF17KULqOO-JCxJLsR7vQ8lGHiqg,4410
|
|
178
185
|
tests/user_management_client/test_user_management_response.py,sha256=HCCG7i2f6-ytrRpTzYZHODKCdW-X5GJn-BMVegd5FXg,1539
|
|
179
|
-
otrs_somconnexio-0.
|
|
180
|
-
otrs_somconnexio-0.
|
|
181
|
-
otrs_somconnexio-0.
|
|
182
|
-
otrs_somconnexio-0.
|
|
186
|
+
otrs_somconnexio-0.6.1.dist-info/METADATA,sha256=XxYdg71wAsANVOB-VfGSGtUAQLVusy4OYPxXRNzDQl0,3458
|
|
187
|
+
otrs_somconnexio-0.6.1.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
|
|
188
|
+
otrs_somconnexio-0.6.1.dist-info/top_level.txt,sha256=gvMaHGNwusWpSIy-PVyb0CKDIA4-4fXmEVER_2a-OnE,23
|
|
189
|
+
otrs_somconnexio-0.6.1.dist-info/RECORD,,
|
|
@@ -5,9 +5,27 @@ from otrs_somconnexio.otrs_models.ticket_factory import TicketFactory
|
|
|
5
5
|
from otrs_somconnexio.otrs_models.adsl_ticket import ADSLTicket
|
|
6
6
|
from otrs_somconnexio.otrs_models.fiber_ticket import FiberTicket
|
|
7
7
|
from otrs_somconnexio.otrs_models.mobile_ticket import MobileTicket, MobilePausedTicket
|
|
8
|
+
from otrs_somconnexio.otrs_models.router_4G_ticket import Router4GTicket
|
|
9
|
+
from otrs_somconnexio.otrs_models.switchboard_ticket import SwitchboardTicket
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
13
|
+
def setUp(self):
|
|
14
|
+
self.customer_data = Mock(
|
|
15
|
+
spec=[
|
|
16
|
+
"id",
|
|
17
|
+
"first_name",
|
|
18
|
+
"name",
|
|
19
|
+
"vat_number",
|
|
20
|
+
"street",
|
|
21
|
+
"city",
|
|
22
|
+
"zip",
|
|
23
|
+
"subdivision",
|
|
24
|
+
"has_active_contracts",
|
|
25
|
+
"language",
|
|
26
|
+
]
|
|
27
|
+
)
|
|
28
|
+
|
|
11
29
|
@patch("otrs_somconnexio.otrs_models.provision_ticket.OTRSClient")
|
|
12
30
|
def test_create_mobile_ticket_factory(self, MockOTRSClient):
|
|
13
31
|
mobile_data = Mock(
|
|
@@ -41,20 +59,6 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
41
59
|
"shared_bond_id",
|
|
42
60
|
]
|
|
43
61
|
)
|
|
44
|
-
customer_data = Mock(
|
|
45
|
-
spec=[
|
|
46
|
-
"id",
|
|
47
|
-
"first_name",
|
|
48
|
-
"name",
|
|
49
|
-
"vat_number",
|
|
50
|
-
"street",
|
|
51
|
-
"city",
|
|
52
|
-
"zip",
|
|
53
|
-
"subdivision",
|
|
54
|
-
"has_active_contracts",
|
|
55
|
-
"language",
|
|
56
|
-
]
|
|
57
|
-
)
|
|
58
62
|
|
|
59
63
|
mobile_data.service_type = "mobile"
|
|
60
64
|
|
|
@@ -66,7 +70,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
66
70
|
MockOTRSClient.return_value = mock_otrs_client
|
|
67
71
|
|
|
68
72
|
ticket = TicketFactory(
|
|
69
|
-
service_data=mobile_data, customer_data=customer_data
|
|
73
|
+
service_data=mobile_data, customer_data=self.customer_data
|
|
70
74
|
).build()
|
|
71
75
|
ticket.create()
|
|
72
76
|
|
|
@@ -105,20 +109,6 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
105
109
|
"shared_bond_id",
|
|
106
110
|
]
|
|
107
111
|
)
|
|
108
|
-
customer_data = Mock(
|
|
109
|
-
spec=[
|
|
110
|
-
"id",
|
|
111
|
-
"first_name",
|
|
112
|
-
"name",
|
|
113
|
-
"vat_number",
|
|
114
|
-
"street",
|
|
115
|
-
"city",
|
|
116
|
-
"zip",
|
|
117
|
-
"subdivision",
|
|
118
|
-
"has_active_contracts",
|
|
119
|
-
"language",
|
|
120
|
-
]
|
|
121
|
-
)
|
|
122
112
|
|
|
123
113
|
mobile_data.service_type = "mobile"
|
|
124
114
|
mobile_data.type = "portability"
|
|
@@ -133,7 +123,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
133
123
|
|
|
134
124
|
ticket = TicketFactory(
|
|
135
125
|
service_data=mobile_data,
|
|
136
|
-
customer_data=customer_data,
|
|
126
|
+
customer_data=self.customer_data,
|
|
137
127
|
).build()
|
|
138
128
|
ticket.create()
|
|
139
129
|
|
|
@@ -172,20 +162,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
172
162
|
"shared_bond_id",
|
|
173
163
|
]
|
|
174
164
|
)
|
|
175
|
-
|
|
176
|
-
spec=[
|
|
177
|
-
"id",
|
|
178
|
-
"first_name",
|
|
179
|
-
"name",
|
|
180
|
-
"vat_number",
|
|
181
|
-
"street",
|
|
182
|
-
"city",
|
|
183
|
-
"zip",
|
|
184
|
-
"subdivision",
|
|
185
|
-
"has_active_contracts",
|
|
186
|
-
"language",
|
|
187
|
-
]
|
|
188
|
-
)
|
|
165
|
+
|
|
189
166
|
mobile_data.service_type = "mobile"
|
|
190
167
|
mobile_data.product = "SE_SC_REC_MOBILE_PACK_UNL_20480"
|
|
191
168
|
mobile_data.is_grouped_with_fiber = True
|
|
@@ -199,7 +176,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
199
176
|
|
|
200
177
|
ticket = TicketFactory(
|
|
201
178
|
service_data=mobile_data,
|
|
202
|
-
customer_data=customer_data,
|
|
179
|
+
customer_data=self.customer_data,
|
|
203
180
|
).build()
|
|
204
181
|
ticket.create()
|
|
205
182
|
|
|
@@ -248,20 +225,6 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
248
225
|
"sales_team",
|
|
249
226
|
]
|
|
250
227
|
)
|
|
251
|
-
customer_data = Mock(
|
|
252
|
-
spec=[
|
|
253
|
-
"id",
|
|
254
|
-
"first_name",
|
|
255
|
-
"name",
|
|
256
|
-
"vat_number",
|
|
257
|
-
"street",
|
|
258
|
-
"city",
|
|
259
|
-
"zip",
|
|
260
|
-
"subdivision",
|
|
261
|
-
"has_active_contracts",
|
|
262
|
-
"language",
|
|
263
|
-
]
|
|
264
|
-
)
|
|
265
228
|
|
|
266
229
|
service_data.service_type = "adsl"
|
|
267
230
|
|
|
@@ -272,7 +235,7 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
272
235
|
mock_otrs_client.create_otrs_process_ticket.return_value = otrs_process_ticket
|
|
273
236
|
MockOTRSClient.return_value = mock_otrs_client
|
|
274
237
|
|
|
275
|
-
ticket = TicketFactory(service_data, customer_data).build()
|
|
238
|
+
ticket = TicketFactory(service_data, self.customer_data).build()
|
|
276
239
|
ticket.create()
|
|
277
240
|
ticket.create()
|
|
278
241
|
|
|
@@ -326,18 +289,108 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
326
289
|
"product_ba_mm",
|
|
327
290
|
]
|
|
328
291
|
)
|
|
329
|
-
|
|
292
|
+
|
|
293
|
+
service_data.service_type = "fiber"
|
|
294
|
+
|
|
295
|
+
otrs_process_ticket = Mock(spec=["id"])
|
|
296
|
+
otrs_process_ticket.id = 234
|
|
297
|
+
|
|
298
|
+
mock_otrs_client = Mock(spec=["create_otrs_process_ticket"])
|
|
299
|
+
mock_otrs_client.create_otrs_process_ticket.return_value = otrs_process_ticket
|
|
300
|
+
MockOTRSClient.return_value = mock_otrs_client
|
|
301
|
+
|
|
302
|
+
ticket = TicketFactory(service_data, self.customer_data).build()
|
|
303
|
+
ticket.create()
|
|
304
|
+
|
|
305
|
+
self.assertIsInstance(ticket, FiberTicket)
|
|
306
|
+
self.assertEqual(ticket.id, 234)
|
|
307
|
+
|
|
308
|
+
@patch("otrs_somconnexio.otrs_models.provision_ticket.OTRSClient")
|
|
309
|
+
def test_create_router_4G_ticket_factory(self, MockOTRSClient):
|
|
310
|
+
service_data = Mock(
|
|
311
|
+
spec=[
|
|
312
|
+
"order_id",
|
|
313
|
+
"previous_provider",
|
|
314
|
+
"previous_owner_name",
|
|
315
|
+
"previous_owner_surname",
|
|
316
|
+
"previous_owner_vat",
|
|
317
|
+
"previous_service",
|
|
318
|
+
"previous_contract_address",
|
|
319
|
+
"previous_contract_phone",
|
|
320
|
+
"previous_internal_provider",
|
|
321
|
+
"service_address",
|
|
322
|
+
"service_city",
|
|
323
|
+
"service_zip",
|
|
324
|
+
"service_subdivision",
|
|
325
|
+
"service_subdivision_code",
|
|
326
|
+
"shipment_address",
|
|
327
|
+
"shipment_city",
|
|
328
|
+
"shipment_zip",
|
|
329
|
+
"shipment_subdivision",
|
|
330
|
+
"adsl_coverage",
|
|
331
|
+
"mm_fiber_coverage",
|
|
332
|
+
"asociatel_fiber_coverage",
|
|
333
|
+
"orange_fiber_coverage",
|
|
334
|
+
"vdf_fiber_coverage",
|
|
335
|
+
"type",
|
|
336
|
+
"iban",
|
|
337
|
+
"email",
|
|
338
|
+
"contact_phone",
|
|
339
|
+
"phone_number",
|
|
340
|
+
"notes",
|
|
341
|
+
"activation_notes",
|
|
342
|
+
"product",
|
|
343
|
+
"technology",
|
|
344
|
+
"sales_team",
|
|
345
|
+
]
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
service_data.service_type = "4G"
|
|
349
|
+
|
|
350
|
+
otrs_process_ticket = Mock(spec=["id"])
|
|
351
|
+
otrs_process_ticket.id = 234
|
|
352
|
+
|
|
353
|
+
mock_otrs_client = Mock(spec=["create_otrs_process_ticket"])
|
|
354
|
+
mock_otrs_client.create_otrs_process_ticket.return_value = otrs_process_ticket
|
|
355
|
+
MockOTRSClient.return_value = mock_otrs_client
|
|
356
|
+
|
|
357
|
+
ticket = TicketFactory(service_data, self.customer_data).build()
|
|
358
|
+
ticket.create()
|
|
359
|
+
|
|
360
|
+
self.assertIsInstance(ticket, Router4GTicket)
|
|
361
|
+
self.assertEqual(ticket.id, 234)
|
|
362
|
+
|
|
363
|
+
@patch("otrs_somconnexio.otrs_models.provision_ticket.OTRSClient")
|
|
364
|
+
def test_create_switchboard_ticket_factory(self, MockOTRSClient):
|
|
365
|
+
service_data = Mock(
|
|
330
366
|
spec=[
|
|
331
|
-
"
|
|
332
|
-
"
|
|
333
|
-
"
|
|
334
|
-
"
|
|
335
|
-
"
|
|
336
|
-
"
|
|
337
|
-
"
|
|
367
|
+
"order_id",
|
|
368
|
+
"technology",
|
|
369
|
+
"sales_team",
|
|
370
|
+
"type",
|
|
371
|
+
"iban",
|
|
372
|
+
"email",
|
|
373
|
+
"contact_phone",
|
|
374
|
+
"product",
|
|
375
|
+
"landline",
|
|
376
|
+
"landline_2",
|
|
377
|
+
"agent_name",
|
|
378
|
+
"agent_email",
|
|
379
|
+
"previous_owner_name",
|
|
380
|
+
"previous_owner_surname",
|
|
381
|
+
"extension",
|
|
382
|
+
"icc",
|
|
383
|
+
"has_sim",
|
|
384
|
+
"shipment_address",
|
|
385
|
+
"shipment_city",
|
|
386
|
+
"shipment_zip",
|
|
387
|
+
"shipment_subdivision",
|
|
388
|
+
"notes",
|
|
389
|
+
"activation_notes",
|
|
338
390
|
]
|
|
339
391
|
)
|
|
340
|
-
|
|
392
|
+
|
|
393
|
+
service_data.service_type = "switchboard"
|
|
341
394
|
|
|
342
395
|
otrs_process_ticket = Mock(spec=["id"])
|
|
343
396
|
otrs_process_ticket.id = 234
|
|
@@ -346,8 +399,8 @@ class TicketFactoryIntegrationTestCase(unittest.TestCase):
|
|
|
346
399
|
mock_otrs_client.create_otrs_process_ticket.return_value = otrs_process_ticket
|
|
347
400
|
MockOTRSClient.return_value = mock_otrs_client
|
|
348
401
|
|
|
349
|
-
ticket = TicketFactory(service_data, customer_data).build()
|
|
402
|
+
ticket = TicketFactory(service_data, self.customer_data).build()
|
|
350
403
|
ticket.create()
|
|
351
404
|
|
|
352
|
-
self.assertIsInstance(ticket,
|
|
405
|
+
self.assertIsInstance(ticket, SwitchboardTicket)
|
|
353
406
|
self.assertEqual(ticket.id, 234)
|
|
@@ -2,18 +2,7 @@ import unittest
|
|
|
2
2
|
from mock import Mock
|
|
3
3
|
|
|
4
4
|
from otrs_somconnexio.otrs_models.adsl_dynamic_fields import ADSLDynamicFields
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def dynamic_fields_to_dct(dynamic_fields):
|
|
8
|
-
"""
|
|
9
|
-
Convert the MobileDynamicFields object in a dict with the name of the dynamic
|
|
10
|
-
field as key and the value as value.
|
|
11
|
-
Only used to test the MobileDynamicFields object.
|
|
12
|
-
"""
|
|
13
|
-
dct = {}
|
|
14
|
-
for df in dynamic_fields:
|
|
15
|
-
dct[df.name] = df.value
|
|
16
|
-
return dct
|
|
5
|
+
from .common_helper import dynamic_fields_to_dct
|
|
17
6
|
|
|
18
7
|
|
|
19
8
|
class ADSLDynamicFieldsTestCase(unittest.TestCase):
|
|
@@ -2,18 +2,7 @@ import unittest
|
|
|
2
2
|
from mock import Mock
|
|
3
3
|
|
|
4
4
|
from otrs_somconnexio.otrs_models.fiber_dynamic_fields import FiberDynamicFields
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def dynamic_fields_to_dct(dynamic_fields):
|
|
8
|
-
"""
|
|
9
|
-
Convert the FiberDynamicFields object in a dict with the name of the dynamic
|
|
10
|
-
field as key and the value as value.
|
|
11
|
-
Only used to test the FiberDynamicFields object.
|
|
12
|
-
"""
|
|
13
|
-
dct = {}
|
|
14
|
-
for df in dynamic_fields:
|
|
15
|
-
dct[df.name] = df.value
|
|
16
|
-
return dct
|
|
5
|
+
from .common_helper import dynamic_fields_to_dct
|
|
17
6
|
|
|
18
7
|
|
|
19
8
|
class FiberDynamicFieldsTestCase(unittest.TestCase):
|
|
@@ -2,18 +2,7 @@ import unittest
|
|
|
2
2
|
from mock import Mock
|
|
3
3
|
|
|
4
4
|
from otrs_somconnexio.otrs_models.mobile_dynamic_fields import MobileDynamicFields
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def dynamic_fields_to_dct(dynamic_fields):
|
|
8
|
-
"""
|
|
9
|
-
Convert the MobileDynamicFields object in a dict with the name of the dynamic
|
|
10
|
-
field as key and the value as value.
|
|
11
|
-
Only used to test the MobileDynamicFields object.
|
|
12
|
-
"""
|
|
13
|
-
dct = {}
|
|
14
|
-
for df in dynamic_fields:
|
|
15
|
-
dct[df.name] = df.value
|
|
16
|
-
return dct
|
|
5
|
+
from .common_helper import dynamic_fields_to_dct
|
|
17
6
|
|
|
18
7
|
|
|
19
8
|
class MobileDynamicFieldsTestCase(unittest.TestCase):
|
|
@@ -4,7 +4,6 @@ from mock import Mock, patch
|
|
|
4
4
|
|
|
5
5
|
from otrs_somconnexio.otrs_models.mobile_ticket import MobilePausedTicket
|
|
6
6
|
from otrs_somconnexio.otrs_models.configurations.provision.mobile_ticket import (
|
|
7
|
-
MobileTicketConfiguration,
|
|
8
7
|
MobileTicketPausedConfiguration,
|
|
9
8
|
)
|
|
10
9
|
|
|
@@ -22,8 +21,8 @@ class MobileTicketPausedTestCase(unittest.TestCase):
|
|
|
22
21
|
"Type": MobileTicketPausedConfiguration.type,
|
|
23
22
|
"QueueID": MobileTicketPausedConfiguration.queue_id,
|
|
24
23
|
"State": MobileTicketPausedConfiguration.state,
|
|
25
|
-
"SLA":
|
|
26
|
-
"Service":
|
|
24
|
+
"SLA": "No pendent resposta",
|
|
25
|
+
"Service": "Mòbil",
|
|
27
26
|
"Priority": MobileTicketPausedConfiguration.priority,
|
|
28
27
|
"CustomerUser": customer_data.id,
|
|
29
28
|
"CustomerID": customer_data.id,
|
|
@@ -21,8 +21,8 @@ class MobileTicketTestCase(unittest.TestCase):
|
|
|
21
21
|
"Type": MobileTicketConfiguration.type,
|
|
22
22
|
"QueueID": MobileTicketConfiguration.queue_id,
|
|
23
23
|
"State": MobileTicketConfiguration.state,
|
|
24
|
-
"SLA":
|
|
25
|
-
"Service":
|
|
24
|
+
"SLA": "No pendent resposta",
|
|
25
|
+
"Service": "Mòbil",
|
|
26
26
|
"Priority": MobileTicketConfiguration.priority,
|
|
27
27
|
"CustomerUser": customer_data.id,
|
|
28
28
|
"CustomerID": customer_data.id,
|
|
@@ -2,18 +2,7 @@ import unittest
|
|
|
2
2
|
from mock import Mock
|
|
3
3
|
|
|
4
4
|
from otrs_somconnexio.otrs_models.router_4G_dynamic_fields import Router4GDynamicFields
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def dynamic_fields_to_dct(dynamic_fields):
|
|
8
|
-
"""
|
|
9
|
-
Convert the Router4GDynamicFields object in a dict with the name of the dynamic
|
|
10
|
-
field as key and the value as value.
|
|
11
|
-
Only used to test the Router4GDynamicFields object.
|
|
12
|
-
"""
|
|
13
|
-
dct = {}
|
|
14
|
-
for df in dynamic_fields:
|
|
15
|
-
dct[df.name] = df.value
|
|
16
|
-
return dct
|
|
5
|
+
from .common_helper import dynamic_fields_to_dct
|
|
17
6
|
|
|
18
7
|
|
|
19
8
|
class Router4GDynamicFieldsTestCase(unittest.TestCase):
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
import unittest
|
|
3
|
+
|
|
4
|
+
from otrs_somconnexio.otrs_models.switchboard_data import SwitchboardData
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SwitchboardDataTestCase(unittest.TestCase):
|
|
8
|
+
def test_init(self):
|
|
9
|
+
switchboard_data = SwitchboardData(
|
|
10
|
+
order_id="1234567890",
|
|
11
|
+
iban="ES6621000418401234567891",
|
|
12
|
+
email="test@test.com",
|
|
13
|
+
contact_phone="666666661",
|
|
14
|
+
product="product",
|
|
15
|
+
technology="switchboard",
|
|
16
|
+
sales_team="Business",
|
|
17
|
+
type="new",
|
|
18
|
+
landline="999888777",
|
|
19
|
+
landline_2="999888778",
|
|
20
|
+
extension="123",
|
|
21
|
+
agent_name="agent1",
|
|
22
|
+
agent_email="agent1@company.org",
|
|
23
|
+
icc="123456789",
|
|
24
|
+
has_sim=True,
|
|
25
|
+
previous_owner_vat="ES12345678A",
|
|
26
|
+
previous_owner_name="name",
|
|
27
|
+
previous_owner_surname="surname",
|
|
28
|
+
shipment_address="address",
|
|
29
|
+
shipment_city="city",
|
|
30
|
+
shipment_zip="08001",
|
|
31
|
+
shipment_subdivision="ES-B",
|
|
32
|
+
notes="Notes",
|
|
33
|
+
activation_notes="More notes",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
self.assertIsInstance(switchboard_data, SwitchboardData)
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from mock import Mock
|
|
3
|
+
from faker import Faker
|
|
4
|
+
|
|
5
|
+
from otrs_somconnexio.otrs_models.switchboard_dynamic_fields import (
|
|
6
|
+
SwitchboardDynamicFields,
|
|
7
|
+
)
|
|
8
|
+
from .common_helper import dynamic_fields_to_dct
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SwitchboardDynamicFieldsTestCase(unittest.TestCase):
|
|
12
|
+
def setUp(self):
|
|
13
|
+
faker = Faker("es_CA")
|
|
14
|
+
|
|
15
|
+
customer_data = Mock(
|
|
16
|
+
first_name=faker.first_name(),
|
|
17
|
+
name=faker.last_name(),
|
|
18
|
+
vat_number=faker.ssn(),
|
|
19
|
+
has_active_contracts=faker.boolean(),
|
|
20
|
+
language=faker.language_code(),
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
self.service_data = Mock(
|
|
24
|
+
order_id=faker.uuid4(),
|
|
25
|
+
iban=faker.iban(),
|
|
26
|
+
email=faker.email(),
|
|
27
|
+
contact_phone=faker.phone_number(),
|
|
28
|
+
product=faker.word(),
|
|
29
|
+
technology=faker.word(),
|
|
30
|
+
sales_team=faker.word(),
|
|
31
|
+
type=faker.word(),
|
|
32
|
+
landline=faker.phone_number(),
|
|
33
|
+
landline_2=faker.phone_number(),
|
|
34
|
+
icc=faker.bban(),
|
|
35
|
+
has_sim=faker.boolean(),
|
|
36
|
+
extension=faker.phone_number(),
|
|
37
|
+
agent_name=faker.name(),
|
|
38
|
+
agent_email=faker.email(),
|
|
39
|
+
previous_owner_vat=faker.ssn(),
|
|
40
|
+
previous_owner_name=faker.first_name(),
|
|
41
|
+
previous_owner_surname=faker.last_name(),
|
|
42
|
+
shipment_address=faker.street_address(),
|
|
43
|
+
shipment_city=faker.city(),
|
|
44
|
+
shipment_zip=faker.zipcode(),
|
|
45
|
+
shipment_subdivision=faker.state(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
self.switchboard_otrs_process_id = faker.uuid4()
|
|
49
|
+
self.switchboard_otrs_activity_id = faker.uuid4()
|
|
50
|
+
|
|
51
|
+
self.dynamic_fields = SwitchboardDynamicFields(
|
|
52
|
+
self.service_data,
|
|
53
|
+
customer_data,
|
|
54
|
+
self.switchboard_otrs_process_id,
|
|
55
|
+
self.switchboard_otrs_activity_id,
|
|
56
|
+
).all()
|
|
57
|
+
|
|
58
|
+
self.dynamic_fields_dct = dynamic_fields_to_dct(self.dynamic_fields)
|
|
59
|
+
|
|
60
|
+
def test_process_id_field(self):
|
|
61
|
+
self.assertEqual(
|
|
62
|
+
self.dynamic_fields_dct["ProcessManagementProcessID"],
|
|
63
|
+
self.switchboard_otrs_process_id,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def test_activity_id_field(self):
|
|
67
|
+
self.assertEqual(
|
|
68
|
+
self.dynamic_fields_dct["ProcessManagementActivityID"],
|
|
69
|
+
self.switchboard_otrs_activity_id,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
def test_product_field(self):
|
|
73
|
+
self.assertEqual(
|
|
74
|
+
self.dynamic_fields_dct["productCV"],
|
|
75
|
+
self.service_data.product,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
def test_extension_field(self):
|
|
79
|
+
self.assertEqual(
|
|
80
|
+
self.dynamic_fields_dct["extensio"],
|
|
81
|
+
self.service_data.extension,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def test_landline_field(self):
|
|
85
|
+
self.assertEqual(
|
|
86
|
+
self.dynamic_fields_dct["portaFixCV1"],
|
|
87
|
+
self.service_data.landline,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
def test_landline_2_field(self):
|
|
91
|
+
self.assertEqual(
|
|
92
|
+
self.dynamic_fields_dct["portaFixCV2"],
|
|
93
|
+
self.service_data.landline_2,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
def test_ICC_field(self):
|
|
97
|
+
self.assertEqual(
|
|
98
|
+
self.dynamic_fields_dct["ICCSC"],
|
|
99
|
+
self.service_data.icc,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
def test_has_sim_field(self):
|
|
103
|
+
self.assertEqual(
|
|
104
|
+
self.dynamic_fields_dct["SIMrebuda"],
|
|
105
|
+
"1" if self.service_data.has_sim else "0",
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
def test_agent_name_field(self):
|
|
109
|
+
self.assertEqual(
|
|
110
|
+
self.dynamic_fields_dct["nomAgentCV"],
|
|
111
|
+
self.service_data.agent_name,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
def test_agent_email_field(self):
|
|
115
|
+
self.assertEqual(
|
|
116
|
+
self.dynamic_fields_dct["correuAgentCV"],
|
|
117
|
+
self.service_data.agent_email,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
def test_shipment_address_field(self):
|
|
121
|
+
self.assertEqual(
|
|
122
|
+
self.dynamic_fields_dct["direccioEnviament"],
|
|
123
|
+
self.service_data.shipment_address,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def test_shipment_city_field(self):
|
|
127
|
+
self.assertEqual(
|
|
128
|
+
self.dynamic_fields_dct["poblacioEnviament"],
|
|
129
|
+
self.service_data.shipment_city,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
def test_shipment_zip_field(self):
|
|
133
|
+
self.assertEqual(
|
|
134
|
+
self.dynamic_fields_dct["CPenviament"],
|
|
135
|
+
self.service_data.shipment_zip,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
def test_shipment_subdivision_field(self):
|
|
139
|
+
self.assertEqual(
|
|
140
|
+
self.dynamic_fields_dct["provinciaEnviament"],
|
|
141
|
+
self.service_data.shipment_subdivision,
|
|
142
|
+
)
|
|
File without changes
|
|
File without changes
|