feat: implement Project Management with Gantt Chart, Milestones, and CRM enhancements

This commit is contained in:
2026-03-01 00:26:59 +01:00
parent 4b5609a75e
commit 6444cf1e81
47 changed files with 15312 additions and 7373 deletions

View File

@@ -75,13 +75,28 @@ export interface Config {
"context-files": ContextFile;
"crm-accounts": CrmAccount;
"crm-contacts": CrmContact;
"crm-topics": CrmTopic;
"crm-interactions": CrmInteraction;
projects: Project;
"payload-kv": PayloadKv;
"payload-locked-documents": PayloadLockedDocument;
"payload-preferences": PayloadPreference;
"payload-migrations": PayloadMigration;
};
collectionsJoins: {};
collectionsJoins: {
"crm-accounts": {
topics: "crm-topics";
contacts: "crm-contacts";
interactions: "crm-interactions";
projects: "projects";
};
"crm-contacts": {
interactions: "crm-interactions";
};
"crm-topics": {
interactions: "crm-interactions";
};
};
collectionsSelect: {
users: UsersSelect<false> | UsersSelect<true>;
media: MediaSelect<false> | MediaSelect<true>;
@@ -91,9 +106,11 @@ export interface Config {
"context-files": ContextFilesSelect<false> | ContextFilesSelect<true>;
"crm-accounts": CrmAccountsSelect<false> | CrmAccountsSelect<true>;
"crm-contacts": CrmContactsSelect<false> | CrmContactsSelect<true>;
"crm-topics": CrmTopicsSelect<false> | CrmTopicsSelect<true>;
"crm-interactions":
| CrmInteractionsSelect<false>
| CrmInteractionsSelect<true>;
projects: ProjectsSelect<false> | ProjectsSelect<true>;
"payload-kv": PayloadKvSelect<false> | PayloadKvSelect<true>;
"payload-locked-documents":
| PayloadLockedDocumentsSelect<false>
@@ -262,6 +279,10 @@ export interface Post {
*/
export interface Inquiry {
id: number;
/**
* Has this inquiry been converted into a CRM Lead?
*/
processed?: boolean | null;
name: string;
email: string;
companyName?: string | null;
@@ -318,57 +339,138 @@ export interface ContextFile {
createdAt: string;
}
/**
* Accounts represent companies or organizations. They are the central hub linking Contacts and Interactions together. Use this to track the overall relationship status.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "crm-accounts".
*/
export interface CrmAccount {
id: number;
/**
* Enter the official name of the business or the research project name.
*/
name: string;
/**
* The website of the account, useful for AI analysis.
* The main website of the account. Required for triggering the AI Website Analysis.
*/
website?: string | null;
/**
* Change from Lead to Client upon conversion.
* Current lifecycle stage of this business relation.
*/
status?: ("lead" | "client" | "partner" | "lost") | null;
/**
* Indicates how likely this lead is to convert soon.
*/
status?: ("lead" | "client" | "lost") | null;
leadTemperature?: ("cold" | "warm" | "hot") | null;
/**
* The internal team member responsible for this account.
*/
assignedTo?: (number | null) | User;
/**
* PDFs and strategy documents generated by AI or attached manually.
* All generated PDF estimates and strategy documents appear here.
*/
reports?: (number | Media)[] | null;
/**
* Projects, deals, or specific topics active for this client.
*/
topics?: {
docs?: (number | CrmTopic)[];
hasNextPage?: boolean;
totalDocs?: number;
};
/**
* All contacts associated with this account.
*/
contacts?: {
docs?: (number | CrmContact)[];
hasNextPage?: boolean;
totalDocs?: number;
};
/**
* Timeline of all communication logged against this account.
*/
interactions?: {
docs?: (number | CrmInteraction)[];
hasNextPage?: boolean;
totalDocs?: number;
};
/**
* All high-level projects associated with this account.
*/
projects?: {
docs?: (number | Project)[];
hasNextPage?: boolean;
totalDocs?: number;
};
updatedAt: string;
createdAt: string;
}
/**
* Group your interactions (emails, calls, notes) into Topics. This helps you keep track of specific projects with a client.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "crm-contacts".
* via the `definition` "crm-topics".
*/
export interface CrmContact {
export interface CrmTopic {
id: number;
firstName: string;
lastName: string;
email: string;
phone?: string | null;
linkedIn?: string | null;
role?: string | null;
account?: (number | null) | CrmAccount;
title: string;
/**
* Which account does this topic belong to?
*/
account: number | CrmAccount;
status: "active" | "paused" | "won" | "lost";
/**
* Optional: What stage is this deal/project currently in?
*/
stage?: ("discovery" | "proposal" | "negotiation" | "implementation") | null;
/**
* Timeline of all emails and notes specifically related to this topic.
*/
interactions?: {
docs?: (number | CrmInteraction)[];
hasNextPage?: boolean;
totalDocs?: number;
};
updatedAt: string;
createdAt: string;
}
/**
* Your CRM journal. Log what happened, when, on which channel, and attach any relevant files. This is for summaries and facts — not for sending messages.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "crm-interactions".
*/
export interface CrmInteraction {
id: number;
type: "email" | "call" | "meeting" | "note";
/**
* Where did this communication take place?
*/
type:
| "email"
| "call"
| "meeting"
| "whatsapp"
| "social"
| "document"
| "note";
direction?: ("inbound" | "outbound") | null;
/**
* When did this happen?
*/
date: string;
subject: string;
/**
* Who was involved?
*/
contact?: (number | null) | CrmContact;
account?: (number | null) | CrmAccount;
subject: string;
/**
* Optional: Group this entry under a specific project or topic.
*/
topic?: (number | null) | CrmTopic;
/**
* Summarize what happened, what was decided, or what the next steps are.
*/
content?: {
root: {
type: string;
@@ -384,6 +486,110 @@ export interface CrmInteraction {
};
[k: string]: unknown;
} | null;
/**
* Attach received documents, screenshots, contracts, or any relevant files.
*/
attachments?: (number | Media)[] | null;
updatedAt: string;
createdAt: string;
}
/**
* Contacts are the individual people linked to an Account. A person should only be created once and can be assigned to a company here.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "crm-contacts".
*/
export interface CrmContact {
id: number;
fullName?: string | null;
firstName: string;
lastName: string;
/**
* Primary email address for communication tracking.
*/
email: string;
phone?: string | null;
linkedIn?: string | null;
/**
* e.g. CEO, Marketing Manager, Technical Lead
*/
role?: string | null;
/**
* Link this person to an organization from the Accounts collection.
*/
account?: (number | null) | CrmAccount;
/**
* Timeline of all communication logged directly with this person.
*/
interactions?: {
docs?: (number | CrmInteraction)[];
hasNextPage?: boolean;
totalDocs?: number;
};
updatedAt: string;
createdAt: string;
}
/**
* Manage high-level projects for your clients.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "projects".
*/
export interface Project {
id: number;
title: string;
/**
* Which account is this project for?
*/
account: number | CrmAccount;
/**
* Key contacts from the client side involved in this project.
*/
contact?: (number | CrmContact)[] | null;
status: "draft" | "in_progress" | "review" | "completed";
startDate?: string | null;
targetDate?: string | null;
valueMin?: number | null;
valueMax?: number | null;
/**
* Project briefing, requirements, or notes.
*/
briefing?: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ("ltr" | "rtl") | null;
format: "left" | "start" | "center" | "right" | "end" | "justify" | "";
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
/**
* Upload files, documents, or assets related to this project.
*/
attachments?: (number | Media)[] | null;
/**
* Granular deliverables or milestones within this project.
*/
milestones?:
| {
name: string;
status: "todo" | "in_progress" | "done";
priority?: ("low" | "medium" | "high") | null;
startDate?: string | null;
targetDate?: string | null;
/**
* Internal team member responsible for this milestone.
*/
assignee?: (number | null) | User;
id?: string | null;
}[]
| null;
updatedAt: string;
createdAt: string;
}
@@ -443,9 +649,17 @@ export interface PayloadLockedDocument {
relationTo: "crm-contacts";
value: number | CrmContact;
} | null)
| ({
relationTo: "crm-topics";
value: number | CrmTopic;
} | null)
| ({
relationTo: "crm-interactions";
value: number | CrmInteraction;
} | null)
| ({
relationTo: "projects";
value: number | Project;
} | null);
globalSlug?: string | null;
user: {
@@ -590,6 +804,7 @@ export interface PostsSelect<T extends boolean = true> {
* via the `definition` "inquiries_select".
*/
export interface InquiriesSelect<T extends boolean = true> {
processed?: T;
name?: T;
email?: T;
companyName?: T;
@@ -631,6 +846,10 @@ export interface CrmAccountsSelect<T extends boolean = true> {
leadTemperature?: T;
assignedTo?: T;
reports?: T;
topics?: T;
contacts?: T;
interactions?: T;
projects?: T;
updatedAt?: T;
createdAt?: T;
}
@@ -639,6 +858,7 @@ export interface CrmAccountsSelect<T extends boolean = true> {
* via the `definition` "crm-contacts_select".
*/
export interface CrmContactsSelect<T extends boolean = true> {
fullName?: T;
firstName?: T;
lastName?: T;
email?: T;
@@ -646,6 +866,20 @@ export interface CrmContactsSelect<T extends boolean = true> {
linkedIn?: T;
role?: T;
account?: T;
interactions?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "crm-topics_select".
*/
export interface CrmTopicsSelect<T extends boolean = true> {
title?: T;
account?: T;
status?: T;
stage?: T;
interactions?: T;
updatedAt?: T;
createdAt?: T;
}
@@ -657,10 +891,41 @@ export interface CrmInteractionsSelect<T extends boolean = true> {
type?: T;
direction?: T;
date?: T;
subject?: T;
contact?: T;
account?: T;
subject?: T;
topic?: T;
content?: T;
attachments?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "projects_select".
*/
export interface ProjectsSelect<T extends boolean = true> {
title?: T;
account?: T;
contact?: T;
status?: T;
startDate?: T;
targetDate?: T;
valueMin?: T;
valueMax?: T;
briefing?: T;
attachments?: T;
milestones?:
| T
| {
name?: T;
status?: T;
priority?: T;
startDate?: T;
targetDate?: T;
assignee?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
}