refactor(validity-time): remove 'active' field from ValidityTime model and related migrations/tests

This commit is contained in:
2026-08-06 16:09:11 -03:00
parent b224dd8650
commit 7561ba756c
5 changed files with 0 additions and 7 deletions

View File

@@ -18,7 +18,6 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
'end_time', 'end_time',
'fixed_starts_at', 'fixed_starts_at',
'fixed_expires_at', 'fixed_expires_at',
'active',
])] ])]
class ValidityTime extends Model class ValidityTime extends Model
{ {
@@ -30,7 +29,6 @@ class ValidityTime extends Model
'type' => ValidityTimeType::class, 'type' => ValidityTimeType::class,
'fixed_starts_at' => 'datetime', 'fixed_starts_at' => 'datetime',
'fixed_expires_at' => 'datetime', 'fixed_expires_at' => 'datetime',
'active' => 'boolean',
]; ];
} }

View File

@@ -15,7 +15,6 @@ return new class extends Migration
$table->time('end_time')->nullable(); $table->time('end_time')->nullable();
$table->dateTime('fixed_starts_at')->nullable(); $table->dateTime('fixed_starts_at')->nullable();
$table->dateTime('fixed_expires_at')->nullable(); $table->dateTime('fixed_expires_at')->nullable();
$table->boolean('active')->default(true);
$table->timestamps(); $table->timestamps();
}); });
} }

View File

@@ -70,7 +70,6 @@ return new class extends Migration
'end_time' => null, 'end_time' => null,
'fixed_starts_at' => $startsAt, 'fixed_starts_at' => $startsAt,
'fixed_expires_at' => $expiresAt, 'fixed_expires_at' => $expiresAt,
'active' => true,
'created_at' => now(), 'created_at' => now(),
'updated_at' => now(), 'updated_at' => now(),
]); ]);

View File

@@ -19,7 +19,6 @@ class TicketValiditySchemaTest extends TestCase
'end_time', 'end_time',
'fixed_starts_at', 'fixed_starts_at',
'fixed_expires_at', 'fixed_expires_at',
'active',
'created_at', 'created_at',
'updated_at', 'updated_at',
], Schema::getColumnListing('validity_times')); ], Schema::getColumnListing('validity_times'));

View File

@@ -19,13 +19,11 @@ class ValidityTimeTest extends TestCase
'type' => ValidityTimeType::FixedWindow->value, 'type' => ValidityTimeType::FixedWindow->value,
'fixed_starts_at' => '2026-08-20 10:00:00', 'fixed_starts_at' => '2026-08-20 10:00:00',
'fixed_expires_at' => '2026-08-21 02:00:00', 'fixed_expires_at' => '2026-08-21 02:00:00',
'active' => '1',
]); ]);
$this->assertSame(ValidityTimeType::FixedWindow, $validityTime->type); $this->assertSame(ValidityTimeType::FixedWindow, $validityTime->type);
$this->assertInstanceOf(Carbon::class, $validityTime->fixed_starts_at); $this->assertInstanceOf(Carbon::class, $validityTime->fixed_starts_at);
$this->assertInstanceOf(Carbon::class, $validityTime->fixed_expires_at); $this->assertInstanceOf(Carbon::class, $validityTime->fixed_expires_at);
$this->assertTrue($validityTime->active);
$this->assertInstanceOf(CatalogItem::class, $validityTime->catalogItems()->getRelated()); $this->assertInstanceOf(CatalogItem::class, $validityTime->catalogItems()->getRelated());
$this->assertInstanceOf(AttributeOption::class, $validityTime->attributeOptions()->getRelated()); $this->assertInstanceOf(AttributeOption::class, $validityTime->attributeOptions()->getRelated());
$this->assertInstanceOf(Ticket::class, $validityTime->tickets()->getRelated()); $this->assertInstanceOf(Ticket::class, $validityTime->tickets()->getRelated());