mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Finished implementing add additional company to account
This commit is contained in:
parent
07b4b81117
commit
65afb4242b
@ -22,8 +22,10 @@ use App\Http\Requests\SignupRequest;
|
||||
use App\Jobs\Company\CreateCompany;
|
||||
use App\Jobs\Company\CreateCompanyToken;
|
||||
use App\Jobs\RegisterNewAccount;
|
||||
use App\Models\Account;
|
||||
use App\Models\Company;
|
||||
use App\Repositories\CompanyRepository;
|
||||
use App\Transformers\AccountTransformer;
|
||||
use App\Transformers\CompanyTransformer;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
@ -118,7 +120,11 @@ class CompanyController extends BaseController
|
||||
*/
|
||||
$company_token = CreateCompanyToken::dispatchNow($company, auth()->user());
|
||||
|
||||
return $this->itemResponse($company);
|
||||
//todo Need to discuss this with Hillel which is the best representation to return
|
||||
//when a company is created. Do we send the entire account? Do we only send back the created CompanyUser?
|
||||
$this->entity_transformer = AccountTransformer::class;
|
||||
$this->entity_type = Account::class;
|
||||
return $this->itemResponse($company->account);
|
||||
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ class CreateCompany
|
||||
{
|
||||
|
||||
$company = new Company();
|
||||
$company->name = isset($this->request['name']) ?: $this->request['first_name'] . ' ' . $this->request['last_name'];
|
||||
$company->name = isset($this->request['name']) ? $this->request['name'] : $this->request['first_name'] . ' ' . $this->request['last_name'];
|
||||
$company->account_id = $this->account->id;
|
||||
$company->company_key = $this->createHash();
|
||||
$company->ip = request()->ip();
|
||||
|
@ -116,7 +116,7 @@ class CreateUsersTable extends Migration
|
||||
$table->string('utm_term')->nullable();
|
||||
$table->string('utm_content')->nullable();
|
||||
|
||||
$table->float('discount');
|
||||
$table->float('discount')->default(0);
|
||||
$table->date('discount_expires')->nullable();
|
||||
|
||||
$table->enum('bluevine_status', ['ignored', 'signed_up'])->nullable();
|
||||
|
Loading…
x
Reference in New Issue
Block a user