{"id":497443,"date":"2026-10-05T15:47:37","date_gmt":"2026-10-05T15:47:37","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=497443"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=497443","title":{"rendered":"\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u0430\u043b\u043e\u043d \u043a\u0440\u0430\u0441\u043e\u0442\u044b"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0441\u0430\u043b\u043e\u043d\u0430\u0445 \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c. \u0415\u0441\u043b\u0438 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0437\u0430\u043d\u044f\u0442 \u0438\u043b\u0438 \u043e\u0442\u043b\u0443\u0447\u0438\u043b\u0441\u044f, \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0437\u0432\u043e\u043d\u043e\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u043f\u0443\u0449\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0440\u0443\u0447\u043a\u0443.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0430\u043c \u043f\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0443 \u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u0438\u0430\u043b\u043e\u0433\u0430:<\/p>\n<ul>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442: \u00ab\u0425\u043e\u0447\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0438\u0436\u043a\u0443 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u043e\u0441\u043b\u0435 \u0448\u0435\u0441\u0442\u0438\u00bb<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0431\u043e\u0442: \u00ab\u0423 \u0410\u043d\u043d\u044b \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0432 18:30 \u0438 19:00\u00bb<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442: \u00ab\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432 18:30\u00bb<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043b\u043e\u0442, \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430.\u00a0<\/p>\n<p>\u0421\u0442\u0435\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430: Python 3.10+, Flask, SQLAlchemy, SQLite \u0438 Google Calendar API, <a href=\"https:\/\/exolve.ru\/products\/robots\/golosovoy-robot-dlya-biznesa\/\">\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442 \u041c\u0422\u0421 Exolve<\/a>.<\/p>\n<h3>\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h3>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0437\u0432\u043e\u043d\u0438\u0442 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 \u0441\u0430\u043b\u043e\u043d\u0430. \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 Flask-\u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u0435\u0431\u0445\u0443\u043a \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0437\u0432\u043e\u043d\u043a\u0430. \u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430 \u0434\u0438\u0430\u043b\u043e\u0433\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0431\u0445\u0443\u043a. \u0421\u0435\u0440\u0432\u0438\u0441 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0432\u0435\u0442\u043e\u043a: \u043d\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u043f\u0435\u0440\u0435\u043d\u043e\u0441, \u043e\u0442\u043c\u0435\u043d\u0430 \u0438\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p>\u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u043e\u0431\u043e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0441\u043b\u0443\u0433\u0443, \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u0443\u0441\u043b\u0443\u0433: \u0441\u0442\u0440\u0438\u0436\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 60 \u043c\u0438\u043d\u0443\u0442, \u043c\u0430\u043d\u0438\u043a\u044e\u0440 \u2014 90, \u043e\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u2014 180. \u0417\u0430\u0442\u0435\u043c \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043b\u0438\u0431\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u043b\u043e\u0442, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u0432\u0435 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u044d\u043a\u0435\u043d\u0434 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0438\u0437\u0438\u0442 \u0432 SQLite, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u0430\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435: \u0438\u043d\u0430\u0447\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0430 \u0441 \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p>\u041f\u0440\u0438 \u043e\u0442\u043c\u0435\u043d\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438\u0437 Google Calendar \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u0442\u043c\u0435\u043d\u0451\u043d\u043d\u043e\u0439. \u042d\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0440\u0438\u0441\u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 SQLite \u0443\u0436\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u043e\u0442\u043c\u0435\u043d\u0435, \u0430 \u0441\u043b\u043e\u0442 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0437\u0430\u043d\u044f\u0442.<\/p>\n<p>\u041f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>\u041a\u043b\u0438\u0435\u043d\u0442 \u2502 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0437\u0432\u043e\u043d\u043e\u043a \u25bc\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u2502 HTTPS-\u0432\u0435\u0431\u0445\u0443\u043a\u0438: \u043d\u0430\u0447\u0430\u043b\u043e \u0437\u0432\u043e\u043d\u043a\u0430, \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0438\u0441\u0438 \u25bcFlask-\u0441\u0435\u0440\u0432\u0438\u0441 \u251c\u2500 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u044e \u0437\u0432\u043e\u043d\u043a\u0430 \u251c\u2500 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0443\u0441\u043b\u0443\u0433\u0443, \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u251c\u2500 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0438 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u251c\u2500 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba SQLite \u2502                \u251c\u2500 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u2502                \u251c\u2500 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u2502                \u2514\u2500 \u0441\u0432\u044f\u0437\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba Google Calendar API                  \u251c\u2500 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432                  \u251c\u2500 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u0439                  \u2514\u2500 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>POST \/webhook\/voice\/incoming-call \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0435\u0441\u0441\u0438\u044e \u0437\u0432\u043e\u043d\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>POST \/webhook\/voice\/intent \u2014 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0435\u0442\u043a\u0443 \u0434\u0438\u0430\u043b\u043e\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>POST \/api\/v1\/booking\/check-slot \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b<\/p>\n<\/li>\n<li>\n<p>POST \/api\/v1\/booking\/confirm \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0437\u0430\u043f\u0438\u0441\u044c<\/p>\n<\/li>\n<li>\n<p>POST \/api\/v1\/booking\/active \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>POST \/api\/v1\/booking\/reschedule \u2014 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0437\u0438\u0442<\/p>\n<\/li>\n<li>\n<p>POST \/api\/v1\/booking\/cancel \u2014 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c<\/p>\n<\/li>\n<li>\n<p>POST \/webhook\/voice\/finish \u2014 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0438\u0442\u043e\u0433 \u0437\u0432\u043e\u043d\u043a\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0438\u043b\u0438 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, Flask \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0437\u0432\u043e\u043d\u043a\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443.<\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0438 Google Calendar. \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u0440\u0435\u0447\u044c \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u044b. Flask \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0431\u0445\u0443\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0441\u043b\u043e\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u0432\u0438\u0437\u0438\u0442\u043e\u0432.<\/p>\n<p>SQLite \u0445\u0440\u0430\u043d\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0438 \u0441\u0432\u044f\u0437\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435. SQLAlchemy \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u0434\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0421\u0423\u0411\u0414 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<p>Google Calendar \u0445\u0440\u0430\u043d\u0438\u0442 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432. \u041f\u0435\u0440\u0435\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441 \u0432\u0438\u0437\u0438\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u0441\u043b\u043e\u0442\u044b \u0447\u0435\u0440\u0435\u0437 API. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435.<\/p>\n<p>\u0422\u0430\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c. Flask \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0434\u0438\u0430\u043b\u043e\u0433\u0430, SQLite \u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0430 Google Calendar \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<pre><code>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430       \u2502       \u2502 JSON + X-Webhook-Secret       \u25bc     app.py       \u251c\u2500 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438 HTTP-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b       \u251c\u2500 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u0432\u043e\u043d\u043a\u0430       \u251c\u2500 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b       \u2514\u2500 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430            \u2502                    \u2502            \u25bc                    \u25bc      database.py      services\/google_calendar_client.py            \u2502                    \u2502            \u25bc                    \u25bc         SQLite          Google Calendar API<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041a\u0442\u043e \u0437\u0430 \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>app.py \u2014 \u0432\u0435\u0431\u0445\u0443\u043a\u0438, \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u0430, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0437\u0430\u043f\u0438\u0441\u044c\u044e<\/p>\n<\/li>\n<li>\n<p>database.py \u2014 \u043c\u043e\u0434\u0435\u043b\u0438 SQLAlchemy, \u0438\u043d\u0434\u0435\u043a\u0441\u044b, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 SQLite \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>services\/google_calendar_client.py \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439, \u043f\u043e\u0438\u0441\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>config.py \u2014 \u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a<\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u0437\u0432\u043e\u043d\u043a\u043e\u0432<\/h3>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u2014 Appointment \u0438 CallRecord. \u041f\u0435\u0440\u0432\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0438\u0437\u0438\u0442\u0430 \u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f, \u0432\u0442\u043e\u0440\u0430\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u0437\u0432\u043e\u043d\u043a\u0430 \u0438 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<pre><code class=\"python\">#database.pyclass Appointment(Base):    __tablename__ = \"appointments\"    id = Column(Integer, primary_key=True)    client_id = Column(Integer, ForeignKey(\"clients.id\"), nullable=False)    master_id = Column(Integer, ForeignKey(\"masters.id\"), nullable=False)    service_id = Column(Integer, ForeignKey(\"beauty_services.id\"), nullable=False)    client_phone = Column(String(20), nullable=False, index=True)    service_name = Column(String(100), nullable=False)    master_name = Column(String(100), nullable=False)    starts_at = Column(DateTime(timezone=True), nullable=False)    ends_at = Column(DateTime(timezone=True), nullable=False)    status = Column(String(30), default=\"active\")    google_calendar_id = Column(String(255), nullable=False)    calendar_event_id = Column(String(255), nullable=True)    idempotency_key = Column(String(80), nullable=True)class CallRecord(Base):    __tablename__ = \"call_records\"    id = Column(Integer, primary_key=True)    phone = Column(String(20), nullable=False, index=True)    intent = Column(String(50), nullable=True)    appointment_id = Column(Integer, ForeignKey(\"appointments.id\"), nullable=True)    call_result = Column(String(50), nullable=True)    transfer_reason = Column(String(255), nullable=True)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0423 \u0432\u0438\u0437\u0438\u0442\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u043f\u0440\u043e\u0441\u0442\u044b\u0435: active \u0438 cancelled. \u0423 \u0437\u0432\u043e\u043d\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e CallRecord \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0430\u043f \u0438 \u0438\u0442\u043e\u0433 \u0434\u0438\u0430\u043b\u043e\u0433\u0430: \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u0443 \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \/webhook\/voice\/finish.<\/p>\n<pre><code> \u251c\u2500 appointment_created \u251c\u2500 appointment_rescheduled \u251c\u2500 appointment_cancelled \u2514\u2500 transfer_to_admin\/webhook\/voice\/finish \u251c\u2500 result=\"success\"  -&gt; finished \u251c\u2500 result=\"transfer\" -&gt; transfer_to_admin \u2514\u2500 \u0434\u0440\u0443\u0433\u043e\u0439 result     -&gt; status=result<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h3>\u0417\u0430\u0449\u0438\u0442\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 SQLite \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0434\u0432\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0434\u043d\u043e\u043c\u0443 \u043c\u0430\u0441\u0442\u0435\u0440\u0443 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u0430. \u0412\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043a\u043b\u044e\u0447 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"python\">__table_args__ = (    Index(        \"uq_appt_active_slot\",        \"master_id\", \"starts_at\",        unique=True,        sqlite_where=text(\"status = 'active'\"),        postgresql_where=text(\"status = 'active'\"),    ),    Index(        \"uq_appt_idem\",        \"idempotency_key\",        unique=True,        sqlite_where=text(\"idempotency_key IS NOT NULL\"),        postgresql_where=text(\"idempotency_key IS NOT NULL\"),    ),)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0418\u043d\u0434\u0435\u043a\u0441 \u043f\u043e \u0441\u043b\u043e\u0442\u0443 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f. \u0417\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 18:00\u201319:00 \u0438 18:30\u201320:00 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Google Calendar \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0435 \u0437\u0430\u043d\u044f\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0441\u043b\u043e\u0442, \u0437\u0430\u043f\u0438\u0441\u0438 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043c\u0430\u0441\u0442\u0435\u0440\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0438\u043b\u043e\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430.<\/p>\n<h3>\u041f\u0440\u0435\u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442<\/h3>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 str | None, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Python 3.10 \u0438\u043b\u0438 \u043d\u043e\u0432\u0435\u0435. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"bash\">python -m venv .venvsource .venv\/bin\/activatepip install -r requirements.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 Google Calendar API:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Google Cloud<\/p>\n<\/li>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 Google Calendar API<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 JSON-\u0444\u0430\u0439\u043b \u0441 \u043a\u043b\u044e\u0447\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0430\u0434\u0440\u0435\u0441\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435\u0439 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 calendar_id \u0432 database.py \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435\u0439<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 .env \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">DEBUG=falsePORT=5000BASE_URL=https:\/\/example.comDATABASE_URL=sqlite:\/\/\/beauty_salon.dbSALON_TIMEZONE=Europe\/MoscowGOOGLE_SERVICE_ACCOUNT_FILE=service-account.jsonADMIN_PHONE=79991112233WEBHOOK_SECRET=random-long-secret-valueWORK_START_HOUR=9WORK_END_HOUR=21SLOT_STEP_MINUTES=30SLOT_SEARCH_DAYS=7<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>BASE_URL \u2014 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 HTTPS-\u0430\u0434\u0440\u0435\u0441, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435.<\/p>\n<p>WEBHOOK_SECRET \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 X-Webhook-Secret. \u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u0441\u0435\u043a\u0440\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 16 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u043d\u0435 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e\u043c\u0435\u0440 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433 \u0441\u0435\u0442\u043a\u0438 \u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442 \u043f\u043e\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<h3>\u0428\u0430\u0433 1. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0437\u0432\u043e\u043d\u043e\u043a \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0435\u0441\u0441\u0438\u044e<\/h3>\n<p>\u0412\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 POST \/webhook\/voice\/incoming-call. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 JSON, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0435\u0441\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a 11 \u0446\u0438\u0444\u0440\u0430\u043c, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0441 7.<\/p>\n<pre><code class=\"python\">#app.py@app.route(\"\/webhook\/voice\/incoming-call\", methods=[\"POST\"])@require_secretdef incoming_call():    data = read_json_object()    if data is None:        return jsonify({\"error\": \"json_body_must_be_object\"}), 400    phone = normalize_phone(data.get(\"phone\"))    if not phone:        return jsonify({\"error\": \"invalid_phone\"}), 400<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 require_secret \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 hmac.compare_digest. \u042d\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u0434\u043f\u0438\u0441\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0438 \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u0449\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443. \u0415\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c. \u0417\u0430\u0442\u0435\u043c \u0432 call_records \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c started.<\/p>\n<pre><code class=\"python\">#app.pycall_record = CallRecord(    phone=phone,    client_id=client.id,    client_name=client.name,    status=\"started\",)db.add(call_record)db.commit()has_active = get_active_appointment(db, phone) is not None<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0432\u0443\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432: \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043b\u0438 \u0438\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u043d\u0435\u0433\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0438\u0437\u0438\u0442. \u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438.<\/p>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 call_id. \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0437\u0432\u043e\u043d\u043a\u043e\u043c.<\/p>\n<h3>\u0428\u0430\u0433 2. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 POST \/webhook\/voice\/intent \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u0435 intent. \u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0430\u0445.<\/p>\n<pre><code class=\"python\">#app.pyif intent in {\"book\", \"booking\", \"\u0437\u0430\u043f\u0438\u0441\u044c\", \"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f\"}:    return jsonify({        \"status\": \"ok\",        \"branch\": \"booking\",        \"phrase\": \"\u041d\u0430 \u043a\u0430\u043a\u0443\u044e \u0443\u0441\u043b\u0443\u0433\u0443 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f?\",        \"next_step\": \"collect_service\",    }), 200<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0438 \u043e\u0442\u043c\u0435\u043d\u044b \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u0449\u0435\u0442 \u0432\u0441\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0432\u0438\u0437\u0438\u0442\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u0434\u043d\u0430, \u0435\u0451 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435. \u0415\u0441\u043b\u0438 \u0432\u0438\u0437\u0438\u0442\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043e\u0442\u0432\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 appointments, \u0438 \u0440\u043e\u0431\u043e\u0442 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0432\u0438\u0437\u0438\u0442\u043e\u0432 \u043d\u0435\u0442, \u0437\u0432\u043e\u043d\u043e\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443. \u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0435\u0441\u0442\u043d\u0438\u0446\u0435\u0439 \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u2014 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0443\u0442\u043e\u0447\u043d\u044f\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u2014 \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u044c\u044f \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u2014 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0434\u0430\u0451\u0442 \u0434\u0438\u0430\u043b\u043e\u0433\u0443 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u0451\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435 \u043f\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e.<\/p>\n<h3>\u0428\u0430\u0433 3. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0443\u0441\u043b\u0443\u0433\u0443, \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0441\u043e\u0431\u0440\u0430\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0438\u0441\u0438, \u043e\u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 POST \/api\/v1\/booking\/check-slot. \u0411\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 ISO 8601 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u043a UTC.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0437\u043e\u043d\u0443, \u043a\u043e\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 SALON_TIMEZONE. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u043d\u043e \u0432 HTTP-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u044f\u0432\u043d\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 +03:00.<\/p>\n<pre><code class=\"python\">#app.pyservice_name = str(data.get(\"service_name\") or \"\").strip()master_name = str(data.get(\"master_name\") or \"\").strip()start_at = parse_datetime(data.get(\"start_time\"))if not service_name or not master_name or not start_at:    return jsonify({\"error\": \"invalid_params\"}), 400if not is_future_time(start_at):    return jsonify({\"error\": \"time_must_be_in_future\"}), 400<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u0449\u0435\u0442 \u0443\u0441\u043b\u0443\u0433\u0443 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0432 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430\u0445. \u041f\u0440\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0440\u043e\u0431\u043e\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0431\u0451\u0440\u043d\u0443\u0442\u0430 \u0432 try\/except. \u0415\u0441\u043b\u0438 Google Calendar \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0442\u0432\u0435\u0442 manual_check \u0441 HTTP-\u043a\u043e\u0434\u043e\u043c 200.<\/p>\n<pre><code class=\"python\">#app.pytry:    is_free = calendar_client.is_slot_free(        calendar_id=master.calendar_id,        start_at=start_at,        duration_minutes=service.duration_minutes,    )except Exception as e:    logger.error(\"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043b\u043e\u0442\u0430: %s\", e)    return jsonify({        \"status\": \"manual_check\",        \"phrase\": \"\u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u041f\u0435\u0440\u0435\u0432\u043e\u0436\u0443 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.\",        \"transfer_phone\": Config.ADMIN_PHONE,    }), 200<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443. \u0415\u0441\u043b\u0438 \u0441\u043b\u043e\u0442 \u0437\u0430\u043d\u044f\u0442 \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432.<\/p>\n<h3>\u0428\u0430\u0433 4. \u0418\u0449\u0435\u043c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \u0432 Google Calendar<\/h3>\n<p>\u041c\u0435\u0442\u043e\u0434 is_slot_free \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0443\u0441\u043b\u0443\u0433\u0438, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">#services\/google_calendar_client.pydef is_slot_free(    self,    calendar_id: str,    start_at: datetime,    duration_minutes: int,    ignore_event_id: str | None = None,) -&gt; bool:    end_at = start_at + timedelta(minutes=duration_minutes)    events = self._list_raw_events(calendar_id, start_at, end_at)    return not _overlaps(_busy_intervals(events, ignore_event_id), start_at, end_at)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442 \u0432\u0440\u0435\u043c\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u00ab\u0441\u0432\u043e\u0431\u043e\u0434\u0435\u043d\u00bb. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0432\u0438\u0437\u0438\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043d\u044f\u0442\u043e, find_nearest_free_slots \u0438\u0449\u0435\u0442 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u043a\u0435 \u0441 \u0448\u0430\u0433\u043e\u043c SLOT_STEP_MINUTES: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u0436\u0434\u044b\u0435 30 \u043c\u0438\u043d\u0443\u0442 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0430. \u041f\u043e\u0438\u0441\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438, \u0435\u0441\u043b\u0438 \u0432 \u044d\u0442\u043e\u0442 \u0434\u0435\u043d\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043e\u043a\u043e\u043d \u043d\u0435\u0442, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043d\u0438.<\/p>\n<pre><code class=\"python\">def find_nearest_free_slots(    self,    calendar_id: str,    preferred_start: datetime,    duration_minutes: int,    limit: int = 2,    work_start_hour: int | None = None,    work_end_hour: int | None = None,) -&gt; list[datetime]:    salon_tz = _salon_tz()    ws = Config.WORK_START_HOUR if work_start_hour is None else work_start_hour    we = Config.WORK_END_HOUR if work_end_hour is None else work_end_hour    step = Config.SLOT_STEP_MINUTES    duration = timedelta(minutes=duration_minutes)    now_utc = datetime.now(timezone.utc)    preferred_local = preferred_start.astimezone(salon_tz)    variants: list[datetime] = []    for day_offset in range(Config.SLOT_SEARCH_DAYS):        day = preferred_local + timedelta(days=day_offset)        day_start = day.replace(hour=ws, minute=0, second=0, microsecond=0)        day_end = day.replace(hour=we, minute=0, second=0, microsecond=0)        lower = max(preferred_local, day_start) if day_offset == 0 else day_start        current = _ceil_to_step(lower, step, day_start)        events = self._list_raw_events(            calendar_id,            day_start.astimezone(timezone.utc),            day_end.astimezone(timezone.utc),        )        busy = _busy_intervals(events, None)        while current + duration &lt;= day_end:            cur_utc = current.astimezone(timezone.utc)            slot_end = cur_utc + duration            if cur_utc &gt; now_utc and not _overlaps(busy, cur_utc, slot_end):                variants.append(cur_utc)                if len(variants) &gt;= limit:                    return variants            current += timedelta(minutes=step)    return variants<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043d\u044f\u0442\u043e, \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u0449\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a Google Calendar. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0437\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0435\u043d\u044c \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u0441\u043b\u043e\u0442\u044b \u043f\u043e \u0441\u0435\u0442\u043a\u0435. \u0415\u0441\u043b\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0434\u0430\u0442\u0443 \u043e\u043a\u043e\u043d \u043d\u0435\u0442, \u043f\u043e\u0438\u0441\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0447\u0438\u0435 \u0447\u0430\u0441\u044b \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 masters: \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0422\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0430. \u041f\u0435\u0440\u0435\u0440\u044b\u0432\u044b, \u043e\u0442\u043f\u0443\u0441\u043a\u0430, \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u044b \u0438 \u0441\u043c\u0435\u043d\u044b \u043b\u0443\u0447\u0448\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f.<\/p>\n<h3>\u0428\u0430\u0433 5. \u0411\u0440\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u043e\u0442 \u0431\u0435\u0437 \u0434\u0443\u0431\u043b\u0435\u0439<\/h3>\n<p>\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 POST \/api\/v1\/booking\/confirm \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u043c\u0430\u0441\u0442\u0435\u0440\u0435, \u0443\u0441\u043b\u0443\u0433\u0435, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0438\u0437\u0438\u0442\u0430 \u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043a\u043b\u044e\u0447 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u043e\u0432\u0440\u0435\u043c\u044f, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043d\u043e\u0432\u0430 \u2014 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043b\u044e\u0447\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043b\u0438\u0448\u043d\u044e\u044e \u0437\u0430\u043f\u0438\u0441\u044c. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0438\u0437\u0438\u0442\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u043a\u043b\u044e\u0447\u043e\u043c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">if idem_key:\u00a0\u00a0\u00a0\u00a0existing = db.query(Appointment).filter_by(idempotency_key=idem_key).first()\u00a0\u00a0\u00a0\u00a0if existing:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return jsonify(confirmed_payload(existing)), 200<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0435\u0442, \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u0441\u043b\u043e\u0442\u0430 \u0432 Google Calendar. \u042d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u043a\u0438, \u0435\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0443\u0441\u043f\u0435\u043b\u0438 \u0437\u0430\u043d\u044f\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n<pre><code class=\"python\">with master_lock(master.id):    is_free = calendar_client.is_slot_free(        calendar_id=master.calendar_id,        start_at=start_at,        duration_minutes=service.duration_minutes,    )    if not is_free:        return jsonify(busy_response(            master, start_at, service.duration_minutes,            status=\"slot_busy\",            prefix=\"\u042d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u043b\u0438. \u041c\u043e\u0433\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c\",        )), 200    appointment = Appointment(        client_id=client.id,        master_id=master.id,        service_id=service.id,        client_phone=phone,        client_name=client.name,        service_name=service.name,        master_name=master.name,        starts_at=start_at,        ends_at=start_at + timedelta(minutes=service.duration_minutes),        status=\"active\",        google_calendar_id=master.calendar_id,        calendar_event_id=None,        idempotency_key=idem_key,    )\u00a0\u00a0\u00a0\u00a0db.add(appointment)    try:        db.flush()    except IntegrityError:        db.rollback()        if idem_key:            existing = db.query(Appointment).filter_by(idempotency_key=idem_key).first()            if existing:                return jsonify(confirmed_payload(existing)), 200        return jsonify(busy_response(            master, start_at, service.duration_minutes,            status=\"slot_busy\",            prefix=\"\u042d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u043b\u0438. \u041c\u043e\u0433\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c\",        )), 200    event_id = calendar_client.create_appointment_event(        calendar_id=master.calendar_id,        client_name=client.name,        client_phone=phone,        service_name=service.name,        master_name=master.name,        start_at=start_at,        duration_minutes=service.duration_minutes,    )    appointment.calendar_event_id = event_id    db.commit()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>db.flush() \u0432\u043d\u043e\u0441\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 SQLite \u0434\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0432\u043d\u0435\u0448\u043d\u0435\u043c\u0443 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044e, \u043d\u043e \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u0430\u0442\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043b\u0438\u0448\u043d\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 Google Calendar.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 API \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 calendar_event_id \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e. \u041f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043a\u043b\u044e\u0447\u043e\u043c \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n<h3>\u0428\u0430\u0433 6. \u041e\u0442\u043c\u0435\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0435\u0437 \u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u0449\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. \u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 appointment_id \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0432\u0438\u0437\u0438\u0442. \u0415\u0441\u043b\u0438 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0437\u0438\u0442\u043e\u0432 \u0438 \u0432\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a. \u042d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043e\u0442\u043c\u0435\u043d\u0443 \u043d\u0435 \u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0442\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438\u0437 Google Calendar:<\/p>\n<pre><code class=\"python\">if appointment.calendar_event_id:\u00a0\u00a0\u00a0\u00a0try:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0calendar_client.delete_appointment_event(\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0calendar_id=appointment.google_calendar_id,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0event_id=appointment.calendar_event_id,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0)\u00a0\u00a0\u00a0\u00a0except Exception as calendar_error:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0logger.error(\"\u041e\u0448\u0438\u0431\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f: %s\", calendar_error)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return jsonify({\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"status\": \"manual_check\",\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"phrase\": \"\u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041f\u0435\u0440\u0435\u0432\u043e\u0436\u0443 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.\",\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"transfer_phone\": Config.ADMIN_PHONE,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}), 200appointment.status = \"cancelled\"db.commit()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0442 Google Calendar. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u0443\u0441\u043f\u0435\u0445\u0435, \u043a\u043e\u0433\u0434\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u0436\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u043b\u0430 \u0441\u043b\u043e\u0442 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0440\u0430\u0441\u0441\u0438\u043d\u0445\u0440\u043e\u043d \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0432 SQLite \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u0440\u0430\u0437\u043e\u0439\u0434\u0443\u0442\u0441\u044f. \u0427\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0432\u0435\u0440\u043a\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0432 Google Calendar.<\/p>\n<h3>\u0428\u0430\u0433 7. \u041f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0432\u0438\u0437\u0438\u0442 \u0431\u0435\u0437 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0441 \u0441\u0430\u043c\u0438\u043c \u0441\u043e\u0431\u043e\u0439<\/h3>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0430 \u0435\u0441\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u2014 \u043f\u043e appointment_id. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043d\u043e\u0432\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0441\u043b\u043e\u0442 \u0441\u0430\u043c\u0430 \u0441\u0435\u0431\u0435, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u0451 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 ignore_event_id.<\/p>\n<pre><code class=\"python\">is_free = calendar_client.is_slot_free(    calendar_id=master.calendar_id,    start_at=new_start_at,    duration_minutes=service.duration_minutes,    ignore_event_id=appointment.calendar_event_id,)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0441\u0442\u0430\u0440\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043d\u044f\u0442\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0431\u044d\u043a\u0435\u043d\u0434 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. flush() \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043b\u043e\u0442\u0430 \u0434\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a Google Calendar. \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c events.patch.<\/p>\n<pre><code class=\"python\">appointment.starts_at = new_start_atappointment.ends_at = new_start_at + timedelta(minutes=service.duration_minutes)try:\u00a0\u00a0\u00a0\u00a0db.flush()except IntegrityError:\u00a0\u00a0\u00a0\u00a0db.rollback()\u00a0\u00a0\u00a0\u00a0return jsonify(busy_response(\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0master, new_start_at, service.duration_minutes,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0status=\"slot_busy\", prefix=\"\u042d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043d\u044f\u043b\u0438. \u041c\u043e\u0433\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c\",\u00a0\u00a0\u00a0\u00a0)), 200    try:    calendar_client.update_appointment_event(        calendar_id=appointment.google_calendar_id,        event_id=appointment.calendar_event_id,        start_at=new_start_at,        duration_minutes=service.duration_minutes,    )except Exception as calendar_error:    db.rollback()    logger.error(\"\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435: %s\", calendar_error)    return jsonify({        \"status\": \"manual_check\",        \"phrase\": \"\u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041f\u0435\u0440\u0435\u0432\u043e\u0436\u0443 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.\",        \"transfer_phone\": Config.ADMIN_PHONE,    }), 200db.commit()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 API \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043f\u0440\u0435\u0436\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 SQLite. \u041a\u0430\u043a \u0438 \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043e\u0442\u043c\u0435\u043d\u044b, \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u0431\u043e\u0439 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0430\u0441\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h3>\u0428\u0430\u0433 8. \u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u041c\u0422\u0421 Exolve \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0435\u0431\u0445\u0443\u043a POST \/webhook\/voice\/finish. \u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043b\u043e\u0433 \u0437\u0432\u043e\u043d\u043a\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0442\u043e\u0433: \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u0443\u0441, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439.<\/p>\n<pre><code class=\"python\">if call_record:\u00a0\u00a0\u00a0\u00a0call_record.call_result = result\u00a0\u00a0\u00a0\u00a0if transfer_reason:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0call_record.transfer_reason = str(transfer_reason)\u00a0\u00a0\u00a0\u00a0if result == \"transfer\":\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0call_record.status = \"transfer_to_admin\"\u00a0\u00a0\u00a0\u00a0elif result == \"success\":\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0call_record.status = \"finished\"\u00a0\u00a0\u00a0\u00a0else:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0call_record.status = result\u00a0\u00a0\u00a0\u00a0db.commit()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u0432 \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0434\u043e\u043b\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430. \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u0430 \u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430. \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0443\u0436\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0432\u043e\u043d\u043a\u0430, \u0432\u0438\u0437\u0438\u0442\u0430 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 Google Calendar.<\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h3>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 JSON-\u0444\u0430\u0439\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435, \u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c calendar_id \u2014 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a Google Calendar API.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 Flask:<\/p>\n<pre><code class=\"bash\">python app.py<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \/healthz, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0435\u0440\u0435\u0437 curl.<\/p>\n<pre><code class=\"bash\">curl http:\/\/localhost:5000\/healthz<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u043e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"status\": \"ok\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h4>1. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0435\u0441\u0441\u0438\u044e \u0437\u0432\u043e\u043d\u043a\u0430<\/h4>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 79991112233 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0435\u0440\u043d\u0451\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0444\u0440\u0430\u0437\u0443.<\/p>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/webhook\/voice\/incoming-call \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\"phone\": \"+7 999 111-22-33\"}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041e\u0442\u0432\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0432\u043e\u043d\u043a\u0430, \u0444\u043b\u0430\u0433 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"call_id\": 1,\u00a0\u00a0\"client_found\": true,\u00a0\u00a0\"client_name\": \"\u0415\u043b\u0435\u043d\u0430\",\u00a0\u00a0\"has_active_appointment\": false,\u00a0\u00a0\"phrase\": \"\u0415\u043b\u0435\u043d\u0430, \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435. \u0425\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0441 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c?\",\u00a0\u00a0\"next_step\": \"recognize_intent\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h4>2. \u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435<\/h4>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/webhook\/voice\/intent \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\u00a0\u00a0\u00a0\u00a0\"call_id\": 1,\u00a0\u00a0\u00a0\u00a0\"phone\": \"+7 999 111-22-33\",\u00a0\u00a0\u00a0\u00a0\"intent\": \"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f\",\u00a0\u00a0\u00a0\u00a0\"attempt\": 1\u00a0\u00a0}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u0443\u0433\u0438:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"status\": \"ok\",\u00a0\u00a0\"branch\": \"booking\",\u00a0\u00a0\"phrase\": \"\u041d\u0430 \u043a\u0430\u043a\u0443\u044e \u0443\u0441\u043b\u0443\u0433\u0443 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f?\",\u00a0\u00a0\"next_step\": \"collect_service\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h4>3. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0440\u0435\u043c\u044f<\/h4>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0430\u0442\u0443 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u0412 \u0431\u0430\u0437\u0435 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440 \u0410\u043d\u043d\u0430 \u0438 \u0443\u0441\u043b\u0443\u0433\u0430 \u0421\u0442\u0440\u0438\u0436\u043a\u0430.<\/p>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/api\/v1\/booking\/check-slot \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\u00a0\u00a0\u00a0\u00a0\"service_name\": \"\u0421\u0442\u0440\u0438\u0436\u043a\u0430\",\u00a0\u00a0\u00a0\u00a0\"master_name\": \"\u0410\u043d\u043d\u0430\",\u00a0\u00a0\u00a0\u00a0\"start_time\": \"2030-08-03T18:30:00+03:00\"\u00a0\u00a0}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u0435\u043d, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043d\u0451\u0442:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"status\": \"free\",\u00a0\u00a0\"phrase\": \"\u0415\u0441\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0443 \u0410\u043d\u043d\u0430 \u043d\u0430 03.08.2030 \u0432 18:30. \u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0430\u0441?\",\u00a0\u00a0\"service_name\": \"\u0421\u0442\u0440\u0438\u0436\u043a\u0430\",\u00a0\u00a0\"master_name\": \"\u0410\u043d\u043d\u0430\",\u00a0\u00a0\"start_time\": \"2030-08-03T15:30:00+00:00\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043d\u044f\u0442\u043e, \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0434\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u043f\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044e \u043c\u0430\u0441\u0442\u0435\u0440\u0430:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"status\": \"busy\",\u00a0\u00a0\"phrase\": \"\u042d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043d\u044f\u0442\u043e. \u041c\u043e\u0433\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c 03.08.2030 \u0432 19:00 \u0438\u043b\u0438 03.08.2030 \u0432 19:30.\",\u00a0\u00a0\"alternatives\": [\u00a0\u00a0\u00a0\u00a0{\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"start_time\": \"2030-08-03T16:00:00+00:00\",\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"label\": \"03.08.2030 \u0432 19:00\"\u00a0\u00a0\u00a0\u00a0},\u00a0\u00a0\u00a0\u00a0{\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"start_time\": \"2030-08-03T16:30:00+00:00\",\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"label\": \"03.08.2030 \u0432 19:30\"\u00a0\u00a0\u00a0\u00a0}\u00a0\u00a0]}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h4>4. \u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c<\/h4>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/api\/v1\/booking\/confirm \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\u00a0\u00a0\u00a0\u00a0\"phone\": \"+7 999 111-22-33\",\u00a0\u00a0\u00a0\u00a0\"call_id\": 1,\u00a0\u00a0\u00a0\u00a0\"client_name\": \"\u0415\u043b\u0435\u043d\u0430\",\u00a0\u00a0\u00a0\u00a0\"service_name\": \"\u0421\u0442\u0440\u0438\u0436\u043a\u0430\",\u00a0\u00a0\u00a0\u00a0\"master_name\": \"\u0410\u043d\u043d\u0430\",\u00a0\u00a0\u00a0\u00a0\"start_time\": \"2030-08-03T18:30:00+03:00\",\u00a0\u00a0\u00a0\u00a0\"idempotency_key\": \"call-1-anna-haircut-20300803T1830\"\u00a0\u00a0}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"status\": \"confirmed\",\u00a0\u00a0\"phrase\": \"\u0413\u043e\u0442\u043e\u0432\u043e. \u0412\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 \u0421\u0442\u0440\u0438\u0436\u043a\u0430 \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0443 \u0410\u043d\u043d\u0430 \u043d\u0430 03.08.2030 \u0432 18:30.\",\u00a0\u00a0\"appointment_id\": 1,\u00a0\u00a0\"calendar_event_id\": \"google-event-id\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0442\u0435\u043c \u0436\u0435 idempotency_key. \u0421\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 appointment_id \u0438 calendar_event_id, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0432\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435.<\/p>\n<h4>5. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c<\/h4>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/api\/v1\/booking\/active \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\"phone\": \"+7 999 111-22-33\"}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0440\u043d\u0451\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0438\u0437\u0438\u0442\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 appointment_id \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0438.<\/p>\n<h4>6. \u041f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0432\u0438\u0437\u0438\u0442<\/h4>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/api\/v1\/booking\/reschedule \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\u00a0\u00a0\u00a0\u00a0\"phone\": \"+7 999 111-22-33\",\u00a0\u00a0\u00a0\u00a0\"call_id\": 1,\u00a0\u00a0\u00a0\u00a0\"appointment_id\": 1,\u00a0\u00a0\u00a0\u00a0\"new_start_time\": \"2030-08-03T19:30:00+03:00\"\u00a0\u00a0}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0442\u0432\u0435\u0442\u0438\u0442:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"status\": \"rescheduled\",\u00a0\u00a0\"phrase\": \"\u0413\u043e\u0442\u043e\u0432\u043e. \u041f\u0435\u0440\u0435\u043d\u0451\u0441 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430 03.08.2030 \u0432 19:30.\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h4>7. \u041e\u0442\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u0438\u0437\u0438\u0442<\/h4>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/api\/v1\/booking\/cancel \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\u00a0\u00a0\u00a0\u00a0\"phone\": \"+7 999 111-22-33\",\u00a0\u00a0\u00a0\u00a0\"call_id\": 1,\u00a0\u00a0\u00a0\u00a0\"appointment_id\": 1\u00a0\u00a0}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u043e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"json\">{\u00a0\u00a0\"status\": \"cancelled\",\u00a0\u00a0\"phrase\": \"\u0413\u043e\u0442\u043e\u0432\u043e. \u0417\u0430\u043f\u0438\u0441\u044c \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430.\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h4>8. \u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0437\u0432\u043e\u043d\u043e\u043a<\/h4>\n<pre><code class=\"bash\">curl -X POST http:\/\/localhost:5000\/webhook\/voice\/finish \\\u00a0\u00a0-H \"Content-Type: application\/json\" \\\u00a0\u00a0-H \"X-Webhook-Secret: random-long-secret-value\" \\\u00a0\u00a0-d '{\u00a0\u00a0\u00a0\u00a0\"call_id\": 1,\u00a0\u00a0\u00a0\u00a0\"result\": \"success\"\u00a0\u00a0}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 \u0432\u0435\u0440\u043d\u0451\u0442 {&#171;status&#187;:&#187;ok&#187;} \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 call_records.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0443 \u0432 \u0441\u0430\u043b\u043e\u043d\u0435 \u043a\u0440\u0430\u0441\u043e\u0442\u044b. <a href=\"https:\/\/exolve.ru\/products\/robots\/golosovoy-robot-dlya-biznesa\/\">\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442<\/a> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u0432\u043e\u043d\u043a\u0438, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u0437\u0432\u0443\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0438, \u0430 Flask-\u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0438 \u0432\u0438\u0437\u0438\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0421 \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u043c \u0440\u043e\u0431\u043e\u0442\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043f\u0438\u043a\u043e\u0432\u044b\u0435 \u0447\u0430\u0441\u044b, \u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f.<\/p>\n<p>\u0421\u0442\u0435\u043a \u0438\u0437 Flask \u0438 SQLite \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0438\u043b\u043e\u0442\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438, \u043d\u043e \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0438\u043b\u0438\u0442\u044c \u043f\u043e \u0447\u0430\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0435\u0432.<\/p>\n<p>\u041a\u043e\u0434 <a href=\"https:\/\/github.com\/duckdevdotdev\/postprod-june2026-beauty-salon\">\u043d\u0430 GitHub<\/a>.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1090650\/\">https:\/\/habr.com\/ru\/articles\/1090650\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u0441\u0430\u043b\u043e\u043d\u0430\u0445 \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c. \u0415\u0441\u043b\u0438 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0437\u0430\u043d\u044f\u0442 \u0438\u043b\u0438 \u043e\u0442\u043b\u0443\u0447\u0438\u043b\u0441\u044f, \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0437\u0432\u043e\u043d\u043e\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u043f\u0443\u0449\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0440\u0443\u0447\u043a\u0443.\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0430\u043c \u043f\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0443 \u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0430.\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u0438\u0430\u043b\u043e\u0433\u0430:\u041a\u043b\u0438\u0435\u043d\u0442: \u00ab\u0425\u043e\u0447\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0438\u0436\u043a\u0443 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u043e\u0441\u043b\u0435 \u0448\u0435\u0441\u0442\u0438\u00bb\u0420\u043e\u0431\u043e\u0442: \u00ab\u0423 \u0410\u043d\u043d\u044b \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0432 18:30 \u0438 19:00\u00bb\u041a\u043b\u0438\u0435\u043d\u0442: \u00ab\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432 18:30\u00bb\u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043b\u043e\u0442, \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430.\u00a0\u0421\u0442\u0435\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430: Python 3.10+, Flask, SQLAlchemy, SQLite \u0438 Google Calendar API, \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442 \u041c\u0422\u0421 Exolve.\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b\u041a\u043b\u0438\u0435\u043d\u0442 \u0437\u0432\u043e\u043d\u0438\u0442 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 \u0441\u0430\u043b\u043e\u043d\u0430. \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u043e\u0431\u043e\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 Flask-\u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u0435\u0431\u0445\u0443\u043a \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0437\u0432\u043e\u043d\u043a\u0430. \u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430 \u0434\u0438\u0430\u043b\u043e\u0433\u0430.\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0431\u0445\u0443\u043a. \u0421\u0435\u0440\u0432\u0438\u0441 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0432\u0435\u0442\u043e\u043a: \u043d\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u043f\u0435\u0440\u0435\u043d\u043e\u0441, \u043e\u0442\u043c\u0435\u043d\u0430 \u0438\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c.\u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u043e\u0431\u043e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0441\u043b\u0443\u0433\u0443, \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u0443\u0441\u043b\u0443\u0433: \u0441\u0442\u0440\u0438\u0436\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 60 \u043c\u0438\u043d\u0443\u0442, \u043c\u0430\u043d\u0438\u043a\u044e\u0440 \u2014 90, \u043e\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u2014 180. \u0417\u0430\u0442\u0435\u043c \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043b\u0438\u0431\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u043b\u043e\u0442, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u0432\u0435 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b.\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u044d\u043a\u0435\u043d\u0434 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0438\u0437\u0438\u0442 \u0432 SQLite, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u0430\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435: \u0438\u043d\u0430\u0447\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0430 \u0441 \u0441\u043e\u0431\u043e\u0439.\u041f\u0440\u0438 \u043e\u0442\u043c\u0435\u043d\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438\u0437 Google Calendar \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u0442\u043c\u0435\u043d\u0451\u043d\u043d\u043e\u0439. \u042d\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0440\u0438\u0441\u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 SQLite \u0443\u0436\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u043e\u0442\u043c\u0435\u043d\u0435, \u0430 \u0441\u043b\u043e\u0442 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0437\u0430\u043d\u044f\u0442.\u041f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:\u041a\u043b\u0438\u0435\u043d\u0442 \u2502 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0437\u0432\u043e\u043d\u043e\u043a \u25bc\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u2502 HTTPS-\u0432\u0435\u0431\u0445\u0443\u043a\u0438: \u043d\u0430\u0447\u0430\u043b\u043e \u0437\u0432\u043e\u043d\u043a\u0430, \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0438\u0441\u0438 \u25bcFlask-\u0441\u0435\u0440\u0432\u0438\u0441 \u251c\u2500 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u044e \u0437\u0432\u043e\u043d\u043a\u0430 \u251c\u2500 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0443\u0441\u043b\u0443\u0433\u0443, \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u251c\u2500 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0438 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u251c\u2500 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba SQLite \u2502                \u251c\u2500 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u2502                \u251c\u2500 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u2502                \u2514\u2500 \u0441\u0432\u044f\u0437\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba Google Calendar API                  \u251c\u2500 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432                  \u251c\u2500 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u0439                  \u2514\u2500 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u0417\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b:POST \/webhook\/voice\/incoming-call \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0435\u0441\u0441\u0438\u044e \u0437\u0432\u043e\u043d\u043a\u0430POST \/webhook\/voice\/intent \u2014 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0435\u0442\u043a\u0443 \u0434\u0438\u0430\u043b\u043e\u0433\u0430POST \/api\/v1\/booking\/check-slot \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044bPOST \/api\/v1\/booking\/confirm \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0437\u0430\u043f\u0438\u0441\u044cPOST \/api\/v1\/booking\/active \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430POST \/api\/v1\/booking\/reschedule \u2014 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0437\u0438\u0442POST \/api\/v1\/booking\/cancel \u2014 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044cPOST \/webhook\/voice\/finish \u2014 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0438\u0442\u043e\u0433 \u0437\u0432\u043e\u043d\u043a\u0430\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0438\u043b\u0438 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, Flask \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0437\u0432\u043e\u043d\u043a\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443.\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0438 Google Calendar. \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u0440\u0435\u0447\u044c \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u044b. Flask \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0431\u0445\u0443\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0441\u043b\u043e\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u0432\u0438\u0437\u0438\u0442\u043e\u0432.SQLite \u0445\u0440\u0430\u043d\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0438 \u0441\u0432\u044f\u0437\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435. SQLAlchemy \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u0434\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0421\u0423\u0411\u0414 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438.Google Calendar \u0445\u0440\u0430\u043d\u0438\u0442 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432. \u041f\u0435\u0440\u0435\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441 \u0432\u0438\u0437\u0438\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u0441\u043b\u043e\u0442\u044b \u0447\u0435\u0440\u0435\u0437 API. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435.\u0422\u0430\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c. Flask \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0434\u0438\u0430\u043b\u043e\u0433\u0430, SQLite \u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0430 Google Calendar \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f.\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430       \u2502       \u2502 JSON + X-Webhook-Secret       \u25bc     app.py       \u251c\u2500 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438 HTTP-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b       \u251c\u2500 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u0432\u043e\u043d\u043a\u0430       \u251c\u2500 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b       \u2514\u2500 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430            \u2502                    \u2502            \u25bc                    \u25bc      database.py      services\/google_calendar_client.py            \u2502                    \u2502            \u25bc                    \u25bc         SQLite          Google Calendar API\u041a\u0442\u043e \u0437\u0430 \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442:app.py \u2014 \u0432\u0435\u0431\u0445\u0443\u043a\u0438, \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u0430, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0437\u0430\u043f\u0438\u0441\u044c\u044edatabase.py \u2014 \u043c\u043e\u0434\u0435\u043b\u0438 SQLAlchemy, \u0438\u043d\u0434\u0435\u043a\u0441\u044b, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 SQLite \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435services\/google_calendar_client.py \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439, \u043f\u043e\u0438\u0441\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438config.py \u2014 \u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a\u041c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u0437\u0432\u043e\u043d\u043a\u043e\u0432\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u2014 Appointment \u0438 CallRecord. \u041f\u0435\u0440\u0432\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0438\u0437\u0438\u0442\u0430 \u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f, \u0432\u0442\u043e\u0440\u0430\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u0437\u0432\u043e\u043d\u043a\u0430 \u0438 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.#database.pyclass Appointment(Base):    __tablename__ = &#171;appointments&#187;    id = Column(Integer, primary_key=True)    client_id = Column(Integer, ForeignKey(&#171;clients.id&#187;), nullable=False)    master_id = Column(Integer, ForeignKey(&#171;masters.id&#187;), nullable=False)    service_id = Column(Integer, ForeignKey(&#171;beauty_services.id&#187;), nullable=False)    client_phone = Column(String(20), nullable=False, index=True)    service_name = Column(String(100), nullable=False)    master_name = Column(String(100), nullable=False)    starts_at = Column(DateTime(timezone=True), nullable=False)    ends_at = Column(DateTime(timezone=True), nullable=False)    status = Column(String(30), default=&#187;active&#187;)    google_calendar_id = Column(String(255), nullable=False)    calendar_event_id = Column(String(255), nullable=True)    idempotency_key = Column(String(80), nullable=True)class CallRecord(Base):    __tablename__ = &#171;call_records&#187;    id = Column(Integer, primary_key=True)    phone = Column(String(20), nullable=False, index=True)    intent = Column(String(50), nullable=True)    appointment_id = Column(Integer, ForeignKey(&#171;appointments.id&#187;), nullable=True)    call_result = Column(String(50), nullable=True)    transfer_reason = Column(String(255), nullable=True)\u0423 \u0432\u0438\u0437\u0438\u0442\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u043f\u0440\u043e\u0441\u0442\u044b\u0435: active \u0438 cancelled. \u0423 \u0437\u0432\u043e\u043d\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e CallRecord \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0430\u043f \u0438 \u0438\u0442\u043e\u0433 \u0434\u0438\u0430\u043b\u043e\u0433\u0430: \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u0443 \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \/webhook\/voice\/finish. \u251c\u2500 appointment_created \u251c\u2500 appointment_rescheduled \u251c\u2500 appointment_cancelled \u2514\u2500 transfer_to_admin\/webhook\/voice\/finish \u251c\u2500 result=&#187;success&#187;  -&gt; finished \u251c\u2500 result=&#187;transfer&#187; -&gt; transfer_to_admin \u2514\u2500 \u0434\u0440\u0443\u0433\u043e\u0439 result     -&gt; status=result\u0417\u0430\u0449\u0438\u0442\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 SQLite \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0434\u0432\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0434\u043d\u043e\u043c\u0443 \u043c\u0430\u0441\u0442\u0435\u0440\u0443 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u0430. \u0412\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043a\u043b\u044e\u0447 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438.__table_args__ = (    Index(        &#171;uq_appt_active_slot&#187;,        &#171;master_id&#187;, &#171;starts_at&#187;,        unique=True,        sqlite_where=text(&#171;status = &#8216;active'&#187;),        postgresql_where=text(&#171;status = &#8216;active'&#187;),    ),    Index(        &#171;uq_appt_idem&#187;,        &#171;idempotency_key&#187;,        unique=True,        sqlite_where=text(&#171;idempotency_key IS NOT NULL&#187;),        postgresql_where=text(&#171;idempotency_key IS NOT NULL&#187;),    ),)\u0418\u043d\u0434\u0435\u043a\u0441 \u043f\u043e \u0441\u043b\u043e\u0442\u0443 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f. \u0417\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 18:00\u201319:00 \u0438 18:30\u201320:00 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Google Calendar \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f.\u0427\u0442\u043e\u0431\u044b \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0435 \u0437\u0430\u043d\u044f\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0441\u043b\u043e\u0442, \u0437\u0430\u043f\u0438\u0441\u0438 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043c\u0430\u0441\u0442\u0435\u0440\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0438\u043b\u043e\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430.\u041f\u0440\u0435\u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u041f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 str | None, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Python 3.10 \u0438\u043b\u0438 \u043d\u043e\u0432\u0435\u0435. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:python -m venv .venvsource .venv\/bin\/activatepip install -r requirements.txt\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 Google Calendar API:\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Google Cloud\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 Google Calendar API\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 JSON-\u0444\u0430\u0439\u043b \u0441 \u043a\u043b\u044e\u0447\u043e\u043c\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0430\u0434\u0440\u0435\u0441\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435\u0439 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 calendar_id \u0432 database.py \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435\u0439\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 .env \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:DEBUG=falsePORT=5000BASE_URL=https:\/\/example.comDATABASE_URL=sqlite:\/\/\/beauty_salon.dbSALON_TIMEZONE=Europe\/MoscowGOOGLE_SERVICE_ACCOUNT_FILE=service-account.jsonADMIN_PHONE=79991112233WEBHOOK_SECRET=random-long-secret-valueWORK_START_HOUR=9WORK_END_HOUR=21SLOT_STEP_MINUTES=30SLOT_SEARCH_DAYS=7BASE_URL \u2014 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 HTTPS-\u0430\u0434\u0440\u0435\u0441, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435.WEBHOOK_SECRET \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 X-Webhook-Secret. \u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u0441\u0435\u043a\u0440\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 16 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u043d\u0435 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443.\u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442:\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430\u041d\u043e\u043c\u0435\u0440 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433 \u0441\u0435\u0442\u043a\u0438 \u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442 \u043f\u043e\u0438\u0441\u043a\u0430\u0415\u0441\u043b\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.\u0428\u0430\u0433 1. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0437\u0432\u043e\u043d\u043e\u043a \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0435\u0441\u0441\u0438\u044e\u0412\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 POST \/webhook\/voice\/incoming-call. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 JSON, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0435\u0441\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a 11 \u0446\u0438\u0444\u0440\u0430\u043c, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0441 7.#app.py@app.route(&#171;\/webhook\/voice\/incoming-call&#187;, methods=[&#171;POST&#187;])@require_secretdef incoming_call():    data = read_json_object()    if data is None:        return jsonify({&#171;error&#187;: &#171;json_body_must_be_object&#187;}), 400    phone = normalize_phone(data.get(&#171;phone&#187;))    if not phone:        return jsonify({&#171;error&#187;: &#171;invalid_phone&#187;}), 400\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 require_secret \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 hmac.compare_digest. \u042d\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-497443","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/497443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=497443"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/497443\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=497443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=497443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=497443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}