Files
clinicpro/migrations/Version20260730091332.php
T
hamedandClaude Opus 5 6c2e075eea feat(booking): persist service duration and allow full service replacement
Appointment gains:
  - replaceServiceItems(): full replacement that unconditionally syncs the
    legacy single serviceItem column. addServiceItem() only fills it when null,
    which would leave stale service names in the four consumers that read
    service_item (admin lists, public site, desktop app).
  - currentServiceUuids(): input-order uuids, falling back to the single column
    for appointments created before multi-service support.
  - service_total_minutes / service_buffer_minutes (both nullable, NULL in slot
    mode). slot_end - slot_start carries the number but cannot say whether it
    was intentional, and a reserve entry has slot_start == slot_end so its
    duration had nowhere to live.

Existing columns untouched: slot_start, slot_end, active_slot_key, is_reserve
verified unchanged via SHOW COLUMNS.

Task: docs/new_feture/taskes/task-00-service-mode-completion/
Slot-mode contract: unchanged (--group=slot-mode-frozen green)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 12:47:48 +03:30

36 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* حالت نوبت‌دهی سرویسی: مدت و بافرِ محاسبه‌شده در لحظهٔ ثبت را روی خودِ نوبت نگه می‌دارد.
*
* هر دو ستون تهی‌پذیرند و در حالت اسلاتی NULL می‌مانند؛ هیچ ستون موجودی حذف نمی‌شود،
* نوعش عوض نمی‌شود و معنایش تغییر نمی‌کند. `slot_start`/`slot_end`/`active_slot_key`
* دست‌نخورده‌اند (خط سرخ فاز موتور چندمنبعی).
*
* @see docs/new_feture/taskes/task-00-service-mode-completion/database.md
*/
final class Version20260730091332 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add service_total_minutes and service_buffer_minutes to appointments (service booking mode)';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE appointments ADD service_total_minutes SMALLINT DEFAULT NULL, ADD service_buffer_minutes SMALLINT DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE appointments DROP service_total_minutes, DROP service_buffer_minutes');
}
}