Add EInvoiceLog Table
This commit is contained in:
parent
b6c58bfbbf
commit
4f52c56bf9
|
|
@ -87,7 +87,6 @@ use Laracasts\Presenter\PresentableTrait;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|Account query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Account first()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Account with()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Account count()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Account where($query)
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankIntegration> $bank_integrations
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\License;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
/**
|
||||
* App\Models\EInvoicingLog
|
||||
*
|
||||
* @package App\Models
|
||||
* @property int $id
|
||||
* @property string $tenant_id
|
||||
* @property string $direction
|
||||
* @property int $legal_entity_id
|
||||
* @property string|null $license_key The license key string
|
||||
* @property string|null $notes
|
||||
* @property int $counter
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property \Carbon\Carbon $deleted_at
|
||||
* @property-read \App\Models\License $license
|
||||
* @mixin \Eloquent
|
||||
*
|
||||
*/
|
||||
class EInvoicingLog extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'created_at' => 'date',
|
||||
'updated_at' => 'date',
|
||||
'deleted_at' => 'date',
|
||||
];
|
||||
|
||||
/**
|
||||
* license
|
||||
*
|
||||
*/
|
||||
public function license(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(License::class, 'license_key', 'license_key');
|
||||
}
|
||||
|
||||
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Company::class, 'tenant_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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::create('e_invoicing_logs', function (Blueprint $table){
|
||||
$table->id();
|
||||
$table->string('tenant_id');
|
||||
$table->unsignedInteger('legal_entity_id')->index();
|
||||
$table->string('license_key')->nullable();
|
||||
$table->string('direction')->default('sent');
|
||||
$table->text('notes')->nullable();
|
||||
$table->integer('counter')->default(0);
|
||||
$table->softDeletes('deleted_at', 6);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue