Adds workflow spec category to API

This commit is contained in:
Aaron Louie 2020-03-16 12:10:32 -04:00
parent 6af1693bdc
commit a98251237b
3 changed files with 23 additions and 2 deletions

View File

@ -716,10 +716,31 @@ components:
properties:
id:
type: string
name:
type: string
display_name:
type: string
description:
type: string
primary_process_id:
type: string
nullable: true
workflow_spec_category_id:
type: integer
nullable: true
workflow_spec_category:
$ref: "#/components/schemas/WorkflowSpecCategory"
is_status:
type: boolean
nullable: true
WorkflowSpecCategory:
properties:
id:
type: integer
name:
type: string
display_name:
type: string
File:
properties:
id:

View File

@ -23,7 +23,7 @@ class WorkflowSpecModel(db.Model):
display_name = db.Column(db.String)
description = db.Column(db.Text)
primary_process_id = db.Column(db.String)
workflow_spec_category_id = db.Column(db.Integer, db.ForeignKey('workflow_spec_category.id'))
workflow_spec_category_id = db.Column(db.Integer, db.ForeignKey('workflow_spec_category.id'), nullable=True)
workflow_spec_category = db.relationship("WorkflowSpecCategoryModel")
is_status = db.Column(db.Boolean, default=False)

View File

@ -25,7 +25,7 @@ class TestWorkflowSpec(BaseTest):
def test_add_new_workflow_specification(self):
self.load_example_data();
num_before = session.query(WorkflowSpecModel).count()
spec = WorkflowSpecModel(id='make_cookies', display_name='Cooooookies',
spec = WorkflowSpecModel(id='make_cookies', name='make_cookies', display_name='Cooooookies',
description='Om nom nom delicious cookies')
rv = self.app.post('/v1.0/workflow-specification',
headers=self.logged_in_headers(),