Advertisement
madrahimov

TaxiYes

Aug 12th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. https://taxiyes.com/docs
  2. taxiyes_senders - Таблица для аккаунта ресторана в системе такси yes
  3. Table "public.taxiyes_senders"
  4. Column | Type | Modifiers
  5. ---------------+-----------------------------+--------------
  6. id | uuid | not null
  7. is_active | boolean | default true
  8. restaurant_id | uuid | not null
  9. name | character varying(255) | not null
  10. email | character varying(255) | not null
  11. password | character varying(255) | not null
  12. phone | character varying(255) | not null
  13. address | character varying(255) | not null
  14. latitude | numeric | not null
  15. longitude | numeric | not null
  16. sender_id | uuid |
  17. created_at | timestamp without time zone | not null
  18. updated_at | timestamp without time zone | not null
  19. Indexes:
  20. "taxiyes_senders_pkey" PRIMARY KEY, btree (id)
  21. Из этой таблицы нужен sender_id для дальнейшей работы
  22.  
  23. taxiyes_costs - Таблица для расчета цены поездки
  24. Table "public.taxiyes_costs"
  25. Column | Type | Modifiers
  26. -------------------+-----------------------------+--------------------
  27. id | uuid | not null
  28. is_active | boolean | default true
  29. restaurant_id | uuid | not null
  30. sender_id | uuid | not null
  31. device_id | uuid | not null
  32. destination_lat | numeric | not null
  33. destination_long | numeric | not null
  34. cost | numeric(20,4) |
  35. status | integer | not null default 1
  36. delivery_distance | numeric(20,4) |
  37. currency | character varying(255) |
  38. created_at | timestamp without time zone | not null
  39. updated_at | timestamp without time zone | not null
  40. Indexes:
  41. "taxiyes_costs_pkey" PRIMARY KEY, btree (id)
  42.  
  43. В эту таблицу записываешь данные, я получаю и пишу данные в поля
  44. cost - Цена поездки
  45. delivery_distance - Дистанция между sender_id и клиентом
  46. destination_lat, destination_long - Можно брать с таблицы bill.online_orders если это онлайн заказ
  47. status - По умолчанию 1. это успешно, если тебе пришел status=0 то не удалось получить данные с их сервера. Чтобы еще раз расчитать создаешь новую запись в таблице.
  48.  
  49.  
  50. taxiyes_requests - Таблица для вызова такси.
  51.  
  52. Table "public.taxiyes_requests"
  53. Column | Type | Modifiers
  54. -------------------------+-----------------------------+--------------------
  55. id | uuid | not null
  56. is_active | boolean | default true
  57. restaurant_id | uuid | not null
  58. sender_id | uuid | not null
  59. sender_order_no | character varying(255) |
  60. sender_order_picktime | integer |
  61. sender_order_total | numeric(20,4) | not null default 0
  62. sender_order_currency | character varying(255) |
  63. is_prepaid | boolean | not null
  64. receiver_name | character varying(255) | not null
  65. receiver_phone | character varying(255) | not null
  66. delivery_note | character varying(255) |
  67. created_at | timestamp without time zone | not null
  68. updated_at | timestamp without time zone | not null
  69. delivery_id | uuid |
  70. taxiyes_cost_id | uuid | not null
  71. driver_id | uuid |
  72. driver_photo | character varying(255) |
  73. driver_name | character varying(255) |
  74. driver_phone | character varying(255) |
  75. driver_vehicle_plate_no | character varying(255) |
  76. driver_vehicle_type | character varying(255) |
  77. driver_vehicle_model | character varying(255) |
  78. driver_vehicle_color | character varying(255) |
  79. driver_latitutde | numeric |
  80. driver_longitude | numeric |
  81. status | character varying(255) |
  82. local_status | integer | not null default 1
  83. Indexes:
  84. "taxiyes_requests_pkey" PRIMARY KEY, btree (id)
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91. Логика работы:
  92. Если по синх получил данные в таблицу taxiyes_senders то показывай кнопку доставки
  93. Для запросов берешь данные с этой таблицы latitude, longitude, sender_id
  94.  
  95. Чтобы узнать стоимость доставки пишешь запись в таблицу taxiyes_costs
  96. Все данные не нужно заполнять, только destination_lat, destination_long, sender_id
  97. В ответ в этой же таблице получишь данные о стомости поездки.
  98. Если поле status пришло 0 то ошибка при получении данных с их сервака, еще один раз добавляешь запись
  99.  
  100.  
  101. Вызов такси:
  102. После получения себестоимости, если такси надо, добавляешь запись в таблицу taxiyes_requests
  103. Описение полей по ссылке в самом начале.
  104.  
  105. *****
  106. В онлайн заказе добавятся новые поля destination_lat, destination_long это чтобы не искать клиента у тебя на карте
  107.  
  108. ****
  109. taxiyes_requests есть поле local_status это для нашего внутренного пользования
  110. Для отмены вызова local_status меняешь на 3 и заказ отменяется
  111.  
  112. там есть по status это статусы по api такси.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement