import payloadHeader from "./payloadHeader"

export default (props = {}) => {
  const header = payloadHeader({
    ...props,
    ...{ _type: "project" },
  })
  return {
    ...header,
    _meta: {
      project: props._id,
      hasConfig: props.hasConfig || null,
    },
    _source: {
      _id: props._id || null,
      title: props.title || null,
      shorttitle: props.shorttitle || null,
      account: props.account || null,
      owner: props.owner || null, // uuid user
      description: props.description || null,
      isDeleted: false,
      journal: props.journal || null,
      tags: props.tags || null,
      code: props.code || null, // type project
    },
  }
}
