add testimony api
This commit is contained in:
15
src/modules/testimony/testimony.mapper.ts
Normal file
15
src/modules/testimony/testimony.mapper.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Testimony } from "@/database/entities/testimony.entity";
|
||||
import type { TestimonyResponse } from "@/modules/testimony/testimony.types";
|
||||
|
||||
export class TestimonyMapper {
|
||||
public mapEntityToResponse(testimony: Testimony): TestimonyResponse {
|
||||
return {
|
||||
id: testimony.id,
|
||||
review: testimony.review,
|
||||
reviewer: testimony.reviewer,
|
||||
rating: testimony.rating,
|
||||
created_at: testimony.createdAt,
|
||||
updated_at: testimony.updatedAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user