diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts index 9cd29a39..a52c30c2 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts @@ -59,7 +59,6 @@ export default class Customers extends BaseSuperAdmin { */ public async post(body: any): Promise { const url = new URL(this.baseURl); - console.log(body); try { return await this.postRequest(url, body); } catch (err) { diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts index a181ca1d..755c599d 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts @@ -92,7 +92,6 @@ export default class Folders extends BaseSuperAdmin { */ public async post(body: any): Promise { const url = new URL(this.baseURl); - console.log(body); try { return await this.postRequest(url, body); } catch (err) { diff --git a/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx b/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx index bb470678..43cfb700 100644 --- a/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx +++ b/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx @@ -9,6 +9,7 @@ import React from "react"; import Typography, { ITypo } from "../../Typography"; import WarningBadge from "../../WarningBadge"; import classes from "./classes.module.scss"; +import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = { document: { @@ -64,7 +65,7 @@ class DocumentNotaryClass extends React.Component { } private onClick() { - if (this.props.document.document_status !== "VALIDATED" && this.props.document.document_status !== "PENDING") return; + if (this.props.document.document_status !== EDocumentStatus.VALIDATED && this.props.document.document_status !== EDocumentStatus.DEPOSITED) return; this.props.router.push(`/folders/${this.props.document.folder?.uid}/documents/${this.props.document.uid}`); } @@ -76,7 +77,7 @@ class DocumentNotaryClass extends React.Component { valid icon ); - case "PENDING": + case EDocumentStatus.DEPOSITED: return ; default: return trash icon; diff --git a/src/front/Components/DesignSystem/FolderContainer/index.tsx b/src/front/Components/DesignSystem/FolderContainer/index.tsx index 5892f98b..0dbdf597 100644 --- a/src/front/Components/DesignSystem/FolderContainer/index.tsx +++ b/src/front/Components/DesignSystem/FolderContainer/index.tsx @@ -6,6 +6,7 @@ import React from "react"; import Typography, { ITypo } from "../Typography"; import WarningBadge from "../WarningBadge"; import classes from "./classes.module.scss"; +import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = { folder: IDashBoardFolder; @@ -39,7 +40,7 @@ export default class FolderContainer extends React.Component { private countPendingDocuments(): number { if (!this.props.folder.documents) return 0; - return this.props.folder.documents?.filter((document) => document.document_status === "PENDING").length ?? 0; + return this.props.folder.documents?.filter((document) => document.document_status === EDocumentStatus.DEPOSITED).length ?? 0; } private onSelectedFolder(): void { diff --git a/src/front/Components/DesignSystem/FolderList/index.tsx b/src/front/Components/DesignSystem/FolderList/index.tsx index 70271435..188c1dc3 100644 --- a/src/front/Components/DesignSystem/FolderList/index.tsx +++ b/src/front/Components/DesignSystem/FolderList/index.tsx @@ -6,6 +6,7 @@ import React from "react"; import FolderContainer from "../FolderContainer"; import classes from "./classes.module.scss"; import Module from "@Front/Config/Module"; +import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = { folders: IDashBoardFolder[]; @@ -28,7 +29,7 @@ class FolderListClass extends React.Component { return (
{this.props.folders.sort((folder) => { - const pendingDocuments = (folder.documents ?? []).filter((document) => document.document_status === "PENDING"); + const pendingDocuments = (folder.documents ?? []).filter((document) => document.document_status === EDocumentStatus.DEPOSITED); return pendingDocuments.length >= 1 ? -1 : 1; }).map((folder) => { return ( diff --git a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx index 8de475b3..f32f3dc7 100644 --- a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx @@ -9,6 +9,7 @@ import React from "react"; import Typography, { ITypo } from "../../Typography"; import WarningBadge from "../../WarningBadge"; import classes from "./classes.module.scss"; +import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = { customer: Customer; @@ -68,7 +69,7 @@ export default class UserFolderHeader extends React.Component { private hasPendingFiles() { const documents = this.props.folder.documents?.filter((document) => document.depositor?.contact?.uid === this.props.customer.contact?.uid) ?? []; - const notAskedDocuments = documents.filter((document) => document.document_status === "PENDING") ?? []; + const notAskedDocuments = documents.filter((document) => document.document_status === EDocumentStatus.DEPOSITED) ?? []; return notAskedDocuments.length > 0; } @@ -82,6 +83,5 @@ export default class UserFolderHeader extends React.Component { } private onEditClick(): void { - // console.log("edit"); } } diff --git a/src/front/Components/DesignSystem/UserFolder/index.tsx b/src/front/Components/DesignSystem/UserFolder/index.tsx index c1698679..a7f00bd0 100644 --- a/src/front/Components/DesignSystem/UserFolder/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/index.tsx @@ -14,6 +14,7 @@ import QuantityProgressBar from "../QuantityProgressBar"; import classes from "./classes.module.scss"; import DocumentList from "./DocumentList"; import UserFolderHeader from "./UserFolderHeader"; +import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = { customer: Customer; @@ -150,8 +151,8 @@ export default class UserFolder extends React.Component { // Get all documents Validated, pending private getValidatedAndPendindDocuments(): Document[] | null { - const pendingDocuments = this.getDocumentsByStatus("PENDING"); - const validatedDocuments = this.getDocumentsByStatus("VALIDATED"); + const pendingDocuments = this.getDocumentsByStatus(EDocumentStatus.DEPOSITED); + const validatedDocuments = this.getDocumentsByStatus(EDocumentStatus.VALIDATED); if (!pendingDocuments && !validatedDocuments) return null; pendingDocuments?.push(...validatedDocuments!); return pendingDocuments; diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx index f081a5d1..bed85b23 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx @@ -119,6 +119,15 @@ export default class DefaultNotaryDashboard extends React.Component {
- Documents PENDING + Documents Depoited
diff --git a/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx b/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx index 3cce7e20..a2b3d705 100644 --- a/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx +++ b/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx @@ -144,9 +144,6 @@ class AddClientToFolderClass extends BasePage { const customer = { contact: values, }; - console.log(customer); - - console.log("SELECTD >>>", this.props.selectedFolderUid); const newCustomerCreated: Customer = await Customers.getInstance().post(customer); if (newCustomerCreated) { diff --git a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx index 2dfbd2a8..2f95d95e 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx @@ -1,7 +1,7 @@ import PlusIcon from "@Assets/Icons/plus.svg"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import CheckBox from "@Front/Components/DesignSystem/CheckBox"; -import Form, { IApiFormErrors } from "@Front/Components/DesignSystem/Form"; +import Form from "@Front/Components/DesignSystem/Form"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; import { IOption } from "@Front/Components/DesignSystem/Select"; @@ -171,9 +171,7 @@ export default class AskDocuments extends BasePage { e: React.FormEvent | null, values: { [key: string]: string; - }, - onApiErrors: (apiFormErrors: IApiFormErrors | null) => void, + } ) { - console.log(values); } } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index 7c7bc254..961b537a 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -171,6 +171,15 @@ class FolderInformationClass extends BasePage { deed: { include: { deed_type: true } }, office: true, office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, + documents: { + include: { + depositor:{ + include: { + contact: true + } + } + } + } }, }; const folder = await Folders.getInstance().getByUid(this.props.selectedFolderUid, query); diff --git a/src/front/Components/Layouts/Folder/UpdateClient/index.tsx b/src/front/Components/Layouts/Folder/UpdateClient/index.tsx index 5dd5ffdd..14b4fcdf 100644 --- a/src/front/Components/Layouts/Folder/UpdateClient/index.tsx +++ b/src/front/Components/Layouts/Folder/UpdateClient/index.tsx @@ -98,7 +98,7 @@ class UpdateClientClass extends BasePage { defaultValue={this.state.customer?.contact?.email} /> { first_name: values["first_name"], last_name: values["last_name"], email: values["email"], - phone_number: values["phone_number"], + cell_phone_number: values["cell_phone_number"], birthdate: values["birthdate"] === "" ? null : values["birthdate"], address: values["address"] === "" diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index e07ae0fc..9ecf68c9 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -19,6 +19,7 @@ import React from "react"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; import OcrResult from "./OcrResult"; +import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = {}; @@ -104,7 +105,7 @@ class ViewDocumentsClass extends BasePage { )}
- {this.props.selectedDocument?.document_status === "PENDING" && ( + {this.props.selectedDocument?.document_status === EDocumentStatus.DEPOSITED && ( <>