Skip to content

Commit

Permalink
Changes to files: Entities/LifeStage.php
Browse files Browse the repository at this point in the history
Entities/Meta.php
Entities/Partner.php
Entities/Slug.php
Entities/Type.php
Entities/TypeRelation.php
database/migrations/2024_08_03_083132_create_partner_life_stage_table.php
database/migrations/2024_08_03_083141_create_partner_meta_table.php
database/migrations/2024_08_03_083148_create_partner_partner_table.php
database/migrations/2024_08_03_083154_create_partner_slug_table.php
database/migrations/2024_08_03_083201_create_partner_type_table.php
database/migrations/2024_08_03_083206_create_partner_type_relation_table.php
  • Loading branch information
dedanirungu committed Aug 6, 2024
1 parent 99f90e2 commit 6c9d257
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 141 deletions.
21 changes: 0 additions & 21 deletions Entities/LifeStage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Modules\Partner\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Entities\BaseModel;

class LifeStage extends BaseModel
Expand All @@ -22,24 +21,4 @@ class LifeStage extends BaseModel
*/
protected $table = "partner_life_stage";

/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->increments('id')->html('hidden');
$this->fields->string('slug', 100)->nullable()->unique('slug')->html('text');
$this->fields->string('title', 100)->nullable()->html('text');
$this->fields->string('title_plural', 100)->nullable()->html('text');
$this->fields->unsignedSmallInteger('position')->default(0)->html('switch');
}




}
18 changes: 0 additions & 18 deletions Entities/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Modules\Partner\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Entities\BaseModel;

class Meta extends BaseModel
Expand All @@ -21,21 +20,4 @@ class Meta extends BaseModel
*/
protected $table = "partner_meta";

/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->increments('id')->html('hidden');
$this->fields->bigInteger('partner_id')->nullable()->index('partner_id')->html('recordpicker')->relation(['partner']);
$this->fields->string('meta_key')->nullable()->html('text');
$this->fields->longText('meta_value')->nullable()->html('text');
}


}
45 changes: 0 additions & 45 deletions Entities/Partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Modules\Partner\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Classes\Migration;
use Modules\Base\Entities\BaseModel;

class Partner extends BaseModel
Expand All @@ -26,47 +24,4 @@ class Partner extends BaseModel
*/
protected $table = "partner";

/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$type = ['customer', 'suppier'];
$gender = ['male', 'female'];

$this->fields->increments('id')->html('hidden');
$this->fields->foreignId('user_id')->nullable()->index('user_id')->html('recordpicker')->relation(['users']);
$this->fields->foreignId('inviter_id')->nullable()->index('inviter_id')->html('recordpicker')->relation(['users']);
$this->fields->string('first_name', 60)->nullable()->html('text');
$this->fields->string('last_name', 60)->nullable()->html('text');
$this->fields->enum('type_str', $type)->options($type)->default('customer')->nullable()->html('select');
$this->fields->enum('gender', $gender)->options($gender)->default('male')->nullable()->html('select');
$this->fields->string('company', 60)->nullable()->html('text');
$this->fields->string('email', 100)->nullable()->index('email')->html('email');
$this->fields->string('phone', 100)->nullable()->html('text');
$this->fields->string('birth_date')->html('datetime');
$this->fields->string('mobile', 100)->nullable()->html('text');
$this->fields->string('other', 50)->nullable()->html('text');
$this->fields->string('website', 100)->nullable()->html('text');
$this->fields->string('fax', 20)->nullable()->html('text');
$this->fields->text('notes')->nullable()->html('text');
$this->fields->string('address')->nullable()->html('text');
$this->fields->string('city', 80)->nullable()->html('text');
$this->fields->string('state', 50)->nullable()->html('text');
$this->fields->string('postal_code', 10)->nullable()->html('text');
$this->fields->foreignId('country_id')->nullable()->html('text');
$this->fields->foreignId('currency_id')->nullable()->html('text');
$this->fields->string('life_stage')->nullable()->html('text');
$this->fields->string('hash', 40)->nullable()->html('text');
}





}
19 changes: 0 additions & 19 deletions Entities/Slug.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Modules\Partner\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Classes\Migration;
use Modules\Base\Entities\BaseModel;

class Slug extends BaseModel
Expand All @@ -22,21 +20,4 @@ class Slug extends BaseModel
*/
protected $table = "partner_slug";

/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->increments('id')->html('hidden');
$this->fields->foreignId('partner_id')->nullable()->index('partner_id')->html('recordpicker')->relation(['partner']);
$this->fields->string('slug')->nullable()->html('text');
}



}
16 changes: 0 additions & 16 deletions Entities/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Modules\Partner\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Entities\BaseModel;

class Type extends BaseModel
Expand All @@ -21,19 +20,4 @@ class Type extends BaseModel
*/
protected $table = "partner_type";

/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->increments('id')->html('hidden');
$this->fields->string('name', 20)->nullable()->unique('name')->html('text');
}


}
17 changes: 0 additions & 17 deletions Entities/TypeRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Modules\Partner\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Entities\BaseModel;

class TypeRelation extends BaseModel
Expand All @@ -21,20 +20,4 @@ class TypeRelation extends BaseModel
*/
protected $table = "partner_type_relation";

/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->bigIncrements('id')->html('text');
$this->fields->unsignedBigInteger('partner_id')->nullable()->index('partner_id')->html('recordpicker')->relation(['partner']);
$this->fields->unsignedInteger('partner_types_id')->nullable()->index('partner_types_id')->html('recordpicker')->relation(['partner', 'types']);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ public function up(): void
{
Schema::create('partner_life_stage', function (Blueprint $table) {
$table->id();


$table->string('slug', 100)->nullable()->unique('slug');
$table->string('title', 100)->nullable();
$table->string('title_plural', 100)->nullable();
$table->unsignedSmallInteger('position')->default(0);

$table->timestamps();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ public function up(): void
{
Schema::create('partner_meta', function (Blueprint $table) {
$table->id();


$table->bigInteger('partner_id')->nullable()->index('partner_id');
$table->string('meta_key')->nullable();
$table->longText('meta_value')->nullable();

$table->timestamps();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ public function up(): void
{
Schema::create('partner_partner', function (Blueprint $table) {
$table->id();

$table->foreignId('user_id')->nullable()->index('user_id');

$table->string('first_name', 60)->nullable();
$table->string('last_name', 60)->nullable();
$table->enum('type_str', ['customer', 'suppier'])->nullable()->default('customer');
$table->enum('gender',['male', 'female'])->nullable()->default('male');
$table->string('company', 60)->nullable();
$table->string('email', 100)->nullable();
$table->string('phone', 100)->nullable();
$table->string('birth_date')->nullable();
$table->string('mobile', 100)->nullable();
$table->string('other', 50)->nullable();
$table->string('website', 100)->nullable();
$table->string('fax', 20)->nullable();
$table->text('notes')->nullable();
$table->string('address')->nullable();
$table->string('city', 80)->nullable();
$table->string('state', 50)->nullable();
$table->string('postal_code', 10)->nullable();
$table->foreignId('country_id')->nullable();
$table->foreignId('currency_id')->nullable();
$table->string('life_stage')->nullable();
$table->string('hash', 40)->nullable();

$table->timestamps();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ public function up(): void
{
Schema::create('partner_slug', function (Blueprint $table) {
$table->id();


$table->foreignId('partner_id')->nullable()->index('partner_id');
$table->string('slug')->nullable();

$table->timestamps();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public function up(): void
{
Schema::create('partner_type', function (Blueprint $table) {
$table->id();


$table->string('name', 20)->nullable()->unique('name');

$table->timestamps();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ public function up(): void
{
Schema::create('partner_type_relation', function (Blueprint $table) {
$table->id();


$table->unsignedBigInteger('partner_id')->nullable()->index('partner_id');
$table->unsignedInteger('partner_types_id')->nullable()->index('partner_types_id');

$table->timestamps();
});
}
Expand Down

0 comments on commit 6c9d257

Please sign in to comment.