import type { IdObject, LinkContributorsRef, ParentsMap, DateValue } from "./common.js"; import type EJSONType from "../../EJSONType.js"; type ObjectIDCtor = typeof EJSONType["ObjectID"]; type ObjectID = InstanceType; /** * Statuts supportés par une action (cf. COSTUM_PROJECT_ACTION_REQUEST_NEW). */ export declare const ACTION_STATUSES: readonly ["todo", "done", "tracking", "discuter", "next", "totest", "disabled", "closed"]; export type ActionStatus = (typeof ACTION_STATUSES)[number]; export interface ActionLinksBlock { contributors?: Record; [k: string]: unknown; } export interface ActionMilestoneRef { milestoneId: string; startDate?: DateValue; endDate?: DateValue; } export interface ActionCounts { contributors?: number; [k: string]: unknown; } /** * Historique des changements de statut (alimenté par /set_status côté backend). * `update` est un MongoDate (DateValue côté Json, Date côté Normalized). */ export interface ActionUpdateStatusEntryJson { status: ActionStatus; author: string; update: DateValue; } export interface ActionUpdateStatusEntryNormalized { status: ActionStatus; author: string; update: Date; } /** * Sous-tâche d'une action. Stockée dans `tasks[]`. */ export interface ActionTaskJson { taskId?: string; task?: string; checked?: boolean; userId?: string; contributors?: Record; timeSpent?: number; createdAt?: DateValue; checkedAt?: DateValue; [key: string]: unknown; } export interface ActionTaskNormalized { taskId?: string; task?: string; checked?: boolean; userId?: string; contributors?: Record; timeSpent?: number; createdAt?: Date; checkedAt?: Date; [key: string]: unknown; } /** * Bloc media : galerie d'images + fichiers attachés (par IDs de documents). */ export interface ActionMedia { type?: string; countImages?: number; images?: string[]; files?: string[]; [k: string]: unknown; } export interface ActionMediaFile { files?: string[]; [k: string]: unknown; } export interface ActionItemJson { _id: IdObject; collection: "actions"; name: string; description?: string; status?: ActionStatus; created?: DateValue; updated?: DateValue; modified?: DateValue; startDate?: DateValue; endDate?: DateValue; parentId: string; parentType: string; parent?: ParentsMap; tags?: string[]; links?: ActionLinksBlock; creator?: string; idUserAuthor?: string; credits?: string; idParentRoom?: string; milestone?: ActionMilestoneRef; importance?: string; counts?: ActionCounts; url?: string; min?: number; max?: number; timeSpent?: number; tracking?: boolean; updateStatus?: ActionUpdateStatusEntryJson[]; rc?: unknown[]; tasks?: ActionTaskJson[]; media?: ActionMedia; mediaFile?: ActionMediaFile; [key: string]: unknown; } export interface ActionItemNormalized { id: string; _id: ObjectID; collection: "actions"; name: string; description?: string; status?: ActionStatus; created?: Date; updated?: Date; modified?: Date; startDate?: Date; endDate?: Date; parentId: string; parentType: string; parent?: ParentsMap; tags?: string[]; links?: ActionLinksBlock; creator?: string; idUserAuthor?: string; credits?: number; idParentRoom?: string; milestone?: Omit & { startDate?: Date; endDate?: Date; }; importance?: string; counts?: ActionCounts; url?: string; min?: number; max?: number; timeSpent?: number; tracking?: boolean; updateStatus?: ActionUpdateStatusEntryNormalized[]; rc?: unknown[]; tasks?: ActionTaskNormalized[]; media?: ActionMedia; mediaFile?: ActionMediaFile; [key: string]: unknown; } export {};