Inventory & Equipment Management
Relevant source files
The following files were used as context for generating this wiki page:
- apps/gauzy/src/app/pages/inventory/components/table-inventory-items/table-inventory.component.ts
- packages/mcp-server/src/lib/schema.ts
- apps/gauzy-e2e/src/support/Base/pageobjects/OrganizationInventoryPageObject.ts
- apps/gauzy-e2e/src/integration/OrganizationInventoryTest.ts
- apps/gauzy-e2e/src/support/step_definitions/OrganizationInventoryTest/OrganizationInventoryTest.ts
- packages/ui-core/i18n/assets/i18n/en.json
- README.md
The Inventory & Equipment Management system is a core Enterprise Resource Planning (ERP) feature within the Gauzy platform. It provides a comprehensive solution for businesses to manage their products, track stock levels across different warehouses, and oversee the sharing and status of company equipment. This module is integral to supply chain management, sales, and asset tracking.
The system is built around several key entities: Product, ProductCategory, ProductType, Warehouse, Merchant, and Equipment. These entities are interconnected to provide a holistic view of an organization's assets. The user interface allows for creating, viewing, updating, and deleting these items through a filterable and paginated table, with options for different layout views.
Core Entities and Relationships
The Inventory & Equipment module is composed of several interconnected data models that work together to represent an organization's assets. The primary entities are Product, Warehouse, and Equipment. Products are further organized by ProductCategory and ProductType. Warehouses can be associated with Merchants.
Sources: packages/mcp-server/src/lib/schema.ts
Entity Relationship Diagram
This diagram illustrates the relationships between the main entities in the Inventory & Equipment Management system.
Product
The Product entity represents an item in the inventory. It can be a digital, physical, or service-based product.
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the product. |
code | string | A unique code for the product. |
enabled | boolean | Whether the product is active. Defaults to true. |
imageUrl | string | URL for the product's image. |
featuredImageId | string | ID of the featured image asset. |
productTypeId | string | Foreign key for the ProductType. |
productCategoryId | string | Foreign key for the ProductCategory. |
translations | array | An array of translations for the product name and description. |
tags | array | Associated tags for categorization and filtering. |
variants | array | Different versions of the product (e.g., size, color). |
Sources: packages/mcp-server/src/lib/schema.ts:1002-1033
Warehouse
The Warehouse entity represents a physical or logical location where products are stored.
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the warehouse. |
name | string | The name of the warehouse. |
code | string | A unique code for the warehouse. |
email | string | Contact email for the warehouse. |
active | boolean | Whether the warehouse is active. Defaults to true. |
logoId | string | ID of the logo image asset. |
contactId | string | Foreign key for the associated Contact entity. |
products | array | A list of products stored in the warehouse with their quantities. |
merchants | array | Associated merchants. |
Sources: packages/mcp-server/src/lib/schema.ts:1377-1400
Equipment
The Equipment entity represents a physical asset owned by the organization that can be shared or assigned to employees.
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the equipment. |
name | string | The name of the equipment. |
type | EquipmentTypeEnum | The type of equipment (e.g., LAPTOP, MONITOR). |
serialNumber | string | The equipment's serial number. |
status | EquipmentStatusEnum | The current status (e.g., AVAILABLE, ASSIGNED). |
initialValue | number | The initial cost of the equipment. |
currency | CurrenciesEnum | The currency of the initial value. |
maxSharePeriod | number | Maximum number of days the equipment can be shared. |
autoApproveShare | boolean | If sharing requests are automatically approved. |
assignedToEmployeeId | string | The ID of the employee the equipment is assigned to. |
Sources: packages/mcp-server/src/lib/schema.ts:1238-1277
Frontend Implementation
The user interface for Inventory Management is handled by the InventoryModule. The primary component for displaying and interacting with inventory items is the TableInventoryComponent.
Sources: apps/gauzy/src/app/pages/inventory/components/table-inventory-items/table-inventory.component.ts
TableInventoryComponent
This component is responsible for fetching and displaying a list of products. It supports both a table layout and a cards grid layout. It uses ServerDataSource to handle server-side pagination, filtering, and sorting.
This diagram shows the key properties and methods of the TableInventoryComponent.
Inventory Table View
The inventory items are displayed in a smart table with server-side data handling. The table provides filtering capabilities for various columns.
| Column | Description | Filter Component |
|---|---|---|
image | Displays the product's featured image. | None |
name | Displays the product's name and description. | None |
code | The unique product code. | InputFilterComponent |
productType | The type of the product. | ProductTypeFilterComponent |
productCategory | The category of the product. | ProductCategoryFilterComponent |
tags | Displays associated tags. | None |
User Workflows
The end-to-end tests outline the primary user workflows for managing inventory, including creating products, categories, types, warehouses, and merchants.
Sources: apps/gauzy-e2e/src/integration/OrganizationInventoryTest.ts, apps/gauzy-e2e/src/support/step_definitions/OrganizationInventoryTest/OrganizationInventoryTest.ts
Adding a New Inventory Item
The process of adding a new inventory item involves navigating to the inventory page, selecting the product type and category, and filling out the product details.
This flowchart shows the steps a user takes to add a new inventory item.
Managing Related Entities
In addition to products, users can manage related entities that provide structure and context to the inventory.
- Product Categories & Types: Users can create, edit, and delete product categories and types. This is done from dedicated pages accessible from the main inventory screen.
- Warehouses: Users can create, edit, and delete warehouses. This includes defining the warehouse name, code, contact information, and location.
- Merchants: Merchants (or stores) can be created and associated with warehouses. This involves providing merchant details like name, contact info, and location.
These actions follow a similar pattern of navigating to the respective management page, using a table to view existing items, and using "Add", "Edit", and "Delete" buttons to perform CRUD operations.
Sources: apps/gauzy-e2e/src/support/step_definitions/OrganizationInventoryTest/OrganizationInventoryTest.ts:25-30, 292-581, apps/gauzy-e2e/src/app/pages/inventory/components/table-inventory-items/table-inventory.component.ts:232-247