import { Prisma } from "@prisma/client";

export const postDetailSelect: Prisma.PostSelect = {
	id: true,
	type: true,
	title: true,
	content: true,
	resources: true,
	watchableDepts: true,
	watchableStaffs: true,
	updatedAt: true,
	author: {
		select: {
			id: true,
			showname: true,
			avatar: true,
			department: {
				select: {
					id: true,
					name: true,
				},
			},
			domain: {
				select: {
					id: true,
					name: true,
				},
			},
		},
	},
};
export const postUnDetailSelect: Prisma.PostSelect = {
	id: true,
	type: true,
	title: true,
	content: true,
	resources: true,
	updatedAt: true,
	author: {
		select: {
			id: true,
			showname: true,
			avatar: true,
			department: {
				select: {
					id: true,
					name: true,
				},
			},
			domain: {
				select: {
					id: true,
					name: true,
				},
			},
		},
	},
};
export const messageDetailSelect: Prisma.MessageSelect = {
	id: true,
	sender: true,
	content: true,
	title: true,
	url: true,
	option: true,
	intent: true,
};
export const courseDetailSelect: Prisma.CourseSelect = {
	id: true,
	title: true,
	subTitle: true,
	description: true,
	thumbnail: true,
	level: true,
	requirements: true,
	objectives: true,
	skills: true,
	audiences: true,
	totalDuration: true,
	totalLectures: true,
	averageRating: true,
	numberOfReviews: true,
	numberOfStudents: true,
	completionRate: true,
	status: true,
	isFeatured: true,
	createdAt: true,
	publishedAt: true,
	// 关联表选择
	sections: {
		include: {
			lectures: true,
		},
	},
	enrollments: true,
};
