Skip to content

Commit

Permalink
add last event and last communication dates
Browse files Browse the repository at this point in the history
  • Loading branch information
RenauxLeaInsee committed Nov 18, 2024
1 parent 1c9a8ac commit 15928c0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 11 deletions.
46 changes: 38 additions & 8 deletions src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ export type APISchemas = {
longWording?: string
shortWording?: string
periodicity?: "X" | "A" | "S" | "T" | "B" | "M"
/* Indicates whether or not you need to use the my surveys portal */
mandatoryMySurveys?: boolean
/* Indicates if the source should be force closed */
forceClose?: boolean
messageInfoSurveyOffline?: string
messageSurveyOffline?: string
Expand Down Expand Up @@ -326,6 +324,7 @@ export type APISchemas = {
idContact?: string
main?: boolean
}
QuestioningCommentInputDto: { comment?: string; author?: string }
QuestioningEventDto: {
/* Format: int64 */
id?: number
Expand Down Expand Up @@ -810,6 +809,12 @@ export type APISchemas = {
messageSurveyOffline?: string
messageInfoSurveyOffline?: string
}
QuestioningCommentOutputDto: {
comment?: string
author?: string
/* Format: date-time */
commentDate?: string
}
QuestioningCommunicationDto: {
/* Format: int64 */
id?: number
Expand All @@ -829,9 +834,14 @@ export type APISchemas = {
surveyUnitIdentificationCode?: string
listEvents?: Array<APISchemas["QuestioningEventDto"]>
lastEvent?: string
/* Format: date-time */
dateLastEvent?: string
listCommunications?: Array<APISchemas["QuestioningCommunicationDto"]>
lastCommunication?: string
/* Format: date-time */
dateLastCommunication?: string
listComments?: Array<APISchemas["QuestioningCommentOutputDto"]>
/* Format: date-time */
validationDate?: string
readOnlyUrl?: string
}
Expand All @@ -854,16 +864,16 @@ export type APISchemas = {
empty?: boolean
}
SearchQuestioningDto: {
campaignId?: string
surveyUnitId?: string
/* Format: int64 */
questioningId?: number
surveyUnitId?: string
surveyUnitIdentificationCode?: string
campaignId?: string
listContactIdentifiers?: Array<string>
lastEvent?: string
lastCommunication?: string
/* Format: date-time */
validationDate?: string
surveyUnitIdentificationCode?: string
}
AssistanceDto: { mailAssistance?: string; surveyUnitId?: string }
Address: {
Expand Down Expand Up @@ -929,6 +939,7 @@ export type APISchemas = {
questioningAccreditations?: Array<APISchemas["QuestioningAccreditation"]>
questioningEvents?: Array<APISchemas["QuestioningEvent"]>
questioningCommunications?: Array<APISchemas["QuestioningCommunication"]>
questioningComments?: Array<APISchemas["QuestioningComment"]>
surveyUnit?: APISchemas["SurveyUnit"]
}
QuestioningAccreditation: {
Expand All @@ -941,6 +952,14 @@ export type APISchemas = {
questioning?: APISchemas["Questioning"]
main?: boolean
}
QuestioningComment: {
/* Format: int64 */
id?: number
comment?: string
author?: string
/* Format: date-time */
date?: string
}
QuestioningCommunication: {
/* Format: int64 */
id?: number
Expand Down Expand Up @@ -997,7 +1016,7 @@ export type APISchemas = {
/* Format: int32 */
pnd?: number
}
MoogCampaign: {
MoogCampaignDto: {
id?: string
label?: string
/* Format: int64 */
Expand All @@ -1017,7 +1036,7 @@ export type APISchemas = {
idContact?: string
idSu?: string
address?: string
campaign?: APISchemas["MoogCampaign"]
campaign?: APISchemas["MoogCampaignDto"]
firstName?: string
lastname?: string
batchNumber?: string
Expand Down Expand Up @@ -1075,9 +1094,9 @@ export type APISchemas = {
listCampaigns?: Array<string>
}
SearchContactDto: {
email?: string
firstName?: string
lastName?: string
email?: string
identifier?: string
}
MyQuestioningDto: {
Expand Down Expand Up @@ -1347,6 +1366,17 @@ export type APIEndpoints = {
body: APISchemas["QuestioningAccreditationDto"]
}
}
"/api/questionings/{id}/comment": {
responses: { post: APISchemas["QuestioningCommentInputDto"] }
requests: {
method: "post"
urlParams: {
/* Format: int64 */
id: number
}
body: APISchemas["QuestioningCommentInputDto"]
}
}
"/api/questionings/questioning-events": {
responses: { post: APISchemas["QuestioningEventDto"] }
requests: {
Expand Down
13 changes: 10 additions & 3 deletions src/ui/Questioning/StatesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ export const StatesCard = ({ questioning, refetch }: Props) => {
<AddIcon fontSize="small" />
</IconButton>
</Row>
<Typography variant="bodyMedium">TODO DATA</Typography>
{questioning.dateLastEvent && (
<Typography variant="bodyMedium">
{new Date(Date.parse(questioning.dateLastEvent)).toLocaleDateString()}
</Typography>
)}
</Row>
</Stack>
{questioning.lastCommunication && (
Expand Down Expand Up @@ -126,8 +130,11 @@ export const StatesCard = ({ questioning, refetch }: Props) => {
"Aucun état"
}
/>

<Typography variant="bodyMedium">TODO DATA</Typography>
{questioning.dateLastCommunication && (
<Typography variant="bodyMedium">
{new Date(Date.parse(questioning.dateLastCommunication)).toLocaleDateString()}
</Typography>
)}
</Row>
</Stack>
)}
Expand Down

0 comments on commit 15928c0

Please sign in to comment.