✨ Fixing getters
This commit is contained in:
parent
f57443a811
commit
324429c988
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||||
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
@ -9,12 +8,11 @@ import BackArrow from "@Front/Components/Elements/BackArrow";
|
|||||||
import WindowStore from "@Front/Stores/WindowStore";
|
import WindowStore from "@Front/Stores/WindowStore";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { OfficeFolder } from "le-coffre-resources/dist/Customer";
|
import { OfficeFolder } from "le-coffre-resources/dist/Customer";
|
||||||
|
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import React, { ReactNode } from "react";
|
import React, { ReactNode } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
|
||||||
|
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
title: string;
|
title: string;
|
||||||
@ -118,9 +116,7 @@ export default class DefaultNotaryDashboard extends React.Component<IProps, ISta
|
|||||||
include: {
|
include: {
|
||||||
deed: { include: { deed_type: true } },
|
deed: { include: { deed_type: true } },
|
||||||
office: true,
|
office: true,
|
||||||
office_folder_has_customers: {
|
customers: {
|
||||||
include: {
|
|
||||||
customer: {
|
|
||||||
include: {
|
include: {
|
||||||
contact: true,
|
contact: true,
|
||||||
documents: {
|
documents: {
|
||||||
@ -132,8 +128,6 @@ export default class DefaultNotaryDashboard extends React.Component<IProps, ISta
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
documents: {
|
documents: {
|
||||||
include: {
|
include: {
|
||||||
depositor: {
|
depositor: {
|
||||||
|
@ -2,12 +2,14 @@ import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers";
|
|||||||
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import Form from "@Front/Components/DesignSystem/Form";
|
import Form from "@Front/Components/DesignSystem/Form";
|
||||||
|
import { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
||||||
import MultiSelect from "@Front/Components/DesignSystem/MultiSelect";
|
import MultiSelect from "@Front/Components/DesignSystem/MultiSelect";
|
||||||
import RadioBox from "@Front/Components/DesignSystem/RadioBox";
|
import RadioBox from "@Front/Components/DesignSystem/RadioBox";
|
||||||
import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography";
|
||||||
import BackArrow from "@Front/Components/Elements/BackArrow";
|
import BackArrow from "@Front/Components/Elements/BackArrow";
|
||||||
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
||||||
import Module from "@Front/Config/Module";
|
import Module from "@Front/Config/Module";
|
||||||
|
import { TextField } from "@mui/material";
|
||||||
import { ECivility } from "le-coffre-resources/dist/Customer/Contact";
|
import { ECivility } from "le-coffre-resources/dist/Customer/Contact";
|
||||||
import { Customer, OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { Customer, OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
@ -15,8 +17,6 @@ import { NextRouter, useRouter } from "next/router";
|
|||||||
|
|
||||||
import BasePage from "../../Base";
|
import BasePage from "../../Base";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
|
||||||
import { TextField } from "@mui/material";
|
|
||||||
|
|
||||||
enum ESelectedOption {
|
enum ESelectedOption {
|
||||||
EXISTING_CUSTOMER = "existing_customer",
|
EXISTING_CUSTOMER = "existing_customer",
|
||||||
@ -108,10 +108,7 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
|||||||
<TextField name="last_name" placeholder="Nom" />
|
<TextField name="last_name" placeholder="Nom" />
|
||||||
<TextField name="first_name" placeholder="Prénom" />
|
<TextField name="first_name" placeholder="Prénom" />
|
||||||
<TextField name="email" placeholder="E-mail" />
|
<TextField name="email" placeholder="E-mail" />
|
||||||
<TextField
|
<TextField name="cell_phone_number" placeholder="Numéro de téléphone" />
|
||||||
name="cell_phone_number"
|
|
||||||
placeholder="Numéro de téléphone"
|
|
||||||
/>
|
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Link href={backwardPath} className={classes["cancel-button"]}>
|
<Link href={backwardPath} className={classes["cancel-button"]}>
|
||||||
<Button variant={EButtonVariant.GHOST}>Annuler</Button>
|
<Button variant={EButtonVariant.GHOST}>Annuler</Button>
|
||||||
@ -150,16 +147,12 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
|||||||
private async getFolderPreSelectedCustomers(folderUid: string): Promise<IOption[] | undefined> {
|
private async getFolderPreSelectedCustomers(folderUid: string): Promise<IOption[] | undefined> {
|
||||||
const query = {
|
const query = {
|
||||||
q: {
|
q: {
|
||||||
office_folder_has_customers: {
|
customers: {
|
||||||
include: {
|
|
||||||
customer: {
|
|
||||||
include: {
|
include: {
|
||||||
contact: true,
|
contact: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
let preExistingCustomers: IOption[] = [];
|
let preExistingCustomers: IOption[] = [];
|
||||||
try {
|
try {
|
||||||
@ -224,9 +217,11 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (customersToLink) {
|
if (customersToLink) {
|
||||||
const body = OfficeFolder.hydrate<OfficeFolder>({ customers: customersToLink.map((customer) => {
|
const body = OfficeFolder.hydrate<OfficeFolder>({
|
||||||
|
customers: customersToLink.map((customer) => {
|
||||||
return Customer.hydrate<Customer>(customer);
|
return Customer.hydrate<Customer>(customer);
|
||||||
}) });
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
await Folders.getInstance().put(this.props.selectedFolderUid, body);
|
await Folders.getInstance().put(this.props.selectedFolderUid, body);
|
||||||
this.props.router.push(`/folders/${this.props.selectedFolderUid}`);
|
this.props.router.push(`/folders/${this.props.selectedFolderUid}`);
|
||||||
|
@ -2,6 +2,7 @@ import ChevronIcon from "@Assets/Icons/chevron.svg";
|
|||||||
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation";
|
import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation";
|
||||||
|
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
||||||
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||||
import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar";
|
import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar";
|
||||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
@ -16,7 +17,6 @@ import { ChangeEvent } from "react";
|
|||||||
import BasePage from "../../Base";
|
import BasePage from "../../Base";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import ClientSection from "./ClientSection";
|
import ClientSection from "./ClientSection";
|
||||||
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
|
|
||||||
@ -189,8 +189,6 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
q: {
|
q: {
|
||||||
deed: { include: { deed_type: true } },
|
deed: { include: { deed_type: true } },
|
||||||
office: true,
|
office: true,
|
||||||
office_folder_has_customers: {
|
|
||||||
include: {
|
|
||||||
customer: {
|
customer: {
|
||||||
include: {
|
include: {
|
||||||
contact: true,
|
contact: true,
|
||||||
@ -203,8 +201,6 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
documents: {
|
documents: {
|
||||||
include: {
|
include: {
|
||||||
depositor: {
|
depositor: {
|
||||||
|
@ -104,16 +104,12 @@ class UpdateFolderCollaboratorsClass extends BasePage<IPropsClass, IState> {
|
|||||||
const query = {
|
const query = {
|
||||||
q: {
|
q: {
|
||||||
office: true,
|
office: true,
|
||||||
office_folder_has_stakeholder: {
|
stakeholders: {
|
||||||
include: {
|
|
||||||
user_stakeholder: {
|
|
||||||
include: {
|
include: {
|
||||||
contact: true,
|
contact: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let folder = null;
|
let folder = null;
|
||||||
|
@ -103,7 +103,7 @@ class UpdateFolderMetadataClass extends BasePage<IPropsClass, IState> {
|
|||||||
q: {
|
q: {
|
||||||
deed: { include: { deed_type: true } },
|
deed: { include: { deed_type: true } },
|
||||||
office: true,
|
office: true,
|
||||||
office_folder_has_customers: { include: { customer: { include: { contact: true } } } },
|
customers: { include: { contact: true } },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const folder = await Folders.getInstance().getByUid(this.props.folderUid, query);
|
const folder = await Folders.getInstance().getByUid(this.props.folderUid, query);
|
||||||
|
@ -140,7 +140,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
q: {
|
q: {
|
||||||
deed: { include: { deed_type: "true" } },
|
deed: { include: { deed_type: "true" } },
|
||||||
office: "true",
|
office: "true",
|
||||||
office_folder_has_customers: { include: { customer: { include: { contact: true } } } },
|
customer: { include: { contact: true } },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const folder = await Folders.getInstance().getByUid(this.props.selectedFolderUid, query);
|
const folder = await Folders.getInstance().getByUid(this.props.selectedFolderUid, query);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user