27 lines
789 B
Swift
27 lines
789 B
Swift
import Foundation
|
|
|
|
/// Mirrors the objects returned by `GET /api/projects` (src/app/api/projects/route.ts).
|
|
/// Projects are Pro-only "folders" receipts can be filed under.
|
|
struct Project: Codable, Identifiable, Equatable {
|
|
let id: String
|
|
var name: String
|
|
var color: String?
|
|
var receiptCount: Int
|
|
let createdAt: String
|
|
let updatedAt: String
|
|
|
|
/// Fixed palette the web app offers when creating/editing a project —
|
|
/// keep in sync with `PROJECT_COLORS` in src/app/api/projects/route.ts.
|
|
static let colorPalette = ["slate", "blue", "emerald", "amber", "rose", "violet"]
|
|
}
|
|
|
|
struct ProjectListResponse: Decodable {
|
|
let success: Bool
|
|
let projects: [Project]
|
|
}
|
|
|
|
struct CreateProjectRequest: Encodable {
|
|
let name: String
|
|
let color: String?
|
|
}
|