Assets can be created through the Assets Board interface, which provides a comprehensive form for capturing all asset details.
1
Navigate to Assets Module
Access the assets page from the main navigation. The interface shows the “Maestro de activos” (Asset Master) board with an ERP-style operational view (src/pages/admin/AssetsHomePage.tsx:11).
2
Click 'Nuevo activo' Button
The create button is located in the header section of the Assets Board (src/components/dashboard/admin/assets/AssetsBoard.tsx:477).
3
Fill Asset Details
Complete the asset form with required and optional information:Required Fields:
Code (unique identifier)
Name
Status
Criticality (1-5)
Optional Fields:
Description
Location
Category
Manufacturer, Model, Serial Number
Purchase and installation dates
Financial information (cost, salvage value)
Warranty end date
4
Save the Asset
The system validates the data and creates the asset record. New assets are immediately available in the asset list.
Assets can also be created programmatically using the assetsService:
import { createAsset } from '@/services/assetsService';import type { AssetInsert } from '@/types/Asset';const newAsset: AssetInsert = { code: 'HVAC-101', name: 'Rooftop Air Conditioning Unit', description: 'Main HVAC unit for Building A', location_id: 5, category_id: 2, asset_type: 'HVAC', criticality: 4, status: 'OPERATIVO', is_active: true, manufacturer: 'Carrier', model: 'AquaEdge 19DV', serial_number: 'SN-2024-HVAC-101', asset_tag: 'TAG-HVAC-101', purchase_date: '2024-01-15', install_date: '2024-02-01', warranty_end_date: '2026-01-15', purchase_cost: 25000.00, salvage_value: 5000.00, image_url: null};const asset = await createAsset(newAsset);console.log(`Asset created with ID: ${asset.id}`);
The createAsset function is defined in src/services/assetsService.ts:90-98 and automatically handles timestamp fields (created_at, updated_at) and audit fields (created_by, updated_by).
Click on any asset row in the assets table to select it. The selected asset is highlighted with an indigo background (src/components/dashboard/admin/assets/AssetsBoard.tsx:667).
2
Click 'Editar seleccionado'
The edit button is available in the header toolbar and in the detail panel (AssetsBoard.tsx:485, AssetsBoard.tsx:743).
3
Modify Fields
Update any asset field including status, location, technical specifications, or preventive maintenance configuration.
4
Save Changes
Changes are persisted to the database and the asset list is refreshed.
import { deactivateAsset } from '@/services/assetsService';const result = await deactivateAsset(123);console.log(`Asset ${result.id} is now inactive: ${result.is_active}`);
import { activateAsset } from '@/services/assetsService';const result = await activateAsset(123);console.log(`Asset ${result.id} is now active: ${result.is_active}`);
Deactivated assets remain in the database but can be filtered out of lists using the includeInactive parameter in listAssetOptions (assetsService.ts:57-75).
import { linkAssetToTicket } from '@/services/assetsService';import type { TicketAssetInsert } from '@/types/Asset';const link: TicketAssetInsert = { ticket_id: 456, asset_id: 123, is_primary: true, created_by: currentUser.id};const association = await linkAssetToTicket(link);
Primary Asset
Multiple Assets
Remove Link
One asset can be marked as primary for each work order. This is typically the main equipment being serviced.
import { setPrimaryAssetForTicket } from '@/services/assetsService';await setPrimaryAssetForTicket({ ticket_id: 456, asset_id: 123});// Sets is_primary=true for asset 123, false for all others
A single work order can be associated with multiple assets. For example, a maintenance task that affects multiple pumps in a system.