From 2bb38e1dc500e07cd6a62bfde2a592161faaeb0b Mon Sep 17 00:00:00 2001 From: PolariTOON <36267812+PolariTOON@users.noreply.github.com> Date: Tue, 6 Dec 2022 12:28:39 +0100 Subject: [PATCH 1/3] feat: Update `date-fns` to 2.29.3 and put it as a dependency --- packages/cozy-client/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cozy-client/package.json b/packages/cozy-client/package.json index b377e1edeb..da7cad2cac 100644 --- a/packages/cozy-client/package.json +++ b/packages/cozy-client/package.json @@ -19,6 +19,7 @@ "@types/lodash": "^4.14.170", "btoa": "^1.2.1", "cozy-stack-client": "^34.1.5", + "date-fns": "2.29.3", "json-stable-stringify": "^1.0.1", "lodash": "^4.17.13", "microee": "^0.0.6", @@ -51,7 +52,6 @@ "cozy-flags": "2.10.2", "cozy-logger": "1.7.0", "cozy-ui": "48.0.0", - "date-fns": "2.27.0", "jsdoc-plugin-intersection": "1.0.4", "mockdate": "2.0.5", "react": "16.14.0", diff --git a/yarn.lock b/yarn.lock index 4e53203e1c..c9d327aa90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5075,10 +5075,10 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -date-fns@2.27.0: - version "2.27.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.27.0.tgz#e1ff3c3ddbbab8a2eaadbb6106be2929a5a2d92b" - integrity sha512-sj+J0Mo2p2X1e306MHq282WS4/A8Pz/95GIFcsPNMPMZVI3EUrAdSv90al1k+p74WGLCruMXk23bfEDZa71X9Q== +date-fns@2.29.3: + version "2.29.3" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8" + integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA== date-fns@^1.28.5: version "1.30.1" From 5f42ba45afb0c7803bfe5a4bc6d0636687538bfc Mon Sep 17 00:00:00 2001 From: PolariTOON <36267812+PolariTOON@users.noreply.github.com> Date: Tue, 6 Dec 2022 11:38:46 +0100 Subject: [PATCH 2/3] feat: Add expiration helpers This extracts and rewrites expiration helpers from `mespapiers` that will be used directly in `cozy-ui`, `cozy-mespapiers-lib` and also `mespapiers`. This avoids using `paperDefinitions` as a config. It may not be generic enough in the future and we don't have any need for that right now. This also removes the need to pass a `dateLabel` argument to these helpers. This also adds new helpers, one giving the notice link if available, and two other for comparing dates. This also removes the default notice period, meaning that papers won't be considered as expiring if the user has not set any notice period and that the alert won't appear and no notification will be sent. --- packages/cozy-client/src/models/index.js | 4 +- packages/cozy-client/src/models/paper.js | 177 ++++++++++++++++++ packages/cozy-client/src/models/paper.spec.js | 73 ++++++++ packages/cozy-client/src/types.js | 10 + 4 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 packages/cozy-client/src/models/paper.js create mode 100644 packages/cozy-client/src/models/paper.spec.js diff --git a/packages/cozy-client/src/models/index.js b/packages/cozy-client/src/models/index.js index 1f406fdb8c..5ced92a25f 100644 --- a/packages/cozy-client/src/models/index.js +++ b/packages/cozy-client/src/models/index.js @@ -13,6 +13,7 @@ import * as timeseries from './timeseries' import * as sharing from './sharing' import * as dacc from './dacc' import * as doctypes from './doctypes' +import * as paper from './paper' // For backward compatibility before 9.0.0 const triggers = trigger @@ -35,5 +36,6 @@ export { timeseries, sharing, dacc, - doctypes + doctypes, + paper } diff --git a/packages/cozy-client/src/models/paper.js b/packages/cozy-client/src/models/paper.js new file mode 100644 index 0000000000..2f930e97b0 --- /dev/null +++ b/packages/cozy-client/src/models/paper.js @@ -0,0 +1,177 @@ +import add from 'date-fns/add' +import sub from 'date-fns/sub' + +/** + * @typedef {import("../types").IOCozyFile} IOCozyFile + */ + +const PERSONAL_SPORTING_LICENCE_PERIOD_DAYS = 365 +const PERSONAL_SPORTING_LICENCE_NOTICE_PERIOD_DAYS = 15 + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {boolean} + * @description Tells if a given file is a national id card, is French, has an expiration date set and has a notice period set + */ +const isExpiringFrenchNationalIdCard = file => { + const label = file.metadata?.qualification?.label + const country = file.metadata?.country + const expirationDate = file.metadata?.expirationDate + const noticePeriod = file.metadata?.noticePeriod + if ( + label === 'national_id_card' && + (!country || country === 'fr') && + expirationDate && + noticePeriod + ) { + return true + } + return false +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {boolean} + * @description Tells if a given file is a residence permit, has an expiration date set and a notice period set + */ +const isExpiringResidencePermit = file => { + const label = file.metadata?.qualification?.label + const expirationDate = file.metadata?.expirationDate + const noticePeriod = file.metadata?.noticePeriod + if (label === 'residence_permit' && expirationDate && noticePeriod) { + return true + } + return false +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {boolean} + * @description Tells if a given file is a sporting license, has a reference date set or a creation date if not + */ +const isExpiringPersonalSportingLicense = file => { + const label = file.metadata?.qualification?.label + const referencedDate = file.metadata?.referencedDate + const created_at = file.created_at + if (label === 'personal_sporting_licence' && (referencedDate || created_at)) { + return true + } + return false +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {boolean} + * @description Tells if a given file matches one of the known types of expiring papers + */ +export const isExpiring = file => { + if (isExpiringFrenchNationalIdCard(file)) { + return true + } + if (isExpiringResidencePermit(file)) { + return true + } + if (isExpiringPersonalSportingLicense(file)) { + return true + } + return false +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {Date | null} Expiration date + * @description Computes et returns the expiration date of the given file, or null if it is not expiring + */ +export const computeExpirationDate = file => { + if (isExpiringFrenchNationalIdCard(file) || isExpiringResidencePermit(file)) { + const expirationDate = file.metadata?.expirationDate + return new Date(expirationDate) + } + if (isExpiringPersonalSportingLicense(file)) { + const referencedDate = file.metadata?.referencedDate + const created_at = file.created_at + return add(new Date(referencedDate ?? created_at), { + days: PERSONAL_SPORTING_LICENCE_PERIOD_DAYS + }) + } + return null +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {number | null} Expiration notice period in days + * @description Computes et returns the expiration notice period of the given file, or null if it is not expiring + */ +const computeExpirationNoticePeriodInDays = file => { + if (isExpiringFrenchNationalIdCard(file) || isExpiringResidencePermit(file)) { + const noticePeriodInDays = file.metadata?.noticePeriod + return parseInt(noticePeriodInDays, 10) + } + if (isExpiringPersonalSportingLicense(file)) { + return PERSONAL_SPORTING_LICENCE_NOTICE_PERIOD_DAYS + } + return null +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {Date | null} Expiration notice date + * @description Computes et returns the expiration notice date of the given file, or null if it is not expiring + */ +export const computeExpirationNoticeDate = file => { + const expirationDate = computeExpirationDate(file) + if (expirationDate == null) { + return null + } + const noticePeriodInDays = computeExpirationNoticePeriodInDays(file) + if (noticePeriodInDays == null) { + return null + } + return sub(expirationDate, { + days: noticePeriodInDays + }) +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {string | null} Expiration notice link + * @description Computes et returns the expiration notice link of the given file, or null if it has none or it is not expiring + */ +export const computeExpirationNoticeLink = file => { + if (isExpiringFrenchNationalIdCard(file)) { + return 'https://www.service-public.fr/particuliers/vosdroits/N358' + } + if (isExpiringResidencePermit(file)) { + return 'https://www.service-public.fr/particuliers/vosdroits/N110' + } + return null +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {boolean} + * @description Tells if the given file is expiring and if today is after its expiration date + */ +export const isExpired = file => { + const now = new Date() + const expirationDate = computeExpirationDate(file) + const isExpired = expirationDate != null && expirationDate <= now + return isExpired +} + +/** + * @param {IOCozyFile} file - io.cozy.files document + * @returns {boolean} + * @description Tells if the given file is expiring and if today is between its expiration notice date and its expiration date + */ +export const isExpiringSoon = file => { + const now = new Date() + const expirationDate = computeExpirationDate(file) + const expirationNoticeDate = computeExpirationNoticeDate(file) + const isExpiringSoon = + expirationDate != null && + expirationNoticeDate != null && + expirationNoticeDate <= now && + now < expirationDate + return isExpiringSoon +} diff --git a/packages/cozy-client/src/models/paper.spec.js b/packages/cozy-client/src/models/paper.spec.js new file mode 100644 index 0000000000..1d492a056e --- /dev/null +++ b/packages/cozy-client/src/models/paper.spec.js @@ -0,0 +1,73 @@ +import MockDate from 'mockdate' + +import * as paperModel from './paper' + +describe('Expiration', () => { + beforeEach(() => { + MockDate.set('2022-11-01T11:35:58.118Z') + }) + afterEach(() => { + MockDate.reset() + }) + + const fakeFile01 = { + _id: '01', + name: 'national id card', + created_at: '2022-09-01T00:00:00.000Z', + metadata: { + qualification: { label: 'national_id_card' }, + expirationDate: '2022-09-23T11:35:58.118Z', + noticePeriod: '90' + } + } + const fakeFile02 = { + _id: '02', + name: 'personal sporting licence', + created_at: '2022-09-01T00:00:00.000Z', + metadata: { + qualification: { label: 'personal_sporting_licence' }, + referencedDate: '2022-09-23T11:35:58.118Z' + } + } + const fakeFile03 = { + _id: '03', + name: 'unknown' + } + + describe('computeExpirationDate', () => { + it('should return expirationDate', () => { + const res = paperModel.computeExpirationDate(fakeFile01) + + expect(res.toISOString()).toBe('2022-09-23T11:35:58.118Z') + }) + it('should return referencedDate plus 365 days', () => { + const res = paperModel.computeExpirationDate(fakeFile02) + + expect(res.toISOString()).toBe('2023-09-23T11:35:58.118Z') + }) + + it('should return "null" if metadata is not found', () => { + const res = paperModel.computeExpirationDate(fakeFile03) + + expect(res).toBeNull() + }) + }) + + describe('computeExpirationNoticeDate', () => { + it('should return notice date for file with expirationDate metadata', () => { + const res = paperModel.computeExpirationNoticeDate(fakeFile01) + + expect(res.toISOString()).toBe('2022-06-25T11:35:58.118Z') + }) + it('should return notice date for file with referencedDate metadata', () => { + const res = paperModel.computeExpirationNoticeDate(fakeFile02) + + expect(res.toISOString()).toBe('2023-09-08T11:35:58.118Z') + }) + it('should return null for file without corresponding metadata', () => { + const res = paperModel.computeExpirationNoticeDate(fakeFile03) + + expect(res).toBeNull() + }) + }) +}) diff --git a/packages/cozy-client/src/types.js b/packages/cozy-client/src/types.js index 68b7e30b73..fc18843054 100644 --- a/packages/cozy-client/src/types.js +++ b/packages/cozy-client/src/types.js @@ -1,5 +1,9 @@ import { QueryDefinition } from './queries/dsl' +/** + * @typedef {import("./models/document/qualification").Qualification} Qualification + */ + /** * @typedef {"io.cozy.accounts"} AccountsDoctype * @typedef {"io.cozy.triggers"} TriggersDoctype @@ -170,6 +174,11 @@ import { QueryDefinition } from './queries/dsl' * @property {object} [schema] - the schema used by prosemirror (with notes and marks serialized as arrays to preserve the order). * @property {string} [title] - the initial title of the note (that will also be used for the file name) * @property {number} [version] - Number of a note + * @property {Qualification} [qualification] - Qualification of the file + * @property {string} [country] - Country of the paper + * @property {string} [expirationDate] - Expiration date of the paper + * @property {string} [referencedDate] - Reference date of the paper + * @property {string} [noticePeriod] - Notice period of the paper, in days */ /** @@ -183,6 +192,7 @@ import { QueryDefinition } from './queries/dsl' * @property {string} mime - Mime of the file * @property {boolean} executable - Whether or not the file is executable * @property {boolean} encrypted - Whether or not the file is client-side encrypted + * @property {string} created_at - Creation date of the file * @typedef {CozyClientDocument & FileDocument} IOCozyFile - An io.cozy.files document */ From b6722a388da7b07ec7a0fa7478afbf5fe566f852 Mon Sep 17 00:00:00 2001 From: PolariTOON <36267812+PolariTOON@users.noreply.github.com> Date: Tue, 6 Dec 2022 11:22:06 +0100 Subject: [PATCH 3/3] feat: Add generated types and documentation for new exported helpers --- docs/api/cozy-client/modules/models.md | 5 +- docs/api/cozy-client/modules/models.paper.md | 153 +++++++++++++++++++ packages/cozy-client/types/models/index.d.ts | 3 +- packages/cozy-client/types/models/paper.d.ts | 7 + packages/cozy-client/types/types.d.ts | 37 ++++- 5 files changed, 196 insertions(+), 9 deletions(-) create mode 100644 docs/api/cozy-client/modules/models.paper.md create mode 100644 packages/cozy-client/types/models/paper.d.ts diff --git a/docs/api/cozy-client/modules/models.md b/docs/api/cozy-client/modules/models.md index 8777a61d4a..89cc94ce43 100644 --- a/docs/api/cozy-client/modules/models.md +++ b/docs/api/cozy-client/modules/models.md @@ -14,6 +14,7 @@ * [folder](models.folder.md) * [instance](models.instance.md) * [note](models.note.md) +* [paper](models.paper.md) * [permission](models.permission.md) * [sharing](models.sharing.md) * [timeseries](models.timeseries.md) @@ -28,7 +29,7 @@ *Defined in* -[packages/cozy-client/src/models/index.js:19](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/index.js#L19) +[packages/cozy-client/src/models/index.js:20](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/index.js#L20) *** @@ -38,4 +39,4 @@ *Defined in* -[packages/cozy-client/src/models/index.js:18](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/index.js#L18) +[packages/cozy-client/src/models/index.js:19](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/index.js#L19) diff --git a/docs/api/cozy-client/modules/models.paper.md b/docs/api/cozy-client/modules/models.paper.md new file mode 100644 index 0000000000..e2b86524a1 --- /dev/null +++ b/docs/api/cozy-client/modules/models.paper.md @@ -0,0 +1,153 @@ +[cozy-client](../README.md) / [models](models.md) / paper + +# Namespace: paper + +[models](models.md).paper + +## Type aliases + +### IOCozyFile + +Ƭ **IOCozyFile**<>: `IOCozyFile` + +*Defined in* + +[packages/cozy-client/src/models/paper.js:5](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L5) + +## Functions + +### computeExpirationDate + +▸ **computeExpirationDate**(`file`): `Date` + +**`description`** Computes et returns the expiration date of the given file, or null if it is not expiring + +*Parameters* + +| Name | Type | Description | +| :------ | :------ | :------ | +| `file` | `IOCozyFile` | io.cozy.files document | + +*Returns* + +`Date` + +Expiration date + +*Defined in* + +[packages/cozy-client/src/models/paper.js:85](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L85) + +*** + +### computeExpirationNoticeDate + +▸ **computeExpirationNoticeDate**(`file`): `Date` + +**`description`** Computes et returns the expiration notice date of the given file, or null if it is not expiring + +*Parameters* + +| Name | Type | Description | +| :------ | :------ | :------ | +| `file` | `IOCozyFile` | io.cozy.files document | + +*Returns* + +`Date` + +Expiration notice date + +*Defined in* + +[packages/cozy-client/src/models/paper.js:121](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L121) + +*** + +### computeExpirationNoticeLink + +▸ **computeExpirationNoticeLink**(`file`): `string` + +**`description`** Computes et returns the expiration notice link of the given file, or null if it has none or it is not expiring + +*Parameters* + +| Name | Type | Description | +| :------ | :------ | :------ | +| `file` | `IOCozyFile` | io.cozy.files document | + +*Returns* + +`string` + +Expiration notice link + +*Defined in* + +[packages/cozy-client/src/models/paper.js:140](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L140) + +*** + +### isExpired + +▸ **isExpired**(`file`): `boolean` + +**`description`** Tells if the given file is expiring and if today is after its expiration date + +*Parameters* + +| Name | Type | Description | +| :------ | :------ | :------ | +| `file` | `IOCozyFile` | io.cozy.files document | + +*Returns* + +`boolean` + +*Defined in* + +[packages/cozy-client/src/models/paper.js:155](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L155) + +*** + +### isExpiring + +▸ **isExpiring**(`file`): `boolean` + +**`description`** Tells if a given file matches one of the known types of expiring papers + +*Parameters* + +| Name | Type | Description | +| :------ | :------ | :------ | +| `file` | `IOCozyFile` | io.cozy.files document | + +*Returns* + +`boolean` + +*Defined in* + +[packages/cozy-client/src/models/paper.js:67](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L67) + +*** + +### isExpiringSoon + +▸ **isExpiringSoon**(`file`): `boolean` + +**`description`** Tells if the given file is expiring and if today is between its expiration notice date and its expiration date + +*Parameters* + +| Name | Type | Description | +| :------ | :------ | :------ | +| `file` | `IOCozyFile` | io.cozy.files document | + +*Returns* + +`boolean` + +*Defined in* + +[packages/cozy-client/src/models/paper.js:167](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L167) diff --git a/packages/cozy-client/types/models/index.d.ts b/packages/cozy-client/types/models/index.d.ts index 90d9f9319b..d37009ea99 100644 --- a/packages/cozy-client/types/models/index.d.ts +++ b/packages/cozy-client/types/models/index.d.ts @@ -15,4 +15,5 @@ import * as timeseries from "./timeseries"; import * as sharing from "./sharing"; import * as dacc from "./dacc"; import * as doctypes from "./doctypes"; -export { trigger, instance, applications, file, folder, note, account, permission, utils, contact, document, timeseries, sharing, dacc, doctypes }; +import * as paper from "./paper"; +export { trigger, instance, applications, file, folder, note, account, permission, utils, contact, document, timeseries, sharing, dacc, doctypes, paper }; diff --git a/packages/cozy-client/types/models/paper.d.ts b/packages/cozy-client/types/models/paper.d.ts new file mode 100644 index 0000000000..40d2e62800 --- /dev/null +++ b/packages/cozy-client/types/models/paper.d.ts @@ -0,0 +1,7 @@ +export function isExpiring(file: IOCozyFile): boolean; +export function computeExpirationDate(file: IOCozyFile): Date | null; +export function computeExpirationNoticeDate(file: IOCozyFile): Date | null; +export function computeExpirationNoticeLink(file: IOCozyFile): string | null; +export function isExpired(file: IOCozyFile): boolean; +export function isExpiringSoon(file: IOCozyFile): boolean; +export type IOCozyFile = import("../types").CozyClientDocument & import("../types").FileDocument; diff --git a/packages/cozy-client/types/types.d.ts b/packages/cozy-client/types/types.d.ts index de11c12547..d3a0abb246 100644 --- a/packages/cozy-client/types/types.d.ts +++ b/packages/cozy-client/types/types.d.ts @@ -1,5 +1,6 @@ declare var _default: {}; export default _default; +export type Qualification = import("./models/document/qualification").Qualification; export type AccountsDoctype = "io.cozy.accounts"; export type TriggersDoctype = "io.cozy.triggers"; export type KonnectorsDoctype = "io.cozy.konnectors"; @@ -194,6 +195,26 @@ export type FileMetadata = { * - Number of a note */ version?: number; + /** + * - Qualification of the file + */ + qualification?: Qualification; + /** + * - Country of the paper + */ + country?: string; + /** + * - Expiration date of the paper + */ + expirationDate?: string; + /** + * - Reference date of the paper + */ + referencedDate?: string; + /** + * - Notice period of the paper, in days + */ + noticePeriod?: string; }; /** * - An io.cozy.files document @@ -235,6 +256,10 @@ export type FileDocument = { * - Whether or not the file is client-side encrypted */ encrypted: boolean; + /** + * - Creation date of the file + */ + created_at: string; }; /** * - An io.cozy.files document @@ -370,7 +395,7 @@ export type Theme = { defaultItems?: Array; }; export type ThemesList = Theme[]; -export type ThemesLabels = "transport" | "identity" | "family" | "work_study" | "health" | "home" | "finance" | "invoice"; +export type ThemesLabels = "transport" | "identity" | "family" | "health" | "invoice" | "work_study" | "home" | "finance"; export type QualificationAttributes = { label: string; purpose?: string; @@ -381,13 +406,13 @@ export type QualificationAttributes = { export type IdentityLabel = "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "citizen_registration_certificate" | "personal_sporting_licence"; export type FamilyLabel = "family_record_book" | "birth_certificate" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "payment_proof_family_allowance"; export type WorkStudyLabels = "resume" | "diploma" | "work_contract" | "pay_sheet" | "unemployment_benefit" | "pension" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "work_disability_recognition" | "school_attendance_certificate"; -export type HealthLabels = "work_disability_recognition" | "health_certificate" | "health_book" | "national_health_insurance_card" | "health_insurance_card" | "prescription" | "health_invoice" | "national_health_insurance_right_certificate" | "pregnancy_medical_certificate" | "other_health_document"; -export type HomeLabels = "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "house_sale_agreeement" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "unfit_for_habitation_declaration" | "accommodation_proof"; +export type HealthLabels = "health_book" | "health_certificate" | "pregnancy_medical_certificate" | "work_disability_recognition" | "national_health_insurance_card" | "national_health_insurance_right_certificate" | "health_insurance_card" | "prescription" | "health_invoice" | "other_health_document"; +export type HomeLabels = "house_sale_agreeement" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "unfit_for_habitation_declaration" | "accommodation_proof"; export type TransportLabels = "driver_license" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document"; -export type FinanceLabels = "payment_proof_family_allowance" | "pay_sheet" | "tax_return" | "tax_notice" | "tax_timetable" | "receipt" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "other_revenue"; -export type InvoiceLabels = "health_invoice" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "work_invoice" | "transport_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice"; +export type FinanceLabels = "pay_sheet" | "other_revenue" | "tax_return" | "tax_notice" | "tax_timetable" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "receipt" | "payment_proof_family_allowance"; +export type InvoiceLabels = "health_invoice" | "transport_invoice" | "work_invoice" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_invoice"; export type ActivityLabels = "personal_sporting_licence" | "other_activity_document"; -export type ItemsLabels = "resume" | "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "citizen_registration_certificate" | "personal_sporting_licence" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "payment_proof_family_allowance" | "diploma" | "work_contract" | "pay_sheet" | "unemployment_benefit" | "pension" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "work_disability_recognition" | "school_attendance_certificate" | "health_certificate" | "health_book" | "national_health_insurance_card" | "health_insurance_card" | "prescription" | "health_invoice" | "national_health_insurance_right_certificate" | "pregnancy_medical_certificate" | "other_health_document" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "house_sale_agreeement" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "unfit_for_habitation_declaration" | "accommodation_proof" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document" | "tax_return" | "tax_notice" | "tax_timetable" | "receipt" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "other_revenue" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_activity_document"; +export type ItemsLabels = "resume" | "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "diploma" | "work_contract" | "pay_sheet" | "unemployment_benefit" | "pension" | "other_revenue" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "health_book" | "health_certificate" | "pregnancy_medical_certificate" | "work_disability_recognition" | "national_health_insurance_card" | "national_health_insurance_right_certificate" | "health_insurance_card" | "prescription" | "health_invoice" | "other_health_document" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document" | "house_sale_agreeement" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_invoice" | "tax_return" | "tax_notice" | "tax_timetable" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "receipt" | "payment_proof_family_allowance" | "school_attendance_certificate" | "unfit_for_habitation_declaration" | "accommodation_proof" | "citizen_registration_certificate" | "personal_sporting_licence" | "other_activity_document"; /** * See https://github.com/cozy/DACC */