refactor: renamed built_in_modules into modules
This commit is contained in:
@ -36,7 +36,7 @@ const useProjectsContextState = (): ProjectsContextState => {
|
|||||||
const modulesSet = useMemo(
|
const modulesSet = useMemo(
|
||||||
() =>
|
() =>
|
||||||
new Set(
|
new Set(
|
||||||
selectedProject?.builtInModules.map(m => m.key as ModuleNames)
|
selectedProject?.modules.map(m => m.key as ModuleNames)
|
||||||
),
|
),
|
||||||
[selectedProject]
|
[selectedProject]
|
||||||
);
|
);
|
||||||
|
|||||||
@ -55,7 +55,7 @@ const DealEditorBody: FC<Props> = props => {
|
|||||||
if (!props.project) return [];
|
if (!props.project) return [];
|
||||||
const tabs: ReactNode[] = [];
|
const tabs: ReactNode[] = [];
|
||||||
|
|
||||||
for (const module of props.project.builtInModules) {
|
for (const module of props.project.modules) {
|
||||||
const moduleInfo = MODULES[module.key];
|
const moduleInfo = MODULES[module.key];
|
||||||
for (const tab of moduleInfo.tabs) {
|
for (const tab of moduleInfo.tabs) {
|
||||||
if (
|
if (
|
||||||
@ -75,7 +75,7 @@ const DealEditorBody: FC<Props> = props => {
|
|||||||
if (!props.project) return [];
|
if (!props.project) return [];
|
||||||
const tabPanels: ReactNode[] = [];
|
const tabPanels: ReactNode[] = [];
|
||||||
|
|
||||||
for (const module of props.project.builtInModules) {
|
for (const module of props.project.modules) {
|
||||||
const moduleInfo = MODULES[module.key];
|
const moduleInfo = MODULES[module.key];
|
||||||
for (const tab of moduleInfo.tabs) {
|
for (const tab of moduleInfo.tabs) {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@ -16,12 +16,10 @@ export const ModulesTab: FC<Props> = ({ value, onChange }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onSubmit = (values: ProjectSchema) => {
|
const onSubmit = (values: ProjectSchema) => {
|
||||||
const modulesWithDependencies = resolveDependencies(
|
const modulesWithDependencies = resolveDependencies(values.modules);
|
||||||
values.builtInModules
|
|
||||||
);
|
|
||||||
const updatedValues = {
|
const updatedValues = {
|
||||||
...values,
|
...values,
|
||||||
builtInModules: modulesWithDependencies,
|
modules: modulesWithDependencies,
|
||||||
};
|
};
|
||||||
form.setValues(updatedValues);
|
form.setValues(updatedValues);
|
||||||
form.resetDirty();
|
form.resetDirty();
|
||||||
@ -32,9 +30,9 @@ export const ModulesTab: FC<Props> = ({ value, onChange }) => {
|
|||||||
<form onSubmit={form.onSubmit(onSubmit)}>
|
<form onSubmit={form.onSubmit(onSubmit)}>
|
||||||
<Stack p={"md"}>
|
<Stack p={"md"}>
|
||||||
<ModulesTable
|
<ModulesTable
|
||||||
selectedRecords={form.values.builtInModules}
|
selectedRecords={form.values.modules}
|
||||||
onSelectedRecordsChange={modules =>
|
onSelectedRecordsChange={modules =>
|
||||||
form.setFieldValue("builtInModules", modules)
|
form.setFieldValue("modules", modules)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@ -2,23 +2,23 @@ import { FC } from "react";
|
|||||||
import { Divider, Stack } from "@mantine/core";
|
import { Divider, Stack } from "@mantine/core";
|
||||||
import BaseTable from "@/components/ui/BaseTable/BaseTable";
|
import BaseTable from "@/components/ui/BaseTable/BaseTable";
|
||||||
import useModulesTableColumns from "@/drawers/common/ProjectEditorDrawer/tabs/ModulesTab/hooks/useModulesTableColumns";
|
import useModulesTableColumns from "@/drawers/common/ProjectEditorDrawer/tabs/ModulesTab/hooks/useModulesTableColumns";
|
||||||
import useBuiltInModulesList from "@/hooks/lists/useBuiltInModulesList";
|
import useModulesList from "@/hooks/lists/useModulesList";
|
||||||
import { BuiltInModuleSchemaOutput } from "@/lib/client";
|
import { ModuleSchemaOutput } from "@/lib/client";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
selectedRecords: BuiltInModuleSchemaOutput[];
|
selectedRecords: ModuleSchemaOutput[];
|
||||||
onSelectedRecordsChange: (records: BuiltInModuleSchemaOutput[]) => void;
|
onSelectedRecordsChange: (records: ModuleSchemaOutput[]) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ModulesTable: FC<Props> = props => {
|
const ModulesTable: FC<Props> = props => {
|
||||||
const columns = useModulesTableColumns();
|
const columns = useModulesTableColumns();
|
||||||
const { builtInModules } = useBuiltInModulesList();
|
const { modules } = useModulesList();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gap={0}>
|
<Stack gap={0}>
|
||||||
<Divider />
|
<Divider />
|
||||||
<BaseTable
|
<BaseTable
|
||||||
records={builtInModules}
|
records={modules}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
verticalSpacing={"md"}
|
verticalSpacing={"md"}
|
||||||
allRecordsSelectionCheckboxProps={{
|
allRecordsSelectionCheckboxProps={{
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useMemo } from "react";
|
|||||||
import { IconInfoCircle } from "@tabler/icons-react";
|
import { IconInfoCircle } from "@tabler/icons-react";
|
||||||
import { DataTableColumn } from "mantine-datatable";
|
import { DataTableColumn } from "mantine-datatable";
|
||||||
import { em, Group, Text, Tooltip } from "@mantine/core";
|
import { em, Group, Text, Tooltip } from "@mantine/core";
|
||||||
import { BuiltInModuleSchemaOutput } from "@/lib/client";
|
import { ModuleSchemaOutput } from "@/lib/client";
|
||||||
|
|
||||||
const useModulesTableColumns = () => {
|
const useModulesTableColumns = () => {
|
||||||
return useMemo(
|
return useMemo(
|
||||||
@ -38,7 +38,7 @@ const useModulesTableColumns = () => {
|
|||||||
</Text>
|
</Text>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
] as DataTableColumn<BuiltInModuleSchemaOutput>[],
|
] as DataTableColumn<ModuleSchemaOutput>[],
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import { uniqBy } from "lodash";
|
import { uniqBy } from "lodash";
|
||||||
import { BuiltInModuleSchemaOutput } from "@/lib/client";
|
import { ModuleSchemaOutput } from "@/lib/client";
|
||||||
|
|
||||||
const resolveDependencies = (
|
const resolveDependencies = (
|
||||||
modules: BuiltInModuleSchemaOutput[]
|
modules: ModuleSchemaOutput[]
|
||||||
): BuiltInModuleSchemaOutput[] => {
|
): ModuleSchemaOutput[] => {
|
||||||
const resolved = new Set<number>();
|
const resolved = new Set<number>();
|
||||||
const result: BuiltInModuleSchemaOutput[] = [];
|
const result: ModuleSchemaOutput[] = [];
|
||||||
|
|
||||||
const addModule = (module: BuiltInModuleSchemaOutput) => {
|
const addModule = (module: ModuleSchemaOutput) => {
|
||||||
if (resolved.has(module.id)) return;
|
if (resolved.has(module.id)) return;
|
||||||
resolved.add(module.id);
|
resolved.add(module.id);
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
import { useQuery } from "@tanstack/react-query";
|
|
||||||
import { getBuiltInModulesOptions } from "@/lib/client/@tanstack/react-query.gen";
|
|
||||||
|
|
||||||
const useBuiltInModulesList = () => {
|
|
||||||
const { data, refetch } = useQuery(getBuiltInModulesOptions());
|
|
||||||
|
|
||||||
return {
|
|
||||||
builtInModules: data?.items ?? [],
|
|
||||||
refetch,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default useBuiltInModulesList;
|
|
||||||
13
src/hooks/lists/useModulesList.ts
Normal file
13
src/hooks/lists/useModulesList.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { getModulesOptions } from "@/lib/client/@tanstack/react-query.gen";
|
||||||
|
|
||||||
|
const useModulesList = () => {
|
||||||
|
const { data, refetch } = useQuery(getModulesOptions());
|
||||||
|
|
||||||
|
return {
|
||||||
|
modules: data?.items ?? [],
|
||||||
|
refetch,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useModulesList;
|
||||||
@ -51,7 +51,6 @@ import {
|
|||||||
getBarcodeTemplateSizes,
|
getBarcodeTemplateSizes,
|
||||||
getBaseMarketplaces,
|
getBaseMarketplaces,
|
||||||
getBoards,
|
getBoards,
|
||||||
getBuiltInModules,
|
|
||||||
getClients,
|
getClients,
|
||||||
getDealProducts,
|
getDealProducts,
|
||||||
getDeals,
|
getDeals,
|
||||||
@ -59,6 +58,7 @@ import {
|
|||||||
getDealTagColors,
|
getDealTagColors,
|
||||||
getDealTags,
|
getDealTags,
|
||||||
getMarketplaces,
|
getMarketplaces,
|
||||||
|
getModules,
|
||||||
getProductBarcodePdf,
|
getProductBarcodePdf,
|
||||||
getProducts,
|
getProducts,
|
||||||
getProjects,
|
getProjects,
|
||||||
@ -203,7 +203,6 @@ import type {
|
|||||||
GetBarcodeTemplateSizesData,
|
GetBarcodeTemplateSizesData,
|
||||||
GetBaseMarketplacesData,
|
GetBaseMarketplacesData,
|
||||||
GetBoardsData,
|
GetBoardsData,
|
||||||
GetBuiltInModulesData,
|
|
||||||
GetClientsData,
|
GetClientsData,
|
||||||
GetDealProductsData,
|
GetDealProductsData,
|
||||||
GetDealsData,
|
GetDealsData,
|
||||||
@ -214,6 +213,7 @@ import type {
|
|||||||
GetDealTagColorsResponse,
|
GetDealTagColorsResponse,
|
||||||
GetDealTagsData,
|
GetDealTagsData,
|
||||||
GetMarketplacesData,
|
GetMarketplacesData,
|
||||||
|
GetModulesData,
|
||||||
GetProductBarcodePdfData,
|
GetProductBarcodePdfData,
|
||||||
GetProductBarcodePdfError,
|
GetProductBarcodePdfError,
|
||||||
GetProductBarcodePdfResponse2,
|
GetProductBarcodePdfResponse2,
|
||||||
@ -1033,19 +1033,16 @@ export const getDealTagColorsMutation = (
|
|||||||
return mutationOptions;
|
return mutationOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getBuiltInModulesQueryKey = (
|
export const getModulesQueryKey = (options?: Options<GetModulesData>) =>
|
||||||
options?: Options<GetBuiltInModulesData>
|
createQueryKey("getModules", options);
|
||||||
) => createQueryKey("getBuiltInModules", options);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Built In Modules
|
* Get Modules
|
||||||
*/
|
*/
|
||||||
export const getBuiltInModulesOptions = (
|
export const getModulesOptions = (options?: Options<GetModulesData>) => {
|
||||||
options?: Options<GetBuiltInModulesData>
|
|
||||||
) => {
|
|
||||||
return queryOptions({
|
return queryOptions({
|
||||||
queryFn: async ({ queryKey, signal }) => {
|
queryFn: async ({ queryKey, signal }) => {
|
||||||
const { data } = await getBuiltInModules({
|
const { data } = await getModules({
|
||||||
...options,
|
...options,
|
||||||
...queryKey[0],
|
...queryKey[0],
|
||||||
signal,
|
signal,
|
||||||
@ -1053,7 +1050,7 @@ export const getBuiltInModulesOptions = (
|
|||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
queryKey: getBuiltInModulesQueryKey(options),
|
queryKey: getModulesQueryKey(options),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -127,8 +127,6 @@ import type {
|
|||||||
GetBoardsData,
|
GetBoardsData,
|
||||||
GetBoardsErrors,
|
GetBoardsErrors,
|
||||||
GetBoardsResponses,
|
GetBoardsResponses,
|
||||||
GetBuiltInModulesData,
|
|
||||||
GetBuiltInModulesResponses,
|
|
||||||
GetClientsData,
|
GetClientsData,
|
||||||
GetClientsErrors,
|
GetClientsErrors,
|
||||||
GetClientsResponses,
|
GetClientsResponses,
|
||||||
@ -149,6 +147,8 @@ import type {
|
|||||||
GetMarketplacesData,
|
GetMarketplacesData,
|
||||||
GetMarketplacesErrors,
|
GetMarketplacesErrors,
|
||||||
GetMarketplacesResponses,
|
GetMarketplacesResponses,
|
||||||
|
GetModulesData,
|
||||||
|
GetModulesResponses,
|
||||||
GetProductBarcodePdfData,
|
GetProductBarcodePdfData,
|
||||||
GetProductBarcodePdfErrors,
|
GetProductBarcodePdfErrors,
|
||||||
GetProductBarcodePdfResponses,
|
GetProductBarcodePdfResponses,
|
||||||
@ -313,8 +313,6 @@ import {
|
|||||||
zGetBaseMarketplacesResponse2,
|
zGetBaseMarketplacesResponse2,
|
||||||
zGetBoardsData,
|
zGetBoardsData,
|
||||||
zGetBoardsResponse2,
|
zGetBoardsResponse2,
|
||||||
zGetBuiltInModulesData,
|
|
||||||
zGetBuiltInModulesResponse,
|
|
||||||
zGetClientsData,
|
zGetClientsData,
|
||||||
zGetClientsResponse2,
|
zGetClientsResponse2,
|
||||||
zGetDealProductsData,
|
zGetDealProductsData,
|
||||||
@ -329,6 +327,8 @@ import {
|
|||||||
zGetDealTagsResponse2,
|
zGetDealTagsResponse2,
|
||||||
zGetMarketplacesData,
|
zGetMarketplacesData,
|
||||||
zGetMarketplacesResponse2,
|
zGetMarketplacesResponse2,
|
||||||
|
zGetModulesData,
|
||||||
|
zGetModulesResponse,
|
||||||
zGetProductBarcodePdfData,
|
zGetProductBarcodePdfData,
|
||||||
zGetProductBarcodePdfResponse2,
|
zGetProductBarcodePdfResponse2,
|
||||||
zGetProductsData,
|
zGetProductsData,
|
||||||
@ -859,22 +859,22 @@ export const getDealTagColors = <ThrowOnError extends boolean = false>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Built In Modules
|
* Get Modules
|
||||||
*/
|
*/
|
||||||
export const getBuiltInModules = <ThrowOnError extends boolean = false>(
|
export const getModules = <ThrowOnError extends boolean = false>(
|
||||||
options?: Options<GetBuiltInModulesData, ThrowOnError>
|
options?: Options<GetModulesData, ThrowOnError>
|
||||||
) => {
|
) => {
|
||||||
return (options?.client ?? _heyApiClient).get<
|
return (options?.client ?? _heyApiClient).get<
|
||||||
GetBuiltInModulesResponses,
|
GetModulesResponses,
|
||||||
unknown,
|
unknown,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
requestValidator: async data => {
|
requestValidator: async data => {
|
||||||
return await zGetBuiltInModulesData.parseAsync(data);
|
return await zGetModulesData.parseAsync(data);
|
||||||
},
|
},
|
||||||
responseType: "json",
|
responseType: "json",
|
||||||
responseValidator: async data => {
|
responseValidator: async data => {
|
||||||
return await zGetBuiltInModulesResponse.parseAsync(data);
|
return await zGetModulesResponse.parseAsync(data);
|
||||||
},
|
},
|
||||||
url: "/crm/v1/module/built-in/",
|
url: "/crm/v1/module/built-in/",
|
||||||
...options,
|
...options,
|
||||||
|
|||||||
@ -137,92 +137,6 @@ export type BodyUploadProductImage = {
|
|||||||
upload_file: Blob | File;
|
upload_file: Blob | File;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* BuiltInModuleSchema
|
|
||||||
*/
|
|
||||||
export type BuiltInModuleSchemaInput = {
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
id: number;
|
|
||||||
/**
|
|
||||||
* Key
|
|
||||||
*/
|
|
||||||
key: string;
|
|
||||||
/**
|
|
||||||
* Label
|
|
||||||
*/
|
|
||||||
label: string;
|
|
||||||
/**
|
|
||||||
* Description
|
|
||||||
*/
|
|
||||||
description: string;
|
|
||||||
/**
|
|
||||||
* Dependson
|
|
||||||
*/
|
|
||||||
dependsOn: Array<BuiltInModuleSchemaInput>;
|
|
||||||
/**
|
|
||||||
* Tabs
|
|
||||||
*/
|
|
||||||
tabs: Array<BuiltInModuleTabSchema>;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BuiltInModuleSchema
|
|
||||||
*/
|
|
||||||
export type BuiltInModuleSchemaOutput = {
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
id: number;
|
|
||||||
/**
|
|
||||||
* Key
|
|
||||||
*/
|
|
||||||
key: string;
|
|
||||||
/**
|
|
||||||
* Label
|
|
||||||
*/
|
|
||||||
label: string;
|
|
||||||
/**
|
|
||||||
* Description
|
|
||||||
*/
|
|
||||||
description: string;
|
|
||||||
/**
|
|
||||||
* Dependson
|
|
||||||
*/
|
|
||||||
dependsOn: Array<BuiltInModuleSchemaOutput>;
|
|
||||||
/**
|
|
||||||
* Tabs
|
|
||||||
*/
|
|
||||||
tabs: Array<BuiltInModuleTabSchema>;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BuiltInModuleTabSchema
|
|
||||||
*/
|
|
||||||
export type BuiltInModuleTabSchema = {
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
id: number;
|
|
||||||
/**
|
|
||||||
* Key
|
|
||||||
*/
|
|
||||||
key: string;
|
|
||||||
/**
|
|
||||||
* Label
|
|
||||||
*/
|
|
||||||
label: string;
|
|
||||||
/**
|
|
||||||
* Iconname
|
|
||||||
*/
|
|
||||||
iconName: string;
|
|
||||||
/**
|
|
||||||
* Device
|
|
||||||
*/
|
|
||||||
device: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClientDetailsSchema
|
* ClientDetailsSchema
|
||||||
*/
|
*/
|
||||||
@ -1277,13 +1191,13 @@ export type DeleteStatusResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GetAllBuiltInModulesResponse
|
* GetAllModulesResponse
|
||||||
*/
|
*/
|
||||||
export type GetAllBuiltInModulesResponse = {
|
export type GetAllModulesResponse = {
|
||||||
/**
|
/**
|
||||||
* Items
|
* Items
|
||||||
*/
|
*/
|
||||||
items: Array<BuiltInModuleSchemaOutput>;
|
items: Array<ModuleSchemaOutput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1550,6 +1464,92 @@ export type MarketplaceSchema = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ModuleSchema
|
||||||
|
*/
|
||||||
|
export type ModuleSchemaInput = {
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
id: number;
|
||||||
|
/**
|
||||||
|
* Key
|
||||||
|
*/
|
||||||
|
key: string;
|
||||||
|
/**
|
||||||
|
* Label
|
||||||
|
*/
|
||||||
|
label: string;
|
||||||
|
/**
|
||||||
|
* Description
|
||||||
|
*/
|
||||||
|
description: string;
|
||||||
|
/**
|
||||||
|
* Dependson
|
||||||
|
*/
|
||||||
|
dependsOn: Array<ModuleSchemaInput>;
|
||||||
|
/**
|
||||||
|
* Tabs
|
||||||
|
*/
|
||||||
|
tabs: Array<ModuleTabSchema>;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ModuleSchema
|
||||||
|
*/
|
||||||
|
export type ModuleSchemaOutput = {
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
id: number;
|
||||||
|
/**
|
||||||
|
* Key
|
||||||
|
*/
|
||||||
|
key: string;
|
||||||
|
/**
|
||||||
|
* Label
|
||||||
|
*/
|
||||||
|
label: string;
|
||||||
|
/**
|
||||||
|
* Description
|
||||||
|
*/
|
||||||
|
description: string;
|
||||||
|
/**
|
||||||
|
* Dependson
|
||||||
|
*/
|
||||||
|
dependsOn: Array<ModuleSchemaOutput>;
|
||||||
|
/**
|
||||||
|
* Tabs
|
||||||
|
*/
|
||||||
|
tabs: Array<ModuleTabSchema>;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ModuleTabSchema
|
||||||
|
*/
|
||||||
|
export type ModuleTabSchema = {
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
id: number;
|
||||||
|
/**
|
||||||
|
* Key
|
||||||
|
*/
|
||||||
|
key: string;
|
||||||
|
/**
|
||||||
|
* Label
|
||||||
|
*/
|
||||||
|
label: string;
|
||||||
|
/**
|
||||||
|
* Iconname
|
||||||
|
*/
|
||||||
|
iconName: string;
|
||||||
|
/**
|
||||||
|
* Device
|
||||||
|
*/
|
||||||
|
device: string;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PaginationInfoSchema
|
* PaginationInfoSchema
|
||||||
*/
|
*/
|
||||||
@ -1746,9 +1746,9 @@ export type ProjectSchema = {
|
|||||||
*/
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
/**
|
/**
|
||||||
* Builtinmodules
|
* Modules
|
||||||
*/
|
*/
|
||||||
builtInModules: Array<BuiltInModuleSchemaOutput>;
|
modules: Array<ModuleSchemaOutput>;
|
||||||
/**
|
/**
|
||||||
* Tags
|
* Tags
|
||||||
*/
|
*/
|
||||||
@ -2383,9 +2383,9 @@ export type UpdateProjectSchema = {
|
|||||||
*/
|
*/
|
||||||
name?: string | null;
|
name?: string | null;
|
||||||
/**
|
/**
|
||||||
* Builtinmodules
|
* Modules
|
||||||
*/
|
*/
|
||||||
builtInModules?: Array<BuiltInModuleSchemaInput>;
|
modules?: Array<ModuleSchemaInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3116,22 +3116,21 @@ export type GetDealTagColorsResponses = {
|
|||||||
export type GetDealTagColorsResponse =
|
export type GetDealTagColorsResponse =
|
||||||
GetDealTagColorsResponses[keyof GetDealTagColorsResponses];
|
GetDealTagColorsResponses[keyof GetDealTagColorsResponses];
|
||||||
|
|
||||||
export type GetBuiltInModulesData = {
|
export type GetModulesData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
path?: never;
|
path?: never;
|
||||||
query?: never;
|
query?: never;
|
||||||
url: "/crm/v1/module/built-in/";
|
url: "/crm/v1/module/built-in/";
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GetBuiltInModulesResponses = {
|
export type GetModulesResponses = {
|
||||||
/**
|
/**
|
||||||
* Successful Response
|
* Successful Response
|
||||||
*/
|
*/
|
||||||
200: GetAllBuiltInModulesResponse;
|
200: GetAllModulesResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GetBuiltInModulesResponse =
|
export type GetModulesResponse = GetModulesResponses[keyof GetModulesResponses];
|
||||||
GetBuiltInModulesResponses[keyof GetBuiltInModulesResponses];
|
|
||||||
|
|
||||||
export type GetClientsData = {
|
export type GetClientsData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
|||||||
@ -73,53 +73,6 @@ export const zBodyUploadProductImage = z.object({
|
|||||||
upload_file: z.any(),
|
upload_file: z.any(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* BuiltInModuleTabSchema
|
|
||||||
*/
|
|
||||||
export const zBuiltInModuleTabSchema = z.object({
|
|
||||||
id: z.int(),
|
|
||||||
key: z.string(),
|
|
||||||
label: z.string(),
|
|
||||||
iconName: z.string(),
|
|
||||||
device: z.string(),
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BuiltInModuleSchema
|
|
||||||
*/
|
|
||||||
export const zBuiltInModuleSchemaInput = z.object({
|
|
||||||
id: z.int(),
|
|
||||||
key: z.string(),
|
|
||||||
label: z.string(),
|
|
||||||
description: z.string(),
|
|
||||||
get dependsOn() {
|
|
||||||
return z.array(
|
|
||||||
z.lazy((): any => {
|
|
||||||
return zBuiltInModuleSchemaInput;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
},
|
|
||||||
tabs: z.array(zBuiltInModuleTabSchema),
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BuiltInModuleSchema
|
|
||||||
*/
|
|
||||||
export const zBuiltInModuleSchemaOutput = z.object({
|
|
||||||
id: z.int(),
|
|
||||||
key: z.string(),
|
|
||||||
label: z.string(),
|
|
||||||
description: z.string(),
|
|
||||||
get dependsOn() {
|
|
||||||
return z.array(
|
|
||||||
z.lazy((): any => {
|
|
||||||
return zBuiltInModuleSchemaOutput;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
},
|
|
||||||
tabs: z.array(zBuiltInModuleTabSchema),
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClientDetailsSchema
|
* ClientDetailsSchema
|
||||||
*/
|
*/
|
||||||
@ -608,13 +561,42 @@ export const zCreateProjectRequest = z.object({
|
|||||||
entity: zCreateProjectSchema,
|
entity: zCreateProjectSchema,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ModuleTabSchema
|
||||||
|
*/
|
||||||
|
export const zModuleTabSchema = z.object({
|
||||||
|
id: z.int(),
|
||||||
|
key: z.string(),
|
||||||
|
label: z.string(),
|
||||||
|
iconName: z.string(),
|
||||||
|
device: z.string(),
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ModuleSchema
|
||||||
|
*/
|
||||||
|
export const zModuleSchemaOutput = z.object({
|
||||||
|
id: z.int(),
|
||||||
|
key: z.string(),
|
||||||
|
label: z.string(),
|
||||||
|
description: z.string(),
|
||||||
|
get dependsOn() {
|
||||||
|
return z.array(
|
||||||
|
z.lazy((): any => {
|
||||||
|
return zModuleSchemaOutput;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
tabs: z.array(zModuleTabSchema),
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProjectSchema
|
* ProjectSchema
|
||||||
*/
|
*/
|
||||||
export const zProjectSchema = z.object({
|
export const zProjectSchema = z.object({
|
||||||
id: z.int(),
|
id: z.int(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
builtInModules: z.array(zBuiltInModuleSchemaOutput),
|
modules: z.array(zModuleSchemaOutput),
|
||||||
tags: z.array(zDealTagSchema),
|
tags: z.array(zDealTagSchema),
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -889,10 +871,10 @@ export const zDeleteStatusResponse = z.object({
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GetAllBuiltInModulesResponse
|
* GetAllModulesResponse
|
||||||
*/
|
*/
|
||||||
export const zGetAllBuiltInModulesResponse = z.object({
|
export const zGetAllModulesResponse = z.object({
|
||||||
items: z.array(zBuiltInModuleSchemaOutput),
|
items: z.array(zModuleSchemaOutput),
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1085,6 +1067,24 @@ export const zHttpValidationError = z.object({
|
|||||||
detail: z.optional(z.array(zValidationError)),
|
detail: z.optional(z.array(zValidationError)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ModuleSchema
|
||||||
|
*/
|
||||||
|
export const zModuleSchemaInput = z.object({
|
||||||
|
id: z.int(),
|
||||||
|
key: z.string(),
|
||||||
|
label: z.string(),
|
||||||
|
description: z.string(),
|
||||||
|
get dependsOn() {
|
||||||
|
return z.array(
|
||||||
|
z.lazy((): any => {
|
||||||
|
return zModuleSchemaInput;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
tabs: z.array(zModuleTabSchema),
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProductServicesDuplicateRequest
|
* ProductServicesDuplicateRequest
|
||||||
*/
|
*/
|
||||||
@ -1410,7 +1410,7 @@ export const zUpdateProductServiceResponse = z.object({
|
|||||||
*/
|
*/
|
||||||
export const zUpdateProjectSchema = z.object({
|
export const zUpdateProjectSchema = z.object({
|
||||||
name: z.optional(z.union([z.string(), z.null()])),
|
name: z.optional(z.union([z.string(), z.null()])),
|
||||||
builtInModules: z.optional(z.array(zBuiltInModuleSchemaInput)),
|
modules: z.optional(z.array(zModuleSchemaInput)),
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1758,7 +1758,7 @@ export const zGetDealTagColorsData = z.object({
|
|||||||
*/
|
*/
|
||||||
export const zGetDealTagColorsResponse = zGetTagColorsResponse;
|
export const zGetDealTagColorsResponse = zGetTagColorsResponse;
|
||||||
|
|
||||||
export const zGetBuiltInModulesData = z.object({
|
export const zGetModulesData = z.object({
|
||||||
body: z.optional(z.never()),
|
body: z.optional(z.never()),
|
||||||
path: z.optional(z.never()),
|
path: z.optional(z.never()),
|
||||||
query: z.optional(z.never()),
|
query: z.optional(z.never()),
|
||||||
@ -1767,7 +1767,7 @@ export const zGetBuiltInModulesData = z.object({
|
|||||||
/**
|
/**
|
||||||
* Successful Response
|
* Successful Response
|
||||||
*/
|
*/
|
||||||
export const zGetBuiltInModulesResponse = zGetAllBuiltInModulesResponse;
|
export const zGetModulesResponse = zGetAllModulesResponse;
|
||||||
|
|
||||||
export const zGetClientsData = z.object({
|
export const zGetClientsData = z.object({
|
||||||
body: z.optional(z.never()),
|
body: z.optional(z.never()),
|
||||||
|
|||||||
Reference in New Issue
Block a user