Refactor: Morph strategy on PipelineProgress (#1065)
* 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
This commit is contained in:
@ -1,17 +1,8 @@
|
||||
import {
|
||||
PipelineProgress,
|
||||
PipelineProgressableType,
|
||||
User,
|
||||
} from '../../generated/graphql';
|
||||
import { PipelineProgress, User } from '../../generated/graphql';
|
||||
|
||||
type MockedPipelineProgress = Pick<
|
||||
PipelineProgress,
|
||||
| 'id'
|
||||
| 'amount'
|
||||
| 'closeDate'
|
||||
| 'progressableId'
|
||||
| 'pipelineStageId'
|
||||
| 'progressableType'
|
||||
'id' | 'amount' | 'closeDate' | 'companyId' | 'pipelineStageId'
|
||||
> & {
|
||||
accountOwner: Pick<
|
||||
User,
|
||||
@ -38,27 +29,24 @@ export const mockedPipelineProgressData: Array<MockedPipelineProgress> = [
|
||||
id: '0ac8761c-1ad6-11ee-be56-0242ac120002',
|
||||
amount: 78,
|
||||
closeDate: '2021-10-01T00:00:00.000Z',
|
||||
progressableId: '0',
|
||||
companyId: '0',
|
||||
accountOwner: accountOwner,
|
||||
pipelineStageId: 'another-pipeline-stage-1',
|
||||
progressableType: PipelineProgressableType.Company,
|
||||
},
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe7-8998-b76aa0bfb600',
|
||||
progressableId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
companyId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
pipelineStageId: 'fe256b39-3ec3-4fe3-8998-b76aa0bfb600',
|
||||
amount: 7,
|
||||
closeDate: '2021-10-01T00:00:00.000Z',
|
||||
accountOwner,
|
||||
progressableType: PipelineProgressableType.Company,
|
||||
},
|
||||
{
|
||||
id: '4a886c90-f4f2-4984-8222-882ebbb905d6',
|
||||
progressableId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
companyId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
amount: 100,
|
||||
closeDate: '2021-10-01T00:00:00.000Z',
|
||||
accountOwner,
|
||||
pipelineStageId: 'fe256b39-3ec3-4fe3-8998-b76aa0bfb600',
|
||||
progressableType: PipelineProgressableType.Company,
|
||||
},
|
||||
];
|
||||
|
||||
@ -14,12 +14,7 @@ type MockedPipeline = Pick<
|
||||
pipelineProgresses: Array<
|
||||
Pick<
|
||||
PipelineProgress,
|
||||
| 'id'
|
||||
| 'progressableType'
|
||||
| 'progressableId'
|
||||
| 'amount'
|
||||
| 'closeDate'
|
||||
| '__typename'
|
||||
'id' | 'companyId' | 'amount' | 'closeDate' | '__typename'
|
||||
>
|
||||
>;
|
||||
}
|
||||
@ -40,16 +35,14 @@ export const mockedPipelinesData: Array<MockedPipeline> = [
|
||||
pipelineProgresses: [
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe7-8998-b76aa0bfb600',
|
||||
progressableType: PipelineProgressableType.Company,
|
||||
progressableId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
companyId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
amount: null,
|
||||
closeDate: null,
|
||||
__typename: 'PipelineProgress',
|
||||
},
|
||||
{
|
||||
id: '4a886c90-f4f2-4984-8222-882ebbb905d6',
|
||||
progressableType: PipelineProgressableType.Company,
|
||||
progressableId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
companyId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
amount: null,
|
||||
closeDate: null,
|
||||
__typename: 'PipelineProgress',
|
||||
|
||||
Reference in New Issue
Block a user