// // Copyright @ 2024 Hardcore Engineering Inc. // import type { Answer, AnswerDataOf, Question } from '@hcengineering/questions' import { type AttachedData, type Class, type Doc, type Ref, type Space, type TxOperations } from '@hcengineering/core' export async function createAnswer, A extends Answer> ( client: TxOperations, classRef: Ref>, space: Ref, attachedTo: Ref, attachedToClass: Ref>, collection: Extract | string, questionRef: Ref, answerData: AnswerDataOf ): Promise> { const data: AttachedData, unknown>> = { answerData, question: questionRef } return (await client.addCollection(classRef, space, attachedTo, attachedToClass, collection, data)) as Ref }