Skip to content

Update project creation endpoint to create phases and products based on project template specified in the payload #86

Closed
@vikasrohit

Description

@vikasrohit

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:

  1. Update POST /v4/projects endpoint to create phases and products as per the template specified in POST body as projectTemplateId param. Store the project template id in a new field(projectTemplateId) in the project table.
  2. Project templates are stored in project_templates table represented by ProjectTemplate model.
  3. 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'
    }
  ]
}]
  1. Project, Phase and Product should be stored in database in a single database transaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions