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(lamda): add admin function for NOSOs #990

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

Conversation

andieswift
Copy link
Collaborator

@andieswift andieswift commented Jan 8, 2025

❌ NOT READY ❌

🎫 Linked Ticket

OY2-31182

💬 Description / Notes

  • added an admin function for creating a new submissions for NOSOs
  • followed similar structure used for admin updatePackage

Submit NOSO

  1. In lamdba functions go to mako--api-submitNOSO
  2. Click Test and JSON should be formated like:
{
 "body": {
   "id": "MD-25-1234",
   "action": "submit",
   "adminChangeType": "submit",
   "item":{
      "action": "submit",
   "adminChangeType": "submit",
   "event": "submit",
   "additionalInformation": "blah",
   "attachments": {
     "cmsForm179": [],
     "spaPages": [],
     "coverLetter": [],
     "tribalEngahgement": [],
     "existingStatePlanPages": [],
     "publicNotice": [],
     "sfq": [],
     "tribalConsultation": [],
     "other": []
   },
   "authority": "Medicaid SPA",
   "proposedEffectiveDate": 10000,
   "id": "MD-25-1234"
   }
   }
  

}
`

## 🛠 Changes


## 📸 Screenshots / Demo

<!-- ### Before -->

<!-- ### After -->

@andieswift andieswift self-assigned this Jan 8, 2025
@andieswift andieswift added the status: NOT READY PR ain't ready label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 89.03% 8431 / 9469
🔵 Statements 88.3% 8852 / 10024
🔵 Functions 83.1% 2553 / 3072
🔵 Branches 61.06% 1761 / 2884
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
lib/lambda/sinkChangelog.ts 92.3% 87.5% 100% 94.11% 105-106, 129, 140
lib/lambda/sinkMainProcessors.ts 97.14% 97.61% 100% 97.11% 57-65
lib/lambda/adminActions/submitNOSO.ts 6% 0% 0% 6.25% 12-60, 73-94, 98-133
lib/packages/shared-types/opensearch/changelog/index.ts 100% 100% 100% 100%
react-app/src/features/package/admin-changes/index.tsx 31.57% 0% 0% 35.29% 54-67, 88-91
Generated in workflow #1576 for commit 419cad2 by the Vitest Coverage Report Action

// check if the package already exists; if it does shoudl not add new record
if (currentPackage) {
return response({
statusCode: 404,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't 404 mean Not Found?

Comment on lines 59 to 63
const parseEventBody = (body: unknown) => {
return submitNOSOAdminSchema.parse(typeof body === "string" ? JSON.parse(body) : body);
};

const { packageId, action } = parseEventBody(event.body);
Copy link
Collaborator

@asharonbaltazar asharonbaltazar Jan 9, 2025

Choose a reason for hiding this comment

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

Would it make sense to just call submitNOSOAdminSchema.parse without abstracting it into a function?

@asharonbaltazar
Copy link
Collaborator

Woops, didn't see the NOT READY badge. Ignore my comments 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: NOT READY PR ain't ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants