mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-01-11 15:28:41 +00:00
make id public, organigram impl. media password/encryption, settings bug fix, Money->FloatInt change, ...
This commit is contained in:
parent
f431897c0c
commit
8d312dbf72
|
|
@ -1,3 +0,0 @@
|
|||
[Dolphin]
|
||||
Timestamp=2022,2,19,13,48,38
|
||||
Version=4
|
||||
|
|
@ -406,6 +406,30 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"clientmgmt_client_account": {
|
||||
"name": "clientmgmt_client_account",
|
||||
"fields": {
|
||||
"clientmgmt_client_account_id": {
|
||||
"name": "clientmgmt_client_account_id",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"clientmgmt_client_account_account": {
|
||||
"name": "clientmgmt_client_account_account",
|
||||
"type": "VARCHAR(50)",
|
||||
"null": false
|
||||
},
|
||||
"clientmgmt_client_account_client": {
|
||||
"name": "clientmgmt_client_account_client",
|
||||
"type": "INT(11)",
|
||||
"null": false,
|
||||
"foreignTable": "clientmgmt_client",
|
||||
"foreignKey": "clientmgmt_client_id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"clientmgmt_client_media": {
|
||||
"name": "clientmgmt_client_media",
|
||||
"fields": {
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ final class Installer extends InstallerAbstract
|
|||
$request->setData('title', \reset($attribute['l11n']));
|
||||
$request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en');
|
||||
$request->setData('is_required', $attribute['is_required'] ?? false);
|
||||
$request->setData('is_custom_allowed', $attribute['is_custom_allowed'] ?? false);
|
||||
$request->setData('custom', $attribute['is_custom_allowed'] ?? false);
|
||||
$request->setData('validation_pattern', $attribute['validation_pattern'] ?? '');
|
||||
$request->setData('datatype', (int) $attribute['value_type']);
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ final class ApiController extends Controller
|
|||
/** @var \Modules\ClientManagement\Models\Client $client */
|
||||
$client = $clientMapper->execute();
|
||||
|
||||
return $client instanceof NullClient ? null : $client;
|
||||
return $client->id === 0 ? null : $client;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -129,7 +129,7 @@ final class ApiController extends Controller
|
|||
if (\in_array($client->mainAddress->getCountry(), ISO3166CharEnum::getRegion('eu'))) {
|
||||
$validate = EUVATVies::validateQualified(
|
||||
$request->getDataString('vat_id') ?? '',
|
||||
$unit->getAttribute('vat_id')?->value->valueStr ?? '',
|
||||
$unit->getAttribute('vat_id')->value->valueStr ?? '',
|
||||
$client->account->name1,
|
||||
$client->mainAddress->city,
|
||||
$client->mainAddress->postal,
|
||||
|
|
@ -144,7 +144,7 @@ final class ApiController extends Controller
|
|||
StringUtils::intHash(EUVATVies::class),
|
||||
'vat_validation',
|
||||
self::NAME,
|
||||
(string) $client->getId(),
|
||||
(string) $client->id,
|
||||
\json_encode($validate),
|
||||
(int) \ip2long($request->getOrigin())
|
||||
);
|
||||
|
|
@ -164,8 +164,8 @@ final class ApiController extends Controller
|
|||
$internalResponse = new HttpResponse();
|
||||
|
||||
$internalRequest->header->account = $request->header->account;
|
||||
$internalRequest->setData('client', $client->getId());
|
||||
$internalRequest->setData('type', $type->getId());
|
||||
$internalRequest->setData('client', $client->id);
|
||||
$internalRequest->setData('type', $type->id);
|
||||
$internalRequest->setData('custom', $request->hasData('vat_id'));
|
||||
|
||||
$this->apiClientAttributeCreate($internalRequest, $internalResponse);
|
||||
|
|
@ -191,9 +191,9 @@ final class ApiController extends Controller
|
|||
$internalResponse = new HttpResponse();
|
||||
|
||||
$internalRequest->header->account = $request->header->account;
|
||||
$internalRequest->setData('client', $client->getId());
|
||||
$internalRequest->setData('type', $type->getId());
|
||||
$internalRequest->setData('value', $value->getId());
|
||||
$internalRequest->setData('client', $client->id);
|
||||
$internalRequest->setData('type', $type->id);
|
||||
$internalRequest->setData('value', $value->id);
|
||||
|
||||
$this->apiClientAttributeCreate($internalRequest, $internalResponse);
|
||||
}
|
||||
|
|
@ -735,7 +735,7 @@ final class ApiController extends Controller
|
|||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
(int) $request->getData('type'),
|
||||
$attrValue->getId(),
|
||||
$attrValue->id,
|
||||
ClientAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
|
||||
);
|
||||
}
|
||||
|
|
@ -898,7 +898,7 @@ final class ApiController extends Controller
|
|||
foreach ($uploaded as $file) {
|
||||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
$file->getId(),
|
||||
$file->id,
|
||||
$request->getDataInt('type'),
|
||||
MediaMapper::class,
|
||||
'types',
|
||||
|
|
@ -911,7 +911,7 @@ final class ApiController extends Controller
|
|||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
(int) $request->getData('client'),
|
||||
\reset($uploaded)->getId(),
|
||||
\reset($uploaded)->id,
|
||||
ClientMapper::class, 'files', '', $request->getOrigin()
|
||||
);
|
||||
|
||||
|
|
@ -942,6 +942,6 @@ final class ApiController extends Controller
|
|||
}
|
||||
|
||||
$model = $responseData['response'];
|
||||
$this->createModelRelation($request->header->account, $request->getData('id'), $model->getId(), ClientMapper::class, 'notes', '', $request->getOrigin());
|
||||
$this->createModelRelation($request->header->account, $request->getData('id'), $model->id, ClientMapper::class, 'notes', '', $request->getOrigin());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ declare(strict_types=1);
|
|||
namespace Modules\ClientManagement\Controller;
|
||||
|
||||
use Modules\Billing\Models\SalesBillMapper;
|
||||
use Modules\ClientManagement\Models\ClientAttributeTypeL11nMapper;
|
||||
use Modules\ClientManagement\Models\ClientAttributeTypeMapper;
|
||||
use Modules\ClientManagement\Models\ClientAttributeValueMapper;
|
||||
use Modules\ClientManagement\Models\ClientMapper;
|
||||
|
|
@ -126,7 +127,12 @@ final class BackendController extends Controller
|
|||
->where('l11n/language', $response->getLanguage())
|
||||
->execute();
|
||||
|
||||
$l11ns = ClientAttributeTypeL11nMapper::getAll()
|
||||
->where('ref', $attribute->id)
|
||||
->execute();
|
||||
|
||||
$view->addData('attribute', $attribute);
|
||||
$view->addData('l11ns', $l11ns);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -238,7 +244,7 @@ final class BackendController extends Controller
|
|||
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self'])
|
||||
->leftJoin(MediaTypeMapper::TABLE)
|
||||
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD)
|
||||
->where(ClientMapper::HAS_MANY['files']['self'], '=', $client->getId())
|
||||
->where(ClientMapper::HAS_MANY['files']['self'], '=', $client->id)
|
||||
->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'client_profile_image');
|
||||
|
||||
$clientImage = MediaMapper::get()
|
||||
|
|
@ -251,21 +257,21 @@ final class BackendController extends Controller
|
|||
|
||||
// stats
|
||||
if ($this->app->moduleManager->isActive('Billing')) {
|
||||
$ytd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
|
||||
$mtd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
|
||||
$lastOrder = SalesBillMapper::getLastOrderDateByClientId($client->getId());
|
||||
$ytd = SalesBillMapper::getSalesByClientId($client->id, new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
|
||||
$mtd = SalesBillMapper::getSalesByClientId($client->id, new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
|
||||
$lastOrder = SalesBillMapper::getLastOrderDateByClientId($client->id);
|
||||
$newestInvoices = SalesBillMapper::getAll()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->with('client')
|
||||
->where('client', $client->getId())
|
||||
->where('client', $client->id)
|
||||
->where('type/l11n/language', $response->getLanguage())
|
||||
->sort('id', OrderType::DESC)
|
||||
->limit(5)
|
||||
->execute();
|
||||
|
||||
$monthlySalesCosts = SalesBillMapper::getClientMonthlySalesCosts($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||
$items = SalesBillMapper::getClientItem($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||
$monthlySalesCosts = SalesBillMapper::getClientMonthlySalesCosts($client->id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||
$items = SalesBillMapper::getClientItem($client->id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||
} else {
|
||||
$ytd = new Money();
|
||||
$mtd = new Money();
|
||||
|
|
|
|||
|
|
@ -34,15 +34,15 @@ use Modules\Profile\Models\Profile;
|
|||
*/
|
||||
class Client
|
||||
{
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
public string $number = '';
|
||||
|
||||
public string $numberReverse = '';
|
||||
|
||||
private int $status = ClientStatus::ACTIVE;
|
||||
public int $status = ClientStatus::ACTIVE;
|
||||
|
||||
private int $type = 0;
|
||||
public int $type = 0;
|
||||
|
||||
public string $info = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ClientL11n implements \JsonSerializable
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Client ID.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class ClientL11nType implements \JsonSerializable
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Identifier for the l11n type.
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['ClientManagement' => [
|
||||
'AttributeTypes' => 'Attribute Types',
|
||||
'Accounting' => 'Accounting',
|
||||
'Addition' => 'Addition',
|
||||
'Address' => 'Address',
|
||||
|
|
|
|||
71
Theme/Backend/attribute-type-list.tpl.php
Normal file
71
Theme/Backend/attribute-type-list.tpl.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\ItemManagement
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$attributes = $this->getData('attributes');
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('AttributeTypes'); ?><i class="fa fa-download floatRight download btn"></i></div>
|
||||
<div class="slider">
|
||||
<table id="iAttributeTypeList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="iAttributeTypeList-sort-1">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-1">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="iAttributeTypeList-sort-2">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-2">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||
<label for="iAttributeTypeList-sort-2">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-2">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="iAttributeTypeList-sort-3">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-3">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($attributes as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/sales/client/attribute/type?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n()); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
65
Theme/Backend/attribute-type.tpl.php
Executable file
65
Theme/Backend/attribute-type.tpl.php
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Tasks
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Localization\ISO639Enum;
|
||||
|
||||
$attribute = $this->getData('attribute');
|
||||
$l11ns = $this->getData('l11ns');
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
<section id="task" class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Attribute'); ?></div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iId"><?= $this->getHtml('ID'); ?></label>
|
||||
<input type="text" value="<?= $this->printHtml((string) $attribute->id); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iName"><?= $this->getHtml('Name'); ?></label>
|
||||
<input type="text" value="<?= $this->printHtml($attribute->name); ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Language', '0', '0'); ?><i class="fa fa-download floatRight download btn"></i></div>
|
||||
<table class="default">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td>
|
||||
<td><?= $this->getHtml('Language', '0', '0'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Title'); ?>
|
||||
<tbody>
|
||||
<?php $c = 0; foreach ($l11ns as $key => $value) : ++$c; ?>
|
||||
<tr>
|
||||
<td><a href="#"><i class="fa fa-times"></i></a>
|
||||
<td><a href="#"><i class="fa fa-cogs"></i></a>
|
||||
<td><?= ISO639Enum::getByName('_' . \strtoupper($value->getLanguage())); ?>
|
||||
<td><?= $value->content; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -103,12 +103,12 @@ echo $this->getData('nav')->render(); ?>
|
|||
</label>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach ($clients as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/sales/client/profile?{?}&id=' . $value->getId());
|
||||
$url = UriFactory::build('{/base}/sales/client/profile?{?}&id=' . $value->id);
|
||||
$image = $value->getFileByTypeName('client_profile_image');
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><img alt="<?= $this->getHtml('IMG_alt_client'); ?>" width="30" loading="lazy" class="item-image"
|
||||
src="<?= $image instanceof NullMedia
|
||||
src="<?= $image->id === 0
|
||||
? 'Web/Backend/img/logo_grey.png'
|
||||
: UriFactory::build('{/base}/' . $image->getPath()); ?>"></a>
|
||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->number); ?></a>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ $bills = $this->getData('newestInvoices') ?? [];
|
|||
/** @var \Modules\Billing\Models\Bill $value */
|
||||
foreach ($bills as $key => $value) :
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $value->getId());
|
||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ $items = $this->getData('items') ?? [];
|
|||
}
|
||||
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/sales/item/profile?{?}&id=' . $value->getId());
|
||||
$url = UriFactory::build('{/base}/sales/item/profile?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><label class="checkbox" for="iSalesItemSelect-<?= $key; ?>">
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ echo $this->getData('nav')->render();
|
|||
<div class="col-xs-12 col-lg-3 last-lg">
|
||||
<div class="box">
|
||||
<?php if(true) : ?>
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/bill/create?client=' . $client->getId()); ?>"><?= $this->getHtml('CreateBill', 'Billing'); ?></a>
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/bill/create?client=' . $client->id); ?>"><?= $this->getHtml('CreateBill', 'Billing'); ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if (false) : ?>
|
||||
<a class="button"><?= $this->getHtml('ViewAccount', 'Accounting'); ?></a>
|
||||
|
|
@ -226,7 +226,7 @@ echo $this->getData('nav')->render();
|
|||
<td><?= $this->getHtml('CreatedAt'); ?>
|
||||
<tbody>
|
||||
<?php foreach ($notes as $note) :
|
||||
$url = UriFactory::build('{/base}/editor/single?{?}&id=' . $note->getId());
|
||||
$url = UriFactory::build('{/base}/editor/single?{?}&id=' . $note->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $note->title; ?></a>
|
||||
|
|
@ -249,7 +249,7 @@ echo $this->getData('nav')->render();
|
|||
<td><?= $this->getHtml('CreatedAt'); ?>
|
||||
<tbody>
|
||||
<?php foreach ($files as $file) :
|
||||
$url = UriFactory::build('{/base}/media/single?{?}&id=' . $file->getId());
|
||||
$url = UriFactory::build('{/base}/media/single?{?}&id=' . $file->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $file->name; ?></a>
|
||||
|
|
@ -278,7 +278,7 @@ echo $this->getData('nav')->render();
|
|||
<?php
|
||||
/** @var \Modules\Billing\Models\Bill $invoice */
|
||||
foreach ($newestInvoices as $invoice) :
|
||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $invoice->getId());
|
||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $invoice->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ trait ApiControllerAttributeTrait
|
|||
$request->setData('language', ISO639x1Enum::_EN);
|
||||
|
||||
$this->module->apiClientAttributeTypeCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,7 +56,7 @@ trait ApiControllerAttributeTrait
|
|||
$request->setData('language', ISO639x1Enum::_DE);
|
||||
|
||||
$this->module->apiClientAttributeTypeL11nCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +76,7 @@ trait ApiControllerAttributeTrait
|
|||
$request->setData('country', ISO3166TwoEnum::_DEU);
|
||||
|
||||
$this->module->apiClientAttributeValueCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -95,7 +95,7 @@ trait ApiControllerAttributeTrait
|
|||
$request->setData('country', ISO3166TwoEnum::_DEU);
|
||||
|
||||
$this->module->apiClientAttributeValueCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -114,7 +114,7 @@ trait ApiControllerAttributeTrait
|
|||
$request->setData('country', ISO3166TwoEnum::_DEU);
|
||||
|
||||
$this->module->apiClientAttributeValueCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -133,7 +133,7 @@ trait ApiControllerAttributeTrait
|
|||
$request->setData('country', ISO3166TwoEnum::_DEU);
|
||||
|
||||
$this->module->apiClientAttributeValueCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -151,7 +151,7 @@ trait ApiControllerAttributeTrait
|
|||
$request->setData('type', '1');
|
||||
|
||||
$this->module->apiClientAttributeCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ trait ApiControllerClientTrait
|
|||
$request->setData('country', ISO3166TwoEnum::_USA);
|
||||
|
||||
$this->module->apiClientCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -103,7 +103,7 @@ trait ApiControllerClientTrait
|
|||
|
||||
$this->module->apiFileCreate($request, $response);
|
||||
$file = $response->get('')['response'];
|
||||
self::assertGreaterThan(0, \reset($file)->getId());
|
||||
self::assertGreaterThan(0, \reset($file)->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -133,7 +133,7 @@ trait ApiControllerClientTrait
|
|||
|
||||
$this->module->apiFileCreate($request, $response);
|
||||
$file = $response->get('')['response'];
|
||||
self::assertGreaterThan(0, \reset($file)->getId());
|
||||
self::assertGreaterThan(0, \reset($file)->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -154,7 +154,7 @@ trait ApiControllerClientTrait
|
|||
$request->setData('plain', \preg_replace('/^.+\n/', '', $MARKDOWN));
|
||||
|
||||
$this->module->apiNoteCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ final class ClientMapperTest extends \PHPUnit\Framework\TestCase
|
|||
// This is required because by default a NullAccount without an ID is created in the Profile model
|
||||
// but NullModels without ids are handled like "null" values which are not allowed for Accounts.
|
||||
$profile = ProfileMapper::get()->where('account', 1)->execute();
|
||||
$profile = $profile instanceof NullProfile ? new Profile() : $profile;
|
||||
if ($profile->account->getId() === 0) {
|
||||
$profile = $profile->id === 0 ? new Profile() : $profile;
|
||||
if ($profile->account->id === 0) {
|
||||
$profile->account = new NullAccount(1);
|
||||
}
|
||||
|
||||
$client->profile = $profile;
|
||||
|
||||
$id = ClientMapper::create()->execute($client);
|
||||
self::assertGreaterThan(0, $client->getId());
|
||||
self::assertEquals($id, $client->getId());
|
||||
self::assertGreaterThan(0, $client->id);
|
||||
self::assertEquals($id, $client->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ final class ClientTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->client->getId());
|
||||
self::assertEquals(0, $this->client->id);
|
||||
self::assertEquals('', $this->client->number);
|
||||
self::assertEquals('', $this->client->numberReverse);
|
||||
self::assertEquals('', $this->client->info);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class NullClientTest extends \PHPUnit\Framework\TestCase
|
|||
public function testId() : void
|
||||
{
|
||||
$null = new NullClient(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user