bug fixes and item management improvements

This commit is contained in:
Dennis Eichhorn 2023-05-24 18:11:37 +00:00
parent 3dcb46138a
commit 04abf14714
7 changed files with 128 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<?php declare(strict_types=1);
use Modules\InvestmentManagement\Controller\BackendController;
use Modules\InvestmentManagement\Models\PermissionState;
use Modules\InvestmentManagement\Models\PermissionCategory;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
@ -13,7 +13,7 @@ return [
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::INVESTMENT,
'state' => PermissionCategory::INVESTMENT,
],
],
],

24
Models/Investment.php Normal file
View File

@ -0,0 +1,24 @@
<?php
use Modules\Admin\Models\Account;
use phpOMS\Business\Finance\DepreciationType;
class Investment
{
public int $id = 0;
public string $name = '';
public int $depreciationType = DepreciationType::STAIGHT_LINE;
public array $objects = [];
/**
* Income
*/
public array $ammortization = [];
public Account $createdBy;
public array $attributeTypes = [];
}

View File

@ -0,0 +1,27 @@
<?php
use phpOMS\Business\Finance\DepreciationType;
class InvestmentObject
{
public int $id = 0;
public string $productName = '';
public string $description = '';
public int $supplier = 0;
public string $supplierName = '';
public string $productLink = '';
/**
* Costs / Revenue
*/
public array $money = [];
public bool $approved = false;
public array $attributes = [];
}

View File

@ -0,0 +1,36 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\InvestmentManagement\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\InvestmentManagement\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Investment status enum.
*
* @package Modules\InvestmentManagement\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
abstract class InvestmentStatus extends Enum
{
public const DRAFT = 1;
public const OPEN = 2;
public const APPROVED = 3;
public const DENIED = 4;
}

22
Models/Money.php Normal file
View File

@ -0,0 +1,22 @@
<?php
use phpOMS\Business\Finance\DepreciationType;
use phpOMS\Stdlib\Base\FloatInt;
class Money {
public int $id = 0;
public string $name = '';
public int $depreciationType = DepreciationType::STAIGHT_LINE;
public int $depreciationDuration = 0;
public FloatInt $amount;
public FloatInt $residualValue;
public MoneyType $moneyType;
public bool $recurring = false;
}

16
Models/MoneyType.php Normal file
View File

@ -0,0 +1,16 @@
<?php
use phpOMS\Localization\BaseStringL11n;
class MoneyType
{
public int $id = 0;
public string $name = '';
public BaseStringL11n $content;
public bool $cost = true;
public bool $recurring = false;
}

View File

@ -24,7 +24,7 @@ use phpOMS\Stdlib\Base\Enum;
* @link https://orange-management.org
* @since 1.0.0
*/
abstract class PermissionState extends Enum
abstract class PermissionCategory extends Enum
{
public const INVESTMENT = 1;
}