Skip to content

Commit

Permalink
Include custodianInfo and accessLevel in NATS message for Tempo update
Browse files Browse the repository at this point in the history
  • Loading branch information
qu8n authored and ao508 committed May 21, 2024
1 parent ca5ff71 commit 4e8ed70
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 43 deletions.
44 changes: 30 additions & 14 deletions frontend/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11409,6 +11409,16 @@ export type SampleMetadataPartsFragment = {
tumorOrNormal: string;
};

export type TempoPartsFragment = {
__typename?: "Tempo";
smileTempoId: string;
billed?: boolean | null;
billedBy?: string | null;
costCenter?: string | null;
custodianInformation: string;
accessLevel: string;
};

export type SamplesQueryVariables = Exact<{
where?: InputMaybe<SampleWhere>;
hasMetadataSampleMetadataWhere2?: InputMaybe<SampleMetadataWhere>;
Expand Down Expand Up @@ -11460,6 +11470,8 @@ export type SamplesQuery = {
billed?: boolean | null;
billedBy?: string | null;
costCenter?: string | null;
custodianInformation: string;
accessLevel: string;
}>;
}>;
};
Expand Down Expand Up @@ -11517,6 +11529,8 @@ export type UpdateSamplesMutation = {
billed?: boolean | null;
billedBy?: string | null;
costCenter?: string | null;
custodianInformation: string;
accessLevel: string;
}>;
}>;
};
Expand Down Expand Up @@ -11637,6 +11651,16 @@ export const SampleMetadataPartsFragmentDoc = gql`
tumorOrNormal
}
`;
export const TempoPartsFragmentDoc = gql`
fragment TempoParts on Tempo {
smileTempoId
billed
billedBy
costCenter
custodianInformation
accessLevel
}
`;
export const RequestsListDocument = gql`
query RequestsList(
$options: RequestOptions
Expand Down Expand Up @@ -11835,12 +11859,7 @@ export const FindSamplesByInputValueDocument = gql`
}
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
custodianInformation
accessLevel
...TempoParts
hasEventBamCompletes(options: $bamCompletesOptions) {
date
status
Expand All @@ -11864,6 +11883,7 @@ export const FindSamplesByInputValueDocument = gql`
${SamplePartsFragmentDoc}
${SampleMetadataPartsFragmentDoc}
${RequestPartsFragmentDoc}
${TempoPartsFragmentDoc}
`;

/**
Expand Down Expand Up @@ -11940,14 +11960,12 @@ export const SamplesDocument = gql`
...SampleMetadataParts
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
...TempoParts
}
}
}
${SampleMetadataPartsFragmentDoc}
${TempoPartsFragmentDoc}
`;

/**
Expand Down Expand Up @@ -12009,15 +12027,13 @@ export const UpdateSamplesDocument = gql`
...SampleMetadataParts
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
...TempoParts
}
}
}
}
${SampleMetadataPartsFragmentDoc}
${TempoPartsFragmentDoc}
`;
export type UpdateSamplesMutationFn = Apollo.MutationFunction<
UpdateSamplesMutation,
Expand Down
44 changes: 30 additions & 14 deletions graphql-server/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11408,6 +11408,16 @@ export type SampleMetadataPartsFragment = {
tumorOrNormal: string;
};

export type TempoPartsFragment = {
__typename?: "Tempo";
smileTempoId: string;
billed?: boolean | null;
billedBy?: string | null;
costCenter?: string | null;
custodianInformation: string;
accessLevel: string;
};

export type SamplesQueryVariables = Exact<{
where?: InputMaybe<SampleWhere>;
hasMetadataSampleMetadataWhere2?: InputMaybe<SampleMetadataWhere>;
Expand Down Expand Up @@ -11459,6 +11469,8 @@ export type SamplesQuery = {
billed?: boolean | null;
billedBy?: string | null;
costCenter?: string | null;
custodianInformation: string;
accessLevel: string;
}>;
}>;
};
Expand Down Expand Up @@ -11516,6 +11528,8 @@ export type UpdateSamplesMutation = {
billed?: boolean | null;
billedBy?: string | null;
costCenter?: string | null;
custodianInformation: string;
accessLevel: string;
}>;
}>;
};
Expand Down Expand Up @@ -11636,6 +11650,16 @@ export const SampleMetadataPartsFragmentDoc = gql`
tumorOrNormal
}
`;
export const TempoPartsFragmentDoc = gql`
fragment TempoParts on Tempo {
smileTempoId
billed
billedBy
costCenter
custodianInformation
accessLevel
}
`;
export const RequestsListDocument = gql`
query RequestsList(
$options: RequestOptions
Expand Down Expand Up @@ -11736,12 +11760,7 @@ export const FindSamplesByInputValueDocument = gql`
}
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
custodianInformation
accessLevel
...TempoParts
hasEventBamCompletes(options: $bamCompletesOptions) {
date
status
Expand All @@ -11765,6 +11784,7 @@ export const FindSamplesByInputValueDocument = gql`
${SamplePartsFragmentDoc}
${SampleMetadataPartsFragmentDoc}
${RequestPartsFragmentDoc}
${TempoPartsFragmentDoc}
`;
export type FindSamplesByInputValueQueryResult = Apollo.QueryResult<
FindSamplesByInputValueQuery,
Expand All @@ -11789,14 +11809,12 @@ export const SamplesDocument = gql`
...SampleMetadataParts
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
...TempoParts
}
}
}
${SampleMetadataPartsFragmentDoc}
${TempoPartsFragmentDoc}
`;
export type SamplesQueryResult = Apollo.QueryResult<
SamplesQuery,
Expand All @@ -11819,15 +11837,13 @@ export const UpdateSamplesDocument = gql`
...SampleMetadataParts
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
...TempoParts
}
}
}
}
${SampleMetadataPartsFragmentDoc}
${TempoPartsFragmentDoc}
`;
export type UpdateSamplesMutationFn = Apollo.MutationFunction<
UpdateSamplesMutation,
Expand Down
6 changes: 5 additions & 1 deletion graphql-server/src/schemas/neo4j.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,20 @@ async function publishNatsMessageForSampleBillingUpdates(
primaryId: string,
updatedSamples: ApolloQueryResult<UpdateSamplesMutationResponse>
) {
const { billed, billedBy, costCenter } =
const { billed, billedBy, costCenter, accessLevel, custodianInformation } =
updatedSamples.data.samples[0].hasTempoTempos[0];

const dataForTempoBillingUpdate = {
primaryId,
billed,
billedBy,
costCenter,
accessLevel,
custodianInformation,
};

console.log("dataForTempoBillingUpdate: ", dataForTempoBillingUpdate);

publishNatsMessage(
props.pub_tempo_sample_billing,
JSON.stringify(dataForTempoBillingUpdate)
Expand Down
26 changes: 12 additions & 14 deletions graphql/operations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,7 @@ query FindSamplesByInputValue(
}
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
custodianInformation
accessLevel
...TempoParts
hasEventBamCompletes(options: $bamCompletesOptions) {
date
status
Expand Down Expand Up @@ -172,6 +167,15 @@ fragment SampleMetadataParts on SampleMetadata {
tumorOrNormal
}

fragment TempoParts on Tempo {
smileTempoId
billed
billedBy
costCenter
custodianInformation
accessLevel
}

query Samples(
$where: SampleWhere
$hasMetadataSampleMetadataWhere2: SampleMetadataWhere
Expand All @@ -190,10 +194,7 @@ query Samples(
...SampleMetadataParts
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
...TempoParts
}
}
}
Expand All @@ -214,10 +215,7 @@ mutation UpdateSamples(
...SampleMetadataParts
}
hasTempoTempos {
smileTempoId
billed
billedBy
costCenter
...TempoParts
}
}
}
Expand Down

0 comments on commit 4e8ed70

Please sign in to comment.