commonMain.cccev.s2.concept.domain.command.InformationConceptCreateCommand.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cccev-concept-domain-jvm Show documentation
Show all versions of cccev-concept-domain-jvm Show documentation
Kotlin implementation of Core Criterion and Core Evidence Vocabulary
package cccev.s2.concept.domain.command
import cccev.s2.concept.domain.D2InformationConceptPage
import cccev.s2.concept.domain.InformationConceptEvent
import cccev.s2.concept.domain.InformationConceptId
import cccev.s2.concept.domain.InformationConceptInitCommand
import cccev.s2.concept.domain.InformationConceptState
import cccev.s2.unit.domain.DataUnitId
import kotlinx.serialization.Serializable
import kotlin.js.JsExport
import kotlin.js.JsName
/**
* Create a new information concept.
* @d2 function
* @parent [D2InformationConceptPage]
* @order 10
*/
interface InformationConceptCreateFunction
@JsExport
@JsName("InformationConceptCreateCommandDTO")
interface InformationConceptCreateCommandDTO: InformationConceptInitCommand {
/**
* Custom identifier of the information concept.
* @example [cccev.s2.concept.domain.model.InformationConcept.identifier]
*/
val identifier: String?
/**
* The name of the information concept.
* @example [cccev.s2.concept.domain.model.InformationConcept.name]
*/
val name: String
/**
* The data unit used for the information concept.
* @example [cccev.s2.concept.domain.model.InformationConcept.unit]
*/
val hasUnit: DataUnitId?
/**
* The description of the information concept.
* @example [cccev.s2.concept.domain.model.InformationConcept.description]
*/
val description: String?
/**
* Expression to evaluate in order to auto-compute the SupportedValue associated with the information concept, if applicable.
* For now, the expression will be evaluated using a Kotlin engine.
* The expression may contain other known information concepts, identified by their id. They must be declared in the `dependsOn` field.
* @example [cccev.s2.concept.domain.model.InformationConcept.expressionOfExpectedValue]
*/
val expressionOfExpectedValue: String?
/**
* A list of information concepts the one depends on for auto-computation, if applicable.
* @example [cccev.s2.concept.domain.model.InformationConcept.dependsOn]
*/
val dependsOn: List?
}
/**
* @d2 command
* @parent [InformationConceptCreateFunction]
*/
@Serializable
data class InformationConceptCreateCommand(
override val name: String,
override val identifier: String? = null,
override val hasUnit: DataUnitId? = null,
override val description: String? = null,
override val expressionOfExpectedValue: String? = null,
override val dependsOn: List? = emptyList()
): InformationConceptCreateCommandDTO
/**
* @d2 event
* @parent [InformationConceptCreateFunction]
*/
@JsExport
@JsName("InformationConceptCreatedEventDTO")
interface InformationConceptCreatedEventDTO: InformationConceptEvent {
/**
* Identifier of the created information concept.
*/
val id: InformationConceptId
/**
* @ref [InformationConceptCreateCommandDTO.identifier]
*/
val identifier: String?
/**
* @ref [InformationConceptCreateCommandDTO.name]
*/
val name: String
/**
* @ref [InformationConceptCreateCommandDTO.hasUnit]
*/
val hasUnit: DataUnitId?
/**
* @ref [InformationConceptCreateCommandDTO.description]
*/
val description: String?
/**
* @ref [InformationConceptCreateCommandDTO.expressionOfExpectedValue]
*/
val expressionOfExpectedValue: String?
/**
* @ref [InformationConceptCreateCommandDTO.dependsOn]
*/
val dependsOn: List?
/**
* Status of the information concept
*/
val status: InformationConceptState
}
/**
* @d2 inherit
*/
@Serializable
data class InformationConceptCreatedEvent(
override val id: InformationConceptId,
override val identifier: String? = null,
override val name: String,
override val hasUnit: DataUnitId? = null,
override val description: String? = null,
override val expressionOfExpectedValue: String? = null,
override val dependsOn: List? = emptyList(),
override val status: InformationConceptState
): InformationConceptCreatedEventDTO {
override fun s2Id() = id
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy