From 91078eb6a1637567d9d1967a08a6d20d5be67017 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 20 May 2024 08:31:28 +1000 Subject: [PATCH] Additional props for account/companies table --- app/Models/Account.php | 1 + app/Models/Company.php | 1 + app/PaymentDrivers/AuthorizePaymentDriver.php | 2 +- app/Transformers/CompanyTransformer.php | 1 + ..._19_215103_2024_05_20_einvoice_columns.php | 33 +++++++++++++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php diff --git a/app/Models/Account.php b/app/Models/Account.php index c2b54f25211e..81d262454b79 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -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 diff --git a/app/Models/Company.php b/app/Models/Company.php index 0538ddddf5df..bc2c36f75df4 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -388,6 +388,7 @@ class Company extends BaseModel 'e_invoice_certificate_passphrase' => EncryptedCast::class, 'smtp_username' => 'encrypted', 'smtp_password' => 'encrypted', + 'einvoice' => 'object', ]; protected $with = []; diff --git a/app/PaymentDrivers/AuthorizePaymentDriver.php b/app/PaymentDrivers/AuthorizePaymentDriver.php index bd1ee2274e79..465474a5d595 100644 --- a/app/PaymentDrivers/AuthorizePaymentDriver.php +++ b/app/PaymentDrivers/AuthorizePaymentDriver.php @@ -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'], diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 7c94978d7260..08b117288cc7 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -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(), ]; } diff --git a/database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php b/database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php new file mode 100644 index 000000000000..19f3e0bb1159 --- /dev/null +++ b/database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php @@ -0,0 +1,33 @@ +mediumText('einvoice')->nullable(); + }); + + + Schema::table('accounts', function (Blueprint $table) { + $table->integer('email_quota')->default(20)->nullable(); + }); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +};