Commit Graph

271 Commits

Author SHA1 Message Date
bc50cf0648 fix: handle missing tags in workflow 2025-12-04 22:09:23 +03:00
f1a39eeb00 feat: expose module version 2025-12-04 22:07:41 +03:00
44d2af3b30 fix: settings numeric error 2025-12-04 14:46:30 +03:00
ad54b14c68 fix: admin mainpage builder drawer doesnot show 2025-12-04 14:08:55 +03:00
3423dd1727 fix(spa): remove html in price for some opencart custom themes 2025-12-04 14:01:16 +03:00
d6a43605ac fix(spa): remove html in price for some opencart custom themes 2025-12-04 13:00:56 +03:00
17865d8af4 feat(admin): add more details for admin errors 2025-12-04 11:25:02 +03:00
8f6af04e73 fix(admin): fix error when chat_id is string 2025-12-04 11:23:00 +03:00
418a2fc5bb chore: update module version 2025-12-03 23:12:47 +03:00
b60c77e453 feat: Add TeleCart Pulse heartbeat telemetry 2025-12-03 23:11:58 +03:00
772efce242 Fix frontend tests and linting errors 2025-12-03 01:34:12 +03:00
50bdb8601c feat: visualize swipe back 2025-12-03 01:30:21 +03:00
0ab09aad10 fix: switch between code and visual for custom forms 2025-12-02 20:03:43 +03:00
dd12cb8c34 feat: separated coupon and voucher errors 2025-12-02 18:26:59 +03:00
fdcfce0a79 feat: add reactivity to formkit 2025-12-02 18:22:27 +03:00
b1d072b35a docs: update .cursor 2025-12-02 00:33:24 +03:00
17972993ca feat: добавлен жест swipe back для навигации назад
- Добавлен композабл useSwipeBack для обработки жеста свайпа от левого края
- Жест активируется при движении от левого края экрана (в пределах 20px)
- Навигация назад выполняется при достижении порога 40px
- Добавлена тактильная обратная связь при достижении порога
- Работает только не на главной странице, как и кнопка назад
- Игнорирует интерактивные элементы (input, button, swiper и т.д.)
2025-12-01 22:55:29 +03:00
db8d1360fc feat(search): add keyboard hide button and auto-hide Dock
- Add floating keyboard hide button that appears on search input focus
- Create KeyboardStore to manage keyboard state globally
- Auto-hide Dock component when keyboard is open on search page
- Position keyboard hide button at bottom when Dock is hidden
- Update keyboard state on focus, blur, and hide actions
2025-12-01 22:37:30 +03:00
17ff888c05 feat: add hide keyboard button on search page 2025-12-01 22:20:10 +03:00
64ead29583 feat(search): improve search UI with sticky bar and keyboard handling
- Add fixed search bar with glassmorphism effect (backdrop blur, semi-transparent)
- Implement clear search button in DaisyUI style
- Auto-hide keyboard on Enter key press and scroll events
- Remove search page title for cleaner UI
- Use DaisyUI theme-aware background colors instead of fixed white
- Add fixed padding offset for content below search bar
2025-12-01 21:55:16 +03:00
cedc49f0d5 feat: Use yaMetrika number in settings 2025-12-01 19:44:14 +03:00
c670e38392 reformat: fix codestyle 2025-12-01 18:18:29 +03:00
f02ef42cb7 refactor: use phpstan stubs instead of opencart sources 2025-12-01 18:17:32 +03:00
5fe4aac7eb refactor: correct static analyze errors 2025-12-01 18:04:54 +03:00
27c99d9966 reformat: correct codestyle 2025-12-01 17:37:30 +03:00
9f34315adb tests: fix order tests 2025-12-01 17:36:34 +03:00
3716e89811 feat: set environment variables 2025-12-01 17:28:49 +03:00
3b2e2cb656 fix: Fix errors and small improvements 2025-12-01 17:24:14 +03:00
49b0201b5f Improve TeleCart Pulse ETL, time handling and customer tracking
- Ensure Pulse store always prefers tracking_id from backend response when saving Telegram customer data.
- Route storeOrder calls through shared ftch helper instead of manual fetch.
- Remove legacy catalog controller extension/tgshop/handle and obsolete telecart_cache migration and setting mapping for Yandex Metrika.
- Update migrations framework to rely on Carbon, sort migration files deterministically and store executed_at as a Carbon timestamp without DEFAULT CURRENT_TIMESTAMP.
- Introduce DateUtils helper to convert timestamps between UTC and system time zone and use it in ETLHandler responses.
- Make TeleCartPulse PayloadSigner and TeleCartPulseService accept nullable secrets/API keys but fail fast when secret is missing.
- Normalize ETL customer payload shape and convert all date fields to UTC JSON timestamps.
- Default created order customer_id to 0 when no OpenCart customer id is available.
2025-12-01 16:11:40 +03:00
ef785654b9 feat: track and push TeleCart Pulse events 2025-11-30 16:52:32 +03:00
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
2743b83a2c feat: send xdebug trigger from frontend 2025-11-30 11:54:24 +03:00
51f462922e feat: provide current opencart timezone to App 2025-11-30 11:54:24 +03:00
eabc66246c build: change xdebug trigger 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
984d4d7ac3 build: fix php obfustation 2025-11-18 16:52:33 +03:00
07b7289fdc build: use node instead of bun 2025-11-18 15:51:05 +03:00
3d078900a1 build: implement php obfustation 2025-11-18 15:40:21 +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
770ec81fdc feat: disable source maps for frontend production builds 2025-11-16 20:48:00 +03:00
09f1e514a9 feat: UI/UX, add reset cache to admin 2025-11-16 20:34:03 +03:00
6ac6a42e21 feat: design update, show avatar in navbar 2025-11-16 13:31:25 +03:00