<?php

namespace App\Domains\Admin\Controllers;

use App\Scopes\CommonController;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class TenantContactUpdateController extends CommonController
{
    public function __invoke(Request $request): JsonResponse
    {
        $this->tenant->update([
            'email' => $request->input('email'),
            'email_finance' => $request->input('email_finance'),
            'postcode' => $request->input('postcode'),
            'city' => $request->input('city'),
        ]);

        return response()->json([
            'status' => 'success',
            'message' => 'Kontaktdaten wurden gespeichert.',
        ]);
    }
}
