Replace public legal files and switch booking to a contact request without a schedule.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
import { ADMIN_GROUP } from '../admin/groups'
|
||||
|
||||
export const Inquiries: CollectionConfig = {
|
||||
slug: 'inquiries',
|
||||
labels: { singular: 'Заявка на запись', plural: 'Заявки на запись' },
|
||||
admin: {
|
||||
group: ADMIN_GROUP.booking,
|
||||
useAsTitle: 'name',
|
||||
defaultColumns: ['name', 'phone', 'email', 'status', 'createdAt'],
|
||||
description: 'Заявки с сайта без выбора времени. Свяжитесь с пациентом и уточните детали.',
|
||||
},
|
||||
access: {
|
||||
create: () => true,
|
||||
read: ({ req: { user } }) => user?.role === 'admin',
|
||||
update: ({ req: { user } }) => user?.role === 'admin',
|
||||
delete: ({ req: { user } }) => user?.role === 'admin',
|
||||
},
|
||||
fields: [
|
||||
{ name: 'name', type: 'text', required: true, label: 'ФИО' },
|
||||
{ name: 'email', type: 'email', required: true, label: 'E-mail' },
|
||||
{ name: 'phone', type: 'text', required: true, label: 'Телефон' },
|
||||
{ name: 'service', type: 'relationship', relationTo: 'services', label: 'Услуга' },
|
||||
{ name: 'doctor', type: 'relationship', relationTo: 'doctors', label: 'Врач' },
|
||||
{ name: 'branch', type: 'relationship', relationTo: 'branches', required: true, label: 'Филиал' },
|
||||
{
|
||||
name: 'status',
|
||||
type: 'select',
|
||||
required: true,
|
||||
defaultValue: 'new',
|
||||
label: 'Статус',
|
||||
options: [
|
||||
{ label: 'Новая', value: 'new' },
|
||||
{ label: 'В работе', value: 'in_progress' },
|
||||
{ label: 'Закрыта', value: 'done' },
|
||||
],
|
||||
},
|
||||
],
|
||||
timestamps: true,
|
||||
}
|
||||
Reference in New Issue
Block a user