From 5e7f670931c54a71b49f5dcec166fab215c507a7 Mon Sep 17 00:00:00 2001 From: binenasc <12201000120@muz.ifsuldeminas.edu.br> Date: Thu, 19 Dec 2024 10:42:51 -0300 Subject: [PATCH] feat: collections --- api/.aeria/aeria-sdk.d.ts | 355 ++++++++++++++++++++++++++++++++++- api/schemas/main.aeria | 101 +++++++++- web/.aeria-ui/aeria-sdk.d.ts | 355 ++++++++++++++++++++++++++++++++++- 3 files changed, 802 insertions(+), 9 deletions(-) diff --git a/api/.aeria/aeria-sdk.d.ts b/api/.aeria/aeria-sdk.d.ts index 59c3488..42c8ce7 100644 --- a/api/.aeria/aeria-sdk.d.ts +++ b/api/.aeria/aeria-sdk.d.ts @@ -9,6 +9,170 @@ import type { } from '@aeriajs/types' declare type MirrorDescriptions = { + "employee": { + "$id": "employee", + "properties": { + "name": { + "type": "string" + }, + "corporate_email": { + "type": "string" + }, + "contact": { + "type": "string" + }, + "employee_status": { + "type": "boolean" + }, + "arrive_date": { + "type": "string", + "format": "date" + }, + "exit_date": { + "type": "string", + "format": "date" + }, + "created_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + } + }, + "icon": "folder-user", + "presets": [ + "crud" + ], + "actions": { + "spawnAdd": { + "label": "action.add", + "event": "spawnAdd", + "icon": "plus", + "button": true, + "translate": true + } + }, + "individualActions": { + "spawnEdit": { + "label": "action.edit", + "event": "spawnEdit", + "icon": "pencil-simple", + "translate": true + }, + "viewItem": { + "label": "action.view", + "icon": "eye", + "translate": true, + "route": { + "name": "/dashboard/:collection/:id", + "setItem": true + } + }, + "remove": { + "label": "action.remove", + "icon": "trash", + "ask": true, + "translate": true + } + } + }, + "equipment": { + "$id": "equipment", + "properties": { + "resource_assigned": { + "$ref": "info", + "indexes": [ + "name_resource" + ] + }, + "asset": { + "type": "string" + }, + "allocation_date": { + "type": "string", + "format": "date-time" + }, + "collection_date": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + } + }, + "icon": "desktop-tower", + "table": [ + "resource_assigned", + "asset", + "allocation_date", + "collection_date" + ], + "required": [ + "resource_assigned", + "asset", + "allocation_date" + ], + "filters": [ + "resource_assigned", + "asset", + "allocation_date", + "collection_date" + ], + "presets": [ + "crud" + ], + "actions": { + "spawnAdd": { + "label": "action.add", + "event": "spawnAdd", + "icon": "plus", + "button": true, + "translate": true + } + }, + "individualActions": { + "spawnEdit": { + "label": "action.edit", + "event": "spawnEdit", + "icon": "pencil-simple", + "translate": true + }, + "viewItem": { + "label": "action.view", + "icon": "eye", + "translate": true, + "route": { + "name": "/dashboard/:collection/:id", + "setItem": true + } + }, + "remove": { + "label": "action.remove", + "icon": "trash", + "ask": true, + "translate": true + } + } + }, "file": { "$id": "file", "icon": "paperclip", @@ -88,6 +252,97 @@ declare type MirrorDescriptions = { } } }, + "info": { + "$id": "info", + "properties": { + "name_resource": { + "type": "string" + }, + "serial_number": { + "type": "string" + }, + "cape": { + "type": "boolean" + }, + "deliver_by": { + "$ref": "user", + "indexes": [ + "name" + ] + }, + "observation": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + } + }, + "icon": "info", + "table": [ + "name_resource", + "serial_number", + "deliver_by", + "observation" + ], + "required": [ + "name_resource", + "serial_number", + "cape", + "deliver_by" + ], + "filters": [ + "name_resource", + "serial_number", + "cape", + "deliver_by" + ], + "presets": [ + "crud" + ], + "actions": { + "spawnAdd": { + "label": "action.add", + "event": "spawnAdd", + "icon": "plus", + "button": true, + "translate": true + } + }, + "individualActions": { + "spawnEdit": { + "label": "action.edit", + "event": "spawnEdit", + "icon": "pencil-simple", + "translate": true + }, + "viewItem": { + "label": "action.view", + "icon": "eye", + "translate": true, + "route": { + "name": "/dashboard/:collection/:id", + "setItem": true + } + }, + "remove": { + "label": "action.remove", + "icon": "trash", + "ask": true, + "translate": true + } + } + }, "tempFile": { "$id": "tempFile", "icon": "file", @@ -165,9 +420,7 @@ declare type MirrorDescriptions = { "items": { "type": "string", "enum": [ - "root", - "supervisor", - "customer" + "RH" ] }, "uniqueItems": true, @@ -321,6 +574,70 @@ declare type MirrorDescriptions = { declare type MirrorRouter = { + "/employee/get": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/employee/getAll": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/employee/insert": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/employee/remove": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/get": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/getAll": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/insert": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/remove": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, "/file/get": { "POST": { "roles": [ @@ -360,6 +677,38 @@ declare type MirrorRouter = { "builtin": true } }, + "/info/get": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/info/getAll": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/info/insert": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/info/remove": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, "/user/get": { "POST": { "roles": [ diff --git a/api/schemas/main.aeria b/api/schemas/main.aeria index d99924e..1ba889f 100644 --- a/api/schemas/main.aeria +++ b/api/schemas/main.aeria @@ -3,10 +3,105 @@ collection TempFile extends aeria.tempFile {} collection User extends aeria.user { properties { roles []enum @values([ - "root", - "supervisor", - "customer" + "RH" ]) } } +collection Employee { + icon "folder-user" + properties { + name str + corporate_email str + contact str + employee_status bool + arrive_date str @format("date") + exit_date str @format("date") + } + functions { + get @expose + getAll @expose + insert @expose + remove @expose + } + presets { + crud + } +} + +collection Info { + icon "info" + properties { + name_resource str + serial_number str + cape bool + deliver_by User + observation str + } + functions { + get @expose + getAll @expose + insert @expose + remove @expose + } + presets { + crud + } + required{ + name_resource + serial_number + cape + deliver_by + } + table{ + name_resource + serial_number + deliver_by + observation + } + filters{ + name_resource + serial_number + cape + deliver_by + } +} + +collection Equipment { + icon "desktop-tower" + properties { + resource_assigned Info + asset str + allocation_date str @format("date-time") + collection_date str @format("date-time") + } + functions { + get @expose + getAll @expose + insert @expose + remove @expose + } + presets { + crud + } + required{ + resource_assigned + asset + allocation_date + } + filters{ + resource_assigned + asset + allocation_date + collection_date + } + table{ + resource_assigned + asset + allocation_date + collection_date + } +} + + + diff --git a/web/.aeria-ui/aeria-sdk.d.ts b/web/.aeria-ui/aeria-sdk.d.ts index 59c3488..42c8ce7 100644 --- a/web/.aeria-ui/aeria-sdk.d.ts +++ b/web/.aeria-ui/aeria-sdk.d.ts @@ -9,6 +9,170 @@ import type { } from '@aeriajs/types' declare type MirrorDescriptions = { + "employee": { + "$id": "employee", + "properties": { + "name": { + "type": "string" + }, + "corporate_email": { + "type": "string" + }, + "contact": { + "type": "string" + }, + "employee_status": { + "type": "boolean" + }, + "arrive_date": { + "type": "string", + "format": "date" + }, + "exit_date": { + "type": "string", + "format": "date" + }, + "created_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + } + }, + "icon": "folder-user", + "presets": [ + "crud" + ], + "actions": { + "spawnAdd": { + "label": "action.add", + "event": "spawnAdd", + "icon": "plus", + "button": true, + "translate": true + } + }, + "individualActions": { + "spawnEdit": { + "label": "action.edit", + "event": "spawnEdit", + "icon": "pencil-simple", + "translate": true + }, + "viewItem": { + "label": "action.view", + "icon": "eye", + "translate": true, + "route": { + "name": "/dashboard/:collection/:id", + "setItem": true + } + }, + "remove": { + "label": "action.remove", + "icon": "trash", + "ask": true, + "translate": true + } + } + }, + "equipment": { + "$id": "equipment", + "properties": { + "resource_assigned": { + "$ref": "info", + "indexes": [ + "name_resource" + ] + }, + "asset": { + "type": "string" + }, + "allocation_date": { + "type": "string", + "format": "date-time" + }, + "collection_date": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + } + }, + "icon": "desktop-tower", + "table": [ + "resource_assigned", + "asset", + "allocation_date", + "collection_date" + ], + "required": [ + "resource_assigned", + "asset", + "allocation_date" + ], + "filters": [ + "resource_assigned", + "asset", + "allocation_date", + "collection_date" + ], + "presets": [ + "crud" + ], + "actions": { + "spawnAdd": { + "label": "action.add", + "event": "spawnAdd", + "icon": "plus", + "button": true, + "translate": true + } + }, + "individualActions": { + "spawnEdit": { + "label": "action.edit", + "event": "spawnEdit", + "icon": "pencil-simple", + "translate": true + }, + "viewItem": { + "label": "action.view", + "icon": "eye", + "translate": true, + "route": { + "name": "/dashboard/:collection/:id", + "setItem": true + } + }, + "remove": { + "label": "action.remove", + "icon": "trash", + "ask": true, + "translate": true + } + } + }, "file": { "$id": "file", "icon": "paperclip", @@ -88,6 +252,97 @@ declare type MirrorDescriptions = { } } }, + "info": { + "$id": "info", + "properties": { + "name_resource": { + "type": "string" + }, + "serial_number": { + "type": "string" + }, + "cape": { + "type": "boolean" + }, + "deliver_by": { + "$ref": "user", + "indexes": [ + "name" + ] + }, + "observation": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "noForm": true, + "readOnly": true, + "isTimestamp": true + } + }, + "icon": "info", + "table": [ + "name_resource", + "serial_number", + "deliver_by", + "observation" + ], + "required": [ + "name_resource", + "serial_number", + "cape", + "deliver_by" + ], + "filters": [ + "name_resource", + "serial_number", + "cape", + "deliver_by" + ], + "presets": [ + "crud" + ], + "actions": { + "spawnAdd": { + "label": "action.add", + "event": "spawnAdd", + "icon": "plus", + "button": true, + "translate": true + } + }, + "individualActions": { + "spawnEdit": { + "label": "action.edit", + "event": "spawnEdit", + "icon": "pencil-simple", + "translate": true + }, + "viewItem": { + "label": "action.view", + "icon": "eye", + "translate": true, + "route": { + "name": "/dashboard/:collection/:id", + "setItem": true + } + }, + "remove": { + "label": "action.remove", + "icon": "trash", + "ask": true, + "translate": true + } + } + }, "tempFile": { "$id": "tempFile", "icon": "file", @@ -165,9 +420,7 @@ declare type MirrorDescriptions = { "items": { "type": "string", "enum": [ - "root", - "supervisor", - "customer" + "RH" ] }, "uniqueItems": true, @@ -321,6 +574,70 @@ declare type MirrorDescriptions = { declare type MirrorRouter = { + "/employee/get": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/employee/getAll": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/employee/insert": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/employee/remove": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/get": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/getAll": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/insert": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/equipment/remove": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, "/file/get": { "POST": { "roles": [ @@ -360,6 +677,38 @@ declare type MirrorRouter = { "builtin": true } }, + "/info/get": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/info/getAll": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/info/insert": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, + "/info/remove": { + "POST": { + "roles": [ + "root" + ], + "builtin": true + } + }, "/user/get": { "POST": { "roles": [