🐛 Fixing requests
This commit is contained in:
parent
302384ab01
commit
0c6f495929
@ -67,6 +67,7 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private hasPendingFiles() {
|
||||
console.log(this.props.folder.documents);
|
||||
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 === EDocumentStatus.DEPOSITED) ?? [];
|
||||
|
@ -125,14 +125,14 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
||||
private calculateDocumentsPercentageProgress(): number {
|
||||
if (!this.props.customer.documents) return 0;
|
||||
const totalDocuments: number = this.props.customer.documents.length;
|
||||
const numberDocumentsAsked: number = this.getDocumentsByStatus("ASKED")?.length || 0;
|
||||
const numberDocumentsAsked: number = this.getDocumentsByStatus(EDocumentStatus.ASKED)?.length || 0;
|
||||
return Math.round(((totalDocuments - numberDocumentsAsked) / totalDocuments) * 100);
|
||||
}
|
||||
|
||||
private getDocumentsByStatus(status: string): Document[] | null {
|
||||
if (!this.props.customer.documents) return null;
|
||||
const filteredDocuments = this.props.customer.documents.filter(
|
||||
(document) => document.document_status === status,
|
||||
(document) => document.document_status === status && document.folder?.uid === this.props.folder.uid,
|
||||
);
|
||||
return filteredDocuments;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import "reflect-metadata";
|
||||
|
||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||
import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer";
|
||||
import Header from "@Front/Components/DesignSystem/Header";
|
||||
@ -9,12 +10,12 @@ import BackArrow from "@Front/Components/Elements/BackArrow";
|
||||
import WindowStore from "@Front/Stores/WindowStore";
|
||||
import classNames from "classnames";
|
||||
import { OfficeFolder } from "le-coffre-resources/dist/Customer";
|
||||
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
||||
import Image from "next/image";
|
||||
import React, { ReactNode } from "react";
|
||||
|
||||
import classes from "./classes.module.scss";
|
||||
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
||||
|
||||
|
||||
type IProps = {
|
||||
title: string;
|
||||
@ -118,12 +119,22 @@ export default class DefaultNotaryDashboard extends React.Component<IProps, ISta
|
||||
include: {
|
||||
deed: { include: { deed_type: true } },
|
||||
office: true,
|
||||
office_folder_has_customers: { include: { customer: { include: { contact: true, documents: {
|
||||
office_folder_has_customers: {
|
||||
include: {
|
||||
document_type: true,
|
||||
files: true
|
||||
}
|
||||
} } } } },
|
||||
customer: {
|
||||
include: {
|
||||
contact: true,
|
||||
documents: {
|
||||
include: {
|
||||
folder: true,
|
||||
document_type: true,
|
||||
files: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
documents: {
|
||||
include: {
|
||||
depositor: {
|
||||
|
@ -185,12 +185,22 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
q: {
|
||||
deed: { include: { deed_type: true } },
|
||||
office: true,
|
||||
office_folder_has_customers: { include: { customer: { include: { contact: true, documents: {
|
||||
office_folder_has_customers: {
|
||||
include: {
|
||||
document_type: true,
|
||||
files: true
|
||||
}
|
||||
} } } } },
|
||||
customer: {
|
||||
include: {
|
||||
contact: true,
|
||||
documents: {
|
||||
include: {
|
||||
folder: true,
|
||||
document_type: true,
|
||||
files: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
documents: {
|
||||
include: {
|
||||
depositor: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user