commonMain.cccev.s2.requirement.domain.command.RequirementCreateCommand.kt Maven / Gradle / Ivy
package cccev.s2.requirement.domain.command
import cccev.dsl.model.EvidenceTypeListId
import cccev.dsl.model.FrameworkId
import cccev.s2.concept.domain.InformationConceptId
import cccev.s2.requirement.domain.D2RequirementPage
import cccev.s2.requirement.domain.RequirementEvent
import cccev.s2.requirement.domain.RequirementId
import cccev.s2.requirement.domain.RequirementInitCommand
import cccev.s2.requirement.domain.RequirementState
import cccev.s2.requirement.domain.model.RequirementIdentifier
import cccev.s2.requirement.domain.model.RequirementKind
import kotlin.js.JsExport
import kotlin.js.JsName
import kotlinx.serialization.Serializable
/**
* Create a new requirement.
* @d2 function
* @parent [D2RequirementPage]
* @order 10
*/
interface RequirementCreateFunction
/**
* @d2 command
* @parent [RequirementCreateFunction]
*/
@Serializable
data class RequirementCreateCommand(
/**
* A custom identifier for the requirement
* @example [cccev.s2.requirement.domain.model.Requirement.identifier]
*/
val identifier: String? = null,
/**
* Subtype used for the requirement.
* @example [cccev.s2.requirement.domain.model.Requirement.kind]
*/
val kind: RequirementKind,
/**
* Name of the requirement.
* @example [cccev.s2.requirement.domain.model.Requirement.name]
*/
val name: String? = null,
/**
* Description of the requirement.
* If the requirement is a constraint, this field must contain an expression returning a boolean.
* For now, this expression will be evaluated using a Kotlin engine.
* The expression may contain known information concepts, identified by their id. They must be declared in the `hasConcept` field.
* @example [cccev.s2.requirement.domain.model.Requirement.description]
*/
val description: String? = null,
/**
* @ref [cccev.s2.requirement.domain.model.Requirement.type]
*/
val type: String? = null,
/**
* @ref [cccev.s2.requirement.domain.model.Requirement.isDerivedFrom]
*/
val isDerivedFrom: List = emptyList(),
/**
* Sub-requirements that must be fulfilled for the requirement to be validated.
* @example [cccev.s2.requirement.domain.model.Requirement.hasRequirement]
*/
val hasRequirement: List = emptyList(),
/**
* @ref [cccev.s2.requirement.domain.model.Requirement.hasQualifiedRelation]
*/
var hasQualifiedRelation: Map>,
/**
* Concepts used by the requirement
* @example [cccev.s2.requirement.domain.model.Requirement.hasConcept]
*/
val hasConcept: List = emptyList(),
/**
* Evidences that must be provided for the requirement to be validated.
* This list represents an OR-relation, i.e. only one of the specified evidence lists has to be fully provided.
* @example [cccev.s2.requirement.domain.model.Requirement.hasEvidenceTypeList]
*/
val hasEvidenceTypeList: List = emptyList()
): RequirementInitCommand
@JsExport
@JsName("RequirementCreatedEventDTO")
interface RequirementCreatedEventDTO: RequirementEvent {
/**
* Identifier of the created requirement
*/
override val id: RequirementId
/**
* @ref [RequirementCreateCommand.identifier]
*/
val identifier: RequirementIdentifier?
/**
* @ref [RequirementCreateCommand.kind]
*/
val kind: RequirementKind
/**
* @ref [RequirementCreateCommand.name]
*/
val name: String?
/**
* @ref [RequirementCreateCommand.description]
*/
val description: String?
/**
* @ref [cccev.s2.requirement.domain.model.Requirement.type]
*/
val type: String?
/**
* @ref [RequirementCreateCommand.isDerivedFrom]
*/
val isDerivedFrom: List?
/**
* @ref [RequirementCreateCommand.hasRequirement]
*/
val hasRequirement: List
/**
* @ref [RequirementCreateCommand.hasQualifiedRelation]
*/
val hasQualifiedRelation: Map>
/**
* @ref [RequirementCreateCommand.hasConcept]
*/
val hasConcept: List
/**
* @ref [RequirementCreateCommand.hasEvidenceTypeList]
*/
val hasEvidenceTypeList: List
/**
* State of the created requirement
* @example "CREATED"
*/
val status: RequirementState
}
/**
* @d2 event
* @parent [RequirementCreateFunction]
*/
@Serializable
data class RequirementCreatedEvent(
override val id: RequirementId,
override val identifier: RequirementIdentifier? = null,
override val kind: RequirementKind,
override val name: String? = null,
override val description: String? = null,
override val type: String? = null,
override val isDerivedFrom: List? = null,
override val hasRequirement: List = emptyList(),
override val hasQualifiedRelation: Map> = emptyMap(),
override val hasConcept: List = emptyList(),
override val hasEvidenceTypeList: List = emptyList(),
override val status: RequirementState
): RequirementCreatedEventDTO
© 2015 - 2025 Weber Informatics LLC | Privacy Policy