model-entity-mapping-extension-layer
Installation
SKILL.md
A mapping layer made of extension functions
Two hops, two files, and neither of them knows anything about input or output:
transport payload ──► domain model ──► persistence row
(data module, (shared module, public extensions)
internal extensions)
// data module — internal, so a transport type can never reach a screen
internal fun SongItem.toTrack(): Track = Track(…)
// shared module — public, both directions declared separately
fun Track.toSongEntity(): SongEntity = SongEntity(…)
fun SongEntity.toTrack(): Track = Track(…)