Files
sam-api/database/migrations/2025_12_17_110002_create_sites_table.php
hskwon ca5618be98 feat: 근무/출퇴근 설정 및 현장 관리 API 구현
- 근무 설정 API (GET/PUT /settings/work)
  - 근무유형, 소정근로시간, 연장근로시간, 근무요일, 출퇴근시간, 휴게시간
- 출퇴근 설정 API (GET/PUT /settings/attendance)
  - GPS 출퇴근, 허용 반경, 본사 위치 설정
- 현장 관리 API (CRUD /sites)
  - 현장 등록/수정/삭제, 활성화된 현장 목록(셀렉트박스용)
  - GPS 좌표 기반 위치 관리

마이그레이션: work_settings, attendance_settings, sites 테이블
모델: WorkSetting, AttendanceSetting, Site (BelongsToTenant, SoftDeletes)
서비스: WorkSettingService, SiteService
Swagger 문서 및 i18n 메시지 키 추가
2025-12-17 20:46:37 +09:00

41 lines
1.3 KiB
PHP

<?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::create('sites', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->comment('테넌트 ID');
$table->string('name', 100)->comment('현장명');
$table->string('address', 255)->nullable()->comment('현장 주소');
$table->decimal('latitude', 10, 8)->nullable()->comment('위도');
$table->decimal('longitude', 11, 8)->nullable()->comment('경도');
$table->boolean('is_active')->default(true)->comment('활성화 여부');
$table->foreignId('created_by')->nullable()->comment('생성자');
$table->foreignId('updated_by')->nullable()->comment('수정자');
$table->foreignId('deleted_by')->nullable()->comment('삭제자');
$table->softDeletes();
$table->timestamps();
$table->index('tenant_id');
$table->index('is_active');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sites');
}
};