feat: add iOS support and harden receipt scanning
This commit is contained in:
26
app/ios/ScanReceipts/Models/Project.swift
Normal file
26
app/ios/ScanReceipts/Models/Project.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
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?
|
||||
}
|
||||
Reference in New Issue
Block a user