Skip to content
Snippets Groups Projects
Commit 16e0e0a4 authored by Borja Gimeno's avatar Borja Gimeno
Browse files

feat: add minutes and data to contract resources

parent aab4daaa
No related branches found
No related tags found
1 merge request!74feat: add minutes and data to contract resources
This commit is part of merge request !74. Comments created here will be created in the context of that merge request.
Showing
with 260 additions and 264 deletions
...@@ -49,6 +49,8 @@ class Contract: ...@@ -49,6 +49,8 @@ class Contract:
price, price,
has_landline_phone, has_landline_phone,
bandwidth, bandwidth,
data,
minutes,
**kwargs **kwargs
): ):
self.id = id self.id = id
...@@ -78,6 +80,8 @@ class Contract: ...@@ -78,6 +80,8 @@ class Contract:
self.has_landline_phone = has_landline_phone self.has_landline_phone = has_landline_phone
self.bandwidth = bandwidth self.bandwidth = bandwidth
self.price = price self.price = price
self.data = data
self.minutes = minutes
@classmethod @classmethod
def search_by_customer_ref( def search_by_customer_ref(
......
...@@ -8,7 +8,7 @@ class FiberContractsToPack: ...@@ -8,7 +8,7 @@ class FiberContractsToPack:
_url_path = "/contract/available-fibers-to-link-with-mobile" _url_path = "/contract/available-fibers-to-link-with-mobile"
@classmethod @classmethod
def search_by_partner_ref(cls, partner_ref, mobiles_sharing_data=False): def search_by_partner_ref(cls, partner_ref, mobiles_sharing_data="false"):
""" """
Search available fiber contracts to pack by their partner reference. Search available fiber contracts to pack by their partner reference.
mobiles_sharing_data if true return fibers with offer mobile associated mobiles_sharing_data if true return fibers with offer mobile associated
......
...@@ -13,33 +13,34 @@ interactions: ...@@ -13,33 +13,34 @@ interactions:
User-Agent: User-Agent:
- python-requests/2.27.1 - python-requests/2.27.1
method: GET method: GET
uri: http://odoo-sc.local:8069/api/contract?code=33057 uri: http://odoo-sc.local:8069/api/contract?code=1
response: response:
body: body:
string: '{"contracts": [{"id": 23156, "code": "33057", "email": "yrm9s6wc@caramail.com", string: '{"contracts": [{"id": 1, "code": "1", "email": "felipdata@demo.net",
"customer_firstname": "Ovidi", "customer_lastname": "Montllor i Mengual", "customer_firstname": "Felip", "customer_lastname": "Dara", "customer_ref":
"customer_ref": "27550", "customer_vat": "ES30282588Y", "phone_number": "-", "1234", "customer_vat": "ES55642302N", "phone_number": "654987654", "current_tariff_product":
"current_tariff_product": "SE_SC_REC_BA_F_300_SF", "description": "Fibra 300Mb "SE_SC_REC_MOBILE_T_UNL_20552", "description": "Il\u00b7limitades 20 GB",
Sense Fix", "ticket_number": "99999994", "technology": "Fiber", "supplier": "ticket_number": false, "technology": "Mobile", "supplier": "M\u00e1sM\u00f3vil",
"M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES6621031479773534034515", "lang": "es_ES", "iban": false, "is_terminated": false, "date_start": "2023-06-30",
"is_terminated": false, "date_start": "2021-12-08", "date_end": false, "fiber_signal": "date_end": false, "fiber_signal": false, "subscription_type": "mobile", "address":
"fibraFTTH", "subscription_type": "broad_band", "address": {"street": "Campo {"street": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country":
Horno, 20", "zip_code": "24946", "city": "Folgoso De La Ribera", "country": "Spain", "state": "Girona (Gerona)"}, "subscription_technology": "mobile",
"Spain", "state": "Le\u00f3n"}, "subscription_technology": "fiber", "available_operations": "available_operations": ["ChangeTariffMobile", "AddOneShotMobile", "ChangeTariffOwner"],
[], "parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "parent_contract": "", "shared_bond_id": false, "price": 13.0, "has_landline_phone":
true,"bandwidth": 0}]}' false, "bandwidth": 0, "data": 20480, "minutes": 99999}], "paging": {"limit":
10, "offset": 0, "totalNumberOfRecords": 1}}'
headers: headers:
Content-Length: Content-Length:
- '798' - '1015'
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:14:06 GMT - Mon, 24 Jul 2023 12:25:13 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie:
- session_id=3c1ac77bc3adca39b2082391df8505d3baafe316; Expires=Sun, 16-Jul-2023 - session_id=e89faa61a62a378acda020c37c67e3c9ddc009d4; Expires=Sun, 22-Oct-2023
10:14:06 GMT; Max-Age=7776000; HttpOnly; Path=/ 12:25:13 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -13,32 +13,34 @@ interactions: ...@@ -13,32 +13,34 @@ interactions:
User-Agent: User-Agent:
- python-requests/2.27.1 - python-requests/2.27.1
method: GET method: GET
uri: http://odoo-sc.local:8069/api/contract?phone_number=616904164 uri: http://odoo-sc.local:8069/api/contract?phone_number=654987654
response: response:
body: body:
string: '{"contracts": [{"id": 23161, "code": "33062", "email": "yrm9s6wc@caramail.com", string: '{"contracts": [{"id": 1, "code": "1", "email": "felipdata@demo.net",
"customer_firstname": "Ovidi", "customer_lastname": "Montllor i Mengual", "customer_firstname": "Felip", "customer_lastname": "Dara", "customer_ref":
"customer_ref": "27550", "customer_vat": "ES30282588Y", "phone_number": "616904164", "1234", "customer_vat": "ES55642302N", "phone_number": "654987654", "current_tariff_product":
"current_tariff_product": "SE_SC_REC_MOBILE_T_UNL_5120", "description": "Ilimitadas "SE_SC_REC_MOBILE_T_UNL_20552", "description": "Il\u00b7limitades 20 GB",
5 GB", "ticket_number": "99999997", "technology": "Mobile", "supplier": "M\u00e1sM\u00f3vil", "ticket_number": false, "technology": "Mobile", "supplier": "M\u00e1sM\u00f3vil",
"lang": "ca_ES", "iban": "ES0421004420219290058430", "is_terminated": false, "lang": "es_ES", "iban": false, "is_terminated": false, "date_start": "2023-06-30",
"date_start": "2022-01-14", "date_end": false, "fiber_signal": false, "subscription_type": "date_end": false, "fiber_signal": false, "subscription_type": "mobile", "address":
"mobile", "address": {"street": "-", "zip_code": "-", "city": "-", "country": {"street": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country":
"Spain", "state": "-"}, "subscription_technology": "mobile", "available_operations": "Spain", "state": "Girona (Gerona)"}, "subscription_technology": "mobile",
["ChangeTariffMobile", "AddOneShotMobile"],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "available_operations": ["ChangeTariffMobile", "AddOneShotMobile", "ChangeTariffOwner"],
true,"bandwidth": 0}]}' "parent_contract": "", "shared_bond_id": false, "price": 13.0, "has_landline_phone":
false, "bandwidth": 0, "data": 20480, "minutes": 99999}], "paging": {"limit":
10, "offset": 0, "totalNumberOfRecords": 1}}'
headers: headers:
Content-Length: Content-Length:
- '793' - '1015'
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:14:06 GMT - Mon, 24 Jul 2023 12:25:13 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie:
- session_id=e44885f53c69d50eb43151d21cc1a969185859df; Expires=Sun, 16-Jul-2023 - session_id=0a2bdd15800a26fb3c694b418d10e9946e18af66; Expires=Sun, 22-Oct-2023
10:14:06 GMT; Max-Age=7776000; HttpOnly; Path=/ 12:25:13 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -24,7 +24,7 @@ interactions: ...@@ -24,7 +24,7 @@ interactions:
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:14:06 GMT - Mon, 24 Jul 2023 12:25:13 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
status: status:
......
...@@ -13,76 +13,79 @@ interactions: ...@@ -13,76 +13,79 @@ interactions:
User-Agent: User-Agent:
- python-requests/2.27.1 - python-requests/2.27.1
method: GET method: GET
uri: http://odoo-sc.local:8069/api/contract?customer_ref=27550&limit=5&offset=0&sortBy=code&sortOrder=DESCENDENT uri: http://odoo-sc.local:8069/api/contract?customer_ref=1234&limit=5&offset=0&sortBy=code&sortOrder=DESCENDENT
response: response:
body: body:
string: '{"contracts": [{"id": 23165, "code": "33066", "email": "yrm9s6wc@caramail.com", string: '{"contracts": [{"id": 7, "code": "7", "email": "felipdata@demo.net",
"customer_firstname": "Ovidi", "customer_lastname": "Montllor i Mengual", "customer_firstname": "Felip", "customer_lastname": "Dara", "customer_ref":
"customer_ref": "27550", "customer_vat": "ES30282588Y", "phone_number": "784203016", "1234", "customer_vat": "ES55642302N", "phone_number": "654543432", "current_tariff_product":
"current_tariff_product": "SE_SC_REC_MOBILE_T_150_1024", "description": "150 "SE_SC_REC_MOBILE_2_SHARED_UNL_51200", "description": "Ilimitadas 50 GB compartidas
min 1 GB", "ticket_number": "99999998", "technology": "Mobile", "supplier": entre 2 m\u00f3viles", "ticket_number": false, "technology": "Mobile", "supplier":
"M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES6621031479773534034515", "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false, "is_terminated": false,
"is_terminated": false, "date_start": "2022-01-14", "date_end": false, "fiber_signal": "date_start": "2023-06-30", "date_end": false, "fiber_signal": false, "subscription_type":
false, "subscription_type": "mobile", "address": {"street": "-", "zip_code": "mobile", "address": {"street": "Carrer del Penal, 2", "zip_code": "17855",
"-", "city": "-", "country": "Spain", "state": "-"}, "subscription_technology": "city": "Oix", "country": "Spain", "state": "Girona (Gerona)"}, "subscription_technology":
"mobile", "available_operations": ["ChangeTariffMobile", "AddOneShotMobile"],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "mobile", "available_operations": ["AddOneShotMobile"], "parent_contract":
true,"bandwidth": 0}, "5", "shared_bond_id": "111111111", "price": 7.5, "has_landline_phone": false,
{"id": 23163, "code": "33064", "email": "yrm9s6wc@caramail.com", "customer_firstname": "bandwidth": 0, "data": 51200, "minutes": 99999}, {"id": 6, "code": "6", "email":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", "felipdata@demo.net", "customer_firstname": "Felip", "customer_lastname":
"customer_vat": "ES30282588Y", "phone_number": "717260966", "current_tariff_product": "Dara", "customer_ref": "1234", "customer_vat": "ES55642302N", "phone_number":
"SE_SC_REC_MOBILE_PACK_UNL_20480", "description": "Il\u00b7limitades 20 GB "654543432", "current_tariff_product": "SE_SC_REC_MOBILE_2_SHARED_UNL_51200",
associat a fibra", "ticket_number": "99999995", "technology": "Mobile", "supplier": "description": "Ilimitadas 50 GB compartidas entre 2 m\u00f3viles", "ticket_number":
"M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES6621031479773534034515", false, "technology": "Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES",
"is_terminated": false, "date_start": "2022-01-14", "date_end": false, "fiber_signal": "iban": false, "is_terminated": false, "date_start": "2023-06-30", "date_end":
false, "subscription_type": "mobile", "address": {"street": "-", "zip_code": false, "fiber_signal": false, "subscription_type": "mobile", "address": {"street":
"-", "city": "-", "country": "Spain", "state": "-"}, "subscription_technology": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country": "Spain",
"mobile", "available_operations": ["ChangeTariffMobile", "AddOneShotMobile"],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "state": "Girona (Gerona)"}, "subscription_technology": "mobile", "available_operations":
true,"bandwidth": 0}, ["AddOneShotMobile"], "parent_contract": "5", "shared_bond_id": "111111111",
{"id": 23161, "code": "33062", "email": "yrm9s6wc@caramail.com", "customer_firstname": "price": 7.5, "has_landline_phone": false, "bandwidth": 0, "data": 51200,
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", "minutes": 99999}, {"id": 5, "code": "5", "email": "felipdata@demo.net", "customer_firstname":
"customer_vat": "ES30282588Y", "phone_number": "616904164", "current_tariff_product": "Felip", "customer_lastname": "Dara", "customer_ref": "1234", "customer_vat":
"SE_SC_REC_MOBILE_T_UNL_5120", "description": "Ilimitadas 5 GB", "ticket_number": "ES55642302N", "phone_number": "939516963", "current_tariff_product": "SE_SC_REC_BA_F_600",
"99999997", "technology": "Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "description": "Fibra 600Mb", "ticket_number": false, "technology": "Fiber",
"ca_ES", "iban": "ES0421004420219290058430", "is_terminated": false, "date_start": "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false, "is_terminated":
"2022-01-14", "date_end": false, "fiber_signal": false, "subscription_type": false, "date_start": "2023-07-09", "date_end": false, "fiber_signal": false,
"mobile", "address": {"street": "-", "zip_code": "-", "city": "-", "country": "subscription_type": "broadband", "address": {"street": "Carrer del Penal,
"Spain", "state": "-"}, "subscription_technology": "mobile", "available_operations": 2", "zip_code": "17855", "city": "Oix", "country": "Spain", "state": "Girona
["ChangeTariffMobile", "AddOneShotMobile"],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": (Gerona)"}, "subscription_technology": "fiber", "available_operations": ["ChangeTariffOwner"],
true,"bandwidth": 0}, {"id": 23160, "code": "33061", "parent_contract": "", "shared_bond_id": false, "price": 43.0, "has_landline_phone":
"email": "yrm9s6wc@caramail.com", "customer_firstname": "Ovidi", "customer_lastname": true, "bandwidth": 600, "data": 0, "minutes": 0}, {"id": 4, "code": "4", "email":
"Montllor i Mengual", "customer_ref": "27550", "customer_vat": "ES30282588Y", "felipdata@demo.net", "customer_firstname": "Felip", "customer_lastname":
"phone_number": "718559891", "current_tariff_product": "SE_SC_REC_MOBILE_T_UNL_20480", "Dara", "customer_ref": "1234", "customer_vat": "ES55642302N", "phone_number":
"description": "Ilimitadas 20 GB", "ticket_number": "99999996", "technology": "654543432", "current_tariff_product": "SE_SC_REC_MOBILE_PACK_UNL_20480",
"Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES0421004420219290058430", "description": "Il\u00b7limitades 20 GB (Pack)", "ticket_number": false, "technology":
"is_terminated": false, "date_start": "2022-01-14", "date_end": false, "fiber_signal": "Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false,
false, "subscription_type": "mobile", "address": {"street": "-", "zip_code": "is_terminated": false, "date_start": "2023-06-30", "date_end": false, "fiber_signal":
"-", "city": "-", "country": "Spain", "state": "-"}, "subscription_technology": false, "subscription_type": "mobile", "address": {"street": "Carrer del Penal,
"mobile", "available_operations": ["ChangeTariffMobile", "AddOneShotMobile"],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": 2", "zip_code": "17855", "city": "Oix", "country": "Spain", "state": "Girona
true,"bandwidth": 0}, (Gerona)"}, "subscription_technology": "mobile", "available_operations": ["ChangeTariffMobile",
{"id": 23158, "code": "33059", "email": "yrm9s6wc@caramail.com", "customer_firstname": "AddOneShotMobile", "ChangeTariffOwner"], "parent_contract": "3", "shared_bond_id":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", false, "price": 8.0, "has_landline_phone": false, "bandwidth": 0, "data":
"customer_vat": "ES30282588Y", "phone_number": "960879143", "current_tariff_product": 20480, "minutes": 99999}, {"id": 3, "code": "3", "email": "felipdata@demo.net",
"SE_SC_REC_BA_F_1024", "description": "Fibra 1Gb", "ticket_number": "99999992", "customer_firstname": "Felip", "customer_lastname": "Dara", "customer_ref":
"technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "1234", "customer_vat": "ES55642302N", "phone_number": "939516963", "current_tariff_product":
"iban": "ES0421004420219290058430", "is_terminated": false, "date_start": "SE_SC_REC_BA_F_600", "description": "Fibra 600Mb", "ticket_number": false,
"2021-12-08", "date_end": false, "fiber_signal": "fibraFTTH", "subscription_type": "technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES",
"broad_band", "address": {"street": "Avenida Horno, 90", "zip_code": "50648", "iban": false, "is_terminated": false, "date_start": "2023-07-09", "date_end":
"city": "Contamina", "country": "Spain", "state": "Zaragoza"}, "subscription_technology": false, "fiber_signal": false, "subscription_type": "broadband", "address":
"fiber", "available_operations": [],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": {"street": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country":
true,"bandwidth": 0}], "paging": {"limit": 5, "offset": 0, "Spain", "state": "Girona (Gerona)"}, "subscription_technology": "fiber",
"totalNumberOfRecords": 8, "sortBy": "code", "sortOrder": "DESCENDENT"}}' "available_operations": ["ChangeTariffOwner"], "parent_contract": "", "shared_bond_id":
false, "price": 43.0, "has_landline_phone": true, "bandwidth": 600, "data":
0, "minutes": 0}], "paging": {"limit": 5, "offset": 0, "totalNumberOfRecords":
7, "sortBy": "code", "sortOrder": "DESCENDENT"}}'
headers: headers:
Content-Length: Content-Length:
- '4031' - '4661'
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:14:06 GMT - Mon, 24 Jul 2023 12:25:13 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie:
- session_id=a866bd2d33e3e6dee03e632d5006c00cf6ec511c; Expires=Sun, 16-Jul-2023 - session_id=02b84941a8c7704d7cb2ff446fb51fe4b3a669f2; Expires=Sun, 22-Oct-2023
10:14:06 GMT; Max-Age=7776000; HttpOnly; Path=/ 12:25:13 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -13,77 +13,79 @@ interactions: ...@@ -13,77 +13,79 @@ interactions:
User-Agent: User-Agent:
- python-requests/2.27.1 - python-requests/2.27.1
method: GET method: GET
uri: http://odoo-sc.local:8069/api/contract?partner_vat=ES30282588Y&limit=5&offset=0&sortBy=code&sortOrder=DESCENDENT uri: http://odoo-sc.local:8069/api/contract?partner_vat=ES55642302N&limit=5&offset=0&sortBy=code&sortOrder=DESCENDENT
response: response:
body: body:
string: '{"contracts": [{"id": 23165, "code": "33066", "email": "yrm9s6wc@caramail.com", string: '{"contracts": [{"id": 7, "code": "7", "email": "felipdata@demo.net",
"customer_firstname": "Ovidi", "customer_lastname": "Montllor i Mengual", "customer_firstname": "Felip", "customer_lastname": "Dara", "customer_ref":
"customer_ref": "27550", "customer_vat": "ES30282588Y", "phone_number": "784203016", "1234", "customer_vat": "ES55642302N", "phone_number": "654543432", "current_tariff_product":
"current_tariff_product": "SE_SC_REC_MOBILE_T_150_1024", "description": "150 "SE_SC_REC_MOBILE_2_SHARED_UNL_51200", "description": "Ilimitadas 50 GB compartidas
min 1 GB", "ticket_number": "99999998", "technology": "Mobile", "supplier": entre 2 m\u00f3viles", "ticket_number": false, "technology": "Mobile", "supplier":
"M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES6621031479773534034515", "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false, "is_terminated": false,
"is_terminated": false, "date_start": "2022-01-14", "date_end": false, "fiber_signal": "date_start": "2023-06-30", "date_end": false, "fiber_signal": false, "subscription_type":
false, "subscription_type": "mobile", "address": {"street": "-", "zip_code": "mobile", "address": {"street": "Carrer del Penal, 2", "zip_code": "17855",
"-", "city": "-", "country": "Spain", "state": "-"}, "subscription_technology": "city": "Oix", "country": "Spain", "state": "Girona (Gerona)"}, "subscription_technology":
"mobile", "available_operations": ["ChangeTariffMobile", "AddOneShotMobile"],"parent_contract": "mobile", "available_operations": ["AddOneShotMobile"], "parent_contract":
"", "shared_bond_id": false, "price": 7, "has_landline_phone":true,"bandwidth": 0}, "5", "shared_bond_id": "111111111", "price": 7.5, "has_landline_phone": false,
{"id": 23163, "code": "33064", "email": "yrm9s6wc@caramail.com", "customer_firstname": "bandwidth": 0, "data": 51200, "minutes": 99999}, {"id": 6, "code": "6", "email":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", "felipdata@demo.net", "customer_firstname": "Felip", "customer_lastname":
"customer_vat": "ES30282588Y", "phone_number": "717260966", "current_tariff_product": "Dara", "customer_ref": "1234", "customer_vat": "ES55642302N", "phone_number":
"SE_SC_REC_MOBILE_PACK_UNL_20480", "description": "Il\u00b7limitades 20 GB "654543432", "current_tariff_product": "SE_SC_REC_MOBILE_2_SHARED_UNL_51200",
associat a fibra", "ticket_number": "99999995", "technology": "Mobile", "supplier": "description": "Ilimitadas 50 GB compartidas entre 2 m\u00f3viles", "ticket_number":
"M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES6621031479773534034515", false, "technology": "Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES",
"is_terminated": false, "date_start": "2022-01-14", "date_end": false, "fiber_signal": "iban": false, "is_terminated": false, "date_start": "2023-06-30", "date_end":
false, "subscription_type": "mobile", "address": {"street": "-", "zip_code": false, "fiber_signal": false, "subscription_type": "mobile", "address": {"street":
"-", "city": "-", "country": "Spain", "state": "-"}, "subscription_technology": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country": "Spain",
"mobile", "available_operations": ["ChangeTariffMobile", "AddOneShotMobile"], "state": "Girona (Gerona)"}, "subscription_technology": "mobile", "available_operations":
"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": ["AddOneShotMobile"], "parent_contract": "5", "shared_bond_id": "111111111",
true,"bandwidth": 0}, "price": 7.5, "has_landline_phone": false, "bandwidth": 0, "data": 51200,
{"id": 23161, "code": "33062", "email": "yrm9s6wc@caramail.com", "customer_firstname": "minutes": 99999}, {"id": 5, "code": "5", "email": "felipdata@demo.net", "customer_firstname":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", "Felip", "customer_lastname": "Dara", "customer_ref": "1234", "customer_vat":
"customer_vat": "ES30282588Y", "phone_number": "616904164", "current_tariff_product": "ES55642302N", "phone_number": "939516963", "current_tariff_product": "SE_SC_REC_BA_F_600",
"SE_SC_REC_MOBILE_T_UNL_5120", "description": "Ilimitadas 5 GB", "ticket_number": "description": "Fibra 600Mb", "ticket_number": false, "technology": "Fiber",
"99999997", "technology": "Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false, "is_terminated":
"ca_ES", "iban": "ES0421004420219290058430", "is_terminated": false, "date_start": false, "date_start": "2023-07-09", "date_end": false, "fiber_signal": false,
"2022-01-14", "date_end": false, "fiber_signal": false, "subscription_type": "subscription_type": "broadband", "address": {"street": "Carrer del Penal,
"mobile", "address": {"street": "-", "zip_code": "-", "city": "-", "country": 2", "zip_code": "17855", "city": "Oix", "country": "Spain", "state": "Girona
"Spain", "state": "-"}, "subscription_technology": "mobile", "available_operations": (Gerona)"}, "subscription_technology": "fiber", "available_operations": ["ChangeTariffOwner"],
["ChangeTariffMobile", "AddOneShotMobile"],"parent_contract": "", "shared_bond_id": "parent_contract": "", "shared_bond_id": false, "price": 43.0, "has_landline_phone":
false, "price": 7, "has_landline_phone": true,"bandwidth": 0}, {"id": 23160, "code": "33061", true, "bandwidth": 600, "data": 0, "minutes": 0}, {"id": 4, "code": "4", "email":
"email": "yrm9s6wc@caramail.com", "customer_firstname": "Ovidi", "customer_lastname": "felipdata@demo.net", "customer_firstname": "Felip", "customer_lastname":
"Montllor i Mengual", "customer_ref": "27550", "customer_vat": "ES30282588Y", "Dara", "customer_ref": "1234", "customer_vat": "ES55642302N", "phone_number":
"phone_number": "718559891", "current_tariff_product": "SE_SC_REC_MOBILE_T_UNL_20480", "654543432", "current_tariff_product": "SE_SC_REC_MOBILE_PACK_UNL_20480",
"description": "Ilimitadas 20 GB", "ticket_number": "99999996", "technology": "description": "Il\u00b7limitades 20 GB (Pack)", "ticket_number": false, "technology":
"Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES0421004420219290058430", "Mobile", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false,
"is_terminated": false, "date_start": "2022-01-14", "date_end": false, "fiber_signal": "is_terminated": false, "date_start": "2023-06-30", "date_end": false, "fiber_signal":
false, "subscription_type": "mobile", "address": {"street": "-", "zip_code": false, "subscription_type": "mobile", "address": {"street": "Carrer del Penal,
"-", "city": "-", "country": "Spain", "state": "-"}, "subscription_technology": 2", "zip_code": "17855", "city": "Oix", "country": "Spain", "state": "Girona
"mobile", "available_operations": ["ChangeTariffMobile", "AddOneShotMobile"], (Gerona)"}, "subscription_technology": "mobile", "available_operations": ["ChangeTariffMobile",
"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": true,"bandwidth": 0}, "AddOneShotMobile", "ChangeTariffOwner"], "parent_contract": "3", "shared_bond_id":
{"id": 23158, "code": "33059", "email": "yrm9s6wc@caramail.com", "customer_firstname": false, "price": 8.0, "has_landline_phone": false, "bandwidth": 0, "data":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", 20480, "minutes": 99999}, {"id": 3, "code": "3", "email": "felipdata@demo.net",
"customer_vat": "ES30282588Y", "phone_number": "960879143", "current_tariff_product": "customer_firstname": "Felip", "customer_lastname": "Dara", "customer_ref":
"SE_SC_REC_BA_F_1024", "description": "Fibra 1Gb", "ticket_number": "99999992", "1234", "customer_vat": "ES55642302N", "phone_number": "939516963", "current_tariff_product":
"technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "SE_SC_REC_BA_F_600", "description": "Fibra 600Mb", "ticket_number": false,
"iban": "ES0421004420219290058430", "is_terminated": false, "date_start": "technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES",
"2021-12-08", "date_end": false, "fiber_signal": "fibraFTTH", "subscription_type": "iban": false, "is_terminated": false, "date_start": "2023-07-09", "date_end":
"broad_band", "address": {"street": "Avenida Horno, 90", "zip_code": "50648", false, "fiber_signal": false, "subscription_type": "broadband", "address":
"city": "Contamina", "country": "Spain", "state": "Zaragoza"}, "subscription_technology": {"street": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country":
"fiber", "available_operations": [],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "Spain", "state": "Girona (Gerona)"}, "subscription_technology": "fiber",
true,"bandwidth": 0}], "paging": {"limit": 5, "offset": 0, "available_operations": ["ChangeTariffOwner"], "parent_contract": "", "shared_bond_id":
"totalNumberOfRecords": 8, "sortBy": "code", "sortOrder": "DESCENDENT"}}' false, "price": 43.0, "has_landline_phone": true, "bandwidth": 600, "data":
0, "minutes": 0}], "paging": {"limit": 5, "offset": 0, "totalNumberOfRecords":
7, "sortBy": "code", "sortOrder": "DESCENDENT"}}'
headers: headers:
Content-Length: Content-Length:
- '4031' - '4661'
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:14:07 GMT - Mon, 24 Jul 2023 12:25:14 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie:
- session_id=5bfe5ebf9c3547abc26713f550b3773dbce5d7bf; Expires=Sun, 16-Jul-2023 - session_id=cfc2682ed3b7a83c4f092c958b242214312757f3; Expires=Sun, 22-Oct-2023
10:14:07 GMT; Max-Age=7776000; HttpOnly; Path=/ 12:25:14 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -23,7 +23,7 @@ interactions: ...@@ -23,7 +23,7 @@ interactions:
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:14:07 GMT - Mon, 24 Jul 2023 12:25:14 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
status: status:
......
...@@ -13,53 +13,32 @@ interactions: ...@@ -13,53 +13,32 @@ interactions:
User-Agent: User-Agent:
- python-requests/2.27.1 - python-requests/2.27.1
method: GET method: GET
uri: http://odoo-sc.local:8069/api/contract/available-fibers-to-link-with-mobile?partner_ref=27550&mobiles_sharing_data=False uri: http://odoo-sc.local:8069/api/contract/available-fibers-to-link-with-mobile?partner_ref=1234&mobiles_sharing_data=false
response: response:
body: body:
string: '[{"id": 23154, "code": "33055", "email": "yrm9s6wc@caramail.com", "customer_firstname": string: '[{"id": 2, "code": "2", "email": "felipdata@demo.net", "customer_firstname":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", "Felip", "customer_lastname": "Dara", "customer_ref": "1234", "customer_vat":
"customer_vat": "ES30282588Y", "phone_number": "939591019", "current_tariff_product": "ES55642302N", "phone_number": "939516001", "current_tariff_product": "SE_SC_REC_BA_F_600",
"SE_SC_REC_BA_F_600", "description": "Fibra 600Mb", "ticket_number": "99999991", "description": "Fibra 600Mb", "ticket_number": false, "technology": "Fiber",
"technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false, "is_terminated":
"iban": "ES6621031479773534034515", "is_terminated": false, "date_start": false, "date_start": "2023-06-20", "date_end": false, "fiber_signal": false,
"2021-12-08", "date_end": false, "fiber_signal": "fibraFTTH", "subscription_type": "subscription_type": "broadband", "address": {"street": "Carrer del Penal,
"broad_band", "address": {"street": "Ronda Horno, 4", "zip_code": "41202", 2", "zip_code": "17855", "city": "Oix", "country": "Spain", "state": "Girona
"city": "Umbrete", "country": "Spain", "state": "Sevilla"}, "subscription_technology": (Gerona)"}, "subscription_technology": "fiber", "available_operations": ["ChangeTariffOwner"],
"fiber", "available_operations": [],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "parent_contract": "", "shared_bond_id": false, "price": 43.0, "has_landline_phone":
true,"bandwidth": 0}, {"id": 23155, "code": "33056", "email": true, "bandwidth": 600, "data": 0, "minutes": 0}]'
"yrm9s6wc@caramail.com", "customer_firstname": "Ovidi", "customer_lastname":
"Montllor i Mengual", "customer_ref": "27550", "customer_vat": "ES30282588Y",
"phone_number": "953777554", "current_tariff_product": "SE_SC_REC_BA_F_300",
"description": "Fibra 300Mb", "ticket_number": "99999993", "technology": "Fiber",
"supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES0421004420219290058430",
"is_terminated": false, "date_start": "2021-12-08", "date_end": false, "fiber_signal":
"fibraFTTH", "subscription_type": "broad_band", "address": {"street": "Avinguda
Mayor, 9", "zip_code": "45218", "city": "Hontanar", "country": "Spain", "state":
"Toledo"}, "subscription_technology": "fiber", "available_operations": [],"parent_contract":
"", "shared_bond_id": false, "price": 7, "has_landline_phone": true,"bandwidth": 0},
{"id": 23158, "code": "33059", "email": "yrm9s6wc@caramail.com", "customer_firstname":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550",
"customer_vat": "ES30282588Y", "phone_number": "960879143", "current_tariff_product":
"SE_SC_REC_BA_F_1024", "description": "Fibra 1Gb", "ticket_number": "99999992",
"technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES",
"iban": "ES0421004420219290058430", "is_terminated": false, "date_start":
"2021-12-08", "date_end": false, "fiber_signal": "fibraFTTH", "subscription_type":
"broad_band", "address": {"street": "Avenida Horno, 90", "zip_code": "50648",
"city": "Contamina", "country": "Spain", "state": "Zaragoza"}, "subscription_technology":
"fiber", "available_operations": [],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone":
true,"bandwidth": 0}]'
headers: headers:
Content-Length: Content-Length:
- '2294' - '865'
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:38:05 GMT - Mon, 24 Jul 2023 13:58:29 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie:
- session_id=dcc083bd607a8ce229819ea899c59a3861970478; Expires=Sun, 16-Jul-2023 - session_id=b0efc56c95b2b6fd07783818c055de4919eb6eca; Expires=Sun, 22-Oct-2023
10:38:05 GMT; Max-Age=7776000; HttpOnly; Path=/ 13:58:29 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -13,53 +13,54 @@ interactions: ...@@ -13,53 +13,54 @@ interactions:
User-Agent: User-Agent:
- python-requests/2.27.1 - python-requests/2.27.1
method: GET method: GET
uri: http://odoo-sc.local:8069/api/contract/available-fibers-to-link-with-mobile?partner_ref=27550&mobiles_sharing_data=True uri: http://odoo-sc.local:8069/api/contract/available-fibers-to-link-with-mobile?partner_ref=1234&mobiles_sharing_data=true
response: response:
body: body:
string: '[{"id": 23154, "code": "33055", "email": "yrm9s6wc@caramail.com", "customer_firstname": string: '[{"id": 2, "code": "2", "email": "felipdata@demo.net", "customer_firstname":
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", "Felip", "customer_lastname": "Dara", "customer_ref": "1234", "customer_vat":
"customer_vat": "ES30282588Y", "phone_number": "939591019", "current_tariff_product": "ES55642302N", "phone_number": "939516001", "current_tariff_product": "SE_SC_REC_BA_F_600",
"SE_SC_REC_BA_F_600", "description": "Fibra 600Mb", "ticket_number": "99999991", "description": "Fibra 600Mb", "ticket_number": false, "technology": "Fiber",
"technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false, "is_terminated":
"iban": "ES6621031479773534034515", "is_terminated": false, "date_start": false, "date_start": "2023-06-20", "date_end": false, "fiber_signal": false,
"2021-12-08", "date_end": false, "fiber_signal": "fibraFTTH", "subscription_type": "subscription_type": "broadband", "address": {"street": "Carrer del Penal,
"broad_band", "address": {"street": "Ronda Horno, 4", "zip_code": "41202", 2", "zip_code": "17855", "city": "Oix", "country": "Spain", "state": "Girona
"city": "Umbrete", "country": "Spain", "state": "Sevilla"}, "subscription_technology": (Gerona)"}, "subscription_technology": "fiber", "available_operations": ["ChangeTariffOwner"],
"fiber", "available_operations": [],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "parent_contract": "", "shared_bond_id": false, "price": 43.0, "has_landline_phone":
true,"bandwidth": 0}, {"id": 23155, "code": "33056", "email": true, "bandwidth": 600, "data": 0, "minutes": 0}, {"id": 3, "code": "3", "email":
"yrm9s6wc@caramail.com", "customer_firstname": "Ovidi", "customer_lastname": "felipdata@demo.net", "customer_firstname": "Felip", "customer_lastname":
"Montllor i Mengual", "customer_ref": "27550", "customer_vat": "ES30282588Y", "Dara", "customer_ref": "1234", "customer_vat": "ES55642302N", "phone_number":
"phone_number": "953777554", "current_tariff_product": "SE_SC_REC_BA_F_300", "939516963", "current_tariff_product": "SE_SC_REC_BA_F_600", "description":
"description": "Fibra 300Mb", "ticket_number": "99999993", "technology": "Fiber", "Fibra 600Mb", "ticket_number": false, "technology": "Fiber", "supplier":
"supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "iban": "ES0421004420219290058430", "M\u00e1sM\u00f3vil", "lang": "es_ES", "iban": false, "is_terminated": false,
"is_terminated": false, "date_start": "2021-12-08", "date_end": false, "fiber_signal": "date_start": "2023-07-09", "date_end": false, "fiber_signal": false, "subscription_type":
"fibraFTTH", "subscription_type": "broad_band", "address": {"street": "Avinguda "broadband", "address": {"street": "Carrer del Penal, 2", "zip_code": "17855",
Mayor, 9", "zip_code": "45218", "city": "Hontanar", "country": "Spain", "state": "city": "Oix", "country": "Spain", "state": "Girona (Gerona)"}, "subscription_technology":
"Toledo"}, "subscription_technology": "fiber", "available_operations": [],"parent_contract": "fiber", "available_operations": ["ChangeTariffOwner"], "parent_contract":
"", "shared_bond_id": false, "price": 7, "has_landline_phone": true,"bandwidth": 0}, "", "shared_bond_id": false, "price": 43.0, "has_landline_phone": true, "bandwidth":
{"id": 23158, "code": "33059", "email": "yrm9s6wc@caramail.com", "customer_firstname": 600, "data": 0, "minutes": 0}, {"id": 5, "code": "5", "email": "felipdata@demo.net",
"Ovidi", "customer_lastname": "Montllor i Mengual", "customer_ref": "27550", "customer_firstname": "Felip", "customer_lastname": "Dara", "customer_ref":
"customer_vat": "ES30282588Y", "phone_number": "960879143", "current_tariff_product": "1234", "customer_vat": "ES55642302N", "phone_number": "939516963", "current_tariff_product":
"SE_SC_REC_BA_F_1024", "description": "Fibra 1Gb", "ticket_number": "99999992", "SE_SC_REC_BA_F_600", "description": "Fibra 600Mb", "ticket_number": false,
"technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "ca_ES", "technology": "Fiber", "supplier": "M\u00e1sM\u00f3vil", "lang": "es_ES",
"iban": "ES0421004420219290058430", "is_terminated": false, "date_start": "iban": false, "is_terminated": false, "date_start": "2023-07-09", "date_end":
"2021-12-08", "date_end": false, "fiber_signal": "fibraFTTH", "subscription_type": false, "fiber_signal": false, "subscription_type": "broadband", "address":
"broad_band", "address": {"street": "Avenida Horno, 90", "zip_code": "50648", {"street": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country":
"city": "Contamina", "country": "Spain", "state": "Zaragoza"}, "subscription_technology": "Spain", "state": "Girona (Gerona)"}, "subscription_technology": "fiber",
"fiber", "available_operations": [],"parent_contract": "", "shared_bond_id": false, "price": 7, "has_landline_phone": "available_operations": ["ChangeTariffOwner"], "parent_contract": "", "shared_bond_id":
true,"bandwidth": 0}]' false, "price": 43.0, "has_landline_phone": true, "bandwidth": 600, "data":
0, "minutes": 0}]'
headers: headers:
Content-Length: Content-Length:
- '2294' - '2595'
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:38:05 GMT - Mon, 24 Jul 2023 13:58:30 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie:
- session_id=dcc083bd607a8ce229819ea899c59a3861970478; Expires=Sun, 16-Jul-2023 - session_id=ad6416afc182b3d1489a908edced17629aaa7c86; Expires=Sun, 22-Oct-2023
10:38:05 GMT; Max-Age=7776000; HttpOnly; Path=/ 13:58:30 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -13,7 +13,7 @@ interactions: ...@@ -13,7 +13,7 @@ interactions:
User-Agent: User-Agent:
- python-requests/2.27.1 - python-requests/2.27.1
method: GET method: GET
uri: http://odoo-sc.local:8069/api/contract/available-fibers-to-link-with-mobile?partner_ref=xxx&mobiles_sharing_data=False uri: http://odoo-sc.local:8069/api/contract/available-fibers-to-link-with-mobile?partner_ref=xxx&mobiles_sharing_data=false
response: response:
body: body:
string: '{"code": 404, "name": "Not Found"}' string: '{"code": 404, "name": "Not Found"}'
...@@ -23,7 +23,7 @@ interactions: ...@@ -23,7 +23,7 @@ interactions:
Content-Type: Content-Type:
- application/json - application/json
Date: Date:
- Mon, 17 Apr 2023 10:38:05 GMT - Mon, 24 Jul 2023 13:58:30 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
status: status:
......
...@@ -24,28 +24,28 @@ class ContractTests(unittest.TestCase): ...@@ -24,28 +24,28 @@ class ContractTests(unittest.TestCase):
@pytest.mark.vcr() @pytest.mark.vcr()
def test_get_contract_by_phone_number(self): def test_get_contract_by_phone_number(self):
contracts = Contract.get_by_phone_number(phone_number="616904164") contracts = Contract.get_by_phone_number(phone_number="654987654")
contract = contracts[0] contract = contracts[0]
assert contract.code == "33062" assert contract.code == "1"
assert contract.customer_vat == "ES30282588Y" assert contract.customer_vat == "ES55642302N"
assert contract.phone_number == "616904164" assert contract.phone_number == "654987654"
assert contract.current_tariff_product == "SE_SC_REC_MOBILE_T_UNL_5120" assert contract.current_tariff_product == "SE_SC_REC_MOBILE_T_UNL_20552"
@pytest.mark.vcr() @pytest.mark.vcr()
def test_get_contract_by_code(self): def test_get_contract_by_code(self):
contracts = Contract.get_by_code(code="33057") contracts = Contract.get_by_code(code="1")
contract = contracts[0] contract = contracts[0]
assert contract.code == "33057" assert contract.code == "1"
assert contract.customer_vat == "ES30282588Y" assert contract.customer_vat == "ES55642302N"
assert contract.phone_number == "-" assert contract.phone_number == "654987654"
assert contract.current_tariff_product == "SE_SC_REC_BA_F_300_SF" assert contract.current_tariff_product == "SE_SC_REC_MOBILE_T_UNL_20552"
@pytest.mark.vcr() @pytest.mark.vcr()
def test_search_paginated_contracts_by_customer_ref(self): def test_search_paginated_contracts_by_customer_ref(self):
paging_contracts = Contract.search_by_customer_ref( paging_contracts = Contract.search_by_customer_ref(
customer_ref="27550", customer_ref="1234",
limit=5, limit=5,
offset=0, offset=0,
sortBy="code", sortBy="code",
...@@ -54,12 +54,12 @@ class ContractTests(unittest.TestCase): ...@@ -54,12 +54,12 @@ class ContractTests(unittest.TestCase):
contract = paging_contracts.contracts[1] contract = paging_contracts.contracts[1]
paging = paging_contracts.paging paging = paging_contracts.paging
assert contract.customer_ref == "27550" assert contract.customer_ref == "1234"
assert contract.customer_vat == "ES30282588Y" assert contract.customer_vat == "ES55642302N"
assert contract.phone_number == "717260966" assert contract.phone_number == "654543432"
assert contract.current_tariff_product == "SE_SC_REC_MOBILE_PACK_UNL_20480" assert contract.current_tariff_product == "SE_SC_REC_MOBILE_2_SHARED_UNL_51200"
assert paging.limit == 5 assert paging.limit == 5
assert paging.totalNumberOfRecords == 8 assert paging.totalNumberOfRecords == 7
assert paging.offset == 0 assert paging.offset == 0
assert paging.sortBy == "code" assert paging.sortBy == "code"
assert paging.sortOrder == "DESCENDENT" assert paging.sortOrder == "DESCENDENT"
...@@ -67,7 +67,7 @@ class ContractTests(unittest.TestCase): ...@@ -67,7 +67,7 @@ class ContractTests(unittest.TestCase):
@pytest.mark.vcr() @pytest.mark.vcr()
def test_search_paginated_contracts_by_vat(self): def test_search_paginated_contracts_by_vat(self):
paging_contracts = Contract.search_by_customer_vat( paging_contracts = Contract.search_by_customer_vat(
vat="ES30282588Y", vat="ES55642302N",
limit=5, limit=5,
offset=0, offset=0,
sortBy="code", sortBy="code",
...@@ -77,20 +77,24 @@ class ContractTests(unittest.TestCase): ...@@ -77,20 +77,24 @@ class ContractTests(unittest.TestCase):
first_contract = paging_contracts.contracts[0] first_contract = paging_contracts.contracts[0]
second_contract = paging_contracts.contracts[1] second_contract = paging_contracts.contracts[1]
assert first_contract.code == "33066" assert first_contract.code == "7"
assert first_contract.customer_vat == "ES30282588Y" assert first_contract.customer_vat == "ES55642302N"
assert first_contract.phone_number == "784203016" assert first_contract.phone_number == "654543432"
assert first_contract.current_tariff_product == "SE_SC_REC_MOBILE_T_150_1024" assert (
first_contract.current_tariff_product
== "SE_SC_REC_MOBILE_2_SHARED_UNL_51200"
)
assert second_contract.code == "33064" assert second_contract.code == "6"
assert second_contract.customer_vat == "ES30282588Y" assert second_contract.customer_vat == "ES55642302N"
assert second_contract.phone_number == "717260966" assert second_contract.phone_number == "654543432"
assert ( assert (
second_contract.current_tariff_product == "SE_SC_REC_MOBILE_PACK_UNL_20480" second_contract.current_tariff_product
== "SE_SC_REC_MOBILE_2_SHARED_UNL_51200"
) )
assert paging.limit == 5 assert paging.limit == 5
assert paging.totalNumberOfRecords == 8 assert paging.totalNumberOfRecords == 7
assert paging.offset == 0 assert paging.offset == 0
assert paging.sortBy == "code" assert paging.sortBy == "code"
assert paging.sortOrder == "DESCENDENT" assert paging.sortOrder == "DESCENDENT"
......
...@@ -10,9 +10,9 @@ from odoo_somconnexio_python_client.resources.fiber_contracts import ( ...@@ -10,9 +10,9 @@ from odoo_somconnexio_python_client.resources.fiber_contracts import (
def assert_model(contracts): def assert_model(contracts):
contract = contracts[0] contract = contracts[0]
assert contract.code == "33055" assert contract.code == "2"
assert contract.customer_vat == "ES30282588Y" assert contract.customer_vat == "ES55642302N"
assert contract.phone_number == "939591019" assert contract.phone_number == "939516001"
assert contract.current_tariff_product == "SE_SC_REC_BA_F_600" assert contract.current_tariff_product == "SE_SC_REC_BA_F_600"
...@@ -27,13 +27,13 @@ def vcr_config(): ...@@ -27,13 +27,13 @@ def vcr_config():
class FiberContractsToPackTests(unittest.TestCase): class FiberContractsToPackTests(unittest.TestCase):
@pytest.mark.vcr() @pytest.mark.vcr()
def test_search_by_partner_ref(self): def test_search_by_partner_ref(self):
assert_model(FiberContractsToPack.search_by_partner_ref(partner_ref=27550)) assert_model(FiberContractsToPack.search_by_partner_ref(partner_ref=1234))
@pytest.mark.vcr() @pytest.mark.vcr()
def test_search_by_partner_ref_and_mobiles_sharing_data(self): def test_search_by_partner_ref_and_mobiles_sharing_data(self):
assert_model( assert_model(
FiberContractsToPack.search_by_partner_ref( FiberContractsToPack.search_by_partner_ref(
partner_ref=27550, mobiles_sharing_data=True partner_ref=1234, mobiles_sharing_data="true"
) )
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment