feat: 출퇴근 설정에 자동 출퇴근 사용 여부 필드 추가

- attendance_settings 테이블에 use_auto 컬럼 추가
- AttendanceSetting 모델에 use_auto 필드 추가 (fillable, casts, attributes)
- UpdateAttendanceSettingRequest에 use_auto 유효성 검사 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
유병철
2026-01-27 14:47:39 +09:00
parent 22f7e9d94a
commit 4c22b74b27
3 changed files with 33 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ public function rules(): array
{ {
return [ return [
'use_gps' => ['sometimes', 'boolean'], 'use_gps' => ['sometimes', 'boolean'],
'use_auto' => ['sometimes', 'boolean'],
'allowed_radius' => ['sometimes', 'integer', 'min:10', 'max:10000'], 'allowed_radius' => ['sometimes', 'integer', 'min:10', 'max:10000'],
'hq_address' => ['nullable', 'string', 'max:255'], 'hq_address' => ['nullable', 'string', 'max:255'],
'hq_latitude' => ['nullable', 'numeric', 'between:-90,90'], 'hq_latitude' => ['nullable', 'numeric', 'between:-90,90'],

View File

@@ -11,6 +11,7 @@
* @property int $id * @property int $id
* @property int $tenant_id * @property int $tenant_id
* @property bool $use_gps * @property bool $use_gps
* @property bool $use_auto
* @property int $allowed_radius * @property int $allowed_radius
* @property string|null $hq_address * @property string|null $hq_address
* @property float|null $hq_latitude * @property float|null $hq_latitude
@@ -25,6 +26,7 @@ class AttendanceSetting extends Model
protected $fillable = [ protected $fillable = [
'tenant_id', 'tenant_id',
'use_gps', 'use_gps',
'use_auto',
'allowed_radius', 'allowed_radius',
'hq_address', 'hq_address',
'hq_latitude', 'hq_latitude',
@@ -33,6 +35,7 @@ class AttendanceSetting extends Model
protected $casts = [ protected $casts = [
'use_gps' => 'boolean', 'use_gps' => 'boolean',
'use_auto' => 'boolean',
'allowed_radius' => 'integer', 'allowed_radius' => 'integer',
'hq_latitude' => 'decimal:8', 'hq_latitude' => 'decimal:8',
'hq_longitude' => 'decimal:8', 'hq_longitude' => 'decimal:8',
@@ -40,6 +43,7 @@ class AttendanceSetting extends Model
protected $attributes = [ protected $attributes = [
'use_gps' => false, 'use_gps' => false,
'use_auto' => false,
'allowed_radius' => 100, 'allowed_radius' => 100,
]; ];

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('attendance_settings', function (Blueprint $table) {
$table->boolean('use_auto')->default(false)->after('use_gps')->comment('자동 출퇴근 사용 여부');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('attendance_settings', function (Blueprint $table) {
$table->dropColumn('use_auto');
});
}
};