Initial Version

This commit is contained in:
root
2025-12-21 10:09:54 -05:00
commit 4ae6befc7b
422 changed files with 47225 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Chrono\Entity;
use JsonSerializable;
enum EntityPermissions: string implements JsonSerializable {
case View = 'view';
case Modify = 'modify';
case Delete = 'delete';
case Share = 'share';
public function jsonSerialize(): string {
return $this->value;
}
}

View File

@@ -0,0 +1,93 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Chrono\Entity;
use DateTimeImmutable;
interface IEntityBase extends \JsonSerializable {
public const JSON_TYPE = 'chrono.entity';
public const JSON_PROPERTY_TYPE = '@type';
public const JSON_PROPERTY_IN = 'in';
public const JSON_PROPERTY_ID = 'id';
public const JSON_PROPERTY_DATA = 'data';
public const JSON_PROPERTY_CREATED = 'created';
public const JSON_PROPERTY_MODIFIED = 'modified';
public const JSON_PROPERTY_SIGNATURE = 'signature';
/**
* Unique arbitrary text string identifying the collection this entity belongs to (e.g. 1 or Collection1 or anything else)
*
* @since 2025.05.01
*/
public function in(): string|int;
/**
* Unique arbitrary text string identifying this entity (e.g. 1 or Entity or anything else)
*
* @since 2025.05.01
*/
public function id(): string|int;
/**
* Gets the creation date of this entity
*/
public function created(): ?DateTimeImmutable;
/**
* Gets the modification date of this entity
*/
public function modified(): ?DateTimeImmutable;
/**
* Gets the signature of this entity
*
* @since 2025.05.01
*/
public function signature(): ?string;
/**
* Gets the priority of this entity
*
* @since 2025.05.01
*/
public function getPriority(): ?int;
/**
* Gets the visibility of this entity
*
* @since 2025.05.01
*/
public function getVisibility(): ?bool;
/**
* Gets the color of this entity
*
* @since 2025.05.01
*/
public function getColor(): ?string;
/**
* Gets the object data (event, task, or journal).
*
* @since 2025.05.01
*/
public function getDataObject(): object|null;
/**
* Gets the raw data as an associative array or JSON string.
*
* @since 2025.05.01
*
* @return array|string|null
*/
public function getDataJson(): array|string|null;
}

View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Chrono\Entity;
use KTXF\Json\JsonDeserializable;
interface IEntityMutable extends IEntityBase, JsonDeserializable {
/**
* Sets the priority of this entity
*
* @since 2025.05.01
*/
public function setPriority(?int $value): static;
/**
* Sets the visibility of this entity
*
* @since 2025.05.01
*/
public function setVisibility(?bool $value): static;
/**
* Sets the color of this entity
*
* @since 2025.05.01
*/
public function setColor(?string $value): static;
/**
* Sets the object as a class instance.
*
* @since 2025.05.01
*/
public function setDataObject(object $value): static;
/**
* Sets the object data from a json string
*
* @since 2025.05.01
*/
public function setDataJson(array|string $value): static;
}