About Layouts
Date | Responsible | Changes |
---|---|---|
October 24, 2024 | @Luis Fidelis | Initial version |
Ledger Layouts
Overview
A ledger layout is a structured template that defines records that should be created or updated within a ledger. It serves as a blueprint for managing standardized models and keep consistency of data for operations in different environments.
Key Concepts
What is a Ledger Layout?
A ledger layout is essentially a predefined structure that maps how different records or fields should be stored in a ledger in order to compose a model or operation that is repeated all the time. It is used to maintain consistency especially when working with complex datasets that require specific formatting, like schemas and policies.
Why to use Ledger Layouts?
- Standardization: Layouts provide a consistent format for data across different operations, reducing errors and ensuring uniformity.
- Automation: Using layouts allows for automated data transformations and validations, streamlining ledger updates.
- Flexibility: Variables in layouts enable dynamic customization, making it possible to adapt to changing data requirements with minimal effort.
Layout Inputs
Layouts can include variables, represented by placeholders in the format {{ inputs.<variableName> }}
, which allow for dynamic adjustments to accommodate different requirements while using a standard template.
The schemas of inputs are defined with JSON Schema vocabulary, which supports not only the enumeration of variables, but also their types and constraints e.g. minLength
for consistency.
See an example of a layout with inputs.
The layout above defines the foundation of a bank domain, which includes the following records:
- domain
- wallet
- circles
The variable domainName
is widely used in the layout and composes the handle of the new domain and wallet, as well as the circle handles.
For more information on the template language used in layouts, consult the SelectTransform documentation.