Skip to content

Commit

Permalink
add handling db fields to palled delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
inikoo committed Jun 17, 2024
1 parent d76a5a5 commit c74e50a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/*
* Author: Raul Perusquia <raul@inikoo.com>
* Created: Sat, 25 May 2024 19:45:40 British Summer Time, Sheffield, UK
* Copyright (c) 2024, Raul A Perusquia Flores
*/

namespace App\Enums\Fulfilment\PalletDelivery;

use App\Enums\EnumHelperTrait;

enum PalletDeliveryHandingTypeEnum: string
{
use EnumHelperTrait;
case COLLECTION = 'collection';
case SHIPPING = 'shipping';

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Copyright (c) 2024, Raul A Perusquia Flores
*/

use App\Enums\Fulfilment\PalletDelivery\PalletDeliveryHandingTypeEnum;
use App\Enums\Fulfilment\PalletDelivery\PalletDeliveryStateEnum;
use App\Stubs\Migrations\HasFulfilmentDelivery;
use App\Stubs\Migrations\HasGroupOrganisationRelationship;
Expand All @@ -29,6 +30,14 @@ public function up(): void
foreach (PalletDeliveryStateEnum::cases() as $state) {
$table->dateTimeTz("{$state->snake()}_at")->nullable();
}

$table->unsignedInteger('delivery_address_id')->index()->nullable();
$table->foreign('delivery_address_id')->references('id')->on('addresses');
$table->unsignedInteger('collection_address_id')->index()->nullable();
$table->foreign('collection_address_id')->references('id')->on('addresses');

$table->string('handing_type')->default(PalletDeliveryHandingTypeEnum::SHIPPING->value)->index();

$table->date('estimated_delivery_date')->nullable();
$table->dateTimeTz('date')->nullable();
$table->text('customer_notes')->nullable();
Expand Down

0 comments on commit c74e50a

Please sign in to comment.