diff --git a/src/Bundle/ChillMainBundle/Resources/public/types.ts b/src/Bundle/ChillMainBundle/Resources/public/types.ts index dd9b73dff..1fe8b525f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/types.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/types.ts @@ -204,4 +204,6 @@ export interface WorkflowAttachment { genericDoc: null | GenericDoc; } -export type PrivateCommentEmbeddable = any; +export interface PrivateCommentEmbeddable { + comments: Record; +} diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js index f41dd882b..31e13bc88 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js @@ -16,7 +16,7 @@ const appMessages = { user_one: "Utilisateur", thirdparty_one: "Tiers", person_one: "Usager", - acpw_one: "Action d'accompagnement" + acpw_one: "Action d'accompagnement", }, }, }; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js index 0a0dc349b..1c7a5023b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js @@ -1,10 +1,12 @@ -import { createApp } from 'vue'; +import { createApp } from "vue"; import AccompanyingPeriodWorkSelectorModal from "../../vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue"; document.addEventListener("DOMContentLoaded", () => { - const el = document.getElementById('linked-acpw-selector'); - if (el) { - const accompanyingPeriodId = el.dataset.accompanyingPeriod; - createApp(AccompanyingPeriodWorkSelectorModal, { accompanyingPeriodId }).mount(el); - } + const el = document.getElementById("linked-acpw-selector"); + if (el) { + const accompanyingPeriodId = el.dataset.accompanyingPeriod; + createApp(AccompanyingPeriodWorkSelectorModal, { + accompanyingPeriodId, + }).mount(el); + } }); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/types.ts b/src/Bundle/ChillPersonBundle/Resources/public/types.ts index 87c42a90c..5d1c40568 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/types.ts +++ b/src/Bundle/ChillPersonBundle/Resources/public/types.ts @@ -7,10 +7,11 @@ import { User, WorkflowAvailable, Job, + PrivateCommentEmbeddable, } from "ChillMainAssets/types"; import { StoredObject } from "ChillDocStoreAssets/types"; -import {Thirdparty} from "../../../ChillThirdPartyBundle/Resources/public/types"; -import {Calendar} from "../../../ChillCalendarBundle/Resources/public/types"; +import { Thirdparty } from "../../../ChillThirdPartyBundle/Resources/public/types"; +import { Calendar } from "../../../ChillCalendarBundle/Resources/public/types"; export interface Person { id: number; @@ -45,7 +46,7 @@ export interface AccompanyingPeriod { createdAt?: Date | null; createdBy?: User | null; emergency: boolean; - intensity?: 'occasional' | 'regular'; + intensity?: "occasional" | "regular"; job?: Job | null; locationHistories: AccompanyingPeriodLocationHistory[]; openingDate?: Date | null; @@ -61,7 +62,12 @@ export interface AccompanyingPeriod { resources: AccompanyingPeriodResource[]; scopes: Scope[]; socialIssues: SocialIssue[]; - step?: 'CLOSED' | 'CONFIRMED' | 'CONFIRMED_INACTIVE_SHORT' | 'CONFIRMED_INACTIVE_LONG' | 'DRAFT'; + step?: + | "CLOSED" + | "CONFIRMED" + | "CONFIRMED_INACTIVE_SHORT" + | "CONFIRMED_INACTIVE_LONG" + | "DRAFT"; } export interface AccompanyingPeriodWorkEvaluationDocument { @@ -102,7 +108,7 @@ export interface AccompanyingPeriodWork { } interface SocialAction { - id?: number; + id: number; parent?: SocialAction | null; children: SocialAction[]; issue?: SocialIssue | null; @@ -162,11 +168,86 @@ export interface AccompanyingPeriodLocationHistory { personLocation?: Person | null; } -type SocialIssue = any; -type Goal = any; -type Result = any; -type Evaluation = any; -type AccompanyingPeriodWorkEvaluation = any; -type AccompanyingPeriodWorkGoal = any; -type PrivateCommentEmbeddable = any; -type AccompanyingPeriodWorkReferrerHistory = any; +export interface SocialIssue { + id: number; + parent?: SocialIssue | null; + children: SocialIssue[]; + socialActions?: SocialAction[] | null; + ordering: number; + title: { + fr: string; + }; + desactivationDate?: string | null; +} + +export interface Goal { + id: number; + results: Result[]; + socialActions?: SocialAction[] | null; + title: { + fr: string; + }; +} + +export interface Result { + id: number; + accompanyingPeriodWorks: AccompanyingPeriodWork[]; + accompanyingPeriodWorkGoals: AccompanyingPeriodWorkGoal[]; + goals: Goal[]; + socialActions: SocialAction[]; + title: { + fr: string; + }; + desactivationDate?: string | null; +} + +export interface AccompanyingPeriodWorkGoal { + id: number; + accompanyingPeriodWork: AccompanyingPeriodWork; + goal: Goal; + note: string; + results: Result[]; +} + +export interface AccompanyingPeriodWorkEvaluation { + accompanyingPeriodWork: AccompanyingPeriodWork | null; + comment: string; + createdAt: DateTime | null; + createdBy: User | null; + documents: AccompanyingPeriodWorkEvaluationDocument[]; + endDate: DateTime | null; + evaluation: Evaluation | null; + id: number | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + key: any; + maxDate: DateTime | null; + startDate: DateTime | null; + updatedAt: DateTime | null; + updatedBy: User | null; + warningInterval: string | null; + timeSpent: number | null; +} + +export interface Evaluation { + id: number; + url: string; + socialActions: SocialAction[]; + title: { + fr: string; + }; + active: boolean; + delay: string; + notificationDelay: string; +} + +export interface AccompanyingPeriodWorkReferrerHistory { + id: number; + accompanyingPeriodWork: AccompanyingPeriodWork; + user: User; + startDate: DateTime; + endDate: DateTime | null; + createdAt: DateTime; + updatedAt: DateTime | null; + createdBy: User; + updatedBy: User | null; +} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkItem.vue index 73e62d173..df5d2ffdd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkItem.vue @@ -1,52 +1,59 @@