@@ -173,10 +173,16 @@ public static function getRawKnownSchemas(): array
173173 'readOnly ' => true ,
174174 ],
175175 'name ' => ['type ' => Doc \Schema::TYPE_STRING ],
176- 'completename ' => ['type ' => Doc \Schema::TYPE_STRING ],
176+ 'completename ' => [
177+ 'type ' => Doc \Schema::TYPE_STRING ,
178+ 'readOnly ' => true ,
179+ ],
177180 'comment ' => ['type ' => Doc \Schema::TYPE_STRING ],
178181 'parent ' => self ::getDropdownTypeSchema (class: SoftwareCategory::class, full_schema: 'SoftwareCategory ' ),
179- 'level ' => ['type ' => Doc \Schema::TYPE_INTEGER ],
182+ 'level ' => [
183+ 'type ' => Doc \Schema::TYPE_INTEGER ,
184+ 'readOnly ' => true ,
185+ ],
180186 ],
181187 ];
182188
@@ -296,7 +302,6 @@ public static function getRawKnownSchemas(): array
296302 'depth ' => ['type ' => Doc \Schema::TYPE_NUMBER , 'format ' => Doc \Schema::FORMAT_NUMBER_FLOAT ],
297303 'power_connections ' => ['type ' => Doc \Schema::TYPE_INTEGER ],
298304 'power_consumption ' => ['type ' => Doc \Schema::TYPE_INTEGER ],
299- 'max_power ' => ['type ' => Doc \Schema::TYPE_INTEGER ],
300305 'is_half_rack ' => ['type ' => Doc \Schema::TYPE_BOOLEAN ],
301306 'date_creation ' => ['type ' => Doc \Schema::TYPE_STRING , 'format ' => Doc \Schema::FORMAT_STRING_DATE_TIME ],
302307 'date_mod ' => ['type ' => Doc \Schema::TYPE_STRING , 'format ' => Doc \Schema::FORMAT_STRING_DATE_TIME ],
@@ -530,7 +535,11 @@ class: User::class,
530535 }
531536
532537 if ($ asset ->isField ('uuid ' )) {
533- $ schemas [$ schema_name ]['properties ' ]['uuid ' ] = ['type ' => Doc \Schema::TYPE_STRING ];
538+ $ schemas [$ schema_name ]['properties ' ]['uuid ' ] = [
539+ 'type ' => Doc \Schema::TYPE_STRING ,
540+ 'pattern ' => Doc \Schema::PATTERN_UUIDV4 ,
541+ 'readOnly ' => true ,
542+ ];
534543 }
535544 if ($ asset ->isField ('autoupdatesystems_id ' )) {
536545 $ schemas [$ schema_name ]['properties ' ]['autoupdatesystem ' ] = self ::getDropdownTypeSchema (AutoUpdateSystem::class);
@@ -820,7 +829,10 @@ class: User::class,
820829 ],
821830 'is_deleted ' => ['type ' => Doc \Schema::TYPE_BOOLEAN ],
822831 'is_update ' => ['type ' => Doc \Schema::TYPE_BOOLEAN ],
823- 'is_valid ' => ['type ' => Doc \Schema::TYPE_BOOLEAN ],
832+ 'is_valid ' => [
833+ 'type ' => Doc \Schema::TYPE_BOOLEAN ,
834+ 'readOnly ' => true ,
835+ ],
824836 'date_creation ' => ['type ' => Doc \Schema::TYPE_STRING , 'format ' => Doc \Schema::FORMAT_STRING_DATE_TIME ],
825837 'date_mod ' => ['type ' => Doc \Schema::TYPE_STRING , 'format ' => Doc \Schema::FORMAT_STRING_DATE_TIME ],
826838 ],
@@ -939,7 +951,10 @@ class: User::class,
939951 'room ' => self ::getDropdownTypeSchema (class: DCRoom::class, full_schema: 'DCRoom ' ),
940952 'room_orientation ' => ['type ' => Doc \Schema::TYPE_INTEGER , 'format ' => Doc \Schema::FORMAT_INTEGER_INT32 ],
941953 'position ' => ['type ' => Doc \Schema::TYPE_STRING ],
942- 'bgcolor ' => ['type ' => Doc \Schema::TYPE_STRING ],
954+ 'bgcolor ' => [
955+ 'type ' => Doc \Schema::TYPE_STRING ,
956+ 'pattern ' => Doc \Schema::PATTERN_COLOR_HEX ,
957+ ],
943958 'max_power ' => ['type ' => Doc \Schema::TYPE_INTEGER , 'format ' => Doc \Schema::FORMAT_INTEGER_INT32 ],
944959 'measured_power ' => [
945960 'type ' => Doc \Schema::TYPE_INTEGER ,
@@ -999,7 +1014,10 @@ class: User::class,
9991014 - 1: Rear
10001015 EOT ,
10011016 ],
1002- 'bgcolor ' => ['type ' => Doc \Schema::TYPE_STRING ],
1017+ 'bgcolor ' => [
1018+ 'type ' => Doc \Schema::TYPE_STRING ,
1019+ 'pattern ' => Doc \Schema::PATTERN_COLOR_HEX ,
1020+ ],
10031021 'position_horizontal ' => [
10041022 'type ' => Doc \Schema::TYPE_INTEGER ,
10051023 'format ' => Doc \Schema::FORMAT_INTEGER_INT32 ,
@@ -1411,6 +1429,7 @@ public static function getAssetTypes(bool $types_only = true): array
14111429
14121430 if ($ assets === null ) {
14131431 $ assets = [];
1432+ //TODO remove SoftwareLicense in v3 as it is a duplicate of License in the Management Controller
14141433 $ types = ['Computer ' , 'Monitor ' , 'NetworkEquipment ' ,
14151434 'Peripheral ' , 'Phone ' , 'Printer ' , 'SoftwareLicense ' ,
14161435 'Certificate ' , 'Unmanaged ' , 'Appliance ' ,
0 commit comments