summaryrefslogtreecommitdiff
path: root/makima/ios/Sources/Makima/Models/Directive.swift
blob: e46a8d27568f17fb29a9353bb26d6f9dd259c6a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Foundation

/// Matches `src/db/models.rs::Directive` (camelCase).
struct Directive: Decodable, Identifiable, Hashable {
    let id: String
    let ownerId: String?
    let goal: String?
    let name: String?
    let status: String?
    let createdAt: Date?
    let updatedAt: Date?

    var displayName: String {
        name ?? goal ?? String(id.prefix(8))
    }
}