itimpulse

← К проектам

Платформа CvetBuket (рус.)

Краткое описание продукта

Платформа CvetBuket — система автоматизации цветочного магазина («ЦвеТут Цветы», г. Аксай). Объединяет сайт (cvetbuket.com), Telegram-бот (@cveTut_bot) и бота в MAX в единое ядро заказов и каталога с интеграцией 1С, оплатой Tinkoff СБП и доставкой через Яндекс. Автоматизирует продажи, приём оплаты, заказ курьера и общение с клиентом, чтобы магазин обрабатывал больше заказов с меньшими ручными операциями.

Бизнес-проблема

Цветочные магазины обычно ведут несколько каналов (сайт, мессенджеры, телефон), вручную обновляют каталог, отслеживают оплаты и заказывают такси. Это даёт ошибки, задержки и потерю заказов. Двойной ввод между сайтом и 1С, «зависшие» резервы по истёкшим ссылкам оплаты и рассинхрон отмен между магазином и ERP увеличивают риски и нагрузку на персонал.

Решение

Платформа даёт один бэкенд для сайта и обоих ботов. Каталог, цены и остатки подтягиваются из 1С по OData; заказы с любого канала пишутся в MySQL и в 1С. Ссылки оплаты (Tinkoff СБП) создаются при оформлении; cron отменяет истёкшие ссылки и снимает резервы в Tinkoff и 1С. Курьерская доставка автоматизирована: cron создаёт заявки в Yandex Delivery по готовым заказам; webhook обновляет статус и уведомляет клиента. Отмены синхронизируются в обе стороны (сайт/бот → 1С и 1С → сайт). В ботах AI-консультант (YandexGPT) подбирает букеты. Флорист отправляет фото собранного букета для согласования с клиентом перед отправкой.

Ключевые возможности

Обзор архитектуры

Карта системы (`doc/system-map.md`) описывает поток: **Клиенты** (сайт, Telegram-бот, MAX-бот) обращаются к **ядру заказов и каталога** (PHP). Ядро использует **MySQL** для заказов, кэша каталога, состояния ботов и пользователей. Внешние системы: **1С:УНФ** (синхронизация каталога, создание/отмена заказов, импорт), **Tinkoff СБП** (ссылки оплаты и отмена), **Yandex** (Delivery, GPT, Direct, Maps) и **Telegram / MAX** API. **Админка** и **CRON** (каталог, истечение оплаты, такси, статусы заказов, фото, Яндекс.Директ) работают в том же приложении. Без фреймворка; одно PHP-приложение, PDO/MySQL, в проде — Docker.

Интеграции

| Система | Назначение |

| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| **1С:УНФ OData** | Каталог (номенклатура, характеристики, цены, остатки, состав наборов), создание заказа (Document_ЗаказПокупателя), отмена (ВариантЗавершения), опрос статусов и импорт заказов только из 1С. |

| **Yandex Delivery** | Курьер: cron создаёт заявки (Express / Other-Day), webhook принимает статусы; геокодинг и расчёт стоимости при оформлении. |

| **Tinkoff СБП** | Выдача ссылки оплаты при оформлении; webhook подтверждения; отмена при истечении ссылки для снятия резерва. |

| **Telegram Bot API** | Webhook бота; сообщения, клавиатуры, фото; проверка подписки для скидок. |

| **MAX Bot API** | Те же сценарии, что и в Telegram, через отдельный webhook и адаптер; общий BotHandler. |

| **Yandex GPT** | AI-консультант в ботах (подбор букетов); опционально генерация SEO-текстов для категорий/товаров; тексты объявлений Директа. |

| **Яндекс.Директ API v5** | Кампании, группы, объявления, ключевые слова, расширения, изображения; семантика и статистика через cron. |

| **Yandex Maps** | Геокодинг адреса доставки (серверный прокси в обход блокировки в браузере). |

Влияние на бизнес

Кейс: cvetbuket

Проблема

Операционные процессы распределены между несколькими системами и требуют ручной синхронизации.

Инженерное решение

Реализован docs-driven pipeline с триггером по endlog и автоматической синхронизацией артефактов проекта.

Архитектура

Project manifest + integration manifests + извлечение знаний + статическая генерация сайта.

Интеграции

1c-unf-odata, tinkoff-sbp, yandex-delivery

Бизнес-ценность

Быстрее обновляется инженерное портфолио, снижаются ручные операции по документации, повышается прозрачность между проектами.

Инженерный лог

Engineering log

Changelog of engineering solutions. Generated from `doc/changelog-entries.md`.

Run: `php scripts/build_engineering_log.php`


2026 — AI consultant for bouquet selection

Problem

Clients needed 24/7 personalised recommendations; staff could not scale.

Engineering

YandexGPTClient::consultFlorist() with catalog slice and system prompt; 3 price tiers; ai_chat_history for context.

Business value

Faster selection, upsell, less routine load on staff.

Tech

PHP, YandexGPT API, MySQL ai_chat_history


2026 — Automatic courier dispatch

Problem

Manual courier ordering slowed down delivery.

Engineering

cron_taxi.php creates delivery requests via Yandex Delivery API (Express / Other-Day). Webhook updates order status.

Business value

Orders automatically receive courier dispatch.

Tech

PHP, Yandex Delivery API, cron, webhook


2026 — Payment link TTL and reserve release

Problem

Expired SBP links left reserves locked in Tinkoff and 1С.

Engineering

cron_payment_expiry.php runs every minute; calls TinkoffSBPClient::cancel() and ODataClient::cancelOdataOrder().

Business value

No stuck reserves; stock and money freed without manual steps.

Tech

PHP, Tinkoff SBP API, 1С OData PATCH, cron


2026 — Two-way order cancellation sync

Problem

Cancel in 1С or on site/bot had to stay in sync.

Engineering

Local cancel → cancelOdataOrder(). cron_order_status.php detects 1С cancel → local status + notify client.

Business value

Single view of order state; operator or client cancel reflected everywhere.

Tech

PHP, 1С OData, cron, Telegram/MAX Notifier


2026 — Unified bot logic (Telegram + MAX)

Problem

Two messengers needed the same flows without duplicating code.

Engineering

BotHandler holds all logic; TelegramAdapter and MaxAdapter implement MessengerInterface; same webhook flow.

Business value

One codebase for two channels; consistent UX and fewer bugs.

Tech

PHP, Telegram Bot API, MAX Bot API, MySQL bot_user_states


Интеграции

CvetBuket Platform

Product Summary

CvetBuket Platform is an automation system for a flower shop («ЦвеТут Цветы», Aksay, Russia). It unifies the website (cvetbuket.com), Telegram bot (@cveTut_bot) and MAX messenger bot into a single order and catalog core, integrated with 1C ERP, Tinkoff SBP payments and Yandex Delivery for courier dispatch. The system automates sales, payment handling, delivery booking and customer communication so the shop can serve more orders with less manual work.

Business Problem

Flower shops typically juggle multiple channels (website, messengers, phone), manual catalog updates, manual payment follow-up and manual courier ordering. That leads to errors, delays and lost orders. Double data entry between a website and 1C, expired payment links with stuck reserves, and unsynced cancellations between the shop and ERP create operational risk and extra work for staff.

Solution

The platform provides one backend for the website and both bots. Catalog, prices and stock are synced from 1C via OData; orders from any channel are written to MySQL and pushed to 1C. Payment links (Tinkoff SBP) are created at checkout; a cron job cancels expired links and releases reserves in both Tinkoff and 1C. Courier delivery is automated: a cron job creates Yandex Delivery claims for ready orders; a webhook updates order status and notifies the client. Cancellations are synced both ways (site/bot → 1C and 1C → site). An AI consultant (YandexGPT) suggests bouquets in the bots. Florists send a photo of the assembled bouquet for client approval before dispatch.

Key Capabilities

Architecture Overview

The system map (`doc/system-map.md`) describes the flow: **Clients** (Website, Telegram Bot, MAX Bot) send requests into the **Order & catalog core** (PHP). The core uses **MySQL** for orders, catalog cache, bot state and users. It talks to **1C:УНФ** (catalog sync, order create/cancel, import), **Tinkoff SBP** (payment links and cancel), **Yandex** (Delivery, GPT, Direct, Maps), and **Telegram / MAX** APIs. **Admin** and **CRON** jobs (catalog, payment expiry, taxi, order status, photo confirm, Yandex Direct) run on the same codebase. No framework; single PHP app with PDO/MySQL and Docker in production.

Integrations

| System | Role |

| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| **1C:УНФ OData** | Catalog (nomenclature, characteristics, prices, stock, set composition), order create (Document_ЗаказПокупателя), order cancel (ВариантЗавершения), order status poll and 1C-only order import. |

| **Yandex Delivery** | Courier dispatch: cron creates claims (Express / Other-Day), webhook receives status; geocoding and cost calculation for checkout. |

| **Tinkoff SBP** | Payment link generation at checkout; webhook for payment confirmation; cancel on link expiry to release reserve. |

| **Telegram Bot API** | Webhook for bot; send messages, keyboards, photos; subscription check for discounts. |

| **MAX Bot API** | Same flows as Telegram via a separate webhook and adapter; shared BotHandler. |

| **Yandex GPT** | AI consultant in bots (bouquet suggestions); optional SEO text generation for categories/products; Yandex Direct ad copy. |

| **Yandex Direct API v5** | Campaigns, ad groups, ads, keywords, extensions, images; semantic core and stats via cron. |

| **Yandex Maps** | Geocoding for delivery address (server-side proxy to avoid browser blocking). |

Business Impact

Карта системы

System map

CvetBuket Platform (cvetbuket.com)

```

Clients

├── Website (index, category, product, cart, process_order)

├── Telegram Bot (webhook.php → BotHandler)

└── MAX Bot (max_webhook.php → BotHandler)

Order & catalog core (PHP)

├── Catalog ← 1С:УНФ OData (cron_update_catalog_odata, CatalogUpdater)

├── Orders → 1С Document_ЗаказПокупателя (ODataClient)

├── Payments ← Tinkoff SBP (process_order, webhook/tinkoff, cron_payment_expiry)

├── Delivery ← Yandex Delivery (cron_taxi, webhook/yandex_delivery)

├── Notifications (Notifier → TG/MAX)

└── AI consultant (YandexGPTClient, ai_chat_history)

MySQL (orders, product_bases, categories, bot_user_states, site_users, yd_*, …)

├── 1С:УНФ OData (catalog, orders, cancel sync, cron_1c_import, cron_order_status)

├── Yandex (Delivery, GPT, Direct API, Maps geocode-proxy)

├── Tinkoff SBP

└── Telegram / MAX Bot API

Admin (admin/*), CRON (catalog, payment_expiry, taxi, order_status, photo_confirm, yd_*)

```