<?php

namespace App\Classes\Modules\Accounts\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Accounts\DataTransferObjects\UserSocialAccountObject;
use App\Models\UserSocialAccount;

class CreatesUserSocialAccount extends AbstractUpdateRecord
{
    /**
     * @param UserSocialAccountObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(UserSocialAccountObject $object) {
        $model = new UserSocialAccount();
        $model->user_id = $object->getUser()->id;
        $model->app_id = $object->getAppId();
        $model->platform = $object->getPlatform();
        return $this->handler($model);

    }
}