Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://taxiyes.com/docs
- taxiyes_senders - Таблица для аккаунта ресторана в системе такси yes
- Table "public.taxiyes_senders"
- Column | Type | Modifiers
- ---------------+-----------------------------+--------------
- id | uuid | not null
- is_active | boolean | default true
- restaurant_id | uuid | not null
- name | character varying(255) | not null
- email | character varying(255) | not null
- password | character varying(255) | not null
- phone | character varying(255) | not null
- address | character varying(255) | not null
- latitude | numeric | not null
- longitude | numeric | not null
- sender_id | uuid |
- created_at | timestamp without time zone | not null
- updated_at | timestamp without time zone | not null
- Indexes:
- "taxiyes_senders_pkey" PRIMARY KEY, btree (id)
- Из этой таблицы нужен sender_id для дальнейшей работы
- taxiyes_costs - Таблица для расчета цены поездки
- Table "public.taxiyes_costs"
- Column | Type | Modifiers
- -------------------+-----------------------------+--------------------
- id | uuid | not null
- is_active | boolean | default true
- restaurant_id | uuid | not null
- sender_id | uuid | not null
- device_id | uuid | not null
- destination_lat | numeric | not null
- destination_long | numeric | not null
- cost | numeric(20,4) |
- status | integer | not null default 1
- delivery_distance | numeric(20,4) |
- currency | character varying(255) |
- created_at | timestamp without time zone | not null
- updated_at | timestamp without time zone | not null
- Indexes:
- "taxiyes_costs_pkey" PRIMARY KEY, btree (id)
- В эту таблицу записываешь данные, я получаю и пишу данные в поля
- cost - Цена поездки
- delivery_distance - Дистанция между sender_id и клиентом
- destination_lat, destination_long - Можно брать с таблицы bill.online_orders если это онлайн заказ
- status - По умолчанию 1. это успешно, если тебе пришел status=0 то не удалось получить данные с их сервера. Чтобы еще раз расчитать создаешь новую запись в таблице.
- taxiyes_requests - Таблица для вызова такси.
- Table "public.taxiyes_requests"
- Column | Type | Modifiers
- -------------------------+-----------------------------+--------------------
- id | uuid | not null
- is_active | boolean | default true
- restaurant_id | uuid | not null
- sender_id | uuid | not null
- sender_order_no | character varying(255) |
- sender_order_picktime | integer |
- sender_order_total | numeric(20,4) | not null default 0
- sender_order_currency | character varying(255) |
- is_prepaid | boolean | not null
- receiver_name | character varying(255) | not null
- receiver_phone | character varying(255) | not null
- delivery_note | character varying(255) |
- created_at | timestamp without time zone | not null
- updated_at | timestamp without time zone | not null
- delivery_id | uuid |
- taxiyes_cost_id | uuid | not null
- driver_id | uuid |
- driver_photo | character varying(255) |
- driver_name | character varying(255) |
- driver_phone | character varying(255) |
- driver_vehicle_plate_no | character varying(255) |
- driver_vehicle_type | character varying(255) |
- driver_vehicle_model | character varying(255) |
- driver_vehicle_color | character varying(255) |
- driver_latitutde | numeric |
- driver_longitude | numeric |
- status | character varying(255) |
- local_status | integer | not null default 1
- Indexes:
- "taxiyes_requests_pkey" PRIMARY KEY, btree (id)
- Логика работы:
- Если по синх получил данные в таблицу taxiyes_senders то показывай кнопку доставки
- Для запросов берешь данные с этой таблицы latitude, longitude, sender_id
- Чтобы узнать стоимость доставки пишешь запись в таблицу taxiyes_costs
- Все данные не нужно заполнять, только destination_lat, destination_long, sender_id
- В ответ в этой же таблице получишь данные о стомости поездки.
- Если поле status пришло 0 то ошибка при получении данных с их сервака, еще один раз добавляешь запись
- Вызов такси:
- После получения себестоимости, если такси надо, добавляешь запись в таблицу taxiyes_requests
- Описение полей по ссылке в самом начале.
- *****
- В онлайн заказе добавятся новые поля destination_lat, destination_long это чтобы не искать клиента у тебя на карте
- ****
- taxiyes_requests есть поле local_status это для нашего внутренного пользования
- Для отмены вызова local_status меняешь на 3 и заказ отменяется
- там есть по status это статусы по api такси.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement