refactor: moved ProjectEditorDrawer into common drawers directory
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
import ProjectEditorDrawer from "@/app/deals/drawers/ProjectEditorDrawer/ProjectEditorDrawer";
|
||||
|
||||
export default ProjectEditorDrawer;
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
import React, { FC, useState } from "react";
|
||||
import { Drawer } from "@mantine/core";
|
||||
import ProjectEditorBody from "@/app/deals/drawers/ProjectEditorDrawer/components/ProjectEditorBody";
|
||||
import { DrawerProps } from "@/drawers/types";
|
||||
import useIsMobile from "@/hooks/utils/useIsMobile";
|
||||
import { ProjectSchema } from "@/lib/client";
|
||||
import ProjectEditorBody from "@/drawers/common/ProjectEditorDrawer/components/ProjectEditorBody";
|
||||
|
||||
type Props = {
|
||||
value: ProjectSchema;
|
||||
@ -1,12 +1,9 @@
|
||||
import { FC } from "react";
|
||||
import { IconBlocks, IconEdit } from "@tabler/icons-react";
|
||||
import { Tabs } from "@mantine/core";
|
||||
import {
|
||||
GeneralTab,
|
||||
ModulesTab,
|
||||
} from "@/app/deals/drawers/ProjectEditorDrawer/tabs";
|
||||
import { ProjectSchema } from "@/lib/client";
|
||||
import styles from "../ProjectEditorDrawer.module.css";
|
||||
import { GeneralTab, ModulesTab } from "@/drawers/common/ProjectEditorDrawer/tabs";
|
||||
|
||||
type Props = {
|
||||
value: ProjectSchema;
|
||||
3
src/drawers/common/ProjectEditorDrawer/index.ts
Normal file
3
src/drawers/common/ProjectEditorDrawer/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import ProjectEditorDrawer from "./ProjectEditorDrawer";
|
||||
|
||||
export default ProjectEditorDrawer;
|
||||
@ -1,8 +1,8 @@
|
||||
import { FC } from "react";
|
||||
import { Stack, TextInput } from "@mantine/core";
|
||||
import { useForm } from "@mantine/form";
|
||||
import Footer from "@/app/deals/drawers/ProjectEditorDrawer/tabs/GeneralTab/components/Footer";
|
||||
import { ProjectSchema } from "@/lib/client";
|
||||
import Footer from "./components/Footer";
|
||||
|
||||
type Props = {
|
||||
value: ProjectSchema;
|
||||
@ -1,7 +1,7 @@
|
||||
import { FC } from "react";
|
||||
import { Button, Stack } from "@mantine/core";
|
||||
import { useForm } from "@mantine/form";
|
||||
import resolveDependencies from "@/app/deals/drawers/ProjectEditorDrawer/tabs/ModulesTab/utils/resolveDependencies";
|
||||
import resolveDependencies from "@/drawers/common/ProjectEditorDrawer/tabs/ModulesTab/utils/resolveDependencies";
|
||||
import { ProjectSchema } from "@/lib/client";
|
||||
import ModulesTable from "./components/ModulesTable";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { FC } from "react";
|
||||
import { Divider, Stack } from "@mantine/core";
|
||||
import useModulesTableColumns from "@/app/deals/drawers/ProjectEditorDrawer/tabs/ModulesTab/hooks/useModulesTableColumns";
|
||||
import BaseTable from "@/components/ui/BaseTable/BaseTable";
|
||||
import useModulesTableColumns from "@/drawers/common/ProjectEditorDrawer/tabs/ModulesTab/hooks/useModulesTableColumns";
|
||||
import useBuiltInModulesList from "@/hooks/lists/useBuiltInModulesList";
|
||||
import { BuiltInModuleSchemaOutput } from "@/lib/client";
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import ClientMarketplaceDrawer from "@/app/clients/drawers/ClientMarketplacesDrawer";
|
||||
import BoardsMobileEditorDrawer from "@/app/deals/drawers/BoardsMobileEditorDrawer";
|
||||
import DealEditorDrawer from "@/app/deals/drawers/DealEditorDrawer";
|
||||
import ProjectEditorDrawer from "@/app/deals/drawers/ProjectEditorDrawer";
|
||||
import ProjectsMobileEditorDrawer from "@/app/deals/drawers/ProjectsMobileEditorDrawer";
|
||||
import StatusesMobileEditorDrawer from "../app/deals/drawers/StatusesMobileEditorDrawer";
|
||||
import ProjectEditorDrawer from "./common/ProjectEditorDrawer";
|
||||
|
||||
const drawerRegistry = {
|
||||
projectsMobileEditorDrawer: ProjectsMobileEditorDrawer,
|
||||
|
||||
@ -26,6 +26,7 @@ import {
|
||||
createServiceCategory,
|
||||
createServicesKit,
|
||||
createStatus,
|
||||
createTag,
|
||||
deleteBarcodeTemplate,
|
||||
deleteBoard,
|
||||
deleteClient,
|
||||
@ -41,6 +42,7 @@ import {
|
||||
deleteServiceCategory,
|
||||
deleteServicesKit,
|
||||
deleteStatus,
|
||||
deleteTag,
|
||||
duplicateProductServices,
|
||||
getBarcodeTemplateAttributes,
|
||||
getBarcodeTemplates,
|
||||
@ -52,6 +54,7 @@ import {
|
||||
getDealProducts,
|
||||
getDeals,
|
||||
getDealServices,
|
||||
getDealTagColors,
|
||||
getMarketplaces,
|
||||
getProductBarcodePdf,
|
||||
getProducts,
|
||||
@ -61,6 +64,7 @@ import {
|
||||
getServicesKits,
|
||||
getStatuses,
|
||||
getStatusHistory,
|
||||
switchDealTag,
|
||||
updateBarcodeTemplate,
|
||||
updateBoard,
|
||||
updateClient,
|
||||
@ -77,6 +81,7 @@ import {
|
||||
updateServiceCategory,
|
||||
updateServicesKit,
|
||||
updateStatus,
|
||||
updateTag,
|
||||
type Options,
|
||||
} from "../sdk.gen";
|
||||
import type {
|
||||
@ -131,6 +136,9 @@ import type {
|
||||
CreateStatusData,
|
||||
CreateStatusError,
|
||||
CreateStatusResponse2,
|
||||
CreateTagData,
|
||||
CreateTagError,
|
||||
CreateTagResponse,
|
||||
DeleteBarcodeTemplateData,
|
||||
DeleteBarcodeTemplateError,
|
||||
DeleteBarcodeTemplateResponse2,
|
||||
@ -176,6 +184,9 @@ import type {
|
||||
DeleteStatusData,
|
||||
DeleteStatusError,
|
||||
DeleteStatusResponse2,
|
||||
DeleteTagData,
|
||||
DeleteTagError,
|
||||
DeleteTagResponse,
|
||||
DuplicateProductServicesData,
|
||||
DuplicateProductServicesError,
|
||||
DuplicateProductServicesResponse,
|
||||
@ -191,6 +202,7 @@ import type {
|
||||
GetDealsError,
|
||||
GetDealServicesData,
|
||||
GetDealsResponse2,
|
||||
GetDealTagColorsData,
|
||||
GetMarketplacesData,
|
||||
GetProductBarcodePdfData,
|
||||
GetProductBarcodePdfError,
|
||||
@ -204,6 +216,9 @@ import type {
|
||||
GetServicesKitsData,
|
||||
GetStatusesData,
|
||||
GetStatusHistoryData,
|
||||
SwitchDealTagData,
|
||||
SwitchDealTagError,
|
||||
SwitchDealTagResponse2,
|
||||
UpdateBarcodeTemplateData,
|
||||
UpdateBarcodeTemplateError,
|
||||
UpdateBarcodeTemplateResponse2,
|
||||
@ -252,6 +267,9 @@ import type {
|
||||
UpdateStatusData,
|
||||
UpdateStatusError,
|
||||
UpdateStatusResponse2,
|
||||
UpdateTagData,
|
||||
UpdateTagError,
|
||||
UpdateTagResponse,
|
||||
} from "../types.gen";
|
||||
|
||||
export type QueryKey<TOptions extends Options> = [
|
||||
@ -777,6 +795,180 @@ export const updateDealsInGroupMutation = (
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Tag
|
||||
*/
|
||||
export const updateTagMutation = (
|
||||
options?: Partial<Options<UpdateTagData>>
|
||||
): UseMutationOptions<
|
||||
UpdateTagResponse,
|
||||
AxiosError<UpdateTagError>,
|
||||
Options<UpdateTagData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
UpdateTagResponse,
|
||||
AxiosError<UpdateTagError>,
|
||||
Options<UpdateTagData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await updateTag({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const createTagQueryKey = (options: Options<CreateTagData>) =>
|
||||
createQueryKey("createTag", options);
|
||||
|
||||
/**
|
||||
* Create Tag
|
||||
*/
|
||||
export const createTagOptions = (options: Options<CreateTagData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await createTag({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: createTagQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Tag
|
||||
*/
|
||||
export const createTagMutation = (
|
||||
options?: Partial<Options<CreateTagData>>
|
||||
): UseMutationOptions<
|
||||
CreateTagResponse,
|
||||
AxiosError<CreateTagError>,
|
||||
Options<CreateTagData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
CreateTagResponse,
|
||||
AxiosError<CreateTagError>,
|
||||
Options<CreateTagData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await createTag({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete Tag
|
||||
*/
|
||||
export const deleteTagMutation = (
|
||||
options?: Partial<Options<DeleteTagData>>
|
||||
): UseMutationOptions<
|
||||
DeleteTagResponse,
|
||||
AxiosError<DeleteTagError>,
|
||||
Options<DeleteTagData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
DeleteTagResponse,
|
||||
AxiosError<DeleteTagError>,
|
||||
Options<DeleteTagData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await deleteTag({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const switchDealTagQueryKey = (options: Options<SwitchDealTagData>) =>
|
||||
createQueryKey("switchDealTag", options);
|
||||
|
||||
/**
|
||||
* Switch Deal Tag
|
||||
*/
|
||||
export const switchDealTagOptions = (options: Options<SwitchDealTagData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await switchDealTag({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: switchDealTagQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Switch Deal Tag
|
||||
*/
|
||||
export const switchDealTagMutation = (
|
||||
options?: Partial<Options<SwitchDealTagData>>
|
||||
): UseMutationOptions<
|
||||
SwitchDealTagResponse2,
|
||||
AxiosError<SwitchDealTagError>,
|
||||
Options<SwitchDealTagData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
SwitchDealTagResponse2,
|
||||
AxiosError<SwitchDealTagError>,
|
||||
Options<SwitchDealTagData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await switchDealTag({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getDealTagColorsQueryKey = (
|
||||
options?: Options<GetDealTagColorsData>
|
||||
) => createQueryKey("getDealTagColors", options);
|
||||
|
||||
/**
|
||||
* Get Deal Tag Colors
|
||||
*/
|
||||
export const getDealTagColorsOptions = (
|
||||
options?: Options<GetDealTagColorsData>
|
||||
) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getDealTagColors({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getDealTagColorsQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const getBuiltInModulesQueryKey = (
|
||||
options?: Options<GetBuiltInModulesData>
|
||||
) => createQueryKey("getBuiltInModules", options);
|
||||
|
||||
@ -54,6 +54,9 @@ import type {
|
||||
CreateStatusData,
|
||||
CreateStatusErrors,
|
||||
CreateStatusResponses,
|
||||
CreateTagData,
|
||||
CreateTagErrors,
|
||||
CreateTagResponses,
|
||||
DeleteBarcodeTemplateData,
|
||||
DeleteBarcodeTemplateErrors,
|
||||
DeleteBarcodeTemplateResponses,
|
||||
@ -99,6 +102,9 @@ import type {
|
||||
DeleteStatusData,
|
||||
DeleteStatusErrors,
|
||||
DeleteStatusResponses,
|
||||
DeleteTagData,
|
||||
DeleteTagErrors,
|
||||
DeleteTagResponses,
|
||||
DuplicateProductServicesData,
|
||||
DuplicateProductServicesErrors,
|
||||
DuplicateProductServicesResponses,
|
||||
@ -127,6 +133,8 @@ import type {
|
||||
GetDealServicesErrors,
|
||||
GetDealServicesResponses,
|
||||
GetDealsResponses,
|
||||
GetDealTagColorsData,
|
||||
GetDealTagColorsResponses,
|
||||
GetMarketplacesData,
|
||||
GetMarketplacesErrors,
|
||||
GetMarketplacesResponses,
|
||||
@ -150,6 +158,9 @@ import type {
|
||||
GetStatusHistoryData,
|
||||
GetStatusHistoryErrors,
|
||||
GetStatusHistoryResponses,
|
||||
SwitchDealTagData,
|
||||
SwitchDealTagErrors,
|
||||
SwitchDealTagResponses,
|
||||
UpdateBarcodeTemplateData,
|
||||
UpdateBarcodeTemplateErrors,
|
||||
UpdateBarcodeTemplateResponses,
|
||||
@ -198,6 +209,9 @@ import type {
|
||||
UpdateStatusData,
|
||||
UpdateStatusErrors,
|
||||
UpdateStatusResponses,
|
||||
UpdateTagData,
|
||||
UpdateTagErrors,
|
||||
UpdateTagResponses,
|
||||
} from "./types.gen";
|
||||
import {
|
||||
zAddKitToDealData,
|
||||
@ -234,6 +248,8 @@ import {
|
||||
zCreateServicesKitResponse2,
|
||||
zCreateStatusData,
|
||||
zCreateStatusResponse2,
|
||||
zCreateTagData,
|
||||
zCreateTagResponse,
|
||||
zDeleteBarcodeTemplateData,
|
||||
zDeleteBarcodeTemplateResponse2,
|
||||
zDeleteBoardData,
|
||||
@ -264,6 +280,8 @@ import {
|
||||
zDeleteServicesKitResponse2,
|
||||
zDeleteStatusData,
|
||||
zDeleteStatusResponse2,
|
||||
zDeleteTagData,
|
||||
zDeleteTagResponse,
|
||||
zDuplicateProductServicesData,
|
||||
zDuplicateProductServicesResponse,
|
||||
zGetBarcodeTemplateAttributesData,
|
||||
@ -286,6 +304,8 @@ import {
|
||||
zGetDealServicesData,
|
||||
zGetDealServicesResponse2,
|
||||
zGetDealsResponse2,
|
||||
zGetDealTagColorsData,
|
||||
zGetDealTagColorsResponse,
|
||||
zGetMarketplacesData,
|
||||
zGetMarketplacesResponse2,
|
||||
zGetProductBarcodePdfData,
|
||||
@ -304,6 +324,8 @@ import {
|
||||
zGetStatusesResponse2,
|
||||
zGetStatusHistoryData,
|
||||
zGetStatusHistoryResponse2,
|
||||
zSwitchDealTagData,
|
||||
zSwitchDealTagResponse2,
|
||||
zUpdateBarcodeTemplateData,
|
||||
zUpdateBarcodeTemplateResponse2,
|
||||
zUpdateBoardData,
|
||||
@ -336,6 +358,8 @@ import {
|
||||
zUpdateServicesKitResponse2,
|
||||
zUpdateStatusData,
|
||||
zUpdateStatusResponse2,
|
||||
zUpdateTagData,
|
||||
zUpdateTagResponse,
|
||||
} from "./zod.gen";
|
||||
|
||||
export type Options<
|
||||
@ -659,6 +683,133 @@ export const updateDealsInGroup = <ThrowOnError extends boolean = false>(
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Tag
|
||||
*/
|
||||
export const updateTag = <ThrowOnError extends boolean = false>(
|
||||
options: Options<UpdateTagData, ThrowOnError>
|
||||
) => {
|
||||
return (options.client ?? _heyApiClient).patch<
|
||||
UpdateTagResponses,
|
||||
UpdateTagErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
requestValidator: async data => {
|
||||
return await zUpdateTagData.parseAsync(data);
|
||||
},
|
||||
responseType: "json",
|
||||
responseValidator: async data => {
|
||||
return await zUpdateTagResponse.parseAsync(data);
|
||||
},
|
||||
url: "/crm/v1/deal-tag/",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Tag
|
||||
*/
|
||||
export const createTag = <ThrowOnError extends boolean = false>(
|
||||
options: Options<CreateTagData, ThrowOnError>
|
||||
) => {
|
||||
return (options.client ?? _heyApiClient).post<
|
||||
CreateTagResponses,
|
||||
CreateTagErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
requestValidator: async data => {
|
||||
return await zCreateTagData.parseAsync(data);
|
||||
},
|
||||
responseType: "json",
|
||||
responseValidator: async data => {
|
||||
return await zCreateTagResponse.parseAsync(data);
|
||||
},
|
||||
url: "/crm/v1/deal-tag/",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete Tag
|
||||
*/
|
||||
export const deleteTag = <ThrowOnError extends boolean = false>(
|
||||
options: Options<DeleteTagData, ThrowOnError>
|
||||
) => {
|
||||
return (options.client ?? _heyApiClient).delete<
|
||||
DeleteTagResponses,
|
||||
DeleteTagErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
requestValidator: async data => {
|
||||
return await zDeleteTagData.parseAsync(data);
|
||||
},
|
||||
responseType: "json",
|
||||
responseValidator: async data => {
|
||||
return await zDeleteTagResponse.parseAsync(data);
|
||||
},
|
||||
url: "/crm/v1/deal-tag/{deal_tag_id}",
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Switch Deal Tag
|
||||
*/
|
||||
export const switchDealTag = <ThrowOnError extends boolean = false>(
|
||||
options: Options<SwitchDealTagData, ThrowOnError>
|
||||
) => {
|
||||
return (options.client ?? _heyApiClient).post<
|
||||
SwitchDealTagResponses,
|
||||
SwitchDealTagErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
requestValidator: async data => {
|
||||
return await zSwitchDealTagData.parseAsync(data);
|
||||
},
|
||||
responseType: "json",
|
||||
responseValidator: async data => {
|
||||
return await zSwitchDealTagResponse2.parseAsync(data);
|
||||
},
|
||||
url: "/crm/v1/deal-tag/switch",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Get Deal Tag Colors
|
||||
*/
|
||||
export const getDealTagColors = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<GetDealTagColorsData, ThrowOnError>
|
||||
) => {
|
||||
return (options?.client ?? _heyApiClient).get<
|
||||
GetDealTagColorsResponses,
|
||||
unknown,
|
||||
ThrowOnError
|
||||
>({
|
||||
requestValidator: async data => {
|
||||
return await zGetDealTagColorsData.parseAsync(data);
|
||||
},
|
||||
responseType: "json",
|
||||
responseValidator: async data => {
|
||||
return await zGetDealTagColorsResponse.parseAsync(data);
|
||||
},
|
||||
url: "/crm/v1/deal-tag/colors",
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Get Built In Modules
|
||||
*/
|
||||
|
||||
@ -492,6 +492,42 @@ export type CreateDealServiceSchema = {
|
||||
price: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* CreateDealTagRequest
|
||||
*/
|
||||
export type CreateDealTagRequest = {
|
||||
entity: CreateDealTagSchema;
|
||||
};
|
||||
|
||||
/**
|
||||
* CreateDealTagResponse
|
||||
*/
|
||||
export type CreateDealTagResponse = {
|
||||
/**
|
||||
* Message
|
||||
*/
|
||||
message: string;
|
||||
entity: DealTagSchema;
|
||||
};
|
||||
|
||||
/**
|
||||
* CreateDealTagSchema
|
||||
*/
|
||||
export type CreateDealTagSchema = {
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Projectid
|
||||
*/
|
||||
projectId: number;
|
||||
/**
|
||||
* Tagcolorid
|
||||
*/
|
||||
tagColorId: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* CreateMarketplaceRequest
|
||||
*/
|
||||
@ -987,6 +1023,51 @@ export type DealServiceSchema = {
|
||||
isFixedPrice: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* DealTagColorSchema
|
||||
*/
|
||||
export type DealTagColorSchema = {
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* Color
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Backgroundcolor
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* Label
|
||||
*/
|
||||
label: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* DealTagSchema
|
||||
*/
|
||||
export type DealTagSchema = {
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Projectid
|
||||
*/
|
||||
projectId: number;
|
||||
/**
|
||||
* Tagcolorid
|
||||
*/
|
||||
tagColorId: number;
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id: number;
|
||||
tagColor: DealTagColorSchema;
|
||||
};
|
||||
|
||||
/**
|
||||
* DeleteBarcodeTemplateResponse
|
||||
*/
|
||||
@ -1057,6 +1138,16 @@ export type DeleteDealServiceResponse = {
|
||||
message: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* DeleteDealTagResponse
|
||||
*/
|
||||
export type DeleteDealTagResponse = {
|
||||
/**
|
||||
* Message
|
||||
*/
|
||||
message: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* DeleteMarketplaceResponse
|
||||
*/
|
||||
@ -1355,6 +1446,16 @@ export type GetStatusesResponse = {
|
||||
items: Array<StatusSchema>;
|
||||
};
|
||||
|
||||
/**
|
||||
* GetTagColorsResponse
|
||||
*/
|
||||
export type GetTagColorsResponse = {
|
||||
/**
|
||||
* Items
|
||||
*/
|
||||
items: Array<DealTagColorSchema>;
|
||||
};
|
||||
|
||||
/**
|
||||
* HTTPValidationError
|
||||
*/
|
||||
@ -1700,6 +1801,34 @@ export type StatusSchema = {
|
||||
color: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* SwitchDealTagRequest
|
||||
*/
|
||||
export type SwitchDealTagRequest = {
|
||||
/**
|
||||
* Tagid
|
||||
*/
|
||||
tagId: number;
|
||||
/**
|
||||
* Dealid
|
||||
*/
|
||||
dealId?: number | null;
|
||||
/**
|
||||
* Groupid
|
||||
*/
|
||||
groupId?: number | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* SwitchDealTagResponse
|
||||
*/
|
||||
export type SwitchDealTagResponse = {
|
||||
/**
|
||||
* Message
|
||||
*/
|
||||
message: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* UpdateBarcodeTemplateRequest
|
||||
*/
|
||||
@ -1944,6 +2073,34 @@ export type UpdateDealServiceSchema = {
|
||||
isFixedPrice: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* UpdateDealTagRequest
|
||||
*/
|
||||
export type UpdateDealTagRequest = {
|
||||
entity: UpdateDealTagSchema;
|
||||
};
|
||||
|
||||
/**
|
||||
* UpdateDealTagResponse
|
||||
*/
|
||||
export type UpdateDealTagResponse = {
|
||||
/**
|
||||
* Message
|
||||
*/
|
||||
message: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* UpdateDealTagSchema
|
||||
*/
|
||||
export type UpdateDealTagSchema = {
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name?: string | null;
|
||||
tagColor?: DealTagColorSchema | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* UpdateDealsInGroupRequest
|
||||
*/
|
||||
@ -2694,6 +2851,129 @@ export type UpdateDealsInGroupResponses = {
|
||||
export type UpdateDealsInGroupResponse2 =
|
||||
UpdateDealsInGroupResponses[keyof UpdateDealsInGroupResponses];
|
||||
|
||||
export type UpdateTagData = {
|
||||
body: UpdateDealTagRequest;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: "/crm/v1/deal-tag/";
|
||||
};
|
||||
|
||||
export type UpdateTagErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type UpdateTagError = UpdateTagErrors[keyof UpdateTagErrors];
|
||||
|
||||
export type UpdateTagResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: UpdateDealTagResponse;
|
||||
};
|
||||
|
||||
export type UpdateTagResponse = UpdateTagResponses[keyof UpdateTagResponses];
|
||||
|
||||
export type CreateTagData = {
|
||||
body: CreateDealTagRequest;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: "/crm/v1/deal-tag/";
|
||||
};
|
||||
|
||||
export type CreateTagErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type CreateTagError = CreateTagErrors[keyof CreateTagErrors];
|
||||
|
||||
export type CreateTagResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: CreateDealTagResponse;
|
||||
};
|
||||
|
||||
export type CreateTagResponse = CreateTagResponses[keyof CreateTagResponses];
|
||||
|
||||
export type DeleteTagData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Deal Tag Id
|
||||
*/
|
||||
deal_tag_id: number;
|
||||
};
|
||||
query?: never;
|
||||
url: "/crm/v1/deal-tag/{deal_tag_id}";
|
||||
};
|
||||
|
||||
export type DeleteTagErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type DeleteTagError = DeleteTagErrors[keyof DeleteTagErrors];
|
||||
|
||||
export type DeleteTagResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: DeleteDealTagResponse;
|
||||
};
|
||||
|
||||
export type DeleteTagResponse = DeleteTagResponses[keyof DeleteTagResponses];
|
||||
|
||||
export type SwitchDealTagData = {
|
||||
body: SwitchDealTagRequest;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: "/crm/v1/deal-tag/switch";
|
||||
};
|
||||
|
||||
export type SwitchDealTagErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type SwitchDealTagError = SwitchDealTagErrors[keyof SwitchDealTagErrors];
|
||||
|
||||
export type SwitchDealTagResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: SwitchDealTagResponse;
|
||||
};
|
||||
|
||||
export type SwitchDealTagResponse2 =
|
||||
SwitchDealTagResponses[keyof SwitchDealTagResponses];
|
||||
|
||||
export type GetDealTagColorsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: "/crm/v1/deal-tag/colors";
|
||||
};
|
||||
|
||||
export type GetDealTagColorsResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: GetTagColorsResponse;
|
||||
};
|
||||
|
||||
export type GetDealTagColorsResponse =
|
||||
GetDealTagColorsResponses[keyof GetDealTagColorsResponses];
|
||||
|
||||
export type GetBuiltInModulesData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
|
||||
@ -411,6 +411,51 @@ export const zCreateDealServiceResponse = z.object({
|
||||
entity: zDealServiceSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* CreateDealTagSchema
|
||||
*/
|
||||
export const zCreateDealTagSchema = z.object({
|
||||
name: z.string(),
|
||||
projectId: z.int(),
|
||||
tagColorId: z.int(),
|
||||
});
|
||||
|
||||
/**
|
||||
* CreateDealTagRequest
|
||||
*/
|
||||
export const zCreateDealTagRequest = z.object({
|
||||
entity: zCreateDealTagSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* DealTagColorSchema
|
||||
*/
|
||||
export const zDealTagColorSchema = z.object({
|
||||
id: z.int(),
|
||||
color: z.string(),
|
||||
backgroundColor: z.string(),
|
||||
label: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* DealTagSchema
|
||||
*/
|
||||
export const zDealTagSchema = z.object({
|
||||
name: z.string(),
|
||||
projectId: z.int(),
|
||||
tagColorId: z.int(),
|
||||
id: z.int(),
|
||||
tagColor: zDealTagColorSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* CreateDealTagResponse
|
||||
*/
|
||||
export const zCreateDealTagResponse = z.object({
|
||||
message: z.string(),
|
||||
entity: zDealTagSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* CreateMarketplaceSchema
|
||||
*/
|
||||
@ -728,6 +773,13 @@ export const zDeleteDealServiceResponse = z.object({
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* DeleteDealTagResponse
|
||||
*/
|
||||
export const zDeleteDealTagResponse = z.object({
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* DeleteMarketplaceResponse
|
||||
*/
|
||||
@ -951,6 +1003,13 @@ export const zGetStatusesResponse = z.object({
|
||||
items: z.array(zStatusSchema),
|
||||
});
|
||||
|
||||
/**
|
||||
* GetTagColorsResponse
|
||||
*/
|
||||
export const zGetTagColorsResponse = z.object({
|
||||
items: z.array(zDealTagColorSchema),
|
||||
});
|
||||
|
||||
/**
|
||||
* ValidationError
|
||||
*/
|
||||
@ -994,6 +1053,22 @@ export const zProductServicesDuplicateResponse = z.object({
|
||||
|
||||
export const zSortDir = z.enum(["asc", "desc"]);
|
||||
|
||||
/**
|
||||
* SwitchDealTagRequest
|
||||
*/
|
||||
export const zSwitchDealTagRequest = z.object({
|
||||
tagId: z.int(),
|
||||
dealId: z.optional(z.union([z.int(), z.null()])),
|
||||
groupId: z.optional(z.union([z.int(), z.null()])),
|
||||
});
|
||||
|
||||
/**
|
||||
* SwitchDealTagResponse
|
||||
*/
|
||||
export const zSwitchDealTagResponse = z.object({
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* UpdateBarcodeTemplateSchema
|
||||
*/
|
||||
@ -1159,6 +1234,28 @@ export const zUpdateDealServiceResponse = z.object({
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* UpdateDealTagSchema
|
||||
*/
|
||||
export const zUpdateDealTagSchema = z.object({
|
||||
name: z.optional(z.union([z.string(), z.null()])),
|
||||
tagColor: z.optional(z.union([zDealTagColorSchema, z.null()])),
|
||||
});
|
||||
|
||||
/**
|
||||
* UpdateDealTagRequest
|
||||
*/
|
||||
export const zUpdateDealTagRequest = z.object({
|
||||
entity: zUpdateDealTagSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* UpdateDealTagResponse
|
||||
*/
|
||||
export const zUpdateDealTagResponse = z.object({
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* UpdateDealsInGroupRequest
|
||||
*/
|
||||
@ -1531,6 +1628,63 @@ export const zUpdateDealsInGroupData = z.object({
|
||||
*/
|
||||
export const zUpdateDealsInGroupResponse2 = zUpdateDealsInGroupResponse;
|
||||
|
||||
export const zUpdateTagData = z.object({
|
||||
body: zUpdateDealTagRequest,
|
||||
path: z.optional(z.never()),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zUpdateTagResponse = zUpdateDealTagResponse;
|
||||
|
||||
export const zCreateTagData = z.object({
|
||||
body: zCreateDealTagRequest,
|
||||
path: z.optional(z.never()),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zCreateTagResponse = zCreateDealTagResponse;
|
||||
|
||||
export const zDeleteTagData = z.object({
|
||||
body: z.optional(z.never()),
|
||||
path: z.object({
|
||||
deal_tag_id: z.int(),
|
||||
}),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zDeleteTagResponse = zDeleteDealTagResponse;
|
||||
|
||||
export const zSwitchDealTagData = z.object({
|
||||
body: zSwitchDealTagRequest,
|
||||
path: z.optional(z.never()),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zSwitchDealTagResponse2 = zSwitchDealTagResponse;
|
||||
|
||||
export const zGetDealTagColorsData = z.object({
|
||||
body: z.optional(z.never()),
|
||||
path: z.optional(z.never()),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zGetDealTagColorsResponse = zGetTagColorsResponse;
|
||||
|
||||
export const zGetBuiltInModulesData = z.object({
|
||||
body: z.optional(z.never()),
|
||||
path: z.optional(z.never()),
|
||||
|
||||
Reference in New Issue
Block a user