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

7. When a new project is created, it's assessments and controls must be created as well. #744

Open
Tracked by #728
MuhammadKhalilzadeh opened this issue Feb 7, 2025 · 3 comments
Assignees
Labels
backend Backend related tasks/issues frontend Frontend related tasks/issues team work and collaboration
Milestone

Comments

@MuhammadKhalilzadeh
Copy link
Collaborator

MuhammadKhalilzadeh commented Feb 7, 2025

When we generate the auto driver, as soon as the project is created, all it's dependencies (assessments, topics, subtopics,...., and controlCategory, controls, ...) are create; but, currently it only exists for the mock data.
We need to add the same thing for real projects that get created manually as well.

Image

@HarshP4585
Copy link
Collaborator

@samuel-coutinho @MuhammadKhalilzadeh

Attaching CURL request for /saveAnswers

curl --location 'http://localhost:3000/assessments/saveAnswers' \
--form 'assessmentId="6"' \
--form 'topic="Project Scope"' \
--form 'topicId="69"' \
--form 'subtopic="[
  {
    \"id\": 92,
    \"name\": \"General\",
    \"questions\": [
      {
        \"id\": 137,
        \"subtopicId\": 92,
        \"questionText\": \"Will you make substantial modifications to the high-risk AI system already on the EU market, and if so, what additional training or fine-tuning will be performed on the model after these modifications?\",
        \"answerType\": \"Long text\",
        \"evidenceFileRequired\": false,
        \"hint\": \"As a deployer, you are responsible for any additional changes made to the high-risk AI system and must fulfill additional requirements based on the data used and the specific use case you are deploying.\",
        \"isRequired\": true,
        \"priorityLevel\": \"high priority\",
        \"evidenceFiles\": [],
        \"answer\": \"THIS IS FOR TESTING PURPOSE\"
      }
    ]
  }
]
"' \
--form 'files=@"/C:/Users/file1.pdf"' \
--form 'files=@"/C:/Users/file2.pdf"'

@HarshP4585
Copy link
Collaborator

@samuel-coutinho @MuhammadKhalilzadeh

Attaching CURL for /saveControls

curl --location 'http://localhost:3000/controls/saveControls' \
--form 'projectId="6"' \
--form 'controlCategoryTitle="AI literacy"' \
--form 'control="{
  \"id\": 232,
  \"controlTitle\": \"AI Literacy and Responsible AI Training\",
  \"controlDescription\": \"Develop the AI literacy ...\",
  \"status\": \"In progress\",
  \"approver\": \"John Doe\",
  \"riskReview\": \"Acceptable risk\",
  \"owner\": \"Bob Johnson\",
  \"reviewer\": \"Alice Williams\",
  \"dueDate\": \"2023-12-31\",
  \"implementationDetails\": \"Implement new feature\",
  \"subControls\": [
    {
      \"id\": 313,
      \"control_id\": 232,
      \"subControlTitle\":
        \"We ensure executive leadership takes responsibility for decisions related to AI risks\",
      \"subControlDescription\":
        \"Leadership is accountable for oversight and strategic decisions regarding AI risks, ensuring alignment with compliance.\",
      \"status\": \"Waiting\",
      \"approver\": \"Sarah Lee\",
      \"riskReview\": \"Residual risk\",
      \"owner\": \"Emily Davis\",
      \"reviewer\": \"David Wilson\",
      \"dueDate\": \"2024-06-30\",
      \"implementationDetails\": \"Update existing functionality\",
      \"evidence\": \"provided evidence\",
      \"feedback\": \"provided feedback\"
    }
  ]
}"' \
--form 'feedbackFiles=@"/C:/Users/file1.pdf"' \
--form 'evidenceFiles=@"/C:/Users/file2.pdf"' \
--form 'evidenceFiles=@"/C:/Users/file3.pdf"' \
--form 'controlCategoryId="66"'

@HarshP4585
Copy link
Collaborator

@MuhammadKhalilzadeh Please use this following CURL commands for updating the metadata

Assessment Tracker

curl --location --request PUT 'http://localhost:3000/questions/105' \
--form 'subtopic_id="54"' \
--form 'question="Describe the AI environment/application used."' \
--form 'answer_type="Long text"' \
--form 'evidence_required="false"' \
--form 'hint="Describe the AI environment/application used."' \
--form 'is_required="true"' \
--form 'priority_level="high priority"' \
--form 'answer="This is for testing purpose"' \
--form 'dropdown_options="[]"' \
--form 'order_id="1"' \
--form 'input_type="Tiptap area"' \
--form 'files=@"/C:/Users/file1.pdf"' \
--form 'files=@"/C:/Users/file2.pdf"'

Compliance Tracker

curl --location --request PUT 'http://localhost:3000/controls/saveControls/81' \
--form 'id="81"' \
--form 'title="AI Literacy and Responsible AI Training"' \
--form 'description="Develop the AI literacy of staff and others who operate or use AI systems on behalf of the organization."' \
--form 'status="In Progress"' \
--form 'approver="John Doe"' \
--form 'risk_review="Acceptable risk"' \
--form 'owner="Bob Johnson"' \
--form 'reviewer="Alice Williams"' \
--form 'due_date="2023-12-31"' \
--form 'implementation_details="Implement new feature"' \
--form 'order_no="1"' \
--form 'control_category_id="31"' \
--form 'feedbackFiles=@"/C:/Users/feedback.pdf"' \
--form 'evidenceFiles=@"/C:/Users/evidence.pdf"' \
--form 'subcontrols="[
  {
    \"id\": 113,
    \"control_id\": 81,
    \"title\": \"We ensure executive leadership takes responsibility for decisions related to AI risks\",
    \"description\": \"Leadership is accountable for oversight and strategic decisions regarding AI risks, ensuring alignment with compliance.\",
    \"order_no\": 1,
    \"status\": \"In Progress\",
    \"approver\": \"John Doe\",
    \"risk_review\": \"Acceptable risk\",
    \"owner\": \"Bob Johnson\",
    \"reviewer\": \"Alice Williams\",
    \"due_date\": \"2023-12-31\",
    \"implementation_details\": \"Implement new feature\",
    \"evidence_description\": \"This is test evidence description 1\",
    \"feedback_description\": \"This is test feedback description 1\"
  },
  {
    \"id\": 114,
    \"control_id\": 81,
    \"title\": \"We provide AI literacy and ethics training to relevant personnel.\",
    \"description\": \"Training equips employees to responsibly manage and understand AI systems, fostering ethics and legal adherence.\",
    \"order_no\": 2,
    \"status\": \"Waiting\",
    \"approver\": \"Sarah Lee\",
    \"risk_review\": \"Residual risk\",
    \"owner\": \"Emily Davis\",
    \"reviewer\": \"David Wilson\",
    \"due_date\": \"2024-06-30\",
    \"implementation_details\": \"Update existing functionality\",
    \"evidence_description\": \"This is test evidence description 2\",
    \"feedback_description\": \"This is test feedback description 2\"
  },
  {
    \"id\": 115,
    \"control_id\": 81,
    \"title\": \"We develop a clear and concise communication plan for informing workers about the use of high-risk AI systems in the workplace.\",
    \"description\": \"A concise plan ensures employees are informed of AI system impacts in their workplace roles and rights.\",
    \"order_no\": 3,
    \"status\": \"Done\",
    \"approver\": \"Michael Brown\",
    \"risk_review\": \"Unacceptable risk\",
    \"owner\": \"Chris Green\",
    \"reviewer\": \"Nancy White\",
    \"due_date\": \"2023-11-15\",
    \"implementation_details\": \"Conduct security audit\",
    \"evidence_description\": \"This is test evidence description 3\",
    \"feedback_description\": \"This is test feedback description 3\"
  }
]
"'

CC: @gorkem-bwl @samuel-coutinho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related tasks/issues frontend Frontend related tasks/issues team work and collaboration
Projects
None yet
Development

No branches or pull requests

3 participants