-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show customer and order info in admin (#105)
* feat: improve the retrieval of a mail's customer * feat: display customer and order in admin * feat: change order of metadata information * feat: show information about the triggering flow * fix: setup dal references correctly * fix: disable DAL autoloading for customer association
- Loading branch information
1 parent
fbfa0ea
commit f5b0786
Showing
16 changed files
with
396 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Frosh\MailArchive\Extension\Checkout\Order; | ||
|
||
use Frosh\MailArchive\Content\MailArchive\MailArchiveDefinition; | ||
use Shopware\Core\Checkout\Order\OrderDefinition; | ||
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension; | ||
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\SetNullOnDelete; | ||
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField; | ||
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection; | ||
|
||
class OrderExtension extends EntityExtension | ||
{ | ||
public function getDefinitionClass(): string | ||
{ | ||
return OrderDefinition::class; | ||
} | ||
|
||
public function extendFields(FieldCollection $collection): void | ||
{ | ||
$collection->add( | ||
(new OneToManyAssociationField( | ||
'froshMailArchive', | ||
MailArchiveDefinition::class, | ||
'order_id', | ||
))->addFlags(new SetNullOnDelete(false)), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Frosh\MailArchive\Extension\Content\Flow; | ||
|
||
use Frosh\MailArchive\Content\MailArchive\MailArchiveDefinition; | ||
use Shopware\Core\Content\Flow\FlowDefinition; | ||
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension; | ||
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\SetNullOnDelete; | ||
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField; | ||
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection; | ||
|
||
class FlowExtension extends EntityExtension | ||
{ | ||
public function getDefinitionClass(): string | ||
{ | ||
return FlowDefinition::class; | ||
} | ||
|
||
public function extendFields(FieldCollection $collection): void | ||
{ | ||
$collection->add( | ||
(new OneToManyAssociationField( | ||
'froshMailArchive', | ||
MailArchiveDefinition::class, | ||
'flow_id', | ||
))->addFlags(new SetNullOnDelete(false)), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Frosh\MailArchive\Migration; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Shopware\Core\Framework\Migration\MigrationStep; | ||
|
||
class Migration1739730285AddOrderId extends MigrationStep | ||
{ | ||
public function getCreationTimestamp(): int | ||
{ | ||
return 1739730285; | ||
} | ||
|
||
public function update(Connection $connection): void | ||
{ | ||
$connection->executeStatement(' | ||
ALTER TABLE `frosh_mail_archive` | ||
ADD COLUMN `order_id` BINARY(16) NULL, | ||
ADD COLUMN `order_version_id` BINARY(16) NULL | ||
; | ||
'); | ||
} | ||
|
||
public function updateDestructive(Connection $connection): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Frosh\MailArchive\Migration; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Shopware\Core\Framework\Migration\MigrationStep; | ||
|
||
class Migration1739731953DropCustomerFK extends MigrationStep | ||
{ | ||
public function getCreationTimestamp(): int | ||
{ | ||
return 1739731953; | ||
} | ||
|
||
public function update(Connection $connection): void | ||
{ | ||
$connection->executeStatement(' | ||
ALTER TABLE `frosh_mail_archive` | ||
DROP FOREIGN KEY `fk.frosh_mail_archive.customerId`; | ||
'); | ||
} | ||
|
||
public function updateDestructive(Connection $connection): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Frosh\MailArchive\Migration; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Shopware\Core\Framework\Migration\MigrationStep; | ||
|
||
class Migration1739741754AddFlowId extends MigrationStep | ||
{ | ||
public function getCreationTimestamp(): int | ||
{ | ||
return 1739741754; | ||
} | ||
|
||
public function update(Connection $connection): void | ||
{ | ||
$connection->executeStatement(" | ||
ALTER TABLE `frosh_mail_archive` | ||
ADD COLUMN `flow_id` BINARY(16) NULL;"); | ||
} | ||
|
||
public function updateDestructive(Connection $connection): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.