Skip to main content
Domain models represent the core business entities in the application’s domain layer.

Article

Represents a summary view of a space flight news article. Used in list views and search results.
data class Article(
    val id: Long,
    val title: String,
    val imageUrl: String,
    val newsSite: String,
    val publishedAt: String
)

Properties

id
Long
required
Unique identifier for the article.
title
String
required
The title of the article.
imageUrl
String
required
URL of the article’s featured image.
newsSite
String
required
Name of the news site that published the article (e.g., “Space.com”, “NASA”).
publishedAt
String
required
Publication date and time of the article in ISO 8601 format.

Example

val article = Article(
    id = 12345L,
    title = "NASA Launches New Mars Rover",
    imageUrl = "https://example.com/images/mars-rover.jpg",
    newsSite = "NASA",
    publishedAt = "2024-03-15T10:30:00Z"
)

ArticleDetail

Represents the complete details of a space flight news article. Used in detail views with full article information.
data class ArticleDetail(
    val id: Long,
    val title: String,
    val authors: List<Author>,
    val url: String,
    val newsSite: String,
    val imageUrl: String,
    val summary: String,
    val publishedAt: String,
    val updatedAt: String
)

Properties

id
Long
required
Unique identifier for the article.
title
String
required
The title of the article.
authors
List<Author>
required
List of authors who wrote the article. See Author for details.
url
String
required
URL to the full article on the original news site.
newsSite
String
required
Name of the news site that published the article.
imageUrl
String
required
URL of the article’s featured image.
summary
String
required
Brief summary or excerpt of the article content.
publishedAt
String
required
Publication date and time of the article in ISO 8601 format.
updatedAt
String
required
Last update date and time of the article in ISO 8601 format.

Example

val articleDetail = ArticleDetail(
    id = 12345L,
    title = "NASA Launches New Mars Rover",
    authors = listOf(
        Author(name = "John Doe"),
        Author(name = "Jane Smith")
    ),
    url = "https://www.nasa.gov/article/mars-rover-launch",
    newsSite = "NASA",
    imageUrl = "https://example.com/images/mars-rover.jpg",
    summary = "NASA successfully launched its newest Mars rover today...",
    publishedAt = "2024-03-15T10:30:00Z",
    updatedAt = "2024-03-15T14:20:00Z"
)

Author

Represents an author of a space flight news article.
data class Author(
    val name: String
)

Properties

name
String
required
The full name of the author.

Example

val author = Author(
    name = "Dr. Emily Johnson"
)

Usage

The Author model is typically used as part of the ArticleDetail model to represent article attribution:
val authors = listOf(
    Author(name = "Dr. Emily Johnson"),
    Author(name = "Michael Chen")
)

val article = ArticleDetail(
    // ... other properties
    authors = authors
)

Build docs developers (and LLMs) love