otrs-somconnexio 0.6.2__py2.py3-none-any.whl → 0.6.3__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,12 +4,23 @@ class WeCallYouConfiguration:
4
4
  type = "Petición"
5
5
  state = "new"
6
6
  priority = "3 normal"
7
- subject = "Formulari 'Vols que et truquem?'"
8
7
 
9
8
 
10
9
  class WeCallYouCATConfiguration(WeCallYouConfiguration):
11
10
  queue_id = 144
11
+ subject = "Formulari 'Vols que et truquem?' (CAT)"
12
12
 
13
13
 
14
14
  class WeCallYouESConfiguration(WeCallYouConfiguration):
15
15
  queue_id = 145
16
+ subject = "Formulari 'Vols que et truquem?' (ES)"
17
+
18
+
19
+ class WeCallYouCompanyCATConfiguration(WeCallYouConfiguration):
20
+ queue_id = 230
21
+ subject = "Formulari 'Vols que et truquem?' - Empreses (CAT)"
22
+
23
+
24
+ class WeCallYouCompanyESConfiguration(WeCallYouConfiguration):
25
+ queue_id = 231
26
+ subject = "Formulari 'Vols que et truquem?' - Empreses (ES)"
@@ -1,8 +1,12 @@
1
1
  from otrs_somconnexio.otrs_models.configurations.querys.we_call_you import (
2
2
  WeCallYouCATConfiguration,
3
+ WeCallYouCompanyCATConfiguration,
4
+ WeCallYouCompanyESConfiguration,
3
5
  WeCallYouESConfiguration,
4
6
  )
5
- from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import BaseCustomerTicket
7
+ from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import (
8
+ BaseCustomerTicket,
9
+ )
6
10
 
7
11
 
8
12
  class WeCallYouTicket(BaseCustomerTicket):
@@ -10,10 +14,8 @@ class WeCallYouTicket(BaseCustomerTicket):
10
14
  super(WeCallYouTicket, self).__init__(
11
15
  username, customer_code, fields_dict, *args
12
16
  )
13
- self.configuration = (
14
- WeCallYouCATConfiguration
15
- if fields_dict["language"] == "ca_ES"
16
- else WeCallYouESConfiguration
17
+ self.configuration = self._get_congifuration(
18
+ fields_dict["language"], fields_dict["is_company"]
17
19
  )
18
20
 
19
21
  def _get_activity_id(self):
@@ -34,4 +36,15 @@ class WeCallYouTicket(BaseCustomerTicket):
34
36
  "horariTrucada": self.fields["schedule"],
35
37
  "telefonContacte": self.fields["phone"],
36
38
  "motiuTrucada": self.fields["reason"],
39
+ "midaEmpresa": self.fields.get("company_size"),
37
40
  }
41
+
42
+ def _get_congifuration(self, lang, is_company):
43
+ if lang == "ca_ES":
44
+ if is_company:
45
+ return WeCallYouCompanyCATConfiguration
46
+ return WeCallYouCATConfiguration
47
+ else:
48
+ if is_company:
49
+ return WeCallYouCompanyESConfiguration
50
+ return WeCallYouESConfiguration
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: otrs-somconnexio
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary: Python package for Somconnexio data syncing in OTRS
5
5
  Home-page: https://gitlab.com/coopdevs/otrs_somconnexio
6
6
  Author: Coopdevs
@@ -50,7 +50,7 @@ otrs_somconnexio/otrs_models/configurations/provision/router_4G_ticket.py,sha256
50
50
  otrs_somconnexio/otrs_models/configurations/provision/switchboard_ticket.py,sha256=ZVLqodwES2-VbJlzDzkIunm3Fbb7xStuV_gd0M_krx4,329
51
51
  otrs_somconnexio/otrs_models/configurations/querys/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  otrs_somconnexio/otrs_models/configurations/querys/check_coverage.py,sha256=KD-T-NFSbMNW-MM4xXlonJWZz1ZM17brAb9N2-GNswg,479
53
- otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py,sha256=suuTDHY7cK3iiTX9Bjql2wpCXBpALhLf0lXJ7r0bWZA,423
53
+ otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py,sha256=xUvm__IH-eAPa5gXHXlzYtC7LA37n5Xm5S_t4pyHVLM,783
54
54
  otrs_somconnexio/otrs_models/coverage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  otrs_somconnexio/otrs_models/coverage/adsl.py,sha256=ZiLbEEKSlwCl3smHkEAnHrG6BRDWBuNXOouC5LpYRgM,476
56
56
  otrs_somconnexio/otrs_models/coverage/asociatel_fiber.py,sha256=TXk5WChGupb8X2i5cBj7kG5TTDix36vdW5i-Hlk5-g8,165
@@ -80,7 +80,7 @@ otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket.py,sha256=2oncxRb
80
80
  otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket_mobile_pack.py,sha256=pu8QItdaICaX2DMvZ7h29Ii_HJVsKWC2lm6UKl145FQ,1844
81
81
  otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket_shared_bonds.py,sha256=CTesCN0NVD6lfTQMKC7nR6RXGjktfYVWFsthg69EnaQ,731
82
82
  otrs_somconnexio/otrs_models/ticket_types/check_coverage_ticket.py,sha256=mHMx4eNo8rq0b5kf8ay0tTcziweS82D2O4N-atNWYv4,1866
83
- otrs_somconnexio/otrs_models/ticket_types/we_call_you_ticket.py,sha256=o4_XkkNVbL31yt0wevdrHnXTc3ANYi8KF19BLTu7bP8,1205
83
+ otrs_somconnexio/otrs_models/ticket_types/we_call_you_ticket.py,sha256=GMSYnV7_8yKZZMNNpac1kL93C_yYZEaZGq0K3c7TFp8,1654
84
84
  otrs_somconnexio/responses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
85
  otrs_somconnexio/responses/ticket_creation.py,sha256=32Iigeg2TO422M2XYaiei57KpimnkB1tgnIexiEhi-E,735
86
86
  otrs_somconnexio/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -162,7 +162,7 @@ tests/otrs_models/ticket_types/test_change_tariff_mobile_pack.py,sha256=mOitwISC
162
162
  tests/otrs_models/ticket_types/test_change_tariff_shared_bonds.py,sha256=Mmuai3rMTaBHCmWZCYeDFtx0tH1DiIxwYMUN4pSZFdo,2136
163
163
  tests/otrs_models/ticket_types/test_check_coverage.py,sha256=o6fVO52WxvrVahIQNscP7LhcQIe2iEK7q0yI9JT3-3Q,4158
164
164
  tests/otrs_models/ticket_types/test_shared_bond.py,sha256=Ha1sCIOkov-u7r7nijNqlSZsXYYNoOGV3pm7Fqx1YcU,3177
165
- tests/otrs_models/ticket_types/test_we_call_you.py,sha256=_1GEYnFNCx6KA_6-EKoX081_QItLtqZ7QEX3PLVbS5Q,2891
165
+ tests/otrs_models/ticket_types/test_we_call_you.py,sha256=0IwtSGLK97iBug6G_0VlYJt6KE8qseqHcKbgdYL2FKc,3698
166
166
  tests/responses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
167
167
  tests/responses/test_ticket_creation.py,sha256=i7Yzps-Kz25Ie1ylr3YAEsUYDMIZTFOvQIpSM2k7lNY,1068
168
168
  tests/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -185,7 +185,7 @@ tests/services/test_update_ticket_with_provider_info.py,sha256=cZUg-hNV4BoMwafbp
185
185
  tests/user_management_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
186
186
  tests/user_management_client/test_client.py,sha256=088q9H1yf8Hii7zUF17KULqOO-JCxJLsR7vQ8lGHiqg,4410
187
187
  tests/user_management_client/test_user_management_response.py,sha256=HCCG7i2f6-ytrRpTzYZHODKCdW-X5GJn-BMVegd5FXg,1539
188
- otrs_somconnexio-0.6.2.dist-info/METADATA,sha256=4Pvmx07grKGHPIHjgNxpJMWYkiZ3NHbLXr50Ttj7Bqs,3458
189
- otrs_somconnexio-0.6.2.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
190
- otrs_somconnexio-0.6.2.dist-info/top_level.txt,sha256=gvMaHGNwusWpSIy-PVyb0CKDIA4-4fXmEVER_2a-OnE,23
191
- otrs_somconnexio-0.6.2.dist-info/RECORD,,
188
+ otrs_somconnexio-0.6.3.dist-info/METADATA,sha256=YwOdh-jX6Udis8W6iR2qo-ma_KJ2fz38XzGvCUBWMdo,3458
189
+ otrs_somconnexio-0.6.3.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
190
+ otrs_somconnexio-0.6.3.dist-info/top_level.txt,sha256=gvMaHGNwusWpSIy-PVyb0CKDIA4-4fXmEVER_2a-OnE,23
191
+ otrs_somconnexio-0.6.3.dist-info/RECORD,,
@@ -1,5 +1,7 @@
1
1
  from otrs_somconnexio.otrs_models.configurations.querys.we_call_you import (
2
2
  WeCallYouCATConfiguration,
3
+ WeCallYouCompanyCATConfiguration,
4
+ WeCallYouCompanyESConfiguration,
3
5
  WeCallYouESConfiguration,
4
6
  )
5
7
  from otrs_somconnexio.otrs_models.ticket_types.we_call_you_ticket import WeCallYouTicket
@@ -9,19 +11,40 @@ class TestCaseWeCallYou:
9
11
  fields_dict = {
10
12
  "name": "name surname",
11
13
  "schedule": "12h-14h",
12
- "language": "ca_ES",
13
14
  "phone": "642525377",
14
15
  "reason": "call me baby",
16
+ "language": "ca_ES",
17
+ "is_company": False,
15
18
  }
16
19
 
17
20
  def test_create_CAT(self, mocker):
18
- self._execute_and_assert_create(mocker, WeCallYouCATConfiguration)
21
+ self._execute_and_assert_create(
22
+ mocker, WeCallYouCATConfiguration, self.fields_dict
23
+ )
19
24
 
20
25
  def test_create_ES(self, mocker):
21
- self.fields_dict["language"] = "es_ES"
22
- self._execute_and_assert_create(mocker, WeCallYouESConfiguration)
26
+ dict = {**self.fields_dict}
27
+ dict["language"] = "es_ES"
28
+ self._execute_and_assert_create(mocker, WeCallYouESConfiguration, dict)
29
+
30
+ def test_create_company_CAT(self, mocker):
31
+ dict = {**self.fields_dict}
32
+ dict["is_company"] = True
33
+ dict["company_size"] = "1"
34
+ self._execute_and_assert_create(
35
+ mocker, WeCallYouCompanyCATConfiguration, dict, True
36
+ )
37
+
38
+ def test_create_company_ES(self, mocker):
39
+ dict = {**self.fields_dict}
40
+ dict["language"] = "es_ES"
41
+ dict["is_company"] = True
42
+ dict["company_size"] = "1"
43
+ self._execute_and_assert_create(
44
+ mocker, WeCallYouCompanyESConfiguration, dict, True
45
+ )
23
46
 
24
- def _execute_and_assert_create(self, mocker, config):
47
+ def _execute_and_assert_create(self, mocker, config, dict, is_company=False):
25
48
  OTRSClientMock = mocker.patch(
26
49
  "otrs_somconnexio.otrs_models.ticket_types.base_ticket.OTRSClient",
27
50
  return_value=mocker.Mock(),
@@ -58,13 +81,15 @@ class TestCaseWeCallYou:
58
81
  "ProcessManagementActivityID",
59
82
  config.activity_id,
60
83
  ),
61
- mocker.call("personaContacte", self.fields_dict["name"]),
62
- mocker.call("horariTrucada", self.fields_dict["schedule"]),
63
- mocker.call("telefonContacte", self.fields_dict["phone"]),
64
- mocker.call("motiuTrucada", self.fields_dict["reason"]),
84
+ mocker.call("personaContacte", dict["name"]),
85
+ mocker.call("horariTrucada", dict["schedule"]),
86
+ mocker.call("telefonContacte", dict["phone"]),
87
+ mocker.call("motiuTrucada", dict["reason"]),
65
88
  ]
89
+ if is_company:
90
+ calls.append(mocker.call("midaEmpresa", dict["company_size"]))
66
91
 
67
- WeCallYouTicket(None, "customer", self.fields_dict, [], "").create()
92
+ WeCallYouTicket(None, "customer", dict, [], "").create()
68
93
 
69
94
  TicketMock.assert_called_once_with(expected_ticket_data)
70
95
  ArticleMock.assert_called_once_with(expected_article_data)