Commit Graph

119 Commits

Author SHA1 Message Date
fc8044484e build: update Makefile and change files chmod 2025-11-30 12:08:17 +03:00
e8d0f8a819 feat: add TeleCartPulse telemetry system and ETL endpoints
- Add TeleCartPulse service for event tracking and analytics
  - Implement PayloadSigner for secure payload signing/verification
  - Add StartParamSerializer for campaign parameter handling
  - Create TeleCartPulseServiceProvider for dependency injection
  - Add PulseEvents constants and exception classes

- Add TelemetryHandler for ingesting client-side events
  - Implement /ingest endpoint for receiving webapp events
  - Support WEBAPP_OPEN event tracking with campaign metadata

- Add ETLHandler for customer data export
  - Implement /customers endpoint for ETL processes
  - Add /customers/meta endpoint for pagination metadata
  - Support filtering by updated_at timestamp
  - Include customer metrics: orders count, total spent, etc.

- Add InvalidApiTokenException for API key validation
- Update Request class to support API key extraction
- Add Utils helper methods for domain extraction
- Integrate telemetry in frontend SPA (webapp open event)
- Add TeleCartPulseView in admin panel for API key configuration
- Update routes to include new telemetry and ETL endpoints
2025-11-30 11:54:24 +03:00
51f462922e feat: provide current opencart timezone to App 2025-11-30 11:54:24 +03:00
74e062e6bb refactor: use Carbon for dates 2025-11-30 11:54:24 +03:00
8260d2bc96 feat: store customer_id in with order 2025-11-30 11:54:24 +03:00
952d8e58da feat(customers): track order meta and OC sync
- add telecart_order_meta table and orders_count column for customers
- introduce OcCustomerService and OrderMetaService for syncing OC data
- rework OrderCreateService transaction flow, metadata handling and tests
- increment telegram customer orders_count and expose it via handlers/UI
- update stats dashboard with rub formatting, tooltips and customers count
- sync SPA theme colors with Telegram WebApp and fix dark variant behavior
- add helpers for RUB formatting and bool casting; simplify logs handler
2025-11-24 14:11:31 +03:00
b39a344a7d feat(admin): refactor logs viewer with table display and detailed dialog
Backend changes:
- Update LogsHandler.php to parse Monolog logs using regex
- Add parseLogLines() method to extract structured data from logs
- Support ISO 8601 format with microseconds and timezone
- Parse JSON context with nested objects and escaped characters support
- Add formatDateTime() method for readable date formatting
- Add findJsonEnd() method for correct JSON object extraction
- Return data in JSON format instead of plain string

Frontend changes:
- Update logs.js store: change data structure from string to array of objects
- Add loading flag for loading indicator
- Remove caching check for data freshness

- Completely refactor LogsViewer.vue component:
  * Replace textarea with PrimeVue DataTable with pagination and sorting
  * Add "Actions" column with view button (eye icon)
  * Use Badge component for log levels with color indicators
  * Remove "Context" column from table (unreadable in table view)
  * Add dialog with detailed log information:
    - Date and time (formatted and raw)
    - Level with color indicator
    - Channel
    - Message
    - Context (formatted JSON)
    - Raw string
  * Add word wrap for all text fields in dialog
  * Dialog closes on outside click (dismissableMask)
  * Configure pagination: 15 records per page by default

UX improvements:
- Improved log readability with structured display
- Easy navigation through large number of records via pagination
- Quick access to detailed information through dialog
- Color-coded levels for quick visual assessment
2025-11-24 00:09:32 +03:00
7a5eebec91 feat: добавлена функциональность политики конфиденциальности и согласия на обработку ПД
Основные изменения:

Backend:
- Добавлена миграция для поля privacy_consented_at в таблицу telecart_customers
- Создан PrivacyPolicyHandler с методами:
  * checkIsUserPrivacyConsented - проверка наличия согласия пользователя
  * userPrivacyConsent - сохранение согласия пользователя
- Обновлен TelegramService для извлечения userId из initData
- Обновлен TelegramServiceProvider для внедрения зависимостей
- Добавлены новые маршруты в routes.php
- Обновлен SettingsHandler для возврата privacy_policy_link
- Обновлен TelegramCustomersHandler для включения privacy_consented_at в ответы
- Обновлены тесты TelegramServiceTest

Frontend (SPA):
- Создан компонент PrivacyPolicy.vue для отображения запроса согласия
- Добавлена проверка согласия при инициализации приложения (main.js)
- Обновлен App.vue для отображения компонента PrivacyPolicy
- Добавлены функции checkIsUserPrivacyConsented и userPrivacyConsent в ftch.js
- Обновлен SettingsStore для хранения privacy_policy_link и is_privacy_consented

Frontend (Admin):
- Добавлено поле privacy_policy_link в настройки (settings.js)
- Добавлена настройка ссылки на политику конфиденциальности в GeneralView.vue
- Обновлен CustomersView.vue:
  * Добавлена колонка privacy_consented_at с отображением даты согласия
  * Добавлена поддержка help-текста для колонок с иконкой вопроса и tooltip
  * Добавлены help-тексты для колонок last_seen_at, privacy_consented_at, created_at
  * Улучшено форматирование кода
2025-11-23 23:19:15 +03:00
9a93cc7342 feat: add Telegram customers management system with admin panel
Implement comprehensive Telegram customers storage and management functionality:

Backend:
- Add database migration for telecart_customers table with indexes
- Create TelegramCustomer model with CRUD operations
- Implement TelegramCustomerService for business logic
- Add TelegramCustomerHandler for API endpoint (saveOrUpdate)
- Add TelegramCustomersHandler for admin API (getCustomers with pagination, filtering, sorting)
- Add SendMessageHandler for sending messages to customers via Telegram
- Create custom exceptions: TelegramCustomerNotFoundException, TelegramCustomerWriteNotAllowedException
- Refactor TelegramInitDataDecoder to separate decoding logic
- Add TelegramHeader enum for header constants
- Update SignatureValidator to use TelegramInitDataDecoder
- Register new routes in bastion/routes.php and src/routes.php

Frontend (Admin):
- Add CustomersView.vue component with PrimeVue DataTable
- Implement advanced filtering (text, date, boolean filters)
- Add column visibility toggle functionality
- Add global search with debounce
- Implement message sending dialog with validation
- Add Russian locale for PrimeVue components
- Add navigation link in App.vue
- Register route in router

Frontend (SPA):
- Add saveTelegramCustomer utility function
- Integrate automatic customer data saving on app initialization
- Extract user data from Telegram.WebApp.initDataUnsafe

The system automatically saves/updates customer data when users access the Telegram Mini App,
and provides admin interface for viewing, filtering, and messaging customers.

BREAKING CHANGE: None
2025-11-23 21:30:51 +03:00
6a59dcc0c9 feat: add FormKit framework support and update dependencies
- Add `telecart_forms` table migration and default checkout form seeder
- Implement `FormsHandler` to fetch form schemas
- Update `OrderCreateService` to handle custom fields in order comments
- Add `update` method to QueryBuilder and Grammar
- Add `Arr::except` helper
- Update composer dependencies (Carbon, Symfony, PHPUnit, etc.)
- Improve `MigratorService` error handling
- Add unit tests for new functionality
2025-11-23 16:05:46 +03:00
ae9771dec4 feat: maintenance tasks, logs
- add interval for periodic maintenance tasks
- add cache prune periodic task
- use rotating handler for monolog
- update UI logs component
- correctly reset cache from admin
- increase cache timeout for tg data
- fix UI errors in admin
2025-11-20 09:20:11 +03:00
d6db083dea Implement PSR3 and PHP Monolog (#19)
* feat: install monolog composer lib
* feat: implement psr3 and monolog
* feat: display logs in frontend
* fix: tests
* build: update cicd to run tests for PR
* build: add phpcs to cicd
* refactor: fix phpcs problems
2025-11-17 15:00:54 +03:00
09f1e514a9 feat: UI/UX, add reset cache to admin 2025-11-16 20:34:03 +03:00
f5d9d417b3 feat: improve mainpage ui/ux 2025-11-16 01:55:59 +03:00
f0837e5c94 feat: added new products_carousel bock type 2025-11-13 22:37:55 +03:00
6f9855995d feat: clear cache after settings update 2025-11-13 10:47:06 +03:00
24db69fbba fix: glob not work with phar 2025-11-13 02:41:53 +03:00
c0a6cb17b3 feat: add migrations, mantenance tasks, database cache, blocks cache 2025-11-13 02:24:00 +03:00
ab5c2f42b9 fix: store error 2025-11-12 20:44:10 +03:00
6176c720b1 feat: new settings and mainpage blocks 2025-11-12 20:32:10 +03:00
4b80fcbda8 test: add unit tests 2025-11-11 00:07:59 +03:00
cd818d3356 feat: update admin page 2025-11-11 00:02:53 +03:00
2bc751119c feat: add default configs 2025-11-02 15:27:48 +03:00
1077417d71 feat(admin): remove legacy setting keys that not defined in defaults 2025-11-02 15:05:52 +03:00
3049bd3101 feat(slider): add slider feature 2025-11-02 14:51:23 +03:00
0cccc7e3d7 refactor: move spa to frontend folder 2025-11-02 14:42:27 +03:00
34dfe90286 feat: add texts configuration 2025-10-27 11:13:04 +03:00
59aa06b2e4 tests: fix covers 2025-10-27 09:07:36 +03:00
c18f5d9038 tests: generate ai tests and run cicd 2025-10-27 09:04:02 +03:00
a27d3d2d0c refactor: remove hardcoded language_id from categories handler 2025-10-27 08:29:05 +03:00
2f74aba35f feat: integrate yandex metrika ecommerce 2025-10-26 18:22:19 +03:00
4e59c4e788 feat: WIP add yandex metrika goals 2025-10-26 14:35:44 +03:00
fbccd50675 feat: add debug mode for developers. Logs improvements 2025-10-26 12:08:45 +03:00
d7666f94ba feat(ya_metrika): WIP yandex metrika 2025-10-26 01:22:29 +03:00
05e7cafd0f feat(banner): add banner feature 2025-10-25 19:59:33 +03:00
c3c0d6d2c1 feat(spa): show navbar with app logo and app name 2025-10-25 18:48:47 +03:00
98ee6d9eca fix(telecart): Fix products search 2025-10-24 14:26:34 +03:00
ac24f0376b feat(telecart): add vouchers and coupons (#9) 2025-10-24 14:26:34 +03:00
78ca4fd309 fix(products): encode html for title on products page 2025-10-24 14:25:01 +03:00
aa42643c34 fix(app): fix unhandled exceptions 2025-10-19 15:17:24 +03:00
0386af9e0d chore: release v1.3.0 2025-10-19 15:02:45 +03:00
00165b3b61 feat(admin): do not log assets cleanup message if nothing deleted 2025-10-19 14:52:13 +03:00
31a9909cc3 feat(admin): remove old maps 2025-10-19 14:37:04 +03:00
01368bbfce feat(admin): remove old assets 2025-10-19 14:34:28 +03:00
e7e045b695 feat(filters): add filters for the main page 2025-10-19 13:48:33 +03:00
da1b71fc89 wip: product filters 2025-10-03 22:32:31 +03:00
a051ff545e fix: escape character for start message command 2025-10-03 00:49:53 +03:00
c936d727b4 feat: handle start command for telecart bot 2025-10-03 00:48:52 +03:00
1e2a9bc705 feat: add filters to mainpage 2025-10-03 00:26:13 +03:00
023acee68f feat(bot): add bot commands 2025-09-27 19:01:50 +03:00