Additional props for account/companies table

This commit is contained in:
David Bomba 2024-05-20 08:31:28 +10:00
parent e8907beeab
commit 91078eb6a1
5 changed files with 37 additions and 1 deletions

View File

@ -31,6 +31,7 @@ use Laracasts\Presenter\PresentableTrait;
* App\Models\Account
*
* @property int $id
* @property int $email_quota
* @property string|null $plan
* @property string|null $plan_term
* @property string|null $plan_started

View File

@ -388,6 +388,7 @@ class Company extends BaseModel
'e_invoice_certificate_passphrase' => EncryptedCast::class,
'smtp_username' => 'encrypted',
'smtp_password' => 'encrypted',
'einvoice' => 'object',
];
protected $with = [];

View File

@ -67,7 +67,7 @@ class AuthorizePaymentDriver extends BaseDriver
public function getClientRequiredFields(): array
{
$data = [
['name' => 'client_name', 'label' => ctrans('texts.name'), 'type' => 'text', 'validation' => 'required|min:2'],
// ['name' => 'client_name', 'label' => ctrans('texts.name'), 'type' => 'text', 'validation' => 'required|min:2'],
['name' => 'client_phone', 'label' => ctrans('texts.phone'), 'type' => 'text', 'validation' => 'required'],
['name' => 'contact_email', 'label' => ctrans('texts.email'), 'type' => 'text', 'validation' => 'required|email:rfc'],
['name' => 'client_address_line_1', 'label' => ctrans('texts.address1'), 'type' => 'text', 'validation' => 'required'],

View File

@ -211,6 +211,7 @@ class CompanyTransformer extends EntityTransformer
'smtp_password' => $company->smtp_password ? '********' : '',
'smtp_local_domain' => (string)$company->smtp_local_domain ?? '',
'smtp_verify_peer' => (bool)$company->smtp_verify_peer,
'einvoice' => $company->einvoice ?: new \stdClass(),
];
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('companies', function (Blueprint $table) {
$table->mediumText('einvoice')->nullable();
});
Schema::table('accounts', function (Blueprint $table) {
$table->integer('email_quota')->default(20)->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};