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

export const postDetailSelect: Prisma.PostSelect = {
	id: true,
	type: true,
	title: true,
	content: true,
	resources: true,
	parent: true,
	parentId: true,
	// watchableDepts: true,
	// watchableStaffs: true,
	updatedAt: true,
	terms: {
		select: {
			id: true,
			name: true,
			taxonomyId: true,
			taxonomy: {
				select: {
					id: true,
					slug: true,
				},
			},
		},
	},
	depts: true,
	author: {
		select: {
			id: true,
			showname: true,
			avatar: true,
			department: {
				select: {
					id: true,
					name: true,
				},
			},
			domain: {
				select: {
					id: true,
					name: true,
				},
			},
		},
	},
	meta: true,
	views: true,
};
export const postUnDetailSelect: Prisma.PostSelect = {
	id: true,
	type: true,
	title: true,
	views: true,
	parent: true,
	parentId: 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.PostSelect = {
	id: true,
	title: true,
	subTitle: true,
	views: true,
	type: true,
	author: true,
	authorId: true,
	content: true,
	depts: true,
	// isFeatured: true,
	createdAt: true,
	updatedAt: true,
	// 关联表选择
	terms: {
		select: {
			id: true,
			name: true,
			taxonomyId: true,
			taxonomy: {
				select: {
					id: true,
					slug: true,
				},
			},
		},
	},
	enrollments: {
		select: {
			id: true,
		},
	},
	meta: true,
	rating: true,
};
export const lectureDetailSelect: Prisma.PostSelect = {
	id: true,
	title: true,
	subTitle: true,
	content: true,
	resources: true,
	views: true,
	createdAt: true,
	updatedAt: true,
	// 关联表选择

	meta: true,
};
