<?php

namespace App\Domains\UserManagement\Actions\UserActivation;

class UserDeactivationCommand {
    private UserDeactivationRequest $request;
    public function __construct(UserDeactivationRequest $request) {
        $this->request = $request;
    }

    public function execute() : UserDeactivationResponse {
        $response = new UserDeactivationResponse();
        $this->request->user->active = false;
        $this->request->user->password = NULL;
        $this->request->user->username = 'deleted-' . $this->request->user->username;
        $this->request->user->email = 'null@example.com';
        $this->request->user->save();
        $response->success = true;
        return $response;
    }
}
