Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MPDX-7812] Add coaching activity component #825

Merged
merged 9 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ extend type Query {
dateRange: String
): AccountListAnalytics!
}

type AccountListAnalytics {
id: ID!
type: String!
createdAt: ISO8601DateTime!
appointments: AppointmentsAccountListAnalytics!
contacts: ContactsAccountListAnalytics!
correspondence: CorrespondenceAccountListAnalytics!
Expand All @@ -18,8 +16,6 @@ type AccountListAnalytics {
textMessage: TextMessageAccountListAnalytics!
startDate: ISO8601DateTime!
endDate: ISO8601DateTime!
updatedAt: ISO8601DateTime!
updatedInDbAt: ISO8601DateTime!
}

type AppointmentsAccountListAnalytics {
Expand All @@ -29,14 +25,14 @@ type AppointmentsAccountListAnalytics {
type ContactsAccountListAnalytics {
active: Int!
referrals: Int!
referrals_on_hand: Int!
referralsOnHand: Int!
}

type CorrespondenceAccountListAnalytics {
precall: Int!
reminders: Int!
support_letters: Int!
thank_yous: Int!
supportLetters: Int!
thankYous: Int!
newsletters: Int!
}

Expand All @@ -61,7 +57,7 @@ type PhoneAccountListAnalytics {
attempted: Int!
completed: Int!
received: Int!
talktoinperson: Int!
talkToInPerson: Int!
}

type TextMessageAccountListAnalytics {
Expand Down
48 changes: 27 additions & 21 deletions pages/api/Schema/AccountListAnalytics/dataHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ const getAccountListAnalytics = (data: {
};
}): AccountListAnalytics => {
const {
id,
type,
attributes: {
created_at,
appointments,
contacts,
correspondence,
Expand All @@ -63,29 +60,38 @@ const getAccountListAnalytics = (data: {
facebook,
phone,
text_message,
start_date,
end_date,
updated_at,
updated_in_db_at,
start_date: startDate,
end_date: endDate,
},
} = data;

return {
id: id,
type: type,
createdAt: created_at,
appointments: appointments,
contacts: contacts,
correspondence: correspondence,
electronic: electronic,
email: email,
facebook: facebook,
phone: phone,
appointments,
canac marked this conversation as resolved.
Show resolved Hide resolved
contacts: {
active: contacts.active,
referrals: contacts.referrals,
referralsOnHand: contacts.referrals_on_hand,
},
correspondence: {
precall: correspondence.precall,
reminders: correspondence.reminders,
supportLetters: correspondence.support_letters,
thankYous: correspondence.thank_yous,
newsletters: correspondence.newsletters,
},
electronic,
email,
facebook,
phone: {
appointments: phone.appointments,
attempted: phone.attempted,
completed: phone.completed,
received: phone.received,
talkToInPerson: phone.talktoinperson,
},
textMessage: text_message,
startDate: start_date,
endDate: end_date,
updatedAt: updated_at,
updatedInDbAt: updated_in_db_at,
startDate,
endDate,
};
};
export { getAccountListAnalytics };
43 changes: 43 additions & 0 deletions src/components/Coaching/CoachingDetail/Activity/Activity.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
query CoachingDetailActivity($accountListId: ID!, $dateRange: String!) {
accountListAnalytics(accountListId: $accountListId, dateRange: $dateRange) {
appointments {
canac marked this conversation as resolved.
Show resolved Hide resolved
completed
}
contacts {
active
referrals
referralsOnHand
}
correspondence {
precall
reminders
supportLetters
thankYous
newsletters
}
electronic {
appointments
received
sent
}
email {
received
sent
}
facebook {
received
sent
}
phone {
attempted
appointments
completed
received
talkToInPerson
}
textMessage {
received
sent
}
}
}
Loading
Loading