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

feat(four fields): This change add required fields to the submission forms #428

Merged
merged 142 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
4e530c0
Update site title
benjaminpaige Jan 28, 2024
dbf249c
init fields to medicaid submittion form
benjaminpaige Jan 29, 2024
638bdad
submission comments
benjaminpaige Jan 29, 2024
f3f13b1
update isprod check for next domain
benjaminpaige Jan 29, 2024
cce8d34
update title check test
benjaminpaige Jan 29, 2024
9f6889f
adjust layout width
benjaminpaige Jan 29, 2024
188745c
Revert "adjust layout width"
benjaminpaige Feb 7, 2024
2be10f1
merge from master
benjaminpaige Feb 9, 2024
0f11aa3
add subject and description to submit forms
benjaminpaige Feb 9, 2024
7a15f2a
adjust some fields did some refactoring
benjaminpaige Feb 12, 2024
767f6af
Merge branch 'master' into four
benjaminpaige Feb 12, 2024
201a095
remove temo form
benjaminpaige Feb 12, 2024
47ea779
lots of refactoring
benjaminpaige Feb 12, 2024
115b504
move dashboard to feature
benjaminpaige Feb 12, 2024
cafc5c9
getAllForms hood refactor structure
benjaminpaige Feb 12, 2024
6a7c70b
add types and subtypes schemas
benjaminpaige Feb 13, 2024
5b975cf
add subject and description
benjaminpaige Feb 13, 2024
af13f0f
add useGetPackageTypes
benjaminpaige Feb 13, 2024
40fb881
refactor authority, type, and subtype. move to a pattern of lookup i…
mdial89f Feb 13, 2024
903eeff
remove tests... little value, just confusing at this point
mdial89f Feb 13, 2024
ae3ddc0
reset file to clear junk diff
mdial89f Feb 13, 2024
b62c133
remove commented lines
mdial89f Feb 13, 2024
8a65eb4
remove unused func
mdial89f Feb 13, 2024
9137536
remove comments
mdial89f Feb 13, 2024
57d3e20
lint
mdial89f Feb 13, 2024
e9836f6
remove comment
mdial89f Feb 13, 2024
8462b97
remove file
mdial89f Feb 13, 2024
447f6a8
Merge branch 'master' into vpi
mdial89f Feb 13, 2024
d195ef4
lint
mdial89f Feb 13, 2024
1d8dade
type to clear vs code red line
mdial89f Feb 13, 2024
53b4831
lint
mdial89f Feb 13, 2024
46b9fa6
remove unused vars
mdial89f Feb 13, 2024
0f1e9c9
Correct custom resource replies
mdial89f Feb 13, 2024
4734e6d
merged master fixed conflicts
benjaminpaige Feb 14, 2024
f39bd36
merged vpi into four
benjaminpaige Feb 14, 2024
edf25a1
added some api calls and hooks
benjaminpaige Feb 14, 2024
f257e40
Merge branch 'master' into vpi
mdial89f Feb 14, 2024
959e8e7
update opensearch types var names
benjaminpaige Feb 14, 2024
e7d31e4
add subtypes stuff
benjaminpaige Feb 14, 2024
b3701e8
filter for do not use
benjaminpaige Feb 14, 2024
cd9d661
update query and waiver implimentation
benjaminpaige Feb 15, 2024
b228305
update submit query
benjaminpaige Feb 15, 2024
b999876
update from master
benjaminpaige Feb 15, 2024
7085880
fix table name typo
benjaminpaige Feb 15, 2024
56edac7
refactor
benjaminpaige Feb 16, 2024
93e3c7e
refactor inports
benjaminpaige Feb 16, 2024
d7aa7c6
updates per paul
mdial89f Feb 16, 2024
b449aa6
prettier"
mdial89f Feb 16, 2024
b40a930
middle ground ish
mdial89f Feb 16, 2024
bf73f2b
yes
mdial89f Feb 16, 2024
5b07656
rename
mdial89f Feb 16, 2024
55e8415
asdf
mdial89f Feb 16, 2024
23c04af
Add back
mdial89f Feb 16, 2024
40258a5
ok
mdial89f Feb 16, 2024
5328894
ok
mdial89f Feb 16, 2024
bc341a2
asdf
mdial89f Feb 16, 2024
e3eb4d8
align names
mdial89f Feb 16, 2024
d2bef91
asdf
mdial89f Feb 16, 2024
52e1bf9
break the seatool index sink away, for operational speed.
mdial89f Feb 16, 2024
d374590
correct logic for disabled triggers
mdial89f Feb 16, 2024
80eca8e
update decode record util
benjaminpaige Feb 16, 2024
a0f4644
added shared comps
benjaminpaige Feb 16, 2024
d39a8ac
Merge branch 'master' into four
benjaminpaige Feb 16, 2024
27d4e4e
merged changes in from master and vpi
benjaminpaige Feb 16, 2024
0b79b28
Refactor our sinks and reindex workflow
mdial89f Feb 20, 2024
60b87ae
Merge branch 'master' into vpi
mdial89f Feb 20, 2024
56645ef
Merge branch 'vpi' into four
mdial89f Feb 20, 2024
629bd38
Merge branch 'master' of github.com:Enterprise-CMCS/macpro-om-templat…
benjaminpaige Feb 20, 2024
65c9812
merge from master
benjaminpaige Feb 20, 2024
267dda8
Merge branch 'master' into vpi
mdial89f Feb 20, 2024
40462f0
Set status to undefined when undefined
mdial89f Feb 20, 2024
cf00c3e
skip records without a status
mdial89f Feb 21, 2024
7d85c79
Merge branch 'vpi' of github.com:Enterprise-CMCS/macpro-om-template i…
benjaminpaige Feb 21, 2024
bded896
Merge branch 'vpi' into four
benjaminpaige Feb 21, 2024
eeb4822
types
benjaminpaige Feb 21, 2024
0620595
update from master
benjaminpaige Feb 21, 2024
e27ca63
fix conflicts
benjaminpaige Feb 21, 2024
b540a2d
update from master
benjaminpaige Feb 22, 2024
47f4d91
update getAllForms
benjaminpaige Feb 22, 2024
616b35b
update types and detail and page
benjaminpaige Feb 22, 2024
18e0e3a
fix unit tests
benjaminpaige Feb 22, 2024
582c635
updates
benjaminpaige Feb 24, 2024
283395a
refactor
benjaminpaige Feb 25, 2024
c527e8f
lots of refactors
benjaminpaige Feb 26, 2024
5cc774b
refactor
benjaminpaige Feb 26, 2024
ac6f59d
add deconde thing back
benjaminpaige Feb 26, 2024
6cc522b
Merge from master
benjaminpaige Feb 27, 2024
16d98e3
temp comment four fields stuff out
benjaminpaige Feb 27, 2024
f7a9f07
clean up
benjaminpaige Feb 27, 2024
789fe1d
Merge remote-tracking branch 'origin' into four
benjaminpaige Feb 28, 2024
a1c1505
remove unused api/util/seatoolservice
benjaminpaige Feb 28, 2024
755f9da
Remove remaining repack stuff
benjaminpaige Feb 28, 2024
65b9dc5
uncomment additinal seatool fields
benjaminpaige Feb 29, 2024
09b7290
merge master into four
benjaminpaige Feb 29, 2024
fbe74b6
update details page fields
benjaminpaige Feb 29, 2024
39658c1
Merge branch 'master' of github.com:Enterprise-CMCS/macpro-mako into …
benjaminpaige Feb 29, 2024
7f94508
update type and subtype fields and stuff
benjaminpaige Mar 3, 2024
78320a2
update more stuff and queries
benjaminpaige Mar 3, 2024
1cb16a8
update styles
benjaminpaige Mar 3, 2024
d790fc6
update that details page sidebar thing
benjaminpaige Mar 3, 2024
9254e9a
style updates
benjaminpaige Mar 3, 2024
299d716
pushing pixels
benjaminpaige Mar 3, 2024
59b07b3
pushing pixels
benjaminpaige Mar 3, 2024
67c4395
merging master into four
benjaminpaige Mar 3, 2024
a187d9d
use a transaction with commit and rollback for submit handler
mdial89f Mar 4, 2024
f9ad6b1
write types and subtypes as a single insert to reduce pressure on ksq…
mdial89f Mar 4, 2024
d40cae1
collapse action type into main query
mdial89f Mar 4, 2024
0d758e6
i am danerous, iceman
mdial89f Mar 4, 2024
0b23df2
fixing an issue... pulling authority id from the static map
mdial89f Mar 4, 2024
1f70bfb
remove transmit begin
benjaminpaige Mar 4, 2024
8ec549a
Merge branch 'four' of github.com:Enterprise-CMCS/macpro-mako into four
benjaminpaige Mar 4, 2024
b32ec55
Updated from master
benjaminpaige Mar 5, 2024
4112b04
Merge branch 'master' of github.com:Enterprise-CMCS/macpro-mako into …
benjaminpaige Mar 6, 2024
e7b54af
Bring back review team thing
benjaminpaige Mar 6, 2024
2f276f2
Merge branch 'master' of github.com:Enterprise-CMCS/macpro-mako into …
benjaminpaige Mar 6, 2024
81b8d0a
Bug fixes
benjaminpaige Mar 7, 2024
2094bc1
small bug fixes
benjaminpaige Mar 7, 2024
6d796cd
Merge branch 'master' of github.com:Enterprise-CMCS/macpro-mako into …
benjaminpaige Mar 8, 2024
6ddcfce
substitute some weird characters in type and subtype
mdial89f Mar 8, 2024
b160c2b
better
mdial89f Mar 8, 2024
f31b68c
Adding fetchTypes tests and adjust styling
benjaminpaige Mar 9, 2024
ef7e87c
Add subtype tests and prettierrc file :0
benjaminpaige Mar 10, 2024
492aec9
Combined type/subtype hooks and tests and mocks
benjaminpaige Mar 10, 2024
eecf450
Remove unused files
benjaminpaige Mar 10, 2024
3c3c096
Pushing pixels
benjaminpaige Mar 10, 2024
c59b8b7
Merge branch 'master' into four
benjaminpaige Mar 11, 2024
c1ce9b8
Pixel pushing
benjaminpaige Mar 11, 2024
03b0765
Update sidebar for details page
benjaminpaige Mar 11, 2024
a300999
Merge branch 'master' of github.com:Enterprise-CMCS/macpro-mako into …
benjaminpaige Mar 11, 2024
0d73be4
typo
benjaminpaige Mar 11, 2024
1730c05
Merge from master
benjaminpaige Mar 13, 2024
b004dad
Merge with master
benjaminpaige Mar 14, 2024
31106c7
Fixed sidebar bug
benjaminpaige Mar 14, 2024
3029e10
Merge branch 'master' of github.com:Enterprise-CMCS/macpro-mako into …
benjaminpaige Mar 14, 2024
aed93f5
fixing bugs
benjaminpaige Mar 14, 2024
806cf27
fixing bugs
benjaminpaige Mar 14, 2024
4f79840
Bug Fixes
benjaminpaige Mar 14, 2024
8ffeeb7
Add size to query
benjaminpaige Mar 14, 2024
b24a19f
Merge from master
benjaminpaige Mar 14, 2024
84afe5e
Bug fixes withn subtypes
benjaminpaige Mar 15, 2024
ded0852
Remainnig bug squashing
benjaminpaige Mar 15, 2024
e866b79
Squashed the rest of the bugs
benjaminpaige Mar 15, 2024
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ testcafe_results
yarn-error.log
.serverless
.webpack
.repack
.yarn_install
tsconfig.tsbuildinfo
build_run
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ testcafe_results
yarn-error.log
.serverless
.webpack
.repack
.yarn_install
tsconfig.tsbuildinfo
build_run
Expand Down
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all"
}
2 changes: 0 additions & 2 deletions src/libs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
"version": "0.0.0",
"dependencies": {
"@aws-sdk/client-cognito-identity-provider": "^3.350.0",
"@aws-sdk/client-dynamodb": "^3.281.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow 👍

"@aws-sdk/credential-provider-node": "^3.369.0",
"@aws-sdk/client-secrets-manager": "^3.410.0",
"@aws-sdk/util-dynamodb": "^3.281.0",
"@opensearch-project/opensearch": "^2.3.0",
"@types/aws4": "^1.11.3",
"aws4": "^1.12.0",
Expand Down
28 changes: 20 additions & 8 deletions src/packages/shared-types/opensearch/main/transforms/seatool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,24 @@ export const transform = (id: string) => {
leadAnalystName,
authorityId: authorityId || null,
authority: getAuthority(authorityId, id) as Authority | null,
typeId: data.STATE_PLAN_SERVICETYPES?.[0]?.SPA_TYPE_ID || null,
typeName: data.STATE_PLAN_SERVICETYPES?.[0]?.SPA_TYPE_NAME || null,
subTypeId: data.STATE_PLAN_SERVICE_SUBTYPES?.[0]?.TYPE_ID || null,
subTypeName: data.STATE_PLAN_SERVICE_SUBTYPES?.[0]?.TYPE_NAME || null,
types:
data.STATE_PLAN_SERVICETYPES?.filter(
(type): type is NonNullable<typeof type> => type != null
).map((type) => {
return {
SPA_TYPE_ID: type.SPA_TYPE_ID,
SPA_TYPE_NAME: type.SPA_TYPE_NAME.replace(/–|—/g, "-"),
};
}) || null,
subTypes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

data.STATE_PLAN_SERVICE_SUBTYPES?.filter(
(subType): subType is NonNullable<typeof subType> => subType != null
).map((subType) => {
return {
TYPE_ID: subType.TYPE_ID,
TYPE_NAME: subType.TYPE_NAME.replace(/–|—/g, "-"),
};
}) || null,
proposedDate: getDateStringOrNullFromEpoc(data.STATE_PLAN.PROPOSED_DATE),
raiReceivedDate,
raiRequestedDate,
Expand Down Expand Up @@ -217,9 +231,7 @@ export const tombstone = (id: string) => {
statusDate: null,
submissionDate: null,
subject: null,
typeId: null,
typeName: null,
subTypeId: null,
subTypeName: null,
types: null,
subTypes: null,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ describe("getNextBusinessDayTimestamp", () => {
expect(nextDate).toEqual(Date.UTC(2024, 0, 16)); // Tuesday, midnight utc
});

// TODO: I dont know if its my time zone but this always fails for me in the MST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test date is created for 3pm local, not explicitly eastern. So, 3pm local for you is 5pm east coast. The logic for getNextBizDay includes "if 5pm or after, go to the next day". 3pm your time is exactly 5pm, and should return the next day. Test isn't accounting for being run in other timezones. Wouldn't hold up merge to fix anything, in addition some of this might be changing or have changed with the unit test effort.

it("identifies valid business days", () => {
let testDate = new Date(2024, 0, 9, 15, 0, 0); // Tuesday 3pm utc, Tuesday 8am eastern
let nextDate = getNextBusinessDayTimestamp(testDate);
Expand Down
3 changes: 1 addition & 2 deletions src/packages/shared-utils/tests/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const testItemResult: opensearch.main.ItemResult = {
finalDispositionDate: null,
stateStatus: "Under Review",
submissionDate: "2024-03-01T00:00:00.000Z",
subTypeId: null,
subTypeIds: null,
cmsStatus: "Pending",
reviewTeam: [],
flavor: "MEDICAID",
Expand All @@ -108,7 +108,6 @@ export const testItemResult: opensearch.main.ItemResult = {
{
_index: "changelog",
_id: "MD-12-3456",
_score: null,
// @ts-ignore
_source: {
authority: "medicaid spa",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { APIGatewayEvent } from "aws-lambda";
import * as os from "../../../libs/opensearch-lib";
import * as os from "libs/opensearch-lib";
import { response } from "../libs/handler";

type GetSeaTypesBoby = {
type GetSubTypesBoby = {
authorityId: string;
typeId?: string;
typeIds: string[];
};

export const querySeaTypes = async (authorityId: string, typeId?: string) => {
export const querySubTypes = async (authorityId: string, typeIds: string[]) => {
if (!process.env.osDomain) {
throw new Error("process.env.osDomain must be defined");
}

const index = typeId ? "subtypes" : "types";
const query: any = {
const query = {
size: 200,
query: {
bool: {
must: [
Expand All @@ -22,6 +22,11 @@ export const querySeaTypes = async (authorityId: string, typeId?: string) => {
authorityId: authorityId,
},
},
{
terms: {
typeId: typeIds,
},
},
],
must_not: [
{
Expand All @@ -34,29 +39,28 @@ export const querySeaTypes = async (authorityId: string, typeId?: string) => {
],
},
},
};

if (typeId) {
query.query.bool.must.push({
match: {
typeId: typeId,
sort: [
{
"name.keyword": {
order: "asc",
},
},
});
}
],
};

return await os.search(process.env.osDomain, index, query);
return await os.search(process.env.osDomain, "subtypes", query);
};

export const getSeaTypes = async (event: APIGatewayEvent) => {
export const getSubTypes = async (event: APIGatewayEvent) => {
if (!event.body) {
return response({
statusCode: 400,
body: { message: "Event body required" },
});
}
const body = JSON.parse(event.body) as GetSeaTypesBoby;
const body = JSON.parse(event.body) as GetSubTypesBoby;
try {
const result = await querySeaTypes(body.authorityId, body.typeId);
const result = await querySubTypes(body.authorityId, body.typeIds);

if (!result)
return response({
Expand All @@ -66,7 +70,7 @@ export const getSeaTypes = async (event: APIGatewayEvent) => {

return response({
statusCode: 200,
body: body.typeId ? { seaSubTypes: result } : { seaTypes: result },
body: result,
});
} catch (err) {
console.error({ err });
Expand All @@ -77,4 +81,4 @@ export const getSeaTypes = async (event: APIGatewayEvent) => {
}
};

export const handler = getSeaTypes;
export const handler = getSubTypes;
76 changes: 76 additions & 0 deletions src/services/api/handlers/getTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { APIGatewayEvent } from "aws-lambda";
import * as os from "libs/opensearch-lib";
import { response } from "../libs/handler";

type GetTypesBoby = {
authorityId: string;
};

export const queryTypes = async (authorityId: string) => {
if (!process.env.osDomain) {
throw new Error("process.env.osDomain must be defined");
}

const query = {
size: 200,
query: {
bool: {
must: [
{
match: {
authorityId: authorityId,
},
},
],
must_not: [
{
match_phrase: {
name: {
query: "Do Not Use",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

},
},
},
],
},
},
sort: [
{
"name.keyword": {
order: "asc",
},
},
],
};
return await os.search(process.env.osDomain, "types", query);
};

export const getTypes = async (event: APIGatewayEvent) => {
if (!event.body) {
return response({
statusCode: 400,
body: { message: "Event body required" },
});
}
const body = JSON.parse(event.body) as GetTypesBoby;
try {
const result = await queryTypes(body.authorityId);
if (!result)
return response({
statusCode: 400,
body: { message: "No record found for the given authority" },
});

return response({
statusCode: 200,
body: result,
});
} catch (err) {
console.error({ err });
return response({
statusCode: 500,
body: { message: "Internal server error" },
});
}
};

export const handler = getTypes;
Loading
Loading