Files
project-manager/web/src/types.ts
T

66 lines
1.4 KiB
TypeScript
Raw Normal View History

export interface User {
id: number
email: string
email_verified: boolean
email_verified_at: string | null
/** A confirmed-but-not-yet-applied email change is waiting on this address. */
pending_email: string | null
/** Whether this user has at least one registered passkey. */
has_passkey: boolean
created_at: string | null
}
export interface AuthResponse {
user: User
token: string
expires_at: string
}
export interface Passkey {
id: number
label: string
created_at: string
last_used_at: string | null
}
export interface Project {
id: number
title: string
description: string
owner_id: number
card_count: number
completed_count: number
created_at: string
updated_at: string
}
/** A project-specific card status ("To do", "Doing", "Done", …). */
export interface CardStatus {
id: number
name: string
}
/**
* A card either sits in its owner's global inbox (project_id and status_id
* both null) or belongs to one project with a status in it (both set).
*/
export interface Card {
id: number
project_id: number | null
text: string
complete: boolean
position: number
status_id: number | null
status: CardStatus | null
created_at: string
updated_at: string
}
/** Shape of every error body returned by the API. */
export interface ApiErrorBody {
error: {
message: string
details?: Record<string, string[]>
}
}