@gg-world/deals
Version:
Zod schemas and TypeScript types for deal-related data structures
388 lines (387 loc) • 15.5 kB
TypeScript
import { z } from "zod";
import { DealSchema } from "../schemas/deal";
export declare class Deal {
private data;
constructor(dealData: unknown);
static isDeal(data: unknown): data is z.infer<typeof DealSchema>;
toJSON(): {
status: "default" | "liked" | "disliked" | "deleted" | "email";
processing_status: "pending" | "completed" | "failed";
investor_email: string | null;
new: boolean;
stage: string | null;
tags: number[];
source: "email" | "file" | "upload";
profile: {
company_name: string;
short_description: string;
website: string | null;
founding_date: string | null;
startup_headquarters: string[];
incorporation: {
country: string | null;
state: string | null;
entity_type: string | null;
};
investment_stage: string | null;
round_size: number | null;
minimum_investment: number | null;
round_deadline: string | null;
round_progress: number | null;
lead_investor: string | null;
valuation: {
pre_money_valuation: number | null;
post_money_valuation: number | null;
};
previous_funding: {
total_raised: number | null;
last_round: {
type: string | null;
date: string | null;
amount: number | null;
};
};
focus_geography_sales: string[] | null;
business_model: string[];
verticals: string[];
unique_selling_points: string[];
challenges: string[];
team: {
team: {
team_size: number | null;
founder_names: string[];
minorities: string[] | null;
skills_focus: string | null;
};
founders: {
email: string | null;
name: string;
linkedin_url: string | null;
phone: string | null;
title: string | null;
notableExperiences: string[] | null;
background: string | null;
linkedin_profile: {
name: string;
id: string;
city: string;
country_code: string;
position: string;
about: string;
current_company: {
name: string;
title: string;
link: string;
};
experience: {
url: string;
duration: string;
title: string;
location: string;
company: string;
description: string;
}[];
education: {
title: string;
degree: string;
field: string;
start_year: string;
end_year: string;
}[];
certifications: {
title: string;
subtitle: string;
meta: string;
credential_url: string;
}[];
avatar: string;
followers: number;
connections: number;
profile_url: string;
};
}[];
};
investor_questions: {
question: string;
answer: string;
}[] | null;
videos: {
video_pitch: string | null;
demo_video: string | null;
};
pitch_deck: {
pitch_deck_link: string | null;
};
traction: {
revenue: {
type: "monthly" | "annual" | "total";
amount: number;
growth: number | null;
};
users: {
total: number | null;
active: number | null;
} | null;
key_metrics: Record<string, string> | null;
};
market: {
tam: number | null;
sam: number | null;
som: number | null;
};
additional_details: Record<string, any> | null;
};
created_at: Date;
notes: {
id: string;
content: string;
created_at: Date;
author: string;
author_email: string;
}[];
enrichment_metadata: {
events: {
id: string;
last_enrichment_date: Date | null;
raw_input: {
text: string;
attachments: {
file_url: string;
filename: string;
uploaded_at: Date;
}[];
received_at: Date;
};
source_data: Record<string, {
raw_data: {
content: string;
metadata?: any;
};
processed_at: Date;
source_type: "personal_linkedin" | "company_linkedin" | "youtube" | "docsend" | "google_drive" | "onedrive" | "google_docs" | "dropbox" | "vimeo" | "funden" | "pitch" | "canva" | "calameo" | "maildoc" | "figma" | "brieflink" | "other" | "file";
}>;
processing_status: {
link_parsing_status: "pending" | "completed";
raw_input_parsing_status: "pending" | "completed";
link_parsing_results: {
type: "personal_linkedin" | "company_linkedin" | "youtube" | "docsend" | "google_drive" | "onedrive" | "google_docs" | "dropbox" | "vimeo" | "funden" | "pitch" | "canva" | "calameo" | "maildoc" | "figma" | "brieflink" | "other" | "file";
status: "parsing_pending" | "parsed_success" | "parsing_failed";
url: string;
parsed_at: Date | null;
error_message: string | null;
retries: number;
}[];
attachment_parsing_results: {
type: "personal_linkedin" | "company_linkedin" | "youtube" | "docsend" | "google_drive" | "onedrive" | "google_docs" | "dropbox" | "vimeo" | "funden" | "pitch" | "canva" | "calameo" | "maildoc" | "figma" | "brieflink" | "other" | "file";
status: "parsing_pending" | "parsed_success" | "parsing_failed";
url: string;
parsed_at: Date | null;
error_message: string | null;
retries: number;
}[];
};
}[];
};
scoring: {
score: number;
factors: {
factor: string;
explanation: string;
weight: number;
deal_breaker: boolean;
impact?: number | undefined;
}[];
};
updated_at: Date | null;
};
get deal(): {
status: "default" | "liked" | "disliked" | "deleted" | "email";
processing_status: "pending" | "completed" | "failed";
investor_email: string | null;
new: boolean;
stage: string | null;
tags: number[];
source: "email" | "file" | "upload";
profile: {
company_name: string;
short_description: string;
website: string | null;
founding_date: string | null;
startup_headquarters: string[];
incorporation: {
country: string | null;
state: string | null;
entity_type: string | null;
};
investment_stage: string | null;
round_size: number | null;
minimum_investment: number | null;
round_deadline: string | null;
round_progress: number | null;
lead_investor: string | null;
valuation: {
pre_money_valuation: number | null;
post_money_valuation: number | null;
};
previous_funding: {
total_raised: number | null;
last_round: {
type: string | null;
date: string | null;
amount: number | null;
};
};
focus_geography_sales: string[] | null;
business_model: string[];
verticals: string[];
unique_selling_points: string[];
challenges: string[];
team: {
team: {
team_size: number | null;
founder_names: string[];
minorities: string[] | null;
skills_focus: string | null;
};
founders: {
email: string | null;
name: string;
linkedin_url: string | null;
phone: string | null;
title: string | null;
notableExperiences: string[] | null;
background: string | null;
linkedin_profile: {
name: string;
id: string;
city: string;
country_code: string;
position: string;
about: string;
current_company: {
name: string;
title: string;
link: string;
};
experience: {
url: string;
duration: string;
title: string;
location: string;
company: string;
description: string;
}[];
education: {
title: string;
degree: string;
field: string;
start_year: string;
end_year: string;
}[];
certifications: {
title: string;
subtitle: string;
meta: string;
credential_url: string;
}[];
avatar: string;
followers: number;
connections: number;
profile_url: string;
};
}[];
};
investor_questions: {
question: string;
answer: string;
}[] | null;
videos: {
video_pitch: string | null;
demo_video: string | null;
};
pitch_deck: {
pitch_deck_link: string | null;
};
traction: {
revenue: {
type: "monthly" | "annual" | "total";
amount: number;
growth: number | null;
};
users: {
total: number | null;
active: number | null;
} | null;
key_metrics: Record<string, string> | null;
};
market: {
tam: number | null;
sam: number | null;
som: number | null;
};
additional_details: Record<string, any> | null;
};
created_at: Date;
notes: {
id: string;
content: string;
created_at: Date;
author: string;
author_email: string;
}[];
enrichment_metadata: {
events: {
id: string;
last_enrichment_date: Date | null;
raw_input: {
text: string;
attachments: {
file_url: string;
filename: string;
uploaded_at: Date;
}[];
received_at: Date;
};
source_data: Record<string, {
raw_data: {
content: string;
metadata?: any;
};
processed_at: Date;
source_type: "personal_linkedin" | "company_linkedin" | "youtube" | "docsend" | "google_drive" | "onedrive" | "google_docs" | "dropbox" | "vimeo" | "funden" | "pitch" | "canva" | "calameo" | "maildoc" | "figma" | "brieflink" | "other" | "file";
}>;
processing_status: {
link_parsing_status: "pending" | "completed";
raw_input_parsing_status: "pending" | "completed";
link_parsing_results: {
type: "personal_linkedin" | "company_linkedin" | "youtube" | "docsend" | "google_drive" | "onedrive" | "google_docs" | "dropbox" | "vimeo" | "funden" | "pitch" | "canva" | "calameo" | "maildoc" | "figma" | "brieflink" | "other" | "file";
status: "parsing_pending" | "parsed_success" | "parsing_failed";
url: string;
parsed_at: Date | null;
error_message: string | null;
retries: number;
}[];
attachment_parsing_results: {
type: "personal_linkedin" | "company_linkedin" | "youtube" | "docsend" | "google_drive" | "onedrive" | "google_docs" | "dropbox" | "vimeo" | "funden" | "pitch" | "canva" | "calameo" | "maildoc" | "figma" | "brieflink" | "other" | "file";
status: "parsing_pending" | "parsed_success" | "parsing_failed";
url: string;
parsed_at: Date | null;
error_message: string | null;
retries: number;
}[];
};
}[];
};
scoring: {
score: number;
factors: {
factor: string;
explanation: string;
weight: number;
deal_breaker: boolean;
impact?: number | undefined;
}[];
};
updated_at: Date | null;
};
}