-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into 10489-story-staging
- Loading branch information
Showing
22 changed files
with
2,785 additions
and
2,483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ version: 2.1 | |
orbs: | ||
git-shallow-clone: guitarrapc/[email protected] | ||
|
||
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.18 | ||
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.19 | ||
|
||
parameters: | ||
run_build_and_deploy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// usage: | ||
// npx ts-node --transpile-only scripts/reports/practitioners-email-in-cases.ts 84c865f0-3867-40c8-aa31-f35c7e45998f | ||
|
||
import { | ||
ServerApplicationContext, | ||
createApplicationContext, | ||
} from '@web-api/applicationContext'; | ||
import { search } from '@web-api/persistence/elasticsearch/searchClient'; | ||
|
||
const practitionerId = process.argv[2]; | ||
if (!practitionerId) { | ||
console.log( | ||
'Usage: npx ts-node --transpile-only scripts/reports/practitioners-email-in-cases.ts <USER ID>', | ||
); | ||
process.exit(1); | ||
} | ||
|
||
const getUsersRole = async ({ | ||
applicationContext, | ||
userId, | ||
}: { | ||
applicationContext: ServerApplicationContext; | ||
userId: string; | ||
}): Promise<string | undefined> => { | ||
const { results } = await search({ | ||
applicationContext, | ||
searchParameters: { | ||
body: { | ||
from: 0, | ||
query: { | ||
bool: { | ||
must: [ | ||
{ | ||
term: { | ||
'pk.S': `user|${userId}`, | ||
}, | ||
}, | ||
{ | ||
term: { | ||
'sk.S': `user|${userId}`, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
size: 1, | ||
}, | ||
index: 'efcms-user', | ||
}, | ||
}); | ||
return results[0]?.role; | ||
}; | ||
|
||
const getPractitionersCases = async ({ | ||
applicationContext, | ||
role, | ||
userId, | ||
}: { | ||
applicationContext: ServerApplicationContext; | ||
role: string; | ||
userId: string; | ||
}): Promise<RawCase[]> => { | ||
const { results } = await search({ | ||
applicationContext, | ||
searchParameters: { | ||
body: { | ||
from: 0, | ||
query: { | ||
bool: { | ||
must: [ | ||
{ | ||
term: { | ||
[`${role}s.L.M.userId.S`]: userId, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
size: 10000, | ||
}, | ||
index: 'efcms-case', | ||
}, | ||
}); | ||
return results; | ||
}; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
(async () => { | ||
const applicationContext = createApplicationContext({}); | ||
const role = await getUsersRole({ | ||
applicationContext, | ||
userId: practitionerId, | ||
}); | ||
if (role !== 'irsPractitioner' && role !== 'privatePractitioner') { | ||
console.log(`Error: user is not a practitioner! User's role: ${role}`); | ||
return; | ||
} | ||
const practitionersCases: RawCase[] = await getPractitionersCases({ | ||
applicationContext, | ||
role, | ||
userId: practitionerId, | ||
}); | ||
const practitionersEmailInCases = {}; | ||
for (const practitionersCase of practitionersCases) { | ||
const practitionerObj = practitionersCase[`${role}s`]?.find( | ||
pract => pract.userId === practitionerId, | ||
); | ||
if (practitionerObj && practitionerObj.email) { | ||
practitionersEmailInCases[practitionersCase.docketNumber] = | ||
practitionerObj.email; | ||
} | ||
} | ||
console.log(practitionersEmailInCases); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ terraform { | |
} | ||
|
||
required_providers { | ||
aws = "5.75.1" | ||
aws = "5.77.0" | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ terraform { | |
} | ||
|
||
required_providers { | ||
aws = "5.75.1" | ||
aws = "5.77.0" | ||
} | ||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.