-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from InseeFr/feat/dexie
feat: Migrate Dexie to TypeScript
- Loading branch information
Showing
14 changed files
with
212 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
type SurveyUnitPhoneNumber = { | ||
source: string; | ||
favorite: boolean; | ||
number: string; | ||
}; | ||
|
||
type SurveyUnitPerson = { | ||
id: number; | ||
title: string; | ||
firstName: string; | ||
lastName: string; | ||
email: string; | ||
birthdate: number; | ||
favoriteEmail: boolean; | ||
privileged: boolean; | ||
phoneNumbers: SurveyUnitPhoneNumber[]; | ||
}; | ||
|
||
type SurveyUnitAddress = { | ||
l1: string; | ||
l2: string; | ||
l3: string; | ||
l4: string; | ||
l5: string; | ||
l6: string; | ||
l7: string; | ||
elevator: boolean; | ||
building: string; | ||
floor: string; | ||
door: string; | ||
staircase: string; | ||
cityPriorityDistrict: boolean; | ||
}; | ||
|
||
type SurveyUnitComment = { | ||
type: string; | ||
value: string; | ||
}; | ||
|
||
type SurveyUnitState = { | ||
id: number; | ||
date: number; | ||
type: string; | ||
}; | ||
|
||
type SurveyUnitSampleIdentifiers = { | ||
bs: number; | ||
ec: string; | ||
le: number; | ||
noi: number; | ||
numfa: number; | ||
rges: number; | ||
ssech: number; | ||
nolog: number; | ||
nole: number; | ||
autre: string; | ||
nograp: string; | ||
}; | ||
|
||
type SurveyUnitIdentification = { | ||
identification: unknown; | ||
access: unknown; | ||
situation: unknown; | ||
category: unknown; | ||
occupant: unknown; | ||
}; | ||
|
||
type SurveyUnitContactAttempt = { | ||
status: string; | ||
date: number; | ||
medium: string; | ||
}; | ||
|
||
type SurveyUnitCommunicationRequest = { | ||
emitter: 'INTERVIEWER' | 'TOOL'; | ||
communicationTemplateId?: string; | ||
reason?: string; | ||
status: { date: number; status: string }[]; | ||
}; | ||
|
||
type SurveyUnitNewCommunicationRequest = { | ||
communicationTemplateId: string; | ||
reason: string; | ||
creationTimestamp: number; | ||
}; | ||
|
||
type SurveyUnitCommunicationTemplate = { | ||
medium: string; | ||
reason: string; | ||
type: string; | ||
id: string; | ||
}; | ||
|
||
export type SurveyUnit = { | ||
displayName: string; | ||
id: string; | ||
persons: SurveyUnitPerson[]; | ||
address: SurveyUnitAddress; | ||
priority: boolean; | ||
move: boolean; | ||
campaign: string; | ||
comments: SurveyUnitComment[]; | ||
sampleIdentifiers: SurveyUnitSampleIdentifiers; | ||
states: SurveyUnitState[]; | ||
contactAttempts: SurveyUnitContactAttempt[]; | ||
contactOutcome?: { date: number; totalNumberOfContactAttempts: number; type: string }; | ||
identification: SurveyUnitIdentification; | ||
campaignLabel: string; | ||
managementStartDate: number; | ||
interviewerStartDate: number; | ||
identificationPhaseStartDate: number; | ||
collectionStartDate: number; | ||
collectionEndDate: number; | ||
endDate: number; | ||
identificationConfiguration: string; | ||
contactOutcomeConfiguration: string; | ||
contactAttemptConfiguration: string; | ||
useLetterCommunication: boolean; | ||
communicationRequests: SurveyUnitCommunicationRequest[]; | ||
communicationTemplates: SurveyUnitCommunicationTemplate[]; | ||
}; | ||
|
||
export type Notification = { | ||
date: number; | ||
type: string; | ||
title: string; | ||
messages: string[]; | ||
state: 'warning' | 'success' | 'error'; | ||
read: boolean; | ||
detail: string; | ||
id: number; | ||
}; | ||
|
||
export type SyncResult = { | ||
state: string; | ||
messages: string[]; | ||
details: { | ||
transmittedSurveyUnits: Record<string, string[]>; | ||
loadedSurveyUnits: Record<string, string[]>; | ||
}; | ||
}; |
16 changes: 14 additions & 2 deletions
16
src/utils/indexeddb/idb-config.js → src/utils/indexeddb/idb-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type SurveyUnitMissing = { | ||
id: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { type SyncResult } from '../../../types/pearl'; | ||
|
||
export type SyncReport = { | ||
id: string; | ||
transmittedSurveyUnits: SyncResult['details']['transmittedSurveyUnits']; | ||
loadedSurveyUnits: SyncResult['details']['loadedSurveyUnits']; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export type User = { | ||
id: string; | ||
civility: string; | ||
email: string; | ||
firstName: string; | ||
lastName: string; | ||
phoneNumber: string; | ||
title: string; | ||
}; |
Oops, something went wrong.