Repository: microsoft/AzureTRE

Issue:
[BUG] ResourceTemplates have properties - should be parameters
Rename properties to parameters



Discussion:

Resolving patch:
diff --git a/management_api_app/db/repositories/workspace_templates.py b/management_api_app/db/repositories/workspace_templates.py
--- a/management_api_app/db/repositories/workspace_templates.py
+++ b/management_api_app/db/repositories/workspace_templates.py
@@ -50,7 +50,7 @@ def create_workspace_template_item(self, workspace_template_create: WorkspaceTem
             name=workspace_template_create.name,
             description=workspace_template_create.description,
             version=workspace_template_create.version,
-            properties=workspace_template_create.properties,
+            parameters=workspace_template_create.parameters,
             resourceType=workspace_template_create.resourceType,
             current=workspace_template_create.current
         )
diff --git a/management_api_app/models/domain/resource_template.py b/management_api_app/models/domain/resource_template.py
--- a/management_api_app/models/domain/resource_template.py
+++ b/management_api_app/models/domain/resource_template.py
@@ -20,6 +20,6 @@ class ResourceTemplate(AzureTREModel):
     name: str = Field(title="Unique template name")
     description: str = Field(title="Template description")
     version: str = Field(title="Template version")
-    properties: List[dict] = Field(title="Template parameters")
+    parameters: List[dict] = Field(title="Template parameters")
     resourceType: ResourceType = Field(title="Type of resource this template is for (workspace/service)")
     current: bool = Field(title="Is this the current version of this template")
diff --git a/management_api_app/models/schemas/workspace_template.py b/management_api_app/models/schemas/workspace_template.py
--- a/management_api_app/models/schemas/workspace_template.py
+++ b/management_api_app/models/schemas/workspace_template.py
@@ -11,7 +11,7 @@ def get_sample_workspace_template_object(template_name: str = "tre-workspace-van
         name=template_name,
         description="vanilla workspace bundle",
         version="0.1.0",
-        properties=[
+        parameters=[
             Parameter(name="azure_location", type="string"),
             Parameter(name="tre_id", type="string"),
             Parameter(name="workspace_id", type="string"),
@@ -42,8 +42,8 @@ class WorkspaceTemplateInCreate(BaseModel):
     name: str = Field(title="Name of workspace template")
     version: str = Field(title="Version of workspace template")
     description: str = Field(title=" Description of workspace template")
-    properties: List[dict] = Field([{}], title="Workspace template properties",
-                                   description="Values for the properties required by the workspace template")
+    parameters: List[dict] = Field([{}], title="Workspace template parameters",
+                                   description="Values for the parameters required by the workspace template")
     resourceType: str = Field(title="Type of workspace template")
     current: bool = Field(title="Mark this version as current")
 
@@ -53,7 +53,7 @@ class Config:
                 "name": "my-tre-workspace",
                 "version": "0.0.1",
                 "description": "workspace template for great product",
-                "properties": [{
+                "parameters": [{
                     "name": "azure_location",
                     "type": "string"
                 }],


Test patch:
diff --git a/management_api_app/tests/test_api/test_routes/test_workspace_templates.py b/management_api_app/tests/test_api/test_routes/test_workspace_templates.py
--- a/management_api_app/tests/test_api/test_routes/test_workspace_templates.py
+++ b/management_api_app/tests/test_api/test_routes/test_workspace_templates.py
@@ -17,7 +17,7 @@
     "name": "my-tre-workspace",
     "version": "0.0.1",
     "description": "workspace template for great product",
-    "properties": [{"blah": "blah"}],
+    "parameters": [{"blah": "blah"}],
     "resourceType": "workspace",
     "current": True
 }
diff --git a/management_api_app/tests/test_db/test_repositories/test_workspace_templates_repository.py b/management_api_app/tests/test_db/test_repositories/test_workspace_templates_repository.py
--- a/management_api_app/tests/test_db/test_repositories/test_workspace_templates_repository.py
+++ b/management_api_app/tests/test_db/test_repositories/test_workspace_templates_repository.py
@@ -15,7 +15,7 @@ def get_sample_workspace_template(name: str, version: str = "1.0") -> ResourceTe
         description="some description",
         version=version,
         resourceType=ResourceType.Workspace,
-        properties=[],
+        parameters=[],
         current=False
     )
 
@@ -147,7 +147,7 @@ def test_create_item(cosmos_mock, uuid_mock, create_mock):
         description="some description",
         version="0.0.1",
         resourceType=ResourceType.Workspace,
-        properties=[],
+        parameters=[],
         current=False
     )
     returned_template = template_repo.create_workspace_template_item(payload)
@@ -157,7 +157,7 @@ def test_create_item(cosmos_mock, uuid_mock, create_mock):
         description="some description",
         version="0.0.1",
         resourceType=ResourceType.Workspace,
-        properties=[],
+        parameters=[],
         current=False
     )
     create_mock.assert_called_once_with(expected_resouce_template)