Commit Graph

2 Commits

Author SHA1 Message Date
3ef2a19537 Исправлена логика продажи витринных комплектов через POS
- Добавлена специальная обработка витринных комплектов в сигнале update_reservation_on_item_change:
  * При создании OrderItem с витринным комплектом привязываются существующие витринные резервы компонентов
  * Не создаются новые резервы на уровне комплекта

- Исправлена логика создания Sale для комплектов в сигнале create_sale_on_order_completion:
  * Для комплектов (витринных и обычных) создаются Sale для каждого компонента через резервы
  * Используется FIFO-списание для компонентов
  * Предотвращена ошибка передачи ProductKit в поле Reservation.product

Fixes: Cannot assign ProductKit to Reservation.product field
Fixes: Не удалось создать Sale для заказа с витринным комплектом
2025-12-08 17:56:47 +03:00
fb4bcf37ec feat: implement password setup link for tenant registration
When admin approves tenant registration:
- Owner account created in tenant schema (in addition to admin@localhost)
- Owner assigned 'owner' role with full permissions
- Password setup email sent with secure 7-day token link
- Owner sets password via link and auto-logs into their shop

Key changes:
- Added password_setup_token fields to TenantRegistration model
- Created tenants/services.py with formatted email service
- Modified _approve_registration to create owner account
- Added password_setup_confirm view with token validation
- Created password setup template and URL route
- Added admin action to resend password setup emails

Security:
- Token expires after 7 days
- Password not transmitted in email (secure setup link)
- Owner account inactive until password set
- Admin@localhost preserved for system administrator access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:08:18 +03:00