Skip to content

Commit

Permalink
feat(cozy-client): Add others theme and other_admin_doc qualif
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed May 16, 2023
1 parent 902b15e commit 47c5618
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/api/cozy-client/modules/models.document.themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

*Defined in*

[packages/cozy-client/src/models/document/documentTypeData.js:176](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/document/documentTypeData.js#L176)
[packages/cozy-client/src/models/document/documentTypeData.js:181](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/document/documentTypeData.js#L181)
3 changes: 3 additions & 0 deletions packages/cozy-client/src/assets/qualifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@
"label": "other_activity_document",
"sourceSubCategory": "sport",
"subjects": ["permit", "invoice"]
},
{
"label": "other_administrative_document"
}
],
"purposeKnownValues": [
Expand Down
11 changes: 11 additions & 0 deletions packages/cozy-client/src/models/document/documentTypeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ const invoiceLabels = [
'other_invoice'
]

/**
* @type {Array<import("../../types").OthersLabels>}
*/
const othersLabels = ['other_administrative_document']

/**
* @type {import("../../types").ThemesList}
*/
Expand Down Expand Up @@ -230,5 +235,11 @@ export const themesList = [
label: 'invoice',
icon: 'bill',
items: buildItemsByLabel(invoiceLabels)
},
{
id: 'theme10',
label: 'others',
icon: 'dots',
items: buildItemsByLabel(othersLabels)
}
]
1 change: 1 addition & 0 deletions packages/cozy-client/src/models/document/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"other_tax_document": "Other tax document |||| Other tax documents",
"other_transport_document": "Other transport document |||| Other transport documents",
"other_work_document": "Other work document |||| Other work documents",
"other_administrative_document": "Other administrative document |||| Other administrative documents",
"others": "Others",
"pacs": "Civil union |||| Civil unions",
"passport": "Passeport |||| Passeports",
Expand Down
1 change: 1 addition & 0 deletions packages/cozy-client/src/models/document/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"other_tax_document": "Impôts - Autre document |||| Impôts - Autres documents",
"other_transport_document": "Autre document de transport |||| Autres documents de transport",
"other_work_document": "Autre document de travail |||| Autres documents de travail",
"other_administrative_document": "Autre document administratif |||| Autres documents administratifs",
"others": "Autres",
"pacs": "Attestation de PACS |||| Attestations de PACS",
"passport": "Passeport |||| Passeports",
Expand Down
6 changes: 4 additions & 2 deletions packages/cozy-client/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ import { QueryDefinition } from './queries/dsl'
*
* @typedef {Array<Theme>} ThemesList
*
* @typedef {'identity'|'family'|'work_study'|'health'|'home'|'transport'|'finance'|'invoice'} ThemesLabels
* @typedef {'identity'|'family'|'work_study'|'health'|'home'|'transport'|'finance'|'invoice'|'others'} ThemesLabels
*/

/**
Expand Down Expand Up @@ -396,7 +396,9 @@ import { QueryDefinition } from './queries/dsl'
*
* @typedef {'personal_sporting_licence'|'other_activity_document'|'fidelity_card'|'library_card'} ActivityLabels
*
* @typedef {IdentityLabel|FamilyLabel|WorkStudyLabels|HealthLabels|HomeLabels|TransportLabels|FinanceLabels|InvoiceLabels|ActivityLabels} ItemsLabels
* @typedef {'other_administrative_document'} OthersLabels
*
* @typedef {IdentityLabel|FamilyLabel|WorkStudyLabels|HealthLabels|HomeLabels|TransportLabels|FinanceLabels|InvoiceLabels|ActivityLabels|OthersLabels} ItemsLabels
*/

/**
Expand Down
5 changes: 3 additions & 2 deletions packages/cozy-client/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export type Theme = {
defaultItems?: Array<string>;
};
export type ThemesList = Theme[];
export type ThemesLabels = "transport" | "identity" | "family" | "health" | "invoice" | "work_study" | "home" | "finance";
export type ThemesLabels = "transport" | "identity" | "family" | "health" | "invoice" | "work_study" | "home" | "finance" | "others";
export type QualificationAttributes = {
label: string;
purpose?: string;
Expand All @@ -583,7 +583,8 @@ export type TransportLabels = "driver_license" | "transport_card" | "vehicle_reg
export type FinanceLabels = "pay_sheet" | "single_parent_benefit" | "other_revenue" | "real_estate_tax" | "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 = "fidelity_card" | "library_card" | "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" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "diploma" | "work_contract" | "pay_sheet" | "fidelity_card" | "library_card" | "single_parent_benefit" | "transport_card" | "electoral_card" | "employment_center_certificate" | "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" | "real_estate_tax" | "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" | "school_insurance_certificate" | "unfit_for_habitation_declaration" | "accommodation_proof" | "citizen_registration_certificate" | "personal_sporting_licence" | "other_activity_document";
export type OthersLabels = "other_administrative_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" | "fidelity_card" | "library_card" | "single_parent_benefit" | "transport_card" | "electoral_card" | "employment_center_certificate" | "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" | "real_estate_tax" | "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" | "school_insurance_certificate" | "unfit_for_habitation_declaration" | "accommodation_proof" | "citizen_registration_certificate" | "personal_sporting_licence" | "other_activity_document" | "other_administrative_document";
/**
* See https://github.com/cozy/DACC
*/
Expand Down

0 comments on commit 47c5618

Please sign in to comment.