mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for transformerS (#3388)
This commit is contained in:
parent
200b26d809
commit
c15f17186d
@ -13,12 +13,10 @@ namespace App\Models;
|
|||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
use Laracasts\Presenter\PresentableTrait;
|
use Laracasts\Presenter\PresentableTrait;
|
||||||
|
|
||||||
class Account extends BaseModel
|
class Account extends BaseModel
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
|
||||||
use PresentableTrait;
|
use PresentableTrait;
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
|
||||||
|
@ -12,9 +12,12 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
class CompanyToken extends Model
|
class CompanyToken extends Model
|
||||||
{
|
{
|
||||||
|
use SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
|
@ -12,9 +12,12 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
class Document extends BaseModel
|
class Document extends BaseModel
|
||||||
{
|
{
|
||||||
|
use SoftDeletes;
|
||||||
|
|
||||||
const DOCUMENT_PREVIEW_SIZE = 300; // pixels
|
const DOCUMENT_PREVIEW_SIZE = 300; // pixels
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,6 +24,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class GroupSetting extends StaticModel
|
class GroupSetting extends StaticModel
|
||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
use SoftDeletes;
|
||||||
|
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ class AccountTransformer extends EntityTransformer
|
|||||||
'id' => (string)$this->encodePrimaryKey($account->id),
|
'id' => (string)$this->encodePrimaryKey($account->id),
|
||||||
'default_url' => config('ninja.site_url'),
|
'default_url' => config('ninja.site_url'),
|
||||||
'plan' => $account->getPlan(),
|
'plan' => $account->getPlan(),
|
||||||
|
'updated_at' => (int)$account->updated_at,
|
||||||
|
'archived_at' => (int)$account->deleted_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ class ActivityTransformer extends EntityTransformer
|
|||||||
'payment_id' => $activity->payment_id ? (string) $this->encodePrimaryKey($activity->payment_id) : '',
|
'payment_id' => $activity->payment_id ? (string) $this->encodePrimaryKey($activity->payment_id) : '',
|
||||||
'credit_id' => $activity->credit_id ? (string) $this->encodePrimaryKey($activity->credit_id) : '',
|
'credit_id' => $activity->credit_id ? (string) $this->encodePrimaryKey($activity->credit_id) : '',
|
||||||
'updated_at' => (int)$activity->updated_at,
|
'updated_at' => (int)$activity->updated_at,
|
||||||
|
'created_at' => (int)$activity->created_at,
|
||||||
'expense_id' => $activity->expense_id ? (string) $this->encodePrimaryKey($activity->expense_id) : '',
|
'expense_id' => $activity->expense_id ? (string) $this->encodePrimaryKey($activity->expense_id) : '',
|
||||||
'is_system' => (bool) $activity->is_system,
|
'is_system' => (bool) $activity->is_system,
|
||||||
'contact_id' => $activity->contact_id ? (string) $this->encodePrimaryKey($activity->contact_id) : '',
|
'contact_id' => $activity->contact_id ? (string) $this->encodePrimaryKey($activity->contact_id) : '',
|
||||||
|
@ -33,6 +33,7 @@ class ClientContactLoginTransformer extends EntityTransformer
|
|||||||
'first_name' => $contact->first_name ?: '',
|
'first_name' => $contact->first_name ?: '',
|
||||||
'last_name' => $contact->last_name ?: '',
|
'last_name' => $contact->last_name ?: '',
|
||||||
'email' => $contact->email ?: '',
|
'email' => $contact->email ?: '',
|
||||||
|
'created_at' => (int)$contact->created_at,
|
||||||
'updated_at' => (int)$contact->updated_at,
|
'updated_at' => (int)$contact->updated_at,
|
||||||
'archived_at' => (int)$contact->deleted_at,
|
'archived_at' => (int)$contact->deleted_at,
|
||||||
'is_primary' => (bool) $contact->is_primary,
|
'is_primary' => (bool) $contact->is_primary,
|
||||||
|
@ -34,6 +34,7 @@ class ClientContactTransformer extends EntityTransformer
|
|||||||
'first_name' => $contact->first_name ?: '',
|
'first_name' => $contact->first_name ?: '',
|
||||||
'last_name' => $contact->last_name ?: '',
|
'last_name' => $contact->last_name ?: '',
|
||||||
'email' => $contact->email ?: '',
|
'email' => $contact->email ?: '',
|
||||||
|
'created_at' => (int)$contact->created_at,
|
||||||
'updated_at' => (int)$contact->updated_at,
|
'updated_at' => (int)$contact->updated_at,
|
||||||
'archived_at' => (int)$contact->deleted_at,
|
'archived_at' => (int)$contact->deleted_at,
|
||||||
'is_primary' => (bool) $contact->is_primary,
|
'is_primary' => (bool) $contact->is_primary,
|
||||||
|
@ -36,6 +36,7 @@ class ClientGatewayTokenTransformer extends EntityTransformer
|
|||||||
'gateway_type_id' => (string)$cgt->gateway_type_id ?: '',
|
'gateway_type_id' => (string)$cgt->gateway_type_id ?: '',
|
||||||
'company_gateway_id' => (string)$this->encodePrimaryKey($cgt->company_gateway_id) ?: '',
|
'company_gateway_id' => (string)$this->encodePrimaryKey($cgt->company_gateway_id) ?: '',
|
||||||
'is_default' => (bool) $cgt->is_default,
|
'is_default' => (bool) $cgt->is_default,
|
||||||
|
'created_at' => (int)$cgt->created_at,
|
||||||
'updated_at' => (int)$cgt->updated_at,
|
'updated_at' => (int)$cgt->updated_at,
|
||||||
'archived_at' => (int)$cgt->deleted_at,
|
'archived_at' => (int)$cgt->deleted_at,
|
||||||
];
|
];
|
||||||
|
@ -115,6 +115,7 @@ class ClientTransformer extends EntityTransformer
|
|||||||
'id_number' => $client->id_number ?: '',
|
'id_number' => $client->id_number ?: '',
|
||||||
'updated_at' => (int)$client->updated_at,
|
'updated_at' => (int)$client->updated_at,
|
||||||
'archived_at' => (int)$client->deleted_at,
|
'archived_at' => (int)$client->deleted_at,
|
||||||
|
'created_at' => (int)$client->created_at,
|
||||||
'display_name' => $client->present()->name()
|
'display_name' => $client->present()->name()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ namespace App\Transformers;
|
|||||||
use App\Models\CompanyGateway;
|
use App\Models\CompanyGateway;
|
||||||
use App\Transformers\GatewayTransformer;
|
use App\Transformers\GatewayTransformer;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CompanyGatewayTransformer.
|
* Class CompanyGatewayTransformer.
|
||||||
@ -21,7 +22,7 @@ use App\Utils\Traits\MakesHash;
|
|||||||
class CompanyGatewayTransformer extends EntityTransformer
|
class CompanyGatewayTransformer extends EntityTransformer
|
||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
use SoftDeletes;
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
@ -55,6 +56,8 @@ class CompanyGatewayTransformer extends EntityTransformer
|
|||||||
'fees_and_limits' => $company_gateway->fees_and_limits ?: '',
|
'fees_and_limits' => $company_gateway->fees_and_limits ?: '',
|
||||||
'updated_at' => (int)$company_gateway->updated_at,
|
'updated_at' => (int)$company_gateway->updated_at,
|
||||||
'archived_at' => (int)$company_gateway->deleted_at,
|
'archived_at' => (int)$company_gateway->deleted_at,
|
||||||
|
'created_at' => (int)$company_gateway->created_at,
|
||||||
|
'is_deleted' => (bool)$company_gateway->is_deleted,
|
||||||
'custom_value1' => $company_gateway->custom_value1 ?: '',
|
'custom_value1' => $company_gateway->custom_value1 ?: '',
|
||||||
'custom_value2' => $company_gateway->custom_value2 ?: '',
|
'custom_value2' => $company_gateway->custom_value2 ?: '',
|
||||||
'custom_value3' => $company_gateway->custom_value3 ?: '',
|
'custom_value3' => $company_gateway->custom_value3 ?: '',
|
||||||
|
@ -44,6 +44,9 @@ class CompanyTokenTransformer extends EntityTransformer
|
|||||||
return [
|
return [
|
||||||
'token' => $company_token->token,
|
'token' => $company_token->token,
|
||||||
'name' => $company_token->name ?: '',
|
'name' => $company_token->name ?: '',
|
||||||
|
'updated_at' => (int)$company_token->updated_at,
|
||||||
|
'archived_at' => (int)$company_token->deleted_at,
|
||||||
|
'created_at' => (int)$company_token->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,7 @@ class CompanyTransformer extends EntityTransformer
|
|||||||
'enabled_tax_rates' => (int)$company->enabled_tax_rates,
|
'enabled_tax_rates' => (int)$company->enabled_tax_rates,
|
||||||
'updated_at' => (int)$company->updated_at,
|
'updated_at' => (int)$company->updated_at,
|
||||||
'archived_at' => (int)$company->deleted_at,
|
'archived_at' => (int)$company->deleted_at,
|
||||||
|
'created_at' =>(int)$company->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ class CompanyUserTransformer extends EntityTransformer
|
|||||||
'is_locked' => (bool) $company_user->is_locked,
|
'is_locked' => (bool) $company_user->is_locked,
|
||||||
'updated_at' => (int)$company_user->updated_at,
|
'updated_at' => (int)$company_user->updated_at,
|
||||||
'archived_at' => (int)$company_user->deleted_at,
|
'archived_at' => (int)$company_user->deleted_at,
|
||||||
|
'created_at' => (int)$company_user->created_at,
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ class CreditInvitationTransformer extends EntityTransformer {
|
|||||||
'opened_date' => $invitation->opened_date ?:'',
|
'opened_date' => $invitation->opened_date ?:'',
|
||||||
'updated_at' => (int) $invitation->updated_at,
|
'updated_at' => (int) $invitation->updated_at,
|
||||||
'archived_at' => (int) $invitation->deleted_at,
|
'archived_at' => (int) $invitation->deleted_at,
|
||||||
|
'created_at' => (int) $invitation->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ class CreditTransformer extends EntityTransformer
|
|||||||
'invoice_id' => (string) ($credit->invoice_id ?: 1),
|
'invoice_id' => (string) ($credit->invoice_id ?: 1),
|
||||||
'updated_at' => (int)$credit->updated_at,
|
'updated_at' => (int)$credit->updated_at,
|
||||||
'archived_at' => (int)$credit->deleted_at,
|
'archived_at' => (int)$credit->deleted_at,
|
||||||
|
'created_at' => (int)$credit->created_at,
|
||||||
'number' => $credit->number ?: '',
|
'number' => $credit->number ?: '',
|
||||||
'discount' => (float) $credit->discount,
|
'discount' => (float) $credit->discount,
|
||||||
'po_number' => $credit->po_number ?: '',
|
'po_number' => $credit->po_number ?: '',
|
||||||
|
@ -13,6 +13,7 @@ namespace App\Transformers;
|
|||||||
|
|
||||||
use App\Models\Design;
|
use App\Models\Design;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DesignTransformer.
|
* Class DesignTransformer.
|
||||||
@ -20,7 +21,7 @@ use App\Utils\Traits\MakesHash;
|
|||||||
class DesignTransformer extends EntityTransformer
|
class DesignTransformer extends EntityTransformer
|
||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
use SoftDeletes;
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
@ -47,6 +48,9 @@ class DesignTransformer extends EntityTransformer
|
|||||||
'is_custom' => (bool)$design->is_custom,
|
'is_custom' => (bool)$design->is_custom,
|
||||||
'is_active' => (bool)$design->is_active,
|
'is_active' => (bool)$design->is_active,
|
||||||
'design' => $design->design,
|
'design' => $design->design,
|
||||||
|
'updated_at' => (int)$design->updated_at,
|
||||||
|
'archived_at' => (int)$design->deleted_at,
|
||||||
|
'created_at' => (int)$design->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ class DocumentTransformer extends EntityTransformer
|
|||||||
'is_default' => (bool) $document->is_default,
|
'is_default' => (bool) $document->is_default,
|
||||||
'updated_at' => (int) $document->updated_at,
|
'updated_at' => (int) $document->updated_at,
|
||||||
'archived_at' => (int) $document->deleted_at
|
'archived_at' => (int) $document->deleted_at
|
||||||
|
'created_at' => (int) $document->created_at
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ namespace App\Transformers;
|
|||||||
|
|
||||||
use App\Models\Expense;
|
use App\Models\Expense;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class ExpenseTransformer
|
* class ExpenseTransformer
|
||||||
@ -20,7 +21,7 @@ use App\Utils\Traits\MakesHash;
|
|||||||
class ExpenseTransformer extends EntityTransformer
|
class ExpenseTransformer extends EntityTransformer
|
||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
use SoftDeletes;
|
||||||
protected $defaultIncludes = [
|
protected $defaultIncludes = [
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -75,6 +76,7 @@ class ExpenseTransformer extends EntityTransformer
|
|||||||
'custom_value4' => $expense->custom_value4 ?: '',
|
'custom_value4' => $expense->custom_value4 ?: '',
|
||||||
'updated_at' => (int)$expense->updated_at,
|
'updated_at' => (int)$expense->updated_at,
|
||||||
'archived_at' => (int)$expense->deleted_at,
|
'archived_at' => (int)$expense->deleted_at,
|
||||||
|
'created_at' => (int)$expense->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -51,6 +51,7 @@ class GatewayTransformer extends EntityTransformer
|
|||||||
'is_secure' => (bool)$gateway->is_secure,
|
'is_secure' => (bool)$gateway->is_secure,
|
||||||
'fields' => (string)$gateway->fields ?: '',
|
'fields' => (string)$gateway->fields ?: '',
|
||||||
'updated_at' => (int)$gateway->updated_at,
|
'updated_at' => (int)$gateway->updated_at,
|
||||||
|
'created_at' => (int)$gateway->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,10 @@ class GroupSettingTransformer extends EntityTransformer
|
|||||||
'id' => $this->encodePrimaryKey($group_setting->id),
|
'id' => $this->encodePrimaryKey($group_setting->id),
|
||||||
'name' => (string)$group_setting->name ?: '',
|
'name' => (string)$group_setting->name ?: '',
|
||||||
'settings' => $group_setting->settings ?: new \stdClass,
|
'settings' => $group_setting->settings ?: new \stdClass,
|
||||||
|
'created_at' => (int)$group_setting->created_at,
|
||||||
|
'updated_at' => (int)$group_setting->updated_at,
|
||||||
|
'archived_at' => (int)$group_setting->deleted_at,
|
||||||
|
'is_deleted' => (bool) $group_setting->is_deleted,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ class InvoiceInvitationTransformer extends EntityTransformer {
|
|||||||
'opened_date' => $invitation->opened_date?:'',
|
'opened_date' => $invitation->opened_date?:'',
|
||||||
'updated_at' => (int) $invitation->updated_at,
|
'updated_at' => (int) $invitation->updated_at,
|
||||||
'archived_at' => (int) $invitation->deleted_at,
|
'archived_at' => (int) $invitation->deleted_at,
|
||||||
|
'created_at' => (int) $invitation->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Invoice Ninja (https://invoiceninja.com)
|
|
||||||
*
|
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
||||||
*
|
|
||||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
||||||
*
|
|
||||||
* @license https://opensource.org/licenses/AAL
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Transformers;
|
|
||||||
|
|
||||||
class InvoiceItemTransformer extends EntityTransformer
|
|
||||||
{
|
|
||||||
public function transform($item)
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'id' => (int) $item->id,
|
|
||||||
'product_key' => $item->product_key,
|
|
||||||
'updated_at' => (int)$item->updated_at,
|
|
||||||
'archived_at' => (int)$item->deleted_at,
|
|
||||||
'notes' => $item->notes ?: '',
|
|
||||||
'cost' => (float) $item->cost ?: '',
|
|
||||||
'quantity' => (float) ($item->quantity ?: 0.0),
|
|
||||||
'tax_name1' => $item->tax_name1 ? $item->tax_name1 : '',
|
|
||||||
'tax_rate1' => (float) ($item->tax_rate1 ?: 0.0),
|
|
||||||
'tax_name2' => $item->tax_name2 ? $item->tax_name2 : '',
|
|
||||||
'tax_rate2' => (float) ($item->tax_rate2 ?: 0.0),
|
|
||||||
'line_item_type_id' => (string) $item->line_item_type_id ?: '',
|
|
||||||
'custom_value1' => $item->custom_value1 ?: '',
|
|
||||||
'custom_value2' => $item->custom_value2 ?: '',
|
|
||||||
'discount' => (float) $item->discount ?: '',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@ -91,8 +91,10 @@ class InvoiceTransformer extends EntityTransformer
|
|||||||
'vendor_id' => (string) $this->encodePrimaryKey($invoice->vendor_id),
|
'vendor_id' => (string) $this->encodePrimaryKey($invoice->vendor_id),
|
||||||
'status_id' => (string) ($invoice->status_id ?: 1),
|
'status_id' => (string) ($invoice->status_id ?: 1),
|
||||||
'design_id' => (string) ($invoice->design_id ?: 1),
|
'design_id' => (string) ($invoice->design_id ?: 1),
|
||||||
|
'created_at' => (int)$invoice->created_at,
|
||||||
'updated_at' => (int)$invoice->updated_at,
|
'updated_at' => (int)$invoice->updated_at,
|
||||||
'archived_at' => (int)$invoice->deleted_at,
|
'archived_at' => (int)$invoice->deleted_at,
|
||||||
|
'is_deleted' => (bool) $invoice->is_deleted,
|
||||||
'number' => $invoice->number ?: '',
|
'number' => $invoice->number ?: '',
|
||||||
'discount' => (float) $invoice->discount,
|
'discount' => (float) $invoice->discount,
|
||||||
'po_number' => $invoice->po_number ?: '',
|
'po_number' => $invoice->po_number ?: '',
|
||||||
@ -103,7 +105,6 @@ class InvoiceTransformer extends EntityTransformer
|
|||||||
'terms' => $invoice->terms ?: '',
|
'terms' => $invoice->terms ?: '',
|
||||||
'public_notes' => $invoice->public_notes ?: '',
|
'public_notes' => $invoice->public_notes ?: '',
|
||||||
'private_notes' => $invoice->private_notes ?: '',
|
'private_notes' => $invoice->private_notes ?: '',
|
||||||
'is_deleted' => (bool) $invoice->is_deleted,
|
|
||||||
'uses_inclusive_taxes' => (bool) $invoice->uses_inclusive_taxes,
|
'uses_inclusive_taxes' => (bool) $invoice->uses_inclusive_taxes,
|
||||||
'tax_name1' => $invoice->tax_name1 ? $invoice->tax_name1 : '',
|
'tax_name1' => $invoice->tax_name1 ? $invoice->tax_name1 : '',
|
||||||
'tax_rate1' => (float) $invoice->tax_rate1,
|
'tax_rate1' => (float) $invoice->tax_rate1,
|
||||||
|
@ -72,6 +72,7 @@ class PaymentTransformer extends EntityTransformer
|
|||||||
'transaction_reference' => $payment->transaction_reference ?: '',
|
'transaction_reference' => $payment->transaction_reference ?: '',
|
||||||
'date' => $payment->date ?: '',
|
'date' => $payment->date ?: '',
|
||||||
'is_manual' => (bool) $payment->is_manual,
|
'is_manual' => (bool) $payment->is_manual,
|
||||||
|
'created_at' => (int)$payment->created_at,
|
||||||
'updated_at' => (int)$payment->updated_at,
|
'updated_at' => (int)$payment->updated_at,
|
||||||
'archived_at' => (int)$payment->deleted_at,
|
'archived_at' => (int)$payment->deleted_at,
|
||||||
'is_deleted' => (bool) $payment->is_deleted,
|
'is_deleted' => (bool) $payment->is_deleted,
|
||||||
|
@ -73,6 +73,7 @@ class ProductTransformer extends EntityTransformer
|
|||||||
'tax_rate2' => (float) $product->tax_rate2 ?: 0,
|
'tax_rate2' => (float) $product->tax_rate2 ?: 0,
|
||||||
'tax_name3' => $product->tax_name3 ?: '',
|
'tax_name3' => $product->tax_name3 ?: '',
|
||||||
'tax_rate3' => (float) $product->tax_rate3 ?: 0,
|
'tax_rate3' => (float) $product->tax_rate3 ?: 0,
|
||||||
|
'created_at' => (int)$product->created_at,
|
||||||
'updated_at' => (int)$product->updated_at,
|
'updated_at' => (int)$product->updated_at,
|
||||||
'archived_at' => (int)$product->deleted_at,
|
'archived_at' => (int)$product->deleted_at,
|
||||||
'custom_value1' => $product->custom_value1 ?: '',
|
'custom_value1' => $product->custom_value1 ?: '',
|
||||||
|
@ -36,6 +36,7 @@ class ProjectTransformer extends EntityTransformer
|
|||||||
'id' => (string) $this->encodePrimaryKey($project->id),
|
'id' => (string) $this->encodePrimaryKey($project->id),
|
||||||
'name' => $project->name ?: '',
|
'name' => $project->name ?: '',
|
||||||
'client_id' => (string) $this->encodePrimaryKey($project->client_id),
|
'client_id' => (string) $this->encodePrimaryKey($project->client_id),
|
||||||
|
'created_at' => (int)$project->created_at,
|
||||||
'updated_at' => (int)$project->updated_at,
|
'updated_at' => (int)$project->updated_at,
|
||||||
'archived_at' => (int)$project->deleted_at,
|
'archived_at' => (int)$project->deleted_at,
|
||||||
'is_deleted' => (bool) $project->is_deleted,
|
'is_deleted' => (bool) $project->is_deleted,
|
||||||
|
@ -31,6 +31,7 @@ class QuoteInvitationTransformer extends EntityTransformer
|
|||||||
'opened_date' => $invitation->opened_date ?: '',
|
'opened_date' => $invitation->opened_date ?: '',
|
||||||
'updated_at' => (int) $invitation->updated_at,
|
'updated_at' => (int) $invitation->updated_at,
|
||||||
'archived_at' => (int) $invitation->deleted_at,
|
'archived_at' => (int) $invitation->deleted_at,
|
||||||
|
'created_at' => (int) $invitation->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ class QuoteTransformer extends EntityTransformer
|
|||||||
'invoice_id' => (string) ($quote->invoice_id ?: 1),
|
'invoice_id' => (string) ($quote->invoice_id ?: 1),
|
||||||
'updated_at' => (int)$quote->updated_at,
|
'updated_at' => (int)$quote->updated_at,
|
||||||
'archived_at' => (int)$quote->deleted_at,
|
'archived_at' => (int)$quote->deleted_at,
|
||||||
|
'created_at' => (int)$quote->created_at,
|
||||||
'number' => $quote->number ?: '',
|
'number' => $quote->number ?: '',
|
||||||
'discount' => (float) $quote->discount,
|
'discount' => (float) $quote->discount,
|
||||||
'po_number' => $quote->po_number ?: '',
|
'po_number' => $quote->po_number ?: '',
|
||||||
|
@ -87,6 +87,7 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
|||||||
'balance' => (float) $invoice->balance ?: '',
|
'balance' => (float) $invoice->balance ?: '',
|
||||||
'client_id' => (string) $invoice->client_id,
|
'client_id' => (string) $invoice->client_id,
|
||||||
'status_id' => (string) ($invoice->status_id ?: 1),
|
'status_id' => (string) ($invoice->status_id ?: 1),
|
||||||
|
'created_at' => (int)$invoice->created_at,
|
||||||
'updated_at' => (int)$invoice->updated_at,
|
'updated_at' => (int)$invoice->updated_at,
|
||||||
'archived_at' => (int)$invoice->deleted_at,
|
'archived_at' => (int)$invoice->deleted_at,
|
||||||
'discount' => (float) $invoice->discount ?: '',
|
'discount' => (float) $invoice->discount ?: '',
|
||||||
|
@ -87,6 +87,7 @@ class RecurringQuoteTransformer extends EntityTransformer
|
|||||||
'balance' => (float) $quote->balance ?: '',
|
'balance' => (float) $quote->balance ?: '',
|
||||||
'client_id' => (string) $quote->client_id,
|
'client_id' => (string) $quote->client_id,
|
||||||
'status_id' => (string) ($quote->status_id ?: 1),
|
'status_id' => (string) ($quote->status_id ?: 1),
|
||||||
|
'created_at' => (int)$quote->created_at,
|
||||||
'updated_at' => (int)$quote->updated_at,
|
'updated_at' => (int)$quote->updated_at,
|
||||||
'archived_at' => (int)$quote->deleted_at,
|
'archived_at' => (int)$quote->deleted_at,
|
||||||
'discount' => (float) $quote->discount ?: '',
|
'discount' => (float) $quote->discount ?: '',
|
||||||
|
@ -36,6 +36,7 @@ class TaskTransformer extends EntityTransformer
|
|||||||
'id' => (string) $this->encodePrimaryKey($task->id),
|
'id' => (string) $this->encodePrimaryKey($task->id),
|
||||||
'description' => $task->description ?: '',
|
'description' => $task->description ?: '',
|
||||||
'duration' => 0,
|
'duration' => 0,
|
||||||
|
'created_at' => (int)$task->created_at,
|
||||||
'updated_at' => (int)$task->updated_at,
|
'updated_at' => (int)$task->updated_at,
|
||||||
'archived_at' => (int)$task->deleted_at,
|
'archived_at' => (int)$task->deleted_at,
|
||||||
'invoice_id' => $this->encodePrimaryKey($task->invoice_id),
|
'invoice_id' => $this->encodePrimaryKey($task->invoice_id),
|
||||||
|
@ -20,6 +20,7 @@ class TaxRateTransformer extends EntityTransformer
|
|||||||
'rate' => (float) $tax_rate->rate,
|
'rate' => (float) $tax_rate->rate,
|
||||||
'updated_at' => (int)$tax_rate->updated_at,
|
'updated_at' => (int)$tax_rate->updated_at,
|
||||||
'archived_at' => (int)$tax_rate->deleted_at,
|
'archived_at' => (int)$tax_rate->deleted_at,
|
||||||
|
'created_at' => (int)$tax_rate->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ class UserTransformer extends EntityTransformer
|
|||||||
'last_name' => $user->last_name ?: '',
|
'last_name' => $user->last_name ?: '',
|
||||||
'email' => $user->email ?: '',
|
'email' => $user->email ?: '',
|
||||||
'last_login' => Carbon::parse($user->last_login)->timestamp,
|
'last_login' => Carbon::parse($user->last_login)->timestamp,
|
||||||
|
'created_at' => (int)$user->created_at,
|
||||||
'updated_at' => (int)$user->updated_at,
|
'updated_at' => (int)$user->updated_at,
|
||||||
'archived_at' => (int)$user->deleted_at,
|
'archived_at' => (int)$user->deleted_at,
|
||||||
'created_at' => (int)$user->created_at,
|
'created_at' => (int)$user->created_at,
|
||||||
|
@ -34,6 +34,7 @@ class VendorContactTransformer extends EntityTransformer
|
|||||||
'first_name' => $vendor->first_name ?: '',
|
'first_name' => $vendor->first_name ?: '',
|
||||||
'last_name' => $vendor->last_name ?: '',
|
'last_name' => $vendor->last_name ?: '',
|
||||||
'email' => $vendor->email ?: '',
|
'email' => $vendor->email ?: '',
|
||||||
|
'created_at' => (int)$vendor->created_at,
|
||||||
'updated_at' => (int)$vendor->updated_at,
|
'updated_at' => (int)$vendor->updated_at,
|
||||||
'archived_at' => (int)$vendor->deleted_at,
|
'archived_at' => (int)$vendor->deleted_at,
|
||||||
'is_primary' => (bool) $vendor->is_primary,
|
'is_primary' => (bool) $vendor->is_primary,
|
||||||
|
@ -94,6 +94,7 @@ class VendorTransformer extends EntityTransformer
|
|||||||
'id_number' => $vendor->id_number ?: '',
|
'id_number' => $vendor->id_number ?: '',
|
||||||
'updated_at' => (int)$vendor->updated_at,
|
'updated_at' => (int)$vendor->updated_at,
|
||||||
'archived_at' => (int)$vendor->deleted_at,
|
'archived_at' => (int)$vendor->deleted_at,
|
||||||
|
'created_at' => (int)$vendor->created_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ trait Uploadable
|
|||||||
|
|
||||||
if ($path) {
|
if ($path) {
|
||||||
$settings = $entity->settings;
|
$settings = $entity->settings;
|
||||||
$settings->company_logo = $company->domain() . $path;
|
$settings->company_logo = $path;
|
||||||
$entity->settings = $settings;
|
$entity->settings = $settings;
|
||||||
$entity->save();
|
$entity->save();
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,6 @@ class CreateUsersTable extends Migration
|
|||||||
$table->string('referral_code')->nullable();
|
$table->string('referral_code')->nullable();
|
||||||
|
|
||||||
$table->timestamps(6);
|
$table->timestamps(6);
|
||||||
$table->softDeletes('deleted_at', 6);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('companies', function (Blueprint $table) {
|
Schema::create('companies', function (Blueprint $table) {
|
||||||
@ -232,6 +231,7 @@ class CreateUsersTable extends Migration
|
|||||||
$table->string('custom_value2')->nullable();
|
$table->string('custom_value2')->nullable();
|
||||||
$table->string('custom_value3')->nullable();
|
$table->string('custom_value3')->nullable();
|
||||||
$table->string('custom_value4')->nullable();
|
$table->string('custom_value4')->nullable();
|
||||||
|
$table->softDeletes('deleted_at', 6);
|
||||||
|
|
||||||
$table->unsignedInteger('documentable_id');
|
$table->unsignedInteger('documentable_id');
|
||||||
$table->string('documentable_type');
|
$table->string('documentable_type');
|
||||||
@ -292,6 +292,8 @@ class CreateUsersTable extends Migration
|
|||||||
$table->unsignedInteger('user_id');
|
$table->unsignedInteger('user_id');
|
||||||
$table->string('token')->nullable();
|
$table->string('token')->nullable();
|
||||||
$table->string('name')->nullable();
|
$table->string('name')->nullable();
|
||||||
|
$table->timestamps(6);
|
||||||
|
$table->softDeletes('deleted_at', 6);
|
||||||
|
|
||||||
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade');
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade');
|
||||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade')->onUpdate('cascade');
|
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade')->onUpdate('cascade');
|
||||||
@ -405,6 +407,7 @@ class CreateUsersTable extends Migration
|
|||||||
$table->boolean('show_billing_address')->default(true)->nullable();
|
$table->boolean('show_billing_address')->default(true)->nullable();
|
||||||
$table->boolean('show_shipping_address')->default(true)->nullable();
|
$table->boolean('show_shipping_address')->default(true)->nullable();
|
||||||
$table->boolean('update_details')->default(false)->nullable();
|
$table->boolean('update_details')->default(false)->nullable();
|
||||||
|
$table->boolean('is_deleted')->default(false);
|
||||||
$table->mediumText('config');
|
$table->mediumText('config');
|
||||||
$table->text('fees_and_limits');
|
$table->text('fees_and_limits');
|
||||||
$table->string('custom_value1')->nullable();
|
$table->string('custom_value1')->nullable();
|
||||||
@ -1153,6 +1156,8 @@ class CreateUsersTable extends Migration
|
|||||||
$table->unsignedInteger('user_id')->nullable();
|
$table->unsignedInteger('user_id')->nullable();
|
||||||
$table->string('name')->nullable();
|
$table->string('name')->nullable();
|
||||||
$table->mediumText('settings')->nullable();
|
$table->mediumText('settings')->nullable();
|
||||||
|
$table->softDeletes('deleted_at', 6);
|
||||||
|
$table->timestamps(6);
|
||||||
|
|
||||||
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade');
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade');
|
||||||
});
|
});
|
||||||
@ -1371,7 +1376,7 @@ class CreateUsersTable extends Migration
|
|||||||
$table->boolean('is_active')->default(true);
|
$table->boolean('is_active')->default(true);
|
||||||
$table->mediumText('design')->nullable();
|
$table->mediumText('design')->nullable();
|
||||||
$table->timestamps(6);
|
$table->timestamps(6);
|
||||||
|
$table->softDeletes('deleted_at', 6);
|
||||||
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade');
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user