Closed
Description
This issue has the final touch which we should do for refactoring product template and project templates to use Form model.
It's a follow up from this PR #290
-
In this PR helper method has been created
util.checkModel
while in previous code this method has been defined several times:- https://github.com/topcoder-platform/tc-project-service/blob/feature/product-templates-refactoring/src/routes/projectTemplates/create.js#L50
- https://github.com/topcoder-platform/tc-project-service/blob/feature/product-templates-refactoring/src/routes/projectTemplates/update.js#L53
- https://github.com/topcoder-platform/tc-project-service/blob/feature/product-templates-refactoring/src/routes/projectTemplates/upgrade.js#L55
So we can reuse a new helper method in all these cases.
-
At the moment we have two ways of defining forms for both
ProductTemplates
andProjectTemplates
: old way inside the template and new way using Form model.
So both of fields are optional:and
For
ProductTemplate
we should check in create/update endpoints that- either
form
ortemplate
field is defined, but not both together.
For
ProjectTemplate
we should check in create/update endpoints that:- either
scope
orform
field must be defined, but not both together scope
orpriceConfig
cannot be defined together (they can be bothnull
though)- either
phases
orphaseConfig
field must be defined, but not both together.
- either
Metadata
Metadata
Assignees
Labels
No labels