Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(account): handle demo feedback carte aadhaar rules #13615

Merged
merged 5 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { kycIndiaModalLocalStorageKey, kycIndiaFeature, requiredStatusKey } from
import { useIdentityDocumentsStatus } from "@/hooks/useIdentityDocumentsStatus";
import { ODS_BUTTON_SIZE, ODS_BUTTON_VARIANT } from '@ovhcloud/ods-components';
import { FunctionComponent, useEffect, useRef, useState } from "react";
import { useFeatureAvailability } from "@ovhcloud/manager-components";
import { useFeatureAvailability } from "@ovh-ux/manager-react-components";
import { useTranslation, Trans } from 'react-i18next';
import { useLocalStorage } from "react-use";
import { useShell } from "@/context";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"identity_documents_modal_title": "We need to verify your identity",
"identity_documents_modal_description": "To comply with Indian law, you need to complete this verification process before placing an order.",
"identity_documents_modal_button_start": "Start",
"identity_documents_modal_button_later": "Skip",
"identity_documents_modal_more_info": "More information",
"identity_documents_modal_legal_information": "OVHcloud is obligated to perform Know Your Customer (KYC) checks on all its customers, pursuant to local regulations in force: Directions No. 20(3)/2022-CERT-In. __ <br>OVHcloud follows a process to collect supporting documents in order to verify the identity and address of its customers. OVHcloud cannot provide you with its services if you don’t submit the required documents."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I missed it originally (so this comment is not blocking) but we should avoid (as much as possible) to use html in our translation.
So this should have been split in two separated translations

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
extended: '<',
isLoaded: '<',
kycStatus: '<',
isValid: '<',
onClick: '&',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@
></p>
</div>
<div class="d-flex flex-shrink-1 flex-end align-items-center mt-3">
<oui-button variant="primary" data-ng-click="$ctrl.onClick()">
<oui-button
variant="primary"
data-ng-click="$ctrl.onClick()"
data-ng-if="$ctrl.kycStatus.status !== $ctrl.KYC_STATUS.OPEN && ($ctrl.isLoaded || (!$ctrl.isLoaded && !($ctrl.userTypeKey === $ctrl.USER_TYPE.individual && $ctrl.isValid)))"
>
<span
data-ng-if="$ctrl.kycStatus.status !== $ctrl.KYC_STATUS.OPEN && !$ctrl.isLoaded"
data-ng-if="!$ctrl.isLoaded"
data-translate="user_account_identity_documents_proof_tile_button"
></span>
<span
data-ng-if="$ctrl.kycStatus.status !== $ctrl.KYC_STATUS.OPEN && $ctrl.isLoaded"
data-ng-if="$ctrl.isLoaded"
data-translate="user_account_identity_documents_proof_tile_button_update"
></span>
</oui-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
{
"user_account_identity_documents_proof_tile_button_update": "Edit"
"user_account_identity_documents_proof_tile_button_update": "Edit",
"user_account_identity_documents_proof_tile_easiest": "The easiest way",
"user_account_identity_documents_proof_tile_heading_aadhaar_card": "Do you have an Aadhaar card?",
"user_account_identity_documents_proof_tile_text_particular_aadhaar_card": "Send a single document as a proof of identity and proof of address",
"user_account_identity_documents_proof_tile_heading_identity": "Proof of identity",
"user_account_identity_documents_proof_tile_heading_address": "Proof of address",
"user_account_identity_documents_proof_tile_heading_vat": "Proof of VAT registration",
"user_account_identity_documents_proof_tile_heading_authority_declaration": "Sworn statement",
"user_account_identity_documents_proof_tile_text_particular_identity": "Aadhaar card, ID card, passport, driving licence, Indian voter card.",
"user_account_identity_documents_proof_tile_text_particular_address": "Aadhaar card, GST certificate, utility bill (electricity, gas, water, internet or telephone), bank statement.",
"user_account_identity_documents_proof_tile_text_non_individual_identity": "Aadhaar card, ID card, passport, driving licence, Indian voter card.",
"user_account_identity_documents_proof_tile_text_non_individual_address": "GST certificate, utility bill (electricity, gas, water, internet or telephone), bank statement.",
"user_account_identity_documents_proof_tile_text_non_individual_vat": "Goods and Services Tax (GST) certificate.",
"user_account_identity_documents_proof_tile_text_non_individual_authority_declaration": "Document granting you authority to act on the company’s behalf.",
"user_account_identity_documents_proof_tile_extended_identity": "Document for legal representative, chief operations officer, or any other contact listed in the GST.",
"user_account_identity_documents_proof_tile_extended_authority_declaration": "Only if you are not the legal representative.",
"user_account_identity_documents_proof_tile_button": "Add"
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,35 @@ export default class AccountUserIdentityDocumentsUploadDetailController {
}
}

clickAddDocuments() {
saveDocuments(isReset = false) {
this.addDocuments({
proofType: this.proofType,
documentType: this.currentDocument,
files: this.files.flatMap((file) => file),
isReset,
});
this.goBack();
}

clickAddDocuments() {
this.saveDocuments();
}

goToParent() {
if (this.checkEmpty()) {
this.saveDocuments(true);
} else {
this.goBack();
}
}

checkEmpty() {
return this.files.reduce(
(acc, fileSlot) => acc && fileSlot.length === 0,
true,
);
}

checkValidity() {
const numberOfMandatoryDocuments = this.proof.documents[
this.currentDocument
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="upload-documents-details d-flex w-100 flex-column">
<h3
class="oui-header__title d-flex align-items-center"
data-ng-click="$ctrl.goBack()"
data-ng-click="$ctrl.goToParent()"
>
<span class="oui-icon oui-icon-chevron-left" aria-hidden="true"></span
><span
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"upload-documents-details-title-identity": "Add proof of identity",
"upload-documents-details-title-address": "Add proof of address",
"upload-documents-details-title-aadhaar_card": "Add Aadhaar card",
"upload-documents-details-title-authority_declaration": "Add sworn statement",
"upload-documents-details-title-vat": "Add proof of VAT",
"upload-documents-details-choose-document": "Choose a document type",
"upload-documents-details-document-type-aadhaar_card": "Aadhaar Card",
"upload-documents-details-document-type-id_card": "ID card",
"upload-documents-details-document-type-passport": "Passport",
"upload-documents-details-document-type-driving_licence": "Driving licence",
"upload-documents-details-document-type-voter_indian_id_card": "Indian voter card",
"upload-documents-details-document-type-gst_certificate": "GST certificate",
"upload-documents-details-document-type-bill": "Utility bill (electricity, gas, water, internet or telephone)",
"upload-documents-details-document-type-bank_statement": "Bank statement",
"upload-documents-details-document-type-authority_declaration": "Document granting you authority to act on the company’s behalf",
"upload-documents-details-add-document": "Add document",
"upload-documents-details-add-documents": "Add documents",
"upload-documents-details-front": "FRONT",
"upload-documents-details-back": "BACK",
"upload-documents-details-last-page": "LAST PAGE",
"user_account_identity_documents_details_acceptance_criteria": "Acceptance criteria",
"upload-documents-details-acceptance-criteria-complete": "The document must be complete (with all pages).",
"upload-documents-details-acceptance-criteria-up_to_date": "The document must be up to date.",
"upload-documents-details-acceptance-criteria-face_visible": "The face should be visible.",
"upload-documents-details-acceptance-criteria-names_account": "Your first and last names must match your customer account information.",
"upload-documents-details-acceptance-criteria-names_address_account": "Your first and last name, and address must match the information in your customer account.",
"upload-documents-details-acceptance-criteria-less_than_three": "Proof dated within the last three months.",
"upload-documents-details-acceptance-criteria-address_gst": "The address on the document must match the one in the GST certificate.",
"upload-documents-details-acceptance-criteria-address_account": "The address on the document must match the one in the customer account.",
"upload-documents-details-acceptance-criteria-company_name_vat": "Company name and VAT information must be provided.",
"upload-documents-details-acceptance-criteria-mandatory_names": "Your name, legal representative’s name, or chief operations officer’s name must be listed.",
"upload-documents-details-acceptance-criteria-names_date_sign_gst": "The full name, date, and signature of the legal representative, chief operations officer, or any other contact listed in the GST certificate.",
"upload-documents-details-acceptance-criteria-delegate_dates": "Authorisation validity dates",
"upload-documents-details-acceptance-criteria-accepted-formats": "Accepted formats for all documents: pdf, .png, .jpg, .jpeg",
"upload-documents-details-acceptance-criteria-maxsize": "File size limit for each uploaded document: 10 MB"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@
<span
data-translate="user_account_identity_documents_sent_informations"
></span>
<oui-collapsible
heading="{{:: 'user_account_identity_documents_sent_legal_title' | translate }}"
aria-label="Action"
class="mt-3"
>
<span
data-translate="user_account_identity_documents_sent_legal_content"
></span>
</oui-collapsible>
<div
class="text-secondary mt-3 small"
data-translate="user_account_identity_documents_sent_legal_content"
></div>
</oui-modal>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"user_account_identity_documents": "My identity documents",
"user_account_identity_documents_title": "Verification of documents required",
"user_account_identity_documents_sub_title": "Upload your documents",
"user_account_identity_documents_intro": "Your account has been created. To place an order on our website, you will need to check that the order is being processed in accordance with Indian law.",
"user_account_identity_documents_intro": "You will receive a response within 24 hours* from our local support team",
"user_account_identity_documents_upload": "Download your documents",
"user_account_identity_documents_intro_others": "If you are an Individual, you only need to submit the required proof of identity and address. In this case, a sworn statement and proof of VAT aren’t required.",
"user_account_identity_documents_selection_file_format": "Format: jpg, jpeg, pdf, png. The file size limit for each document is 10 MB.",
Expand All @@ -17,5 +17,6 @@
"user_account_identity_documents_legal_info3": "The documents will be retained for 5 years after the end of the contract.",
"user_account_identity_documents_verification_in_progress_info": "Your documents are currently being processed by our team.",
"user_account_identity_documents_verification_waiting_info": "Your request has been processed but we require additional documents. Please consult your support ticket.",
"user_account_identity_documents_legal_info4": "Response time during business hours: 9am to 6pm IST (India Standard Time) Monday to Friday, excluding public holidays."
"user_account_identity_documents_legal_info4": "Response time during business hours: 9am to 6pm IST (India Standard Time) Monday to Friday, excluding public holidays.",
"user_account_identity_documents_default_intro": "If you are an individual, you only need to submit the required proof of identity and address. You don’t need to provide a proof of VAT and sworn statement."
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const DOCUMENT_INDIVIDUAL_MATRIX = {
],
},
gst_certificate: {
quantity: 3,
quantity: 1,
mandatory: 1,
acceptance_criteria: [
DOCUMENT_ACCEPTANCE_CRITERIA.names_address_account,
Expand All @@ -133,6 +133,13 @@ const DOCUMENT_INDIVIDUAL_MATRIX = {
DOCUMENT_ACCEPTANCE_CRITERIA.less_than_three,
],
},
bank_statement: {
quantity: 1,
mandatory: 1,
acceptance_criteria: [
DOCUMENT_ACCEPTANCE_CRITERIA.names_address_account,
],
},
},
},
};
Expand Down Expand Up @@ -187,7 +194,7 @@ const DOCUMENT_NON_INDIVIDUAL_MATRIX = {
extended: false,
documents: {
gst_certificate: {
quantity: 3,
quantity: 1,
mandatory: 1,
acceptance_criteria: [
DOCUMENT_ACCEPTANCE_CRITERIA.address_gst,
Expand All @@ -203,14 +210,21 @@ const DOCUMENT_NON_INDIVIDUAL_MATRIX = {
DOCUMENT_ACCEPTANCE_CRITERIA.less_than_three,
],
},
bank_statement: {
quantity: 1,
mandatory: 1,
acceptance_criteria: [
DOCUMENT_ACCEPTANCE_CRITERIA.names_address_account,
],
},
},
},
vat: {
extended: false,
documents: {
gst_certificate: {
quantity: 3,
mandatory: 3,
quantity: 1,
mandatory: 1,
extended: true,
acceptance_criteria: [
DOCUMENT_ACCEPTANCE_CRITERIA.company_name_vat,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
USER_TYPE,
PROOF_TYPE,
DOCUMENT_TYPE,
TRACKING_TASK_TAG,
TRACKING_VARIABLES,
LEGAL_LINK1,
Expand Down Expand Up @@ -36,8 +37,10 @@ export default class AccountUserIdentityDocumentsController {
this.TRACKING_TASK_TAG = TRACKING_TASK_TAG;
this.USER_TYPE = USER_TYPE;
this.PROOF_TYPE = PROOF_TYPE;
this.DOCUMENT_TYPE = DOCUMENT_TYPE;
this.DOCUMENTS_MATRIX = DOCUMENTS_MATRIX;
this.isValid = false;
this.hasAadhaarCard = false;
}

$onInit() {
Expand Down Expand Up @@ -114,20 +117,36 @@ export default class AccountUserIdentityDocumentsController {
this.isOpenInformationModal = open;
}

addDocuments(proofType, documentType, files) {
this.files[proofType] = {
document: documentType,
files,
};
addDocuments(proofType, documentType, files, isReset) {
if (isReset) {
delete this.files[proofType];
} else {
this.files[proofType] = {
document: documentType,
files,
};
}
this.checkValidity();
}

checkInvidualValidity() {
this.hasAadhaarCard =
!!this.files[this.PROOF_TYPE.aadhaar_card] ||
!!Object.entries(this.files).find(
([, value]) => value.document === this.DOCUMENT_TYPE.aadhaar_card,
);

const isComplete =
!!this.files[this.PROOF_TYPE.identity] &&
!!this.files[this.PROOF_TYPE.address];

return this.hasAadhaarCard || isComplete;
}

checkValidity() {
this.isValid =
this.user_type === this.USER_TYPE.individual
? this.files[this.PROOF_TYPE.aadhaar_card] ||
(this.files[this.PROOF_TYPE.identity] &&
this.files[this.PROOF_TYPE.address])
? this.checkInvidualValidity()
: Object.keys(this.proofs).reduce(
(acc, proofType) =>
(acc &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
data-proof="$ctrl.currentProof"
data-proof-type="$ctrl.currentProofType"
data-go-back="$ctrl.selectProofType(null)"
data-add-documents="$ctrl.addDocuments(proofType, documentType, files)"
data-add-documents="$ctrl.addDocuments(proofType, documentType, files, isReset)"
data-document-files="$ctrl.currentDocumentFiles"
data-document="$ctrl.currentDocumentType"
>
Expand Down Expand Up @@ -60,6 +60,7 @@
data-on-click="$ctrl.selectProofType(proof)"
data-is-loaded="$ctrl.files[proof] && $ctrl.files[proof].length !== 0"
data-kyc-status="$ctrl.kycStatus"
data-is-valid="$ctrl.isValid"
></account-upload-identity-documents-proof-tile>
</div>
</div>
Expand Down
Loading