You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
3.0 KiB
104 lines
3.0 KiB
2 months ago
|
<?php
|
||
2 months ago
|
|
||
|
|
||
1 week ago
|
namespace Auxilium\Schemas;
|
||
2 months ago
|
|
||
|
use Darksparrow\AuxiliumSchemaBuilder\Enumerators\SchemaFieldExistence;
|
||
|
use Darksparrow\AuxiliumSchemaBuilder\Attributes\SchemaDocument;
|
||
|
use Darksparrow\AuxiliumSchemaBuilder\Attributes\SchemaDocumentField;
|
||
|
use Darksparrow\AuxiliumSchemaBuilder\Interfaces\SchemaDocumentInterface;
|
||
|
|
||
|
#[SchemaDocument(
|
||
2 months ago
|
Name: "organisation",
|
||
2 months ago
|
MaxSize: 0,
|
||
|
Comment: "The organisation object itself SHOULD not have a value",
|
||
|
)]
|
||
1 week ago
|
class OrganisationSchema
|
||
2 months ago
|
{
|
||
|
#[SchemaDocumentField(
|
||
|
Name: "name",
|
||
|
Existence: SchemaFieldExistence::MUST,
|
||
|
Comment: "This MUST be the organisation's name",
|
||
|
MaxSize: 2048,
|
||
1 week ago
|
MimeType: "text/plain",
|
||
2 months ago
|
Children: [
|
||
|
new SchemaDocumentField(
|
||
|
Name: "trading_as",
|
||
|
Existence: SchemaFieldExistence::SHOULD,
|
||
1 week ago
|
Comment: "This SHOULD be the organisation's short trading name, or the abbreviation they would usually go by",
|
||
2 months ago
|
MaxSize: 256,
|
||
1 week ago
|
MimeType: "text/plain",
|
||
2 months ago
|
)
|
||
|
]
|
||
|
)]
|
||
|
public string $Name;
|
||
|
|
||
|
|
||
|
#[SchemaDocumentField(
|
||
|
Name: "departments",
|
||
|
Existence: SchemaFieldExistence::SHOULD,
|
||
|
Comment: "This SHOULD be an 'array node' of all sub-organisations if applicable",
|
||
|
ValidSchemas: [
|
||
1 week ago
|
CollectionSchema::class,
|
||
2 months ago
|
],
|
||
|
MaxSize: 0,
|
||
1 week ago
|
Child: new SchemaDocumentField(
|
||
|
Name: "departments",
|
||
2 months ago
|
Comment: null,
|
||
|
ValidSchemas: [
|
||
1 week ago
|
OrganisationSchema::class,
|
||
2 months ago
|
],
|
||
|
),
|
||
|
)]
|
||
|
public array $Departments;
|
||
|
|
||
|
|
||
|
#[SchemaDocumentField(
|
||
|
Name: "cases",
|
||
|
Existence: SchemaFieldExistence::SHOULD,
|
||
|
Comment: "This SHOULD be an 'array node' of all the cases the organisation is either directly working on or the client of",
|
||
|
ValidSchemas: [
|
||
1 week ago
|
CollectionSchema::class,
|
||
2 months ago
|
],
|
||
|
MaxSize: 0,
|
||
1 week ago
|
Child: new SchemaDocumentField(
|
||
|
Name: "cases",
|
||
2 months ago
|
Comment: null,
|
||
|
ValidSchemas: [
|
||
1 week ago
|
CaseSchema::class,
|
||
2 months ago
|
],
|
||
|
),
|
||
|
)]
|
||
|
public array $Cases;
|
||
|
|
||
|
|
||
|
#[SchemaDocumentField(
|
||
|
Name: "staff",
|
||
|
Existence: SchemaFieldExistence::SHOULD,
|
||
1 week ago
|
Comment: "This SHOULD be an 'array node' of all the staff that cannot be categorised into departments, or in the case of small organisations with no departments, all staff",
|
||
2 months ago
|
ValidSchemas: [
|
||
1 week ago
|
CollectionSchema::class,
|
||
2 months ago
|
],
|
||
|
MaxSize: 0,
|
||
1 week ago
|
Child: new SchemaDocumentField(
|
||
|
Name: "staff",
|
||
2 months ago
|
Comment: null,
|
||
|
ValidSchemas: [
|
||
|
"https://schemas.auxiliumsoftware.co.uk/v1/user.json",
|
||
|
],
|
||
|
),
|
||
|
)]
|
||
|
public array $Staff;
|
||
|
|
||
|
|
||
1 week ago
|
/*
|
||
2 months ago
|
public function __construct(array $data)
|
||
|
{
|
||
|
$this->Name = $data["name"];
|
||
|
$this->Departments = $data["departments"];
|
||
|
$this->Cases = $data["cases"];
|
||
|
$this->Staff = $data["staff"];
|
||
|
}
|
||
1 week ago
|
*/
|
||
2 months ago
|
}
|