import { ActivityDayReadModel, ReleaseForecastReadModel, SprintPulseReadModel, } from './insights.read-model'; /** The blocks a project can show to outsiders, in the order they are shown. */ export const SHARED_BLOCKS = [ 'flow', 'sprint', 'releases', 'epics', 'activity', ] as const; export type SharedBlock = (typeof SHARED_BLOCKS)[number]; /** A project's link for clients: the secret, and what it shows. */ export class DashboardShareReadModel { projectId!: string; /** Random and long; whoever has it sees the chosen blocks. */ token!: string; blocks!: SharedBlock[]; createdAt!: string; } /** Tickets in one status (the board's columns, archived ones left out). */ export class SharedFlowReadModel { status!: string; name!: string; /** A colour name of the project's settings. */ color!: string; count!: number; } /** An open epic and how far it got: no more than its key and title. */ export class SharedEpicReadModel { key!: string; title!: string; dueDate!: string | null; done!: number; total!: number; percent!: number; } /** * What a client sees through the link: only the chosen blocks (the others * are null), nothing about people or single tickets but the epics. */ export class SharedDashboardReadModel { projectKey!: string; projectName!: string; generatedAt!: string; blocks!: SharedBlock[]; flow!: SharedFlowReadModel[] | null; sprint!: SprintPulseReadModel | null; releases!: ReleaseForecastReadModel[] | null; epics!: SharedEpicReadModel[] | null; activity!: ActivityDayReadModel[] | null; }