Initial commit
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
// API request/response types — the wire format for the backend endpoints.
|
||||
|
||||
export interface ApiError {
|
||||
code: string
|
||||
message: string
|
||||
details?: Record<string, unknown>
|
||||
}
|
||||
|
||||
// Auth
|
||||
export interface RegisterRequest {
|
||||
email: string
|
||||
password: string
|
||||
displayName: string
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
email: string
|
||||
password: string
|
||||
}
|
||||
|
||||
export interface TokenResponse {
|
||||
accessToken: string
|
||||
tokenType: string
|
||||
expiresIn: number
|
||||
}
|
||||
|
||||
// Vacation days
|
||||
export interface VacationDaysCreateRequest {
|
||||
personalDataUuid: string
|
||||
workspaceId: string
|
||||
year: number
|
||||
totalDays: number
|
||||
savedDaysIn?: number
|
||||
}
|
||||
|
||||
export interface VacationDaysUpdateRequest {
|
||||
totalDays: number
|
||||
savedDaysIn?: number
|
||||
}
|
||||
|
||||
// Workspace
|
||||
export interface WorkspaceCreateRequest {
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface WorkspaceUpdateRequest {
|
||||
name?: string
|
||||
planningGoal?: 'max_time' | 'max_money' | 'balanced'
|
||||
}
|
||||
|
||||
// Parental leave manual entry
|
||||
export interface ManualFetchRequest {
|
||||
personalDataUuid: string
|
||||
workspaceId: string
|
||||
childId: string
|
||||
totalDays: number
|
||||
daysUsed: number
|
||||
reservedDaysTotal?: number
|
||||
reservedDaysLeft: number
|
||||
transferableDaysLeft: number
|
||||
dubbeldagarLeft?: number
|
||||
sjukpenningTotal?: number
|
||||
sjukpenningUsed: number
|
||||
lagstaNivaTotal?: number
|
||||
lagstaNivaUsed: number
|
||||
}
|
||||
|
||||
// Planned days
|
||||
export interface AddPlannedDayRequest {
|
||||
workspaceId: string
|
||||
childId: string
|
||||
parentPersonalDataUuid: string
|
||||
date: string // ISO-8601
|
||||
dayType: 'sjukpenning' | 'lagsta' | 'vacation'
|
||||
isDubbeldag?: boolean
|
||||
}
|
||||
|
||||
export interface UpdatePlannedDayRequest {
|
||||
dayType?: 'sjukpenning' | 'lagsta' | 'vacation'
|
||||
isDubbeldag?: boolean
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
// Domain entity types — transcribed from ARCHITECTURE.md §7.
|
||||
// These mirror the backend entities. Keep in sync when the schema changes.
|
||||
|
||||
export interface Workspace {
|
||||
id: string
|
||||
name: string
|
||||
planningGoal: 'max_time' | 'max_money' | 'balanced'
|
||||
createdAt: string // ISO-8601
|
||||
}
|
||||
|
||||
export interface PersonalData {
|
||||
uuid: string
|
||||
workspaceId: string
|
||||
name: string
|
||||
salaryType: 'monthly' | 'hourly'
|
||||
employmentStatus: 'employed' | 'jobseeking' | 'none'
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface Child {
|
||||
id: string
|
||||
workspaceId: string
|
||||
name: string
|
||||
birthDate: string // ISO-8601 date
|
||||
preschoolStartDate: string | null
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface BreakPeriod {
|
||||
id: string
|
||||
workspaceId: string
|
||||
name: string
|
||||
startDate: string
|
||||
endDate: string
|
||||
targetWeeks: number
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
export interface TierData {
|
||||
sjukpenningTotal: number
|
||||
sjukpenningUsed: number
|
||||
sjukpenningLeft: number
|
||||
lagstaNivaTotal: number
|
||||
lagstaNivaUsed: number
|
||||
lagstaNivaLeft: number
|
||||
}
|
||||
|
||||
export interface ParentalLeaveFetch {
|
||||
id: string
|
||||
personalDataUuid: string
|
||||
workspaceId: string
|
||||
childId: string
|
||||
source: 'scraped' | 'manual'
|
||||
fetchedAt: string
|
||||
totalDays: number
|
||||
daysUsed: number
|
||||
daysLeft: number
|
||||
reservedDaysTotal: number
|
||||
reservedDaysLeft: number
|
||||
transferableDaysLeft: number
|
||||
dubbeldagarLeft: number
|
||||
tierData: TierData
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
export interface VacationDays {
|
||||
id: string
|
||||
personalDataUuid: string
|
||||
workspaceId: string
|
||||
year: number
|
||||
totalDays: number
|
||||
savedDaysIn: number
|
||||
createdAt: string | null
|
||||
updatedAt: string | null
|
||||
}
|
||||
|
||||
export interface PlannedLeaveDay {
|
||||
id: string
|
||||
workspaceId: string
|
||||
childId: string
|
||||
parentPersonalDataUuid: string
|
||||
date: string // ISO-8601 date
|
||||
dayType: 'sjukpenning' | 'lagsta' | 'vacation'
|
||||
isDubbeldag: boolean
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
export interface Age4Projection {
|
||||
personalDataUuid: string
|
||||
childId: string
|
||||
birthDate: string
|
||||
fourthBirthday: string
|
||||
totalDays: number
|
||||
daysUsed: number
|
||||
plannedDaysBeforeB4: number
|
||||
projectedLeftAtB4: number
|
||||
savableAfterB4: number
|
||||
expiringAtB4: number
|
||||
}
|
||||
|
||||
export interface WorkspaceOverview {
|
||||
workspaceId: string
|
||||
childId: string
|
||||
parentProjections: Age4Projection[]
|
||||
combinedDaysUsed: number
|
||||
combinedDaysLeft: number
|
||||
combinedExpiringAtB4: number
|
||||
}
|
||||
|
||||
export interface Tip {
|
||||
id: string
|
||||
severity: 'info' | 'warning' | 'action'
|
||||
messageKey: string
|
||||
data: Record<string, unknown>
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export type * from './entities'
|
||||
export type * from './api'
|
||||
Reference in New Issue
Block a user