* Deprecate pipelineprogress backref on person to improve naming * Remove deprecated point of contact fields * Add company and person entities on pipelineprogress * Migrate data from old progressable to new entity fields * Codegen frontend * Use company Id, deprecate progressableId * Get rid of deprecated progressableId field * Remove deprecated progressableType field from pipeline progress * Remove useless migrations
58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import { gql } from '@apollo/client';
|
|
|
|
import { SelectedSortType } from '@/ui/filter-n-sort/types/interface';
|
|
import {
|
|
PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By,
|
|
SortOrder as Order_By,
|
|
} from '~/generated/graphql';
|
|
|
|
export type PipelineProgressesSelectedSortType =
|
|
SelectedSortType<PipelineProgresses_Order_By>;
|
|
|
|
export const GET_PIPELINES = gql`
|
|
query GetPipelines($where: PipelineWhereInput) {
|
|
findManyPipeline(where: $where) {
|
|
id
|
|
name
|
|
pipelineProgressableType
|
|
pipelineStages {
|
|
id
|
|
name
|
|
color
|
|
index
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const GET_PIPELINE_PROGRESS = gql`
|
|
query GetPipelineProgress(
|
|
$where: PipelineProgressWhereInput
|
|
$orderBy: [PipelineProgressOrderByWithRelationInput!]
|
|
) {
|
|
findManyPipelineProgress(where: $where, orderBy: $orderBy) {
|
|
id
|
|
pipelineStageId
|
|
companyId
|
|
personId
|
|
amount
|
|
closeDate
|
|
pointOfContactId
|
|
pointOfContact {
|
|
id
|
|
firstName
|
|
lastName
|
|
displayName
|
|
avatarUrl
|
|
}
|
|
probability
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const defaultPipelineProgressOrderBy: PipelineProgresses_Order_By[] = [
|
|
{
|
|
createdAt: Order_By.Asc,
|
|
},
|
|
];
|