Files
interview-demo-code/Makefile
Nikita Kiselev 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

72 lines
2.3 KiB
Makefile

.PHONY: build
fresh:
$(MAKE) stop && \
rm -rf ./src && \
./scripts/download_oc_store.sh && \
./scripts/install_ocstore.sh && \
$(MAKE) start
setup:
$(MAKE) stop && \
rm -rf ./src && \
./scripts/download_oc_store.sh && \
./scripts/install_ocstore.sh && \
$(MAKE) start && \
$(MAKE) link
stop:
docker compose down
start:
docker compose up -d
restart:
docker compose down && docker compose up -d
ssh:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash
link:
docker compose exec web bash -c "php ./scripts/link.php"
dev:
rm -rf module/oc_telegram_shop/upload/system/library/oc_telegram_shop && \
$(MAKE) link && \
cd frontend/spa && npm run dev
dev-admin:
rm -rf module/oc_telegram_shop/upload/admin/view/javascript && \
rm -rf module/oc_telegram_shop/upload/system/library/oc_telegram_shop && \
rm -rf src/upload/admin/view/javascript/telecart && \
$(MAKE) link && \
cd frontend/admin && npm run dev
cd frontend/spa && npm run dev
lint:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpstan analyse src framework"
phpcs:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpcs --standard=PSR12 bastion framework src"
phpcbf:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpcbf --standard=PSR12 bastion framework src"
test:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpunit --testdox tests/"
test-integration:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpunit --testdox tests/Integration"
test-unit:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpunit --testdox tests/Unit"
test-telegram:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpunit --testdox tests/Telegram"
test-coverage:
docker compose exec -w /module/oc_telegram_shop/upload/oc_telegram_shop web bash -c "./vendor/bin/phpunit --coverage-html coverage tests/"
phar:
docker build -t telecart_local_build -f ./docker/build.dockerfile . && \
docker run -v "./src/upload/system/library/oc_telegram_shop:/build" telecart_local_build sh -c 'sh /scripts/build_phar.sh'