Closed
Description
We have to create default phases and products as per the specified project template id in the project creation endpoint. Following are the key points:
- Update
POST /v4/projects
endpoint to create phases and products as per the template specified in POST body asprojectTemplateId
param. Store the project template id in a new field(projectTemplateId
) in the project table. - Project templates are stored in
project_templates
table represented by ProjectTemplate model. - Each project template contains a json field
phases
which contains array of objects and each object represents a phase. Each phase object has default values for few fields and a products array. Products array contains objects which represent default values for some of the fields of a product and more importantly the id of the product. We use this product id to create a new product.
Sample phases field value:
[{
name: "Design Stage",
products: [
{
id: 21,
productKey: 'visual_design_prod'
}
]
}, {
name: "Development Stage",
products: [
{
id: 23,
productKey: 'website_development'
}
]
}]
- Project, Phase and Product should be stored in database in a single database transaction.
Metadata
Metadata
Assignees
Labels
No labels