Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat(Review): add review messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed May 17, 2016
1 parent 591c926 commit f20c858
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Model/Message/ReviewCreatedMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* @author @jayS-de <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Model\Message;

class ReviewCreatedMessage extends Message
{
const MESSAGE_TYPE = 'ReviewCreated';

public function fieldDefinitions()
{
$definitions = parent::fieldDefinitions();
$definitions['review'] = [static::TYPE => '\Commercetools\Core\Model\Review\Review'];

return $definitions;
}
}
22 changes: 22 additions & 0 deletions src/Model/Message/ReviewRatingSetMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* @author @jayS-de <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Model\Message;

class ReviewRatingSetMessage extends Message
{
const MESSAGE_TYPE = 'ReviewRatingSet';

public function fieldDefinitions()
{
$definitions = parent::fieldDefinitions();
$definitions['oldRating'] = [static::TYPE => 'float'];
$definitions['newRating'] = [static::TYPE => 'float'];
$definitions['includedInStatistics'] = [static::TYPE => 'bool'];
$definitions['target'] = [static::TYPE => '\Commercetools\Core\Model\Common\Reference'];

return $definitions;
}
}
24 changes: 24 additions & 0 deletions src/Model/Message/ReviewStateTransitionMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* @author @jayS-de <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Model\Message;

class ReviewStateTransitionMessage extends Message
{
const MESSAGE_TYPE = 'ReviewStateTransition';

public function fieldDefinitions()
{
$definitions = parent::fieldDefinitions();
$definitions['oldState'] = [static::TYPE => '\Commercetools\Core\Model\State\StateReference'];
$definitions['newState'] = [static::TYPE => '\Commercetools\Core\Model\State\StateReference'];
$definitions['oldIncludedInStatistics'] = [static::TYPE => 'bool'];
$definitions['newIncludedInStatistics'] = [static::TYPE => 'bool'];
$definitions['target'] = [static::TYPE => '\Commercetools\Core\Model\Common\Reference'];
$definitions['force'] = [static::TYPE => 'bool'];

return $definitions;
}
}

0 comments on commit f20c858

Please # to comment.