Skip to content

Commit

Permalink
Product: Some backend fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
koencaerels committed Jul 12, 2024
1 parent 224a3c5 commit 9391b3b
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private function __construct(
// Hydrate from a json command
// —————————————————————————————————————————————————————————————————————————

public static function hydrateFromJson($json): self
public static function hydrateFromJson(\stdClass $json): self
{
return new self(
$json->code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private function __construct(
// Hydrate from a json command
// —————————————————————————————————————————————————————————————————————————

public static function hydrateFromJson($json): self
public static function hydrateFromJson(\stdClass $json): self
{
return new self(
$json->code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private function __construct(
// Hydrate from a json command
// —————————————————————————————————————————————————————————————————————————

public static function hydrateFromJson($json): self
public static function hydrateFromJson(\stdClass $json): self
{
return new self(
$json->code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private function __construct(
// Hydrate from a json command
// —————————————————————————————————————————————————————————————————————————

public static function hydrateFromJson($json): self
public static function hydrateFromJson(\stdClass $json): self
{
return new self(
$json->code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
// Commands
// —————————————————————————————————————————————————————————————————————————

public function go(ChangeJudogi $command): bool
public function change(ChangeJudogi $command): bool
{
$model = $this->judogiRepo->getById($command->getId());
$model->change(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function changeJudogi(\stdClass $jsonCommand): bool

$command = ChangeJudogi::hydrateFromJson($jsonCommand);
$handler = new ChangeJudogiHandler($this->judogiRepository);
$handler->go($command);
$handler->change($command);
$this->entityManager->flush();

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function changeProduct(\stdClass $jsonCommand): bool

$command = ChangeProduct::hydrateFromJson($jsonCommand);
$handler = new ChangeProductHandler($this->productRepository);
$handler->go($command);
$handler->change($command);
$this->entityManager->flush();

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function changeProductGroup(\stdClass $jsonCommand): bool

$command = ChangeProductGroup::hydrateFromJson($jsonCommand);
$handler = new ChangeProductGroupHandler($this->productGroupRepository);
$handler->go($command);
$handler->change($command);
$this->entityManager->flush();

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function orderProductGroup(\stdClass $jsonCommand): bool
{
$this->permission->CheckRole(['ROLE_DEVELOPER', 'ROLE_ADMIN', 'ROLE_CHIEF_EDITOR']);

$command = OrderJudogi::hydrateFromJson($jsonCommand);
$handler = new OrderJudogiHandler($this->judogiRepository);
$command = OrderProductGroup::hydrateFromJson($jsonCommand);
$handler = new OrderProductGroupHandler($this->productGroupRepository);
$handler->go($command);
$this->entityManager->flush();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function orderProductItem(\stdClass $jsonCommand): bool
{
$this->permission->CheckRole(['ROLE_DEVELOPER', 'ROLE_ADMIN', 'ROLE_CHIEF_EDITOR']);

$command = OrderJudogi::hydrateFromJson($jsonCommand);
$handler = new OrderJudogiHandler($this->judogiRepository);
$command = OrderProductItem::hydrateFromJson($jsonCommand);
$handler = new OrderProductItemHandler($this->productItemRepository);
$handler->go($command);
$this->entityManager->flush();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function orderProductItemBatch(\stdClass $jsonCommand): bool
{
$this->permission->CheckRole(['ROLE_DEVELOPER', 'ROLE_ADMIN', 'ROLE_CHIEF_EDITOR']);

$command = OrderJudogi::hydrateFromJson($jsonCommand);
$handler = new OrderJudogiHandler($this->judogiRepository);
$command = OrderProductItemBatch::hydrateFromJson($jsonCommand);
$handler = new OrderProductItemBatchHandler($this->productItemBatchRepository);
$handler->go($command);
$this->entityManager->flush();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace App\YoshiKan\Application\Query\Product\Readmodel;

use App\YoshiKan\Domain\Model\Product;
use App\YoshiKan\Domain\Model\Product\Product;

class ProductReadModel implements \JsonSerializable
{
Expand Down
2 changes: 1 addition & 1 deletion frontends/member_module/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# VITE_API_URL=http://localhost.charlesproxy.com:8080/mm/api
VITE_API_URL=http://localhost:8080/mm/api
VITE_VERSION=0.0.2
VITE_VERSION=0.0.3
2 changes: 1 addition & 1 deletion frontends/member_module/.env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_API_URL=/mm/api
VITE_VERSION=0.0.2
VITE_VERSION=0.0.3

0 comments on commit 9391b3b

Please sign in to comment.