diff --git a/.env.example b/.env.example index a10f75c..0753eaa 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,12 @@ -# Local development only (`npm run dev`). Reference for the values -# `npm run dev` reads from .env; nothing here is used by a deployed build. -# -# In a deployed environment these values come from config.js, which the server -# writes when it places the build. Do not commit environment-specific values — -# one build is promoted across environments unchanged. -VITE_ZINO_API_URL=http://localhost:8085 -VITE_ZINO_MOCK=false +# Copy to .env.local and adjust. Vite only exposes vars prefixed with VITE_. + +# Auth host — POST /usr/login +VITE_API_BASE_URL=https://dev-apps.getzino.in + +# App/workflow host — POST /app/{APP_ID}/start +VITE_APP_API_BASE_URL=https://dev.getzino.in + +# Asset workflow — take workflow_uuid from the asset activity's sample cURL in +# the Zino editor. The uuid in the editor URL is a different id and is rejected. +# VITE_ASSET_WORKFLOW_UUID= +# VITE_ASSET_WORKFLOW_VERSION=1 diff --git a/.gitignore b/.gitignore index 5b08070..558d8b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ -node_modules/ -dist/ -.env +node_modules +dist +dist-ssr *.local +.vite +.DS_Store +npm-debug.log* +.env \ No newline at end of file diff --git a/Employee_data.postman_collection.json b/Employee_data.postman_collection.json new file mode 100644 index 0000000..f89f1cd --- /dev/null +++ b/Employee_data.postman_collection.json @@ -0,0 +1,133 @@ +{ + "info": { + "name": "Employee Data (Zino)", + "description": "All 5 APIs used by the Employee Data app. Run 'Login' first - it saves the token automatically for the other requests.", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "variable": [ + { "key": "auth_url", "value": "https://dev-apps.getzino.in" }, + { "key": "app_url", "value": "https://dev.getzino.in" }, + { "key": "token", "value": "" } + ], + "item": [ + { + "name": "1. Login", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "if (pm.response.code === 200) {", + " var t = pm.response.json().token;", + " pm.collectionVariables.set('token', t);", + " console.log('Token saved.');", + "} else {", + " console.log('Login failed:', pm.response.text());", + "}" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "url": { "raw": "{{auth_url}}/usr/login", "host": ["{{auth_url}}"], "path": ["usr", "login"] }, + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"YOUR_EMAIL\",\n \"password\": \"YOUR_PASSWORD\"\n}" + } + } + }, + { + "name": "2. Employee List", + "request": { + "method": "POST", + "header": [ + { "key": "Content-Type", "value": "application/json" }, + { "key": "Authorization", "value": "Bearer {{token}}" } + ], + "url": { "raw": "{{app_url}}/app/531/view/recordview", "host": ["{{app_url}}"], "path": ["app", "531", "view", "recordview"] }, + "body": { + "mode": "raw", + "raw": "{\n \"rv_template_uid\": \"f3b07dfd-ddcf-4039-ba82-078179a16f21\",\n \"preset_alias\": \"\",\n \"params\": {},\n \"search_query\": { \"page\": 1, \"limit\": 10, \"sort_by\": \"\", \"sort_dir\": \"\", \"search\": \"\", \"filters\": [] }\n}" + } + } + }, + { + "name": "3. Asset List", + "request": { + "method": "POST", + "header": [ + { "key": "Content-Type", "value": "application/json" }, + { "key": "Authorization", "value": "Bearer {{token}}" } + ], + "url": { "raw": "{{app_url}}/app/531/view/recordview", "host": ["{{app_url}}"], "path": ["app", "531", "view", "recordview"] }, + "body": { + "mode": "raw", + "raw": "{\n \"rv_template_uid\": \"c91be68b-2650-44ef-b566-8f7ca3b85b28\",\n \"preset_alias\": \"\",\n \"params\": {},\n \"search_query\": { \"page\": 1, \"limit\": 10, \"sort_by\": \"\", \"sort_dir\": \"\", \"search\": \"\", \"filters\": [] }\n}" + } + } + }, + { + "name": "4. Create Employee", + "request": { + "method": "POST", + "header": [ + { "key": "Content-Type", "value": "application/json" }, + { "key": "Authorization", "value": "Bearer {{token}}" } + ], + "url": { "raw": "{{app_url}}/app/531/start", "host": ["{{app_url}}"], "path": ["app", "531", "start"] }, + "body": { + "mode": "raw", + "raw": "{\n \"activity_id\": \"d42f026c-f9ac-4170-91c4-f1570d815d7a\",\n \"workflow_uuid\": \"f4a303c2-869a-47d5-a5f3-1d2f7d5ae58e\",\n \"version\": 1,\n \"data\": {\n \"field_1\": \"John\",\n \"field_34\": \"Doe\",\n \"field_2\": \"john.doe@example.com\",\n \"field_3\": 9876543210,\n \"field_4\": \"2026-09-23\",\n \"field_6\": \"permanent\",\n \"field_35\": \"Engineering\",\n \"field_36\": \"Developer\",\n \"field_37\": \"active\",\n \"field_38\": \"EMP001\"\n }\n}" + } + } + }, + { + "name": "5. Create Asset", + "request": { + "method": "POST", + "header": [ + { "key": "Content-Type", "value": "application/json" }, + { "key": "Authorization", "value": "Bearer {{token}}" } + ], + "url": { "raw": "{{app_url}}/app/531/start", "host": ["{{app_url}}"], "path": ["app", "531", "start"] }, + "body": { + "mode": "raw", + "raw": "{\n \"activity_id\": \"a2405547-0db4-474b-aa76-af1246d01a6a\",\n \"workflow_uuid\": \"b5ea718c-e1a3-4d73-ac72-d0fc25f8b611\",\n \"version\": 1,\n \"data\": {\n \"field_43\": \"laptop\",\n \"field_42\": \"Dell Latitude 5440\",\n \"field_44\": \"SN123456\",\n \"field_45\": \"2026-09-01\",\n \"field_46\": 75000,\n \"field_47\": \"new\"\n }\n}" + } + } + }, + { + "name": "6. Update Employee", + "request": { + "method": "POST", + "header": [ + { "key": "Content-Type", "value": "application/json" }, + { "key": "Authorization", "value": "Bearer {{token}}" } + ], + "url": { "raw": "{{app_url}}/app/531/activity", "host": ["{{app_url}}"], "path": ["app", "531", "activity"] }, + "body": { + "mode": "raw", + "raw": "{\n \"activity_id\": \"95d39136-519f-4558-95e4-df326f6fb68c\",\n \"data\": {\n \"field_9\": \"John\",\n \"field_8\": \"Doe\",\n \"field_10\": \"john.doe@example.com\",\n \"field_11\": 9876543210,\n \"field_5\": \"2026-09-23\",\n \"field_7\": \"permanent\",\n \"field_12\": \"Engineering\",\n \"field_13\": \"Senior Developer\",\n \"field_14\": \"active\",\n \"field_15\": \"EMP001\"\n },\n \"instance_id\": \"INSTANCE_ID_FROM_INIT\",\n \"workflow_uuid\": \"f4a303c2-869a-47d5-a5f3-1d2f7d5ae58e\"\n}" + } + } + }, + { + "name": "7. Mark Employee Inactive", + "request": { + "method": "POST", + "header": [ + { "key": "Content-Type", "value": "application/json" }, + { "key": "Authorization", "value": "Bearer {{token}}" } + ], + "url": { "raw": "{{app_url}}/app/531/activity", "host": ["{{app_url}}"], "path": ["app", "531", "activity"] }, + "body": { + "mode": "raw", + "raw": "{\n \"activity_id\": \"7dcde7c9-82ce-4dd5-bcca-68fca6904eb4\",\n \"data\": {\n \"field_16\": \"2026-09-25\",\n \"field_33\": \"Reason for leaving\",\n \"field_39\": { \"id\": 8 },\n \"field_40\": { \"id\": 8, \"employee_code\": \"7656565\" }\n },\n \"instance_id\": \"INSTANCE_ID_FROM_INIT\",\n \"workflow_uuid\": \"f4a303c2-869a-47d5-a5f3-1d2f7d5ae58e\"\n}" + } + } + } + ] +} diff --git a/asset-lifecycle-diagram.png b/asset-lifecycle-diagram.png new file mode 100644 index 0000000..cfc6035 Binary files /dev/null and b/asset-lifecycle-diagram.png differ diff --git a/docs/asset-assignment-workflow.html b/docs/asset-assignment-workflow.html new file mode 100644 index 0000000..27709fc --- /dev/null +++ b/docs/asset-assignment-workflow.html @@ -0,0 +1,221 @@ + + +
+ +States an Assigned Asset can be in, and the activities the Asset Manager, the System and the Employee perform to move it between them.
+States · boxes are the four states, arrows are the activities that change state
+ + +Activities · who does what, in order, and the asset state after each step
+