Blueprint projects
- Frontend
- Blueprint assignments
- Blueprint builders
- Blueprint general
- Blueprint how to
- Blueprint tools
- Backend
Base-data
Introduction
In all our application we use a lot of key value lists. For example client types. The purpose of base-data is to prevent development time waste, make all our list translatable and managable by our client. The @capturum/complete package contains functionalities to support these base-data lists. Base-data consists of two parts: base-data key and base-data values. A base-data key contains multiple values and a base-data value belongs to one base-data key.
Interface
export interface BaseDataValueApi {
id: string;
value: string;
parent_id?: string;
base_data_key_id: string;
tenant_id: string | number;
translations?: BaseTranslation[];
attributes?: any[];
created_at: string;
updated_at: string;
}
export interface BaseTranslation {
id: string;
locale_id: string;
translation: string;
}
BaseDataKeyService
Endpoint: base-data-key
The BaseDataKeyService is an ApiService which extends the ApiService of the @capturum/api package. This service is used to retrieve base-data keys.
BaseDataValueService
Endpoint: base-data-value
The BaseDataValueService is an ApiService which extends the ApiService of the @capturum/api package. This service is used to retrieve/post base-data values
BaseDataListComponent
Route: /admin/base-data/:id/values
The BaseDataListComponent is a standard complete list component. This means that it’s a page which extends the BaseListComponent of the @capturum/shared package. The HTML contains an CapturumInfoTable component and a button to add a base-data value. It gets the data from the BaseDataValueService which extends the ApiService class of the @capturum/api package. The BaseDataListComponent displays the values belonging to the given base-data key.

BaseDataListComponent
Routes:
admin/base-data/:baseDataKeyId/values/addadmin/base-data/:baseDataKeyId/values/:id
The BaseDataDetailComponent is a detail component for adding or editing a base-data value. The page displays a form with the value, parent and translations for the base-data value.

How to retrieve base-data values by key
It’s very common to want to retrieve the base-data values of a specific base-data key. To accomplish this you can do the following:
import { BaseDataKeyService } from '@capturum/complete';
constructor(private baseDataKeyService: BaseDataKeyService) {...}
this.baseDataKeyService.getBaseDataKeyValues('base-data.currencies').subscribe(...);