diff --git a/app/Modules/CardPinOrder/CardPinOrderModule.php b/app/Modules/CardPinOrder/CardPinOrderModule.php new file mode 100644 index 0000000..db3ca25 --- /dev/null +++ b/app/Modules/CardPinOrder/CardPinOrderModule.php @@ -0,0 +1,64 @@ +enabled; + } + + /** + * Disable module + */ + public function disable(): void + { + $this->enabled = false; + } + + /** + * Enable module + */ + public function enable(): void + { + $this->enabled = true; + } + + /** + * Check if module has a filament resource + */ + public function hasFilamentResource(): bool + { + return false; + } + + /** + * Get module composer requirements + */ + public function getComposerRequirements(): array + { + return []; + } + + /** + * Get module composer suggestions + */ + public function getComposerSuggestions(): array + { + return []; + } +} diff --git a/app/Modules/CardPinOrder/Database/Migrations/2025_11_02_221302_create_card_pin_orders_table.php b/app/Modules/CardPinOrder/Database/Migrations/2025_11_02_221302_create_card_pin_orders_table.php new file mode 100644 index 0000000..dcd33d8 --- /dev/null +++ b/app/Modules/CardPinOrder/Database/Migrations/2025_11_02_221302_create_card_pin_orders_table.php @@ -0,0 +1,55 @@ +id(); + $table->string('unique_id')->nullable()->unique(); + $table->foreignId('user_id')->constrained('users')->cascadeOnDelete(); + + $table->foreignId('card_type_id')->constrained('card_types')->restrictOnDelete(); + $table->string('card_number'); + + // Region & Branch + $table->string('region', 2); + $table->foreignId('branch_id')->constrained('branches')->restrictOnDelete(); + + // Customer name,surname,patronic name + $table->string('customer_name')->index(); + $table->string('customer_surname')->index(); + $table->string('customer_patronic_name')->nullable(); + + $table->date('born_at')->nullable(); + $table->string('phone')->index()->nullable(); + + $table->string('passport_serie')->index(); + $table->string('passport_id')->index(); + + $table->text('passport_one')->nullable(); + $table->text('passport_two')->nullable(); + $table->text('passport_three')->nullable(); + $table->text('passport_four')->nullable(); + + $table->string('status')->nullable(); + $table->string('notes')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +}; diff --git a/app/Modules/CardPinOrder/Models/CardPinOrder.php b/app/Modules/CardPinOrder/Models/CardPinOrder.php new file mode 100644 index 0000000..2fb2c6c --- /dev/null +++ b/app/Modules/CardPinOrder/Models/CardPinOrder.php @@ -0,0 +1,76 @@ + + */ + protected $casts = [ + 'born_at' => 'date', + ]; + + /** + * User + * + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + + /** + * Card type + * + * @return BelongsTo + */ + public function cardType(): BelongsTo + { + return $this->belongsTo(CardType::class, 'card_type_id'); + } + + /** + * Branch + * + * @return BelongsTo + */ + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class); + } +} diff --git a/app/Modules/CardPinOrder/Repositories/CardPinOrderRepository.php b/app/Modules/CardPinOrder/Repositories/CardPinOrderRepository.php new file mode 100644 index 0000000..8d3b430 --- /dev/null +++ b/app/Modules/CardPinOrder/Repositories/CardPinOrderRepository.php @@ -0,0 +1,5 @@ +