Shared Specification
Description
A Specification that is part of the Shared Kernel.
Definition Schema
The definition for a shared_specification
component expects the following structure:
{
"$defs": {
"SpecificationParameterInputDTO": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"type_str": {
"title": "Type Str",
"type": "string"
},
"default_value_str": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Default Value Str"
}
},
"required": [
"name",
"type_str"
],
"title": "SpecificationParameterInputDTO",
"type": "object"
}
},
"properties": {
"name": {
"description": "Name of the Specification class (e.g., UserIsActive).",
"title": "Name",
"type": "string"
},
"applies_to_entity_name": {
"description": "Name of the entity this specification applies to (e.g., User).",
"title": "Applies To Entity Name",
"type": "string"
},
"applies_to_entity_module": {
"description": "Module path for the entity (e.g., app_root_name.domain.users.aggregates.user_aggregate).",
"title": "Applies To Entity Module",
"type": "string"
},
"constructor_parameters": {
"description": "Parameters for the __init__ method.",
"items": {
"$ref": "#/$defs/SpecificationParameterInputDTO"
},
"title": "Constructor Parameters",
"type": "array"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional docstring for the class.",
"title": "Description"
}
},
"required": [
"name",
"applies_to_entity_name",
"applies_to_entity_module"
],
"title": "SpecificationEngineInputDTO",
"type": "object"
}
Naming and Location Conventions
Class: PascalCase, typically ends with 'Specification'. File: ${shared_specification_name}.py
(based on ${shared_specification_name}
). Location: app/domain/shared_kernel/specifications
.
Example Definition
No example available.