core/architecture/api/README.md
High‑level primitives shared across modules in this project.
Small, cross‑module primitives for strongly‑typed identifiers.
BaseIdentifier<T>: base class for strongly-typed identifiers.BaseUuidIdentifier: specialized base for UUID-based identifiers.IdentifierFactory<T>: contract for creating/parsing typed IDs.BaseUuidIdentifierFactory<T>: abstract UUID-based implementation of IdentifierFactory<T>.Implement custom factories if you need non-UUID schemes; otherwise prefer BaseUuidIdentifierFactory.
Create a typed ID and factory:
// Typed ID
class ProjectId(value: Uuid) : BaseUuidIdentifier(value)
// Factory
object ProjectIdFactory : BaseUuidIdentifierFactory<ProjectId>(::ProjectId)
// Domain type
data class Project(val id: ProjectId)
// Create new ID
val id: ProjectId = ProjectIdFactory.create()
// Persist/restore
val raw: String = id.toString()
val parsed: ProjectId = ProjectIdFactory.of(raw)