make id public, organigram impl. media password/encryption, settings bug fix, Money->FloatInt change, ...

This commit is contained in:
Dennis Eichhorn 2023-05-06 11:42:06 +00:00
parent c979546b15
commit 5611db45d6
8 changed files with 30 additions and 30 deletions

View File

@ -33,7 +33,7 @@ class AccountRelation
* @var int
* @since 1.0.0
*/
protected int $id = 0;
public int $id = 0;
/**
* Promotion

View File

@ -20,7 +20,7 @@ use Modules\Calendar\Models\Calendar;
use Modules\Media\Models\Media;
use Modules\Tasks\Models\NullTask;
use Modules\Tasks\Models\Task;
use phpOMS\Localization\Money;
use phpOMS\Stdlib\Base\FloatInt;
/**
* Promotion class.
@ -38,7 +38,7 @@ class Promotion
* @var int
* @since 1.0.0
*/
protected int $id = 0;
public int $id = 0;
/**
* Event start.
@ -83,34 +83,34 @@ class Promotion
/**
* Budget costs.
*
* @var Money
* @var FloatInt
* @since 1.0.0
*/
public Money $budgetCosts;
public FloatInt $budgetCosts;
/**
* Budget earnings.
*
* @var Money
* @var FloatInt
* @since 1.0.0
*/
public Money $budgetEarnings;
public FloatInt $budgetEarnings;
/**
* Current total costs.
*
* @var Money
* @var FloatInt
* @since 1.0.0
*/
public Money $actualCosts;
public FloatInt $actualCosts;
/**
* Current total earnings.
*
* @var Money
* @var FloatInt
* @since 1.0.0
*/
public Money $actualEarnings;
public FloatInt $actualEarnings;
/**
* Tasks.
@ -188,10 +188,10 @@ class Promotion
$this->start = new \DateTime('now');
$this->end = (new \DateTime('now'))->modify('+1 month');
$this->calendar = new Calendar();
$this->actualCosts = new Money();
$this->actualEarnings = new Money();
$this->budgetCosts = new Money();
$this->budgetEarnings = new Money();
$this->actualCosts = new FloatInt();
$this->actualEarnings = new FloatInt();
$this->budgetCosts = new FloatInt();
$this->budgetEarnings = new FloatInt();
$this->createdAt = new \DateTimeImmutable('now');
$this->createdBy = new NullAccount();

View File

@ -30,7 +30,7 @@ class PromotionAttribute implements \JsonSerializable
* @var int
* @since 1.0.0
*/
protected int $id = 0;
public int $id = 0;
/**
* Promotion this attribute belongs to

View File

@ -33,7 +33,7 @@ class PromotionAttributeType implements \JsonSerializable
* @var int
* @since 1.0.0
*/
protected int $id = 0;
public int $id = 0;
/**
* Name/string identifier by which it can be found/categorized

View File

@ -36,7 +36,7 @@ class PromotionAttributeValue implements \JsonSerializable
* @var int
* @since 1.0.0
*/
protected int $id = 0;
public int $id = 0;
/**
* Depending attribute type

View File

@ -34,7 +34,7 @@ echo $this->getData('nav')->render(); ?>
<td><?= $this->getHtml('Due'); ?>
<tbody>
<?php $count = 0; foreach ($list as $key => $value) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('marketing/promotion/profile?{?}&id=' . $value->getId()); ?>
$url = \phpOMS\Uri\UriFactory::build('marketing/promotion/profile?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td data-label="<?= $this->getHtml('Start'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getStart()->format('Y-m-d')); ?></a>

View File

@ -21,7 +21,7 @@ use Modules\Marketing\Models\PromotionMapper;
use Modules\Media\Models\Media;
use Modules\Tasks\Models\Task;
use phpOMS\DataStorage\Database\Query\OrderType;
use phpOMS\Localization\Money;
use phpOMS\Stdlib\Base\FloatInt;
/**
* @internal
@ -42,7 +42,7 @@ final class PromotionMapperTest extends \PHPUnit\Framework\TestCase
$promotion->start = new \DateTime('2000-05-05');
$promotion->end = new \DateTime('2005-05-05');
$money = new Money();
$money = new FloatInt();
$money->setString('1.23');
$promotion->budgetCosts = $money;
@ -74,13 +74,13 @@ final class PromotionMapperTest extends \PHPUnit\Framework\TestCase
$promotion->addMedia($media);
$id = PromotionMapper::create()->execute($promotion);
self::assertGreaterThan(0, $promotion->getId());
self::assertEquals($id, $promotion->getId());
self::assertGreaterThan(0, $promotion->id);
self::assertEquals($id, $promotion->id);
$promotionR = PromotionMapper::get()
->with('tasks')
->with('media')
->where('id', $promotion->getId())->execute();
->where('id', $promotion->id)->execute();
self::assertEquals($promotion->name, $promotionR->name);
self::assertEquals($promotion->description, $promotionR->description);

View File

@ -18,7 +18,7 @@ use Modules\Marketing\Models\ProgressType;
use Modules\Marketing\Models\Promotion;
use Modules\Media\Models\Media;
use Modules\Tasks\Models\Task;
use phpOMS\Localization\Money;
use phpOMS\Stdlib\Base\FloatInt;
/**
* @internal
@ -41,7 +41,7 @@ final class PromotionTest extends \PHPUnit\Framework\TestCase
*/
public function testDefault() : void
{
self::assertEquals(0, $this->promotion->getId());
self::assertEquals(0, $this->promotion->id);
self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->promotion->calendar);
self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->promotion->start->format('Y-m-d'));
self::assertEquals((new \DateTime('now'))->modify('+1 month')->format('Y-m-d'), $this->promotion->end->format('Y-m-d'));
@ -130,10 +130,10 @@ final class PromotionTest extends \PHPUnit\Framework\TestCase
'end' => $this->promotion->end,
'name' => 'Name',
'description' => 'Description',
'budgetCosts' => new Money(),
'budgetEarnings' => new Money(),
'actualCosts' => new Money(),
'actualEarnings' => new Money(),
'budgetCosts' => new FloatInt(),
'budgetEarnings' => new FloatInt(),
'actualCosts' => new FloatInt(),
'actualEarnings' => new FloatInt(),
'tasks' => [],
'media' => [],
'progress' => 10,