Skip to content

Commit

Permalink
Take a first stab at household join
Browse files Browse the repository at this point in the history
  • Loading branch information
martha committed Jan 13, 2025
1 parent f860bba commit 986a820
Show file tree
Hide file tree
Showing 24 changed files with 1,756 additions and 105 deletions.
237 changes: 237 additions & 0 deletions graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18273,6 +18273,26 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "project",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "projectType",
"description": null,
Expand Down Expand Up @@ -28017,6 +28037,178 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "JoinHouseholdsInput",
"description": "Autogenerated input type of JoinHouseholds",
"isOneOf": false,
"fields": null,
"inputFields": [
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "joiningEnrollmentInputs",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "JoiningEnrollmentInput",
"ofType": null
}
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "receivingHouseholdId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "JoinHouseholdsPayload",
"description": "Autogenerated return type of JoinHouseholds.",
"isOneOf": null,
"fields": [
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "errors",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "ValidationError",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "household",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Household",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "JoiningEnrollmentInput",
"description": null,
"isOneOf": false,
"fields": null,
"inputFields": [
{
"name": "enrollmentId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "relationshipToHoh",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "RelationshipToHoH",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "SCALAR",
"name": "JsonObject",
Expand Down Expand Up @@ -30465,6 +30657,35 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "joinHouseholds",
"description": null,
"args": [
{
"name": "input",
"description": "Parameters for JoinHouseholds",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "JoinHouseholdsInput",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "OBJECT",
"name": "JoinHouseholdsPayload",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "mergeClients",
"description": null,
Expand Down Expand Up @@ -36095,6 +36316,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canSplitHouseholds",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canViewDob",
"description": null,
Expand Down
1 change: 1 addition & 0 deletions src/api/operations/access.fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fragment ProjectAccessFields on ProjectAccess {
canManageIncomingReferrals
canManageOutgoingReferrals
canManageExternalFormSubmissions
canSplitHouseholds
}

fragment OrganizationAccessFields on OrganizationAccess {
Expand Down
25 changes: 25 additions & 0 deletions src/api/operations/client.queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,31 @@ query GetClientEnrollments(
}
}

query GetClientEnrollmentWithHousehold(
$id: ID!
$limit: Int = 1
$offset: Int = 0
$filters: EnrollmentsForClientFilterOptions
) {
client(id: $id) {
id
enrollments(
limit: $limit
offset: $offset
sortOrder: MOST_RECENT
filters: $filters
includeEnrollmentsWithLimitedAccess: true
) {
offset
limit
nodesCount
nodes {
...EnrollmentWithHouseholdFields
}
}
}
}

query GetClientServices(
$id: ID!
$limit: Int = 10
Expand Down
7 changes: 7 additions & 0 deletions src/api/operations/enrollment.fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,10 @@ fragment EnrollmentRangeFields on Enrollment {
exitDate
inProgress
}

fragment EnrollmentWithHouseholdFields on Enrollment {
...EnrollmentFields
household {
...HouseholdFields
}
}
9 changes: 1 addition & 8 deletions src/api/operations/enrollment.queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ query GetEnrollmentDetails($id: ID!) {

query GetEnrollmentWithHousehold($id: ID!) {
enrollment(id: $id) {
...EnrollmentFields
household {
id
shortId
householdClients {
...HouseholdClientFields
}
}
...EnrollmentWithHouseholdFields
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/api/operations/household.operations.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mutation JoinHouseholds($input: JoinHouseholdsInput!) {
joinHouseholds(input: $input) {
household {
...HouseholdFields
}
}
}
4 changes: 2 additions & 2 deletions src/components/elements/CommonDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { useCallback } from 'react';

import SentryErrorBoundary from '@/modules/errors/components/SentryErrorBoundary';

interface Props extends DialogProps {
export interface CommonDialogProps extends DialogProps {
enableBackdropClick?: boolean;
}

const CommonDialog: React.FC<Props> = ({
const CommonDialog: React.FC<CommonDialogProps> = ({
children,
onClose,
enableBackdropClick = false,
Expand Down
25 changes: 25 additions & 0 deletions src/components/elements/StepDialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Meta, StoryObj } from '@storybook/react';
import StepDialog from './StepDialog';

export default {
component: StepDialog,
} as Meta<typeof StepDialog>;

type Story = StoryObj<typeof StepDialog>;

export const Default: Story = {
args: {
open: true,
title: 'Stepper Dialog Demo',
tabDefinitions: [
{
title: 'One',
content: 'hello first tab',
},
{
title: 'Two',
content: 'this is the second tab',
},
],
},
};
Loading

0 comments on commit 986a820

Please sign in to comment.