@gg-world/deals
Version:
Zod schemas and TypeScript types for deal-related data structures
177 lines (176 loc) • 6.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvestorSchema = exports.InvestorTutorialsSchema = exports.InvestorEnrichmentMetadataSchema = exports.InvestorDealsFileMetadataSchema = exports.InvestorLinkParsingErrorSchema = exports.InvestorLinkParsingResultSchema = exports.LinkTypeEnum = exports.InvestorFileMetadataSchema = exports.FileMetadataStatusSchema = exports.InvestorProfileSchema = exports.InvestmentSizeSchema = exports.InvestorCriteriaSchema = void 0;
const zod_1 = require("zod");
const deal_1 = require("./deal");
// Investor Profile
exports.InvestorCriteriaSchema = zod_1.z
.object({
business_model: zod_1.z.array(zod_1.z.string()).nullable(),
verticals: zod_1.z.array(zod_1.z.string()).nullable(),
focus_geography: zod_1.z.array(zod_1.z.string()).nullable(),
minorities: zod_1.z.array(zod_1.z.string()).nullable(),
rounds: zod_1.z.array(zod_1.z.string()).nullable(),
})
.nullable();
exports.InvestmentSizeSchema = zod_1.z
.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
})
.nullable();
exports.InvestorProfileSchema = zod_1.z
.object({
company: zod_1.z.string().nullable(),
fund_type: zod_1.z.string().nullable(),
fund_location: zod_1.z
.object({
fund_country: zod_1.z.string().nullable(),
fund_city: zod_1.z.string().nullable(),
})
.nullable(),
investment_focus: zod_1.z
.object({
investment_stage: zod_1.z.array(zod_1.z.string()).nullable(),
check_size: zod_1.z.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
}),
round_size: zod_1.z.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
}),
pre_money_valuation: zod_1.z.number().nullable(),
post_money_valuation: zod_1.z.number().nullable(),
})
.nullable(),
traction: zod_1.z
.object({
revenue: zod_1.z.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
}),
MRR: zod_1.z.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
}),
ARR: zod_1.z.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
}),
percent_growth: zod_1.z.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
}),
})
.nullable(),
focus_geography_sales: zod_1.z.array(zod_1.z.string()).nullable(),
business_model: zod_1.z.array(zod_1.z.string()).nullable(),
verticals: zod_1.z.array(zod_1.z.string()).nullable(),
minorities: zod_1.z.array(zod_1.z.string()).nullable(),
startup_headquarters: zod_1.z.array(zod_1.z.string()).nullable(),
team: zod_1.z
.object({
team_size: zod_1.z.object({
min: zod_1.z.number().nullable(),
max: zod_1.z.number().nullable(),
}),
skills_focus: zod_1.z.array(zod_1.z.string()).nullable(),
education_background: zod_1.z.array(zod_1.z.string()).nullable(),
})
.nullable(),
additional_details: zod_1.z.record(zod_1.z.any()).nullable(),
key_metrics: zod_1.z
.array(zod_1.z.object({
metric: zod_1.z.string(),
description: zod_1.z.string(),
weight: zod_1.z.number().default(1),
deal_breaker: zod_1.z.boolean().default(false), // Will lock the score to either 0 or 1—it either meets requirement or it doesn't
}))
.nullable(),
deal_questions: zod_1.z
.array(zod_1.z.object({
title: zod_1.z.string(),
description: zod_1.z.string(),
}))
.nullable(),
})
.nullable();
// Investor Enrichment Metadata
// Files
exports.FileMetadataStatusSchema = zod_1.z.enum([
"pending",
"in progress",
"completed",
"failed",
]);
exports.InvestorFileMetadataSchema = zod_1.z.object({
originalFileName: zod_1.z.string(),
fileName: zod_1.z.string(),
s3URL: zod_1.z.string().optional(),
uploadDate: zod_1.z.number(),
status: exports.FileMetadataStatusSchema,
processingError: zod_1.z.string().nullable(),
active: zod_1.z.boolean(),
});
exports.LinkTypeEnum = zod_1.z.enum([
"personal_linkedin",
"company_linkedin",
"youtube",
"google_drive",
"google_docs",
"docsend",
"other",
]);
exports.InvestorLinkParsingResultSchema = zod_1.z.object({
url: zod_1.z.string().url(),
status: deal_1.LinkStatusEnum,
type: exports.LinkTypeEnum,
parsed_at: zod_1.z.date().nullable(),
error_message: zod_1.z.string().nullable(),
retries: zod_1.z.number().default(0),
});
exports.InvestorLinkParsingErrorSchema = zod_1.z
.object({
name: zod_1.z.string().nullable(),
message: zod_1.z.string().nullable(),
})
.nullable();
// File Deal list
exports.InvestorDealsFileMetadataSchema = zod_1.z.object({
originalFileName: zod_1.z.string(),
fileName: zod_1.z.string(),
s3URL: zod_1.z.string(),
uploadDate: zod_1.z.number(),
status: exports.FileMetadataStatusSchema,
processingError: zod_1.z.string().nullable(),
active: zod_1.z.boolean(),
signature: zod_1.z.string(),
});
// Enrichment Metadata Summary
exports.InvestorEnrichmentMetadataSchema = zod_1.z.object({
bio: zod_1.z.string().nullable(),
files: zod_1.z.array(exports.InvestorFileMetadataSchema).nullable(),
links: zod_1.z
.object({
link_parsing_status: deal_1.LinkParsingStatusEnum,
link_parsing_error: exports.InvestorLinkParsingErrorSchema,
link_parsing_results: zod_1.z.array(exports.InvestorLinkParsingResultSchema),
})
.nullable(),
deals_csv: zod_1.z.array(exports.InvestorDealsFileMetadataSchema).nullable(),
});
exports.InvestorTutorialsSchema = zod_1.z.object({
metrics_and_questions_stage: zod_1.z.number().nullable(),
metrics_and_questions_stage_completed: zod_1.z.boolean().default(false).nullable(),
new_user_modal: zod_1.z.boolean().nullable(),
has_opened_tutorial_bot: zod_1.z.boolean().nullable(),
});
// Investor Document
exports.InvestorSchema = zod_1.z.object({
email: zod_1.z.string(),
investor_profile: exports.InvestorProfileSchema.nullable(),
enrichment_metadata: exports.InvestorEnrichmentMetadataSchema.nullable(),
settings: zod_1.z.object({}),
tutorials: exports.InvestorTutorialsSchema.nullable(),
});