diff --git a/backend/src/interfaces/answer.ts b/backend/src/interfaces/answer.ts index 493fd3c0..b62aa741 100644 --- a/backend/src/interfaces/answer.ts +++ b/backend/src/interfaces/answer.ts @@ -1,14 +1,7 @@ -import { mapToUserDTO, UserDTO } from './user.js'; -import { mapToQuestionDTO, mapToQuestionId, QuestionDTO, QuestionId } from './question.js'; +import { mapToUserDTO } from './user.js'; +import { mapToQuestionDTO, mapToQuestionId } from './question.js'; import { Answer } from '../entities/questions/answer.entity.js'; - -export interface AnswerDTO { - author: UserDTO; - toQuestion: QuestionDTO; - sequenceNumber: number; - timestamp: string; - content: string; -} +import { AnswerDTO, AnswerId } from 'dwengo-1-common/src/interfaces/answer'; /** * Convert a Question entity to a DTO format. @@ -23,12 +16,6 @@ export function mapToAnswerDTO(answer: Answer): AnswerDTO { }; } -export interface AnswerId { - author: string; - toQuestion: QuestionId; - sequenceNumber: number; -} - export function mapToAnswerId(answer: AnswerDTO): AnswerId { return { author: answer.author.username, diff --git a/common/src/interfaces/answer.d.ts b/common/src/interfaces/answer.d.ts new file mode 100644 index 00000000..96ed063b --- /dev/null +++ b/common/src/interfaces/answer.d.ts @@ -0,0 +1,16 @@ +import { UserDTO } from 'dwengo-1-backend/src/interfaces/user.js' +import { QuestionDTO } from 'dwengo-1-backend/src/interfaces/question.js' + +export interface AnswerDTO { + author: UserDTO; + toQuestion: QuestionDTO; + sequenceNumber: number; + timestamp: string; + content: string; +} + +export interface AnswerId { + author: string; + toQuestion: QuestionId; + sequenceNumber: number; +}