|
@@ -4,19 +4,27 @@ import config
|
|
import ast
|
|
import ast
|
|
|
|
|
|
#Тестовый класс User и Address (ВАЖНО!!!) поля классов должны называться также как и поля json объекта
|
|
#Тестовый класс User и Address (ВАЖНО!!!) поля классов должны называться также как и поля json объекта
|
|
-
|
|
|
|
-#Full json order example
|
|
|
|
'''
|
|
'''
|
|
|
|
+#Full json order example
|
|
|
|
+https://wiki.sharix-app.org/doku.php/open/tech/dev/sharix_open_-_primery_json
|
|
|
|
+
|
|
{
|
|
{
|
|
|
|
|
|
"ticket": 123,
|
|
"ticket": 123,
|
|
-"state": 111,
|
|
|
|
|
|
+"status": 111,
|
|
|
|
+
|
|
|
|
+"priority": 1,
|
|
|
|
+"title": "123",
|
|
|
|
+"note": "123",
|
|
|
|
+"due_date": 2023-05-15T17:16:22.955601Z,
|
|
|
|
+
|
|
"id_metaservice": 1,
|
|
"id_metaservice": 1,
|
|
"is_global": false,
|
|
"is_global": false,
|
|
"is_visible": false,
|
|
"is_visible": false,
|
|
"service": 1,
|
|
"service": 1,
|
|
"service_type": 1,
|
|
"service_type": 1,
|
|
|
|
|
|
|
|
+"status_changed_date": "2023-05-15T17:16:22.955601Z",
|
|
"time_placed": "2023-05-15T16:40:32.179777Z",
|
|
"time_placed": "2023-05-15T16:40:32.179777Z",
|
|
"time_start": "2023-05-15T16:40:32.179777Z",
|
|
"time_start": "2023-05-15T16:40:32.179777Z",
|
|
"time_start_predicted": "2023-05-15T16:40:32.179777Z",
|
|
"time_start_predicted": "2023-05-15T16:40:32.179777Z",
|
|
@@ -24,12 +32,15 @@ import ast
|
|
"time_start_real": "2023-05-15T16:40:32.179777Z",
|
|
"time_start_real": "2023-05-15T16:40:32.179777Z",
|
|
"time_finish_real": "2023-05-15T16:40:32.179777Z",
|
|
"time_finish_real": "2023-05-15T16:40:32.179777Z",
|
|
|
|
|
|
|
|
+"order_place_type": "address",
|
|
"order_place_start": "р-н Беговой",
|
|
"order_place_start": "р-н Беговой",
|
|
"order_place_start_gps": "55.751941, 37.607513",
|
|
"order_place_start_gps": "55.751941, 37.607513",
|
|
|
|
+"order_place_start_sector": 4,
|
|
"order_place_start_real": "р-н Беговой",
|
|
"order_place_start_real": "р-н Беговой",
|
|
"order_place_start_real_gps": "55.751941, 37.607513",
|
|
"order_place_start_real_gps": "55.751941, 37.607513",
|
|
"order_place_finish_predicted": "р-н Мещанский",
|
|
"order_place_finish_predicted": "р-н Мещанский",
|
|
"order_place_finish_predicted_gps": "55.751941, 37.607513",
|
|
"order_place_finish_predicted_gps": "55.751941, 37.607513",
|
|
|
|
+"order_place_finish_sector": 4,
|
|
"order_place_finish_real": "р-н Мещанский",
|
|
"order_place_finish_real": "р-н Мещанский",
|
|
"order_place_finish_real_gps": "55.751941, 37.607513",
|
|
"order_place_finish_real_gps": "55.751941, 37.607513",
|
|
|
|
|
|
@@ -43,52 +54,13 @@ import ast
|
|
"receiver": 1,
|
|
"receiver": 1,
|
|
"receiver_screen_name": "Marfa Clientovna",
|
|
"receiver_screen_name": "Marfa Clientovna",
|
|
"client_id": 1,
|
|
"client_id": 1,
|
|
-"resource_id": 1
|
|
|
|
-}
|
|
|
|
-'''
|
|
|
|
-
|
|
|
|
-#minimal acceptable as order json example
|
|
|
|
-
|
|
|
|
-'''
|
|
|
|
-{
|
|
|
|
-"ticket": 123,
|
|
|
|
-"state": 111,
|
|
|
|
-"id_metaservice": 1,
|
|
|
|
-"is_global": false,
|
|
|
|
-"is_visible": false,
|
|
|
|
-"service": 1,
|
|
|
|
-"service_type": 1,
|
|
|
|
-
|
|
|
|
-"time_placed": "2023-05-15T16:40:32.179777Z",
|
|
|
|
-"time_start": null,
|
|
|
|
-"time_start_predicted": null,
|
|
|
|
-"time_finish_predicted": null,
|
|
|
|
-"time_start_real": null,
|
|
|
|
-"time_finish_real": null,
|
|
|
|
-
|
|
|
|
-"order_place_start": null,
|
|
|
|
-"order_place_start_gps": null,
|
|
|
|
-"order_place_start_real": null,
|
|
|
|
-"order_place_start_real_gps": null,
|
|
|
|
-"order_place_finish_predicted": null,
|
|
|
|
-"order_place_finish_predicted_gps": null,
|
|
|
|
-"order_place_finish_real": null,
|
|
|
|
-"order_place_finish_real_gps": null,
|
|
|
|
-
|
|
|
|
-"predicted_price": null,
|
|
|
|
-"real_price": null,
|
|
|
|
-"payment_transaction_id": null,
|
|
|
|
-"rating_id": null,
|
|
|
|
-
|
|
|
|
-"provider": null,
|
|
|
|
-"provider_screen_name": null,
|
|
|
|
-"receiver": null,
|
|
|
|
-"receiver_screen_name": null,
|
|
|
|
-"client_id": null,
|
|
|
|
-"resource_id": null
|
|
|
|
|
|
+"client_screen_name": "Fedor Client",
|
|
|
|
+"resource_id": 1,
|
|
|
|
+"attempts": null
|
|
}
|
|
}
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
+#надо адаптировать класс к новому формату JSON
|
|
class Order(object):
|
|
class Order(object):
|
|
def __init__(self, ticket, state, id_metaservice, is_global, is_visible, service, service_type, time_placed, time_start=None, time_start_predicted=None, time_finish_predicted=None, time_start_real=None, time_finish_real=None, order_place_start=None, order_place_start_gps=None, order_place_start_real=None, order_place_start_real_gps=None, order_place_finish_predicted=None, order_place_finish_predicted_gps=None, order_place_finish_real=None, order_place_finish_real_gps=None, predicted_price=None, real_price=None, payment_transaction_id=None, rating_id=None, provider=None, provider_screen_name=None, receiver=None, receiver_screen_name=None, client_id=None, resource_id=None):
|
|
def __init__(self, ticket, state, id_metaservice, is_global, is_visible, service, service_type, time_placed, time_start=None, time_start_predicted=None, time_finish_predicted=None, time_start_real=None, time_finish_real=None, order_place_start=None, order_place_start_gps=None, order_place_start_real=None, order_place_start_real_gps=None, order_place_finish_predicted=None, order_place_finish_predicted_gps=None, order_place_finish_real=None, order_place_finish_real_gps=None, predicted_price=None, real_price=None, payment_transaction_id=None, rating_id=None, provider=None, provider_screen_name=None, receiver=None, receiver_screen_name=None, client_id=None, resource_id=None):
|
|
self.ticket = ticket
|
|
self.ticket = ticket
|