commonMain.cccev.s2.requirement.domain.command.RequirementUpdateCommand.kt Maven / Gradle / Ivy
package cccev.s2.requirement.domain.command
import cccev.s2.requirement.domain.D2RequirementPage
import cccev.s2.requirement.domain.RequirementCommand
import cccev.s2.requirement.domain.RequirementEvent
import cccev.s2.requirement.domain.RequirementId
import kotlin.js.JsExport
import kotlin.js.JsName
import kotlinx.serialization.Serializable
/**
* Update a requirement.
* @d2 function
* @parent [D2RequirementPage]
* @order 10
*/
interface RequirementUpdateFunction
@JsExport
@JsName("RequirementUpdateCommandDTO")
interface RequirementUpdateCommandDTO: RequirementCommand {
/**
* Identifier of the requirement to update.
*/
override val id: RequirementId
/**
* Name of the requirement.
* @example [cccev.s2.requirement.domain.model.Requirement.name]
*/
val name: String?
/**
* 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?
// /**
// * Sub-requirements that must be fulfilled for the requirement to be validated.
// * @example [cccev.s2.requirement.domain.model.Requirement.hasRequirement]
// */
// val hasRequirement: List
//
// /**
// * Concepts used by the requirement
// * @example [cccev.s2.requirement.domain.model.Requirement.hasConcept]
// */
// val hasConcept: List
//
// /**
// * 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
}
/**
* @d2 command
* @parent [RequirementUpdateFunction]
*/
@Serializable
data class RequirementUpdateCommand(
override val id: RequirementId,
override val name: String? = null,
override val description: String? = null,
// override val hasRequirement: List,
// override val hasConcept: List,
// override val hasEvidenceTypeList: List
): RequirementUpdateCommandDTO
@JsExport
@JsName("RequirementUpdatedEventDTO")
interface RequirementUpdatedEventDTO: RequirementEvent {
/**
* Identifier of the updated requirement.
*/
override val id: RequirementId
val name: String?
val description: String?
}
/**
* @d2 event
* @parent [RequirementUpdateFunction]
*/
@Serializable
data class RequirementUpdatedEvent(
override val id: RequirementId,
override val name: String? = null,
override val description: String? = null,
): RequirementUpdatedEventDTO {
override fun s2Id() = id
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy