Add signature and use id
This commit is contained in:
@@ -23,17 +23,19 @@ data class MantraArtifact(
|
||||
val license: String,
|
||||
// val artifactApprovalId: String,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
fun toArtifactEvent(): ArtifactEvent {
|
||||
return ArtifactEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ data class MantraArtifactVersion(
|
||||
*/
|
||||
val versionLabel: String,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
fun toArtifactVersionEvent(): ArtifactVersionEvent {
|
||||
return ArtifactVersionEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,18 +23,20 @@ data class MantraChapter(
|
||||
val wordCount: Int,
|
||||
val characterCount: Int,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
fun toChapterEvent(): ChapterEvent {
|
||||
return ChapterEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,18 +22,20 @@ data class MantraChunk(
|
||||
val wordCount: Int,
|
||||
val characterCount: Int,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
fun toChunkEvent(): ChunkEvent {
|
||||
return ChunkEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,20 @@ data class MantraDialect(
|
||||
val country: String,
|
||||
val language: String,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
fun toDialectEvent(): DialectEvent {
|
||||
return DialectEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -20,18 +20,20 @@ data class MantraTranslation(
|
||||
val translationArtifactVersionId: HexKey,
|
||||
val text: String,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
fun toTranslationEvent(): TranslationEvent {
|
||||
return TranslationEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -21,18 +21,20 @@ data class MantraTranslationArtifactVersion(
|
||||
val name: String,
|
||||
val visibility: String,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
fun toTranslationArtifactVersionEvent(): TranslationArtifactVersionEvent {
|
||||
return TranslationArtifactVersionEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ data class MantraTranslationArtifactVersionEditor(
|
||||
val translationArtifactVersionId: HexKey,
|
||||
val editorPublicKey: HexKey,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
@@ -18,17 +18,19 @@ data class MantraTranslationChapter(
|
||||
val translationArtifactVersionId: HexKey,
|
||||
val index: Int,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
fun toTranslationChapterEvent(): TranslationChapterEvent {
|
||||
return TranslationChapterEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ data class MantraTranslationChapterProofReader(
|
||||
val translationChapterId: HexKey,
|
||||
val proofReaderPublicKey: HexKey,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
@@ -20,6 +20,8 @@ data class MantraTranslationChapterTranslator(
|
||||
val translationChapterId: HexKey,
|
||||
val translatorPublicKey: HexKey,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
@@ -21,18 +21,20 @@ data class MantraTranslationChunk(
|
||||
val chunkId: HexKey,
|
||||
val translationChapterId: HexKey,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
fun toTranslationChunkEvent(): TranslationChunkEvent {
|
||||
return TranslationChunkEvent(
|
||||
id = "",
|
||||
id = id,
|
||||
pubKey = publicKey,
|
||||
createdAt = createdAt.epochSeconds,
|
||||
tags = emptyArray(),
|
||||
content = "",
|
||||
sig = ""
|
||||
sig = signature
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ data class MantraTranslationTranslator(
|
||||
val translationId: HexKey,
|
||||
val translatorPublicKey: HexKey,
|
||||
|
||||
val signature: String,
|
||||
|
||||
override val createdAt: Instant = Clock.System.now(),
|
||||
override val updatedAt: Instant = createdAt
|
||||
): TimestampedEntity {
|
||||
|
||||
Reference in New Issue
Block a user