<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_auth_records', function (Blueprint $table) {
            $table->comment('店铺认证记录');
            $table->increments('id');
            $table->unsignedBigInteger('shop_id')->comment('店铺编号');
            $table->string('shop_name')->default('')->comment('店铺名称');
            $table->text('shop_desc')->nullable()->comment('店铺描述');
            $table->string('shop_address')->default('')->comment('店铺地址');
            $table->string('contact_phone')->default('')->comment('店铺联系电话');
            $table->string('contact_name')->default('')->comment('店铺联系人');
            $table->string('contact_id_card')->default('')->comment('店铺联系人身份证');
            $table->string('id_card_front_photo')->default('')->comment('店铺联系人身份证正面');
            $table->string('id_card_back_photo')->default('')->comment('店铺联系人身份证反面');
            $table->string('business_license')->default('')->comment('店铺营业执照');
            $table->string('license_front_photo')->default('')->comment('店铺营业执照正面');
            $table->string('license_back_photo')->default('')->comment('店铺营业执照反面');
            $table->string('storefront_photo')->default('')->comment('店铺门头照');
            $table->string('storefront_front_photo')->default('')->comment('店铺门头照正面');
            $table->string('storefront_back_photo')->default('')->comment('店铺门头照反面');
            $table->decimal('longitude')->comment('店铺经营地址经度');
            $table->decimal('latitude')->comment('店铺经营地址纬度');
            $table->decimal('operating_area')->comment('店铺经营面积');
            $table->integer('operating_years')->comment('店铺经营年限');
            $table->integer('technician_count')->comment('店铺技师人数');
            $table->json('business_hours')->nullable()->comment('店铺营业时间');
            $table->decimal('rating')->nullable()->comment('评分');
            $table->string('auditor')->nullable()->comment('审核人');
            $table->timestamp('audit_time')->nullable()->comment('审核时间');
            $table->string('audit_remark')->nullable()->comment('审核回馈');
            $table->string('state')->default('PENDING')->comment('审核状态');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_auth_records');
    }
};
