alan-turing-institute / AssurancePlatform

Project to facilitate creation of Assurance Cases
MIT License
17 stars 6 forks source link

Expand the information retrived by the API #515

Closed cptanalatriste closed 4 days ago

cptanalatriste commented 1 week ago

This issue is a dependency of https://github.com/alan-turing-institute/AssurancePlatform/issues/492

Currently, when retrieving case information strategy items do not contain type information. For example, the request https://staging-eap-backend.azurewebsites.net/api/cases/51/ returns:

{
    "id": 51,
    "type": "AssuranceCase",
    "name": "demo",
    "description": "demo",
    "created_date": "2024-06-19T22:10:07.047079Z",
    "lock_uuid": null,
    "goals": [
        {
            "id": 97,
            "type": "TopLevelNormativeGoal",
            "name": "G1",
            "short_description": "G1",
            "long_description": "N/A",
            "keywords": "N/A",
            "assurance_case_id": 51,
            "context": [
                {
                    "id": 133,
                    "type": "Context",
                    "name": "C1",
                    "short_description": "C2",
                    "long_description": "C2",
                    "created_date": "2024-06-21T09:58:59.618702Z",
                    "goal_id": 97
                }
            ],
            "property_claims": [],
            "strategies": [
                {
                    "id": 243,
                    "name": "S1",
                    "short_description": "Collapsed strategy",
                    "long_description": "S2",
                    "goal_id": 97,
                    "property_claims": [
                        {
                            "id": 1646,
                            "type": "PropertyClaim",
                            "name": "P1",
                            "short_description": "P2",
                            "long_description": "P2",
                            "goal_id": null,
                            "property_claim_id": null,
                            "level": 1,
                            "claim_type": "Property Claim",
                            "property_claims": [
                                {
                                    "id": 1647,
                                    "type": "PropertyClaim",
                                    "name": "P1.1",
                                    "short_description": "P 2.2",
                                    "long_description": "P 2.2",
                                    "goal_id": null,
                                    "property_claim_id": 1646,
                                    "level": 2,
                                    "claim_type": "Property Claim",
                                    "property_claims": [],
                                    "evidence": [],
                                    "strategy_id": null
                                }
                            ],
                            "evidence": [],
                            "strategy_id": 243
                        },
                        {
                            "id": 1776,
                            "type": "PropertyClaim",
                            "name": "P2",
                            "short_description": "This is a new claim",
                            "long_description": "This is a new claim",
                            "goal_id": null,
                            "property_claim_id": null,
                            "level": 1,
                            "claim_type": "Property Claim",
                            "property_claims": [],
                            "evidence": [],
                            "strategy_id": 243
                        }
                    ]
                },
                {
                    "id": 254,
                    "name": "S2",
                    "short_description": "New Strategy",
                    "long_description": "New Strategy",
                    "goal_id": 97,
                    "property_claims": [
                        {
                            "id": 1777,
                            "type": "PropertyClaim",
                            "name": "P3",
                            "short_description": "New Claim",
                            "long_description": "New Claim",
                            "goal_id": null,
                            "property_claim_id": null,
                            "level": 1,
                            "claim_type": "Property Claim",
                            "property_claims": [],
                            "evidence": [],
                            "strategy_id": 254
                        }
                    ]
                }
            ]
        }
    ],
    "owner": 4,
    "edit_groups": [],
    "view_groups": [],
    "color_profile": "default",
    "comments": [],
    "permissions": "manage"
}

Notice that strategy elements are missing type information, unline case or goal. For example, goal creation returns the following: {"name": "P3.3.1", "id": 1783}. @RichGriff , please specify what extra information you need.

RichGriff commented 4 days ago

@cptanalatriste this looks to have done the job 👍 we now get the type back and the whole object that was created.