chore: clean up test scripts and sync payload CRM collections
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 11s
Build & Deploy / 🧪 QA (push) Failing after 23s
Build & Deploy / 🏗️ Build (push) Failing after 27s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 5s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 11s
Build & Deploy / 🧪 QA (push) Failing after 23s
Build & Deploy / 🏗️ Build (push) Failing after 27s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 5s
This commit is contained in:
79
apps/web/src/payload/collections/CrmContacts.ts
Normal file
79
apps/web/src/payload/collections/CrmContacts.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { CollectionConfig } from "payload";
|
||||
|
||||
export const CrmContacts: CollectionConfig = {
|
||||
slug: "crm-contacts",
|
||||
labels: {
|
||||
singular: "Contact",
|
||||
plural: "Contacts",
|
||||
},
|
||||
admin: {
|
||||
useAsTitle: "email", // Fallback, will define an afterRead hook or virtual field for a better title
|
||||
defaultColumns: ["firstName", "lastName", "email", "account"],
|
||||
group: "CRM",
|
||||
},
|
||||
access: {
|
||||
read: ({ req: { user } }) => Boolean(user),
|
||||
create: ({ req: { user } }) => Boolean(user),
|
||||
update: ({ req: { user } }) => Boolean(user),
|
||||
delete: ({ req: { user } }) => Boolean(user),
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
type: "row",
|
||||
fields: [
|
||||
{
|
||||
name: "firstName",
|
||||
type: "text",
|
||||
required: true,
|
||||
admin: {
|
||||
width: "50%",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "lastName",
|
||||
type: "text",
|
||||
required: true,
|
||||
admin: {
|
||||
width: "50%",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
type: "email",
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
{
|
||||
type: "row",
|
||||
fields: [
|
||||
{
|
||||
name: "phone",
|
||||
type: "text",
|
||||
admin: {
|
||||
width: "50%",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "linkedIn",
|
||||
type: "text",
|
||||
admin: {
|
||||
width: "50%",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "role",
|
||||
type: "text",
|
||||
label: "Job Title / Role",
|
||||
},
|
||||
{
|
||||
name: "account",
|
||||
type: "relationship",
|
||||
relationTo: "crm-accounts",
|
||||
label: "Company / Account",
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user