last rename

This commit is contained in:
Godfrey M 2025-01-16 12:24:32 -08:00
parent 52bf0faaa5
commit d217c2e295
9 changed files with 11 additions and 11 deletions

View file

@ -1535,7 +1535,7 @@ class Helper
{
if (!$license->reassignable) {
$count = LicenseSeat::where('reassignable_seat', '=', true)
$count = LicenseSeat::where('unreassignable_seat', '=', true)
->where('license_id', '=', $license->id)
->count();
return $count;

View file

@ -119,7 +119,7 @@ class LicenseSeatsController extends Controller
// nothing to update
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
if( $touched && $licenseSeat->reassignable_seat) {
if( $touched && $licenseSeat->unreassignable_seat) {
return response()->json(Helper::formatStandardApiResponse('error', $licenseSeat, trans('admin/licenses/message.checkout.unavailable')));
}
// the logging functions expect only one "target". if both asset and user are present in the request,
@ -140,7 +140,7 @@ class LicenseSeatsController extends Controller
if ($is_checkin) {
$licenseSeat->logCheckin($target, $request->input('note'));
if(!$licenseSeat->license->reassignable){
$licenseSeat->reassignable_seat = true;
$licenseSeat->unreassignable_seat = true;
$licenseSeat->save();
}

View file

@ -96,7 +96,7 @@ class LicenseCheckinController extends Controller
$licenseSeat->asset_id = null;
$licenseSeat->notes = $request->input('notes');
if (! $licenseSeat->license->reassignable) {
$licenseSeat->reassignable_seat = true;
$licenseSeat->unreassignable_seat = true;
$licenseSeat->notes .= "\n" . trans('admin/licenses/message.checkin.not_reassignable') . '.';
}

View file

@ -251,7 +251,7 @@ class LicensesController extends Controller
$total_seats_count = (int) $license->totalSeatsByLicenseID();
$available_seats_count = $license->availCount()->count();
$unreassignable_seats_count = Helper::unReassignableCount($license);
if(!$license->reassignable){
if(!$license->unreassignable_seat){
$checkedout_seats_count = ($total_seats_count - $available_seats_count - $unreassignable_seats_count );
}
else {

View file

@ -49,7 +49,7 @@ class LicenseSeatsTransformer
'reassignable' => (bool) $seat->license->reassignable,
'notes' => e($seat->notes),
'user_can_checkout' => (($seat->assigned_to == '') && ($seat->asset_id == '')),
'disabled' => $seat->reassignable_seat,
'disabled' => $seat->unreassignable_seat,
];
if ($seat_count != 0) {

View file

@ -653,7 +653,7 @@ class License extends Depreciable
{
return $this->licenseseats()
->whereNull('deleted_at')
->where('reassignable_seat', '=', false)
->where('unreassignable_seat', '=', false)
->where(function ($query) {
$query->whereNull('assigned_to')
->whereNull('asset_id');

View file

@ -14,7 +14,7 @@ class LicenseSeatFactory extends Factory
{
return [
'license_id' => License::factory(),
'reassignable_seat' => false,
'unreassignable_seat' => false,
];
}

View file

@ -14,7 +14,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('license_seats', function (Blueprint $table) {
$table->addColumn('boolean', 'reassignable_seat')->default(false)->after('assigned_to');
$table->addColumn('boolean', 'unreassignable_seat')->default(false)->after('assigned_to');
});
}
/**
@ -23,7 +23,7 @@ return new class extends Migration
public function down(): void
{
Schema::table('license_seats', function (Blueprint $table) {
$table->dropColumn('reassignable_seat');
$table->dropColumn('unreassignable_seat');
});
}
};

View file

@ -32,7 +32,7 @@ class LicenseCheckinTest extends TestCase
$licenseSeat->refresh();
$this->assertEquals(1, $licenseSeat->reassignable_seat);
$this->assertEquals(1, $licenseSeat->unreassignable_seat);
}
public function testCannotCheckinLicenseThatIsNotAssigned()