<?php

namespace Hubleto\App\Community\Customers\Models;

use Hubleto\App\Community\Customers\Models\Migrations\CustomerActivity_26_02_2026_0001;
use Hubleto\Framework\Db\Column\Lookup;
use Hubleto\App\Community\Contacts\Models\Contact;

class CustomerActivity extends \Hubleto\App\Community\Calendar\Models\Activity
{
  public string $table = 'customer_activities';
  public string $recordManagerClass = RecordManagers\CustomerActivity::class;

  public array $relations = [
    'CUSTOMER' => [ self::BELONGS_TO, Customer::class, 'id_customer', 'id' ],
    'CONTACT' => [ self::BELONGS_TO, Contact::class, 'id_contact', 'id' ],
  ];

  public function describeColumns(): array
  {
    return array_merge(parent::describeColumns(), [
      'id_customer' => (new Lookup($this, $this->translate('Customer'), Customer::class))->setRequired()->setIcon(self::COLUMN_ID_CUSTOMER_DEFAULT_ICON),
      'id_contact' => (new Lookup($this, $this->translate('Contact'), Contact::class))->setIcon(self::COLUMN_CONTACT_DEFAULT_ICON),
    ]);
  }

}
