@claritylabs/cl-sdk 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -4
- package/dist/index.d.mts +179 -168
- package/dist/index.d.ts +179 -168
- package/dist/index.js +1118 -980
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1117 -980
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -234,6 +234,7 @@ __export(index_exports, {
|
|
|
234
234
|
safeGenerateObject: () => safeGenerateObject,
|
|
235
235
|
sanitizeNulls: () => sanitizeNulls,
|
|
236
236
|
stripFences: () => stripFences,
|
|
237
|
+
toStrictSchema: () => toStrictSchema,
|
|
237
238
|
withRetry: () => withRetry
|
|
238
239
|
});
|
|
239
240
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -317,14 +318,70 @@ function sanitizeNulls(obj) {
|
|
|
317
318
|
return obj;
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
// src/core/strict-schema.ts
|
|
322
|
+
var import_zod = require("zod");
|
|
323
|
+
function toStrictSchema(schema) {
|
|
324
|
+
const def = schema._zod?.def;
|
|
325
|
+
const typeName = def?.type ?? schema.type;
|
|
326
|
+
if (typeName === "object") {
|
|
327
|
+
const shape = schema.shape;
|
|
328
|
+
if (!shape) return schema;
|
|
329
|
+
const newShape = {};
|
|
330
|
+
for (const [key, value] of Object.entries(shape)) {
|
|
331
|
+
const field = value;
|
|
332
|
+
const fieldDef = field._zod?.def;
|
|
333
|
+
const fieldType = fieldDef?.type ?? field.type;
|
|
334
|
+
if (fieldType === "optional") {
|
|
335
|
+
const innerType = fieldDef?.innerType;
|
|
336
|
+
const description = field.description ?? fieldDef?.description ?? field._zod?.def?.description;
|
|
337
|
+
if (innerType) {
|
|
338
|
+
const transformed = toStrictSchema(innerType);
|
|
339
|
+
let nullable = import_zod.z.nullable(transformed);
|
|
340
|
+
if (description) nullable = nullable.describe(description);
|
|
341
|
+
newShape[key] = nullable;
|
|
342
|
+
} else {
|
|
343
|
+
let nullable = import_zod.z.nullable(field);
|
|
344
|
+
if (description) nullable = nullable.describe(description);
|
|
345
|
+
newShape[key] = nullable;
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
newShape[key] = toStrictSchema(field);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const objDesc = schema.description ?? def?.description ?? schema._zod?.def?.description;
|
|
352
|
+
const result = import_zod.z.object(newShape);
|
|
353
|
+
return objDesc ? result.describe(objDesc) : result;
|
|
354
|
+
}
|
|
355
|
+
if (typeName === "array") {
|
|
356
|
+
const element = def?.element ?? schema.element;
|
|
357
|
+
if (element) {
|
|
358
|
+
const arrDesc = schema.description ?? def?.description ?? schema._zod?.def?.description;
|
|
359
|
+
const result = import_zod.z.array(toStrictSchema(element));
|
|
360
|
+
return arrDesc ? result.describe(arrDesc) : result;
|
|
361
|
+
}
|
|
362
|
+
return schema;
|
|
363
|
+
}
|
|
364
|
+
if (typeName === "nullable") {
|
|
365
|
+
const innerType = def?.innerType;
|
|
366
|
+
if (innerType) {
|
|
367
|
+
const nullDesc = schema.description ?? def?.description ?? schema._zod?.def?.description;
|
|
368
|
+
const result = import_zod.z.nullable(toStrictSchema(innerType));
|
|
369
|
+
return nullDesc ? result.describe(nullDesc) : result;
|
|
370
|
+
}
|
|
371
|
+
return schema;
|
|
372
|
+
}
|
|
373
|
+
return schema;
|
|
374
|
+
}
|
|
375
|
+
|
|
320
376
|
// src/core/safe-generate.ts
|
|
321
377
|
async function safeGenerateObject(generateObject, params, options) {
|
|
322
378
|
const maxRetries = options?.maxRetries ?? 1;
|
|
323
379
|
let lastError;
|
|
380
|
+
const strictParams = { ...params, schema: toStrictSchema(params.schema) };
|
|
324
381
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
325
382
|
try {
|
|
326
383
|
const result = await withRetry(
|
|
327
|
-
() => generateObject(
|
|
384
|
+
() => generateObject(strictParams),
|
|
328
385
|
options?.log
|
|
329
386
|
);
|
|
330
387
|
return result;
|
|
@@ -381,8 +438,8 @@ function createPipelineContext(opts) {
|
|
|
381
438
|
}
|
|
382
439
|
|
|
383
440
|
// src/schemas/enums.ts
|
|
384
|
-
var
|
|
385
|
-
var PolicyTypeSchema =
|
|
441
|
+
var import_zod2 = require("zod");
|
|
442
|
+
var PolicyTypeSchema = import_zod2.z.enum([
|
|
386
443
|
// Commercial lines
|
|
387
444
|
"general_liability",
|
|
388
445
|
"commercial_property",
|
|
@@ -429,7 +486,7 @@ var PolicyTypeSchema = import_zod.z.enum([
|
|
|
429
486
|
"other"
|
|
430
487
|
]);
|
|
431
488
|
var POLICY_TYPES = PolicyTypeSchema.options;
|
|
432
|
-
var EndorsementTypeSchema =
|
|
489
|
+
var EndorsementTypeSchema = import_zod2.z.enum([
|
|
433
490
|
"additional_insured",
|
|
434
491
|
"waiver_of_subrogation",
|
|
435
492
|
"primary_noncontributory",
|
|
@@ -450,7 +507,7 @@ var EndorsementTypeSchema = import_zod.z.enum([
|
|
|
450
507
|
"other"
|
|
451
508
|
]);
|
|
452
509
|
var ENDORSEMENT_TYPES = EndorsementTypeSchema.options;
|
|
453
|
-
var ConditionTypeSchema =
|
|
510
|
+
var ConditionTypeSchema = import_zod2.z.enum([
|
|
454
511
|
"duties_after_loss",
|
|
455
512
|
"notice_requirements",
|
|
456
513
|
"other_insurance",
|
|
@@ -470,7 +527,7 @@ var ConditionTypeSchema = import_zod.z.enum([
|
|
|
470
527
|
"other"
|
|
471
528
|
]);
|
|
472
529
|
var CONDITION_TYPES = ConditionTypeSchema.options;
|
|
473
|
-
var PolicySectionTypeSchema =
|
|
530
|
+
var PolicySectionTypeSchema = import_zod2.z.enum([
|
|
474
531
|
"declarations",
|
|
475
532
|
"insuring_agreement",
|
|
476
533
|
"policy_form",
|
|
@@ -485,7 +542,7 @@ var PolicySectionTypeSchema = import_zod.z.enum([
|
|
|
485
542
|
"other"
|
|
486
543
|
]);
|
|
487
544
|
var POLICY_SECTION_TYPES = PolicySectionTypeSchema.options;
|
|
488
|
-
var QuoteSectionTypeSchema =
|
|
545
|
+
var QuoteSectionTypeSchema = import_zod2.z.enum([
|
|
489
546
|
"terms_summary",
|
|
490
547
|
"premium_indication",
|
|
491
548
|
"underwriting_condition",
|
|
@@ -495,13 +552,13 @@ var QuoteSectionTypeSchema = import_zod.z.enum([
|
|
|
495
552
|
"other"
|
|
496
553
|
]);
|
|
497
554
|
var QUOTE_SECTION_TYPES = QuoteSectionTypeSchema.options;
|
|
498
|
-
var CoverageFormSchema =
|
|
555
|
+
var CoverageFormSchema = import_zod2.z.enum(["occurrence", "claims_made", "accident"]);
|
|
499
556
|
var COVERAGE_FORMS = CoverageFormSchema.options;
|
|
500
|
-
var PolicyTermTypeSchema =
|
|
557
|
+
var PolicyTermTypeSchema = import_zod2.z.enum(["fixed", "continuous"]);
|
|
501
558
|
var POLICY_TERM_TYPES = PolicyTermTypeSchema.options;
|
|
502
|
-
var CoverageTriggerSchema =
|
|
559
|
+
var CoverageTriggerSchema = import_zod2.z.enum(["occurrence", "claims_made", "accident"]);
|
|
503
560
|
var COVERAGE_TRIGGERS = CoverageTriggerSchema.options;
|
|
504
|
-
var LimitTypeSchema =
|
|
561
|
+
var LimitTypeSchema = import_zod2.z.enum([
|
|
505
562
|
"per_occurrence",
|
|
506
563
|
"per_claim",
|
|
507
564
|
"aggregate",
|
|
@@ -512,7 +569,7 @@ var LimitTypeSchema = import_zod.z.enum([
|
|
|
512
569
|
"scheduled"
|
|
513
570
|
]);
|
|
514
571
|
var LIMIT_TYPES = LimitTypeSchema.options;
|
|
515
|
-
var DeductibleTypeSchema =
|
|
572
|
+
var DeductibleTypeSchema = import_zod2.z.enum([
|
|
516
573
|
"per_occurrence",
|
|
517
574
|
"per_claim",
|
|
518
575
|
"aggregate",
|
|
@@ -520,16 +577,16 @@ var DeductibleTypeSchema = import_zod.z.enum([
|
|
|
520
577
|
"waiting_period"
|
|
521
578
|
]);
|
|
522
579
|
var DEDUCTIBLE_TYPES = DeductibleTypeSchema.options;
|
|
523
|
-
var ValuationMethodSchema =
|
|
580
|
+
var ValuationMethodSchema = import_zod2.z.enum([
|
|
524
581
|
"replacement_cost",
|
|
525
582
|
"actual_cash_value",
|
|
526
583
|
"agreed_value",
|
|
527
584
|
"functional_replacement"
|
|
528
585
|
]);
|
|
529
586
|
var VALUATION_METHODS = ValuationMethodSchema.options;
|
|
530
|
-
var DefenseCostTreatmentSchema =
|
|
587
|
+
var DefenseCostTreatmentSchema = import_zod2.z.enum(["inside_limits", "outside_limits", "supplementary"]);
|
|
531
588
|
var DEFENSE_COST_TREATMENTS = DefenseCostTreatmentSchema.options;
|
|
532
|
-
var EntityTypeSchema =
|
|
589
|
+
var EntityTypeSchema = import_zod2.z.enum([
|
|
533
590
|
"corporation",
|
|
534
591
|
"llc",
|
|
535
592
|
"partnership",
|
|
@@ -543,9 +600,9 @@ var EntityTypeSchema = import_zod.z.enum([
|
|
|
543
600
|
"other"
|
|
544
601
|
]);
|
|
545
602
|
var ENTITY_TYPES = EntityTypeSchema.options;
|
|
546
|
-
var AdmittedStatusSchema =
|
|
603
|
+
var AdmittedStatusSchema = import_zod2.z.enum(["admitted", "non_admitted", "surplus_lines"]);
|
|
547
604
|
var ADMITTED_STATUSES = AdmittedStatusSchema.options;
|
|
548
|
-
var AuditTypeSchema =
|
|
605
|
+
var AuditTypeSchema = import_zod2.z.enum([
|
|
549
606
|
"annual",
|
|
550
607
|
"semi_annual",
|
|
551
608
|
"quarterly",
|
|
@@ -555,7 +612,7 @@ var AuditTypeSchema = import_zod.z.enum([
|
|
|
555
612
|
"none"
|
|
556
613
|
]);
|
|
557
614
|
var AUDIT_TYPES = AuditTypeSchema.options;
|
|
558
|
-
var EndorsementPartyRoleSchema =
|
|
615
|
+
var EndorsementPartyRoleSchema = import_zod2.z.enum([
|
|
559
616
|
"additional_insured",
|
|
560
617
|
"loss_payee",
|
|
561
618
|
"mortgage_holder",
|
|
@@ -564,13 +621,13 @@ var EndorsementPartyRoleSchema = import_zod.z.enum([
|
|
|
564
621
|
"other"
|
|
565
622
|
]);
|
|
566
623
|
var ENDORSEMENT_PARTY_ROLES = EndorsementPartyRoleSchema.options;
|
|
567
|
-
var ClaimStatusSchema =
|
|
624
|
+
var ClaimStatusSchema = import_zod2.z.enum(["open", "closed", "reopened"]);
|
|
568
625
|
var CLAIM_STATUSES = ClaimStatusSchema.options;
|
|
569
|
-
var SubjectivityCategorySchema =
|
|
626
|
+
var SubjectivityCategorySchema = import_zod2.z.enum(["pre_binding", "post_binding", "information"]);
|
|
570
627
|
var SUBJECTIVITY_CATEGORIES = SubjectivityCategorySchema.options;
|
|
571
|
-
var DocumentTypeSchema =
|
|
628
|
+
var DocumentTypeSchema = import_zod2.z.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
|
|
572
629
|
var DOCUMENT_TYPES = DocumentTypeSchema.options;
|
|
573
|
-
var ChunkTypeSchema =
|
|
630
|
+
var ChunkTypeSchema = import_zod2.z.enum([
|
|
574
631
|
"declarations",
|
|
575
632
|
"coverage_form",
|
|
576
633
|
"endorsement",
|
|
@@ -579,7 +636,7 @@ var ChunkTypeSchema = import_zod.z.enum([
|
|
|
579
636
|
"mixed"
|
|
580
637
|
]);
|
|
581
638
|
var CHUNK_TYPES = ChunkTypeSchema.options;
|
|
582
|
-
var RatingBasisTypeSchema =
|
|
639
|
+
var RatingBasisTypeSchema = import_zod2.z.enum([
|
|
583
640
|
"payroll",
|
|
584
641
|
"revenue",
|
|
585
642
|
"area",
|
|
@@ -593,7 +650,7 @@ var RatingBasisTypeSchema = import_zod.z.enum([
|
|
|
593
650
|
"other"
|
|
594
651
|
]);
|
|
595
652
|
var RATING_BASIS_TYPES = RatingBasisTypeSchema.options;
|
|
596
|
-
var VehicleCoverageTypeSchema =
|
|
653
|
+
var VehicleCoverageTypeSchema = import_zod2.z.enum([
|
|
597
654
|
"liability",
|
|
598
655
|
"collision",
|
|
599
656
|
"comprehensive",
|
|
@@ -606,32 +663,32 @@ var VehicleCoverageTypeSchema = import_zod.z.enum([
|
|
|
606
663
|
"physical_damage"
|
|
607
664
|
]);
|
|
608
665
|
var VEHICLE_COVERAGE_TYPES = VehicleCoverageTypeSchema.options;
|
|
609
|
-
var HomeownersFormTypeSchema =
|
|
666
|
+
var HomeownersFormTypeSchema = import_zod2.z.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
|
|
610
667
|
var HOMEOWNERS_FORM_TYPES = HomeownersFormTypeSchema.options;
|
|
611
|
-
var DwellingFireFormTypeSchema =
|
|
668
|
+
var DwellingFireFormTypeSchema = import_zod2.z.enum(["DP-1", "DP-2", "DP-3"]);
|
|
612
669
|
var DWELLING_FIRE_FORM_TYPES = DwellingFireFormTypeSchema.options;
|
|
613
|
-
var FloodZoneSchema =
|
|
670
|
+
var FloodZoneSchema = import_zod2.z.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
|
|
614
671
|
var FLOOD_ZONES = FloodZoneSchema.options;
|
|
615
|
-
var ConstructionTypeSchema =
|
|
672
|
+
var ConstructionTypeSchema = import_zod2.z.enum(["frame", "masonry", "superior", "mixed", "other"]);
|
|
616
673
|
var CONSTRUCTION_TYPES = ConstructionTypeSchema.options;
|
|
617
|
-
var RoofTypeSchema =
|
|
674
|
+
var RoofTypeSchema = import_zod2.z.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
|
|
618
675
|
var ROOF_TYPES = RoofTypeSchema.options;
|
|
619
|
-
var FoundationTypeSchema =
|
|
676
|
+
var FoundationTypeSchema = import_zod2.z.enum(["basement", "crawl_space", "slab", "pier", "other"]);
|
|
620
677
|
var FOUNDATION_TYPES = FoundationTypeSchema.options;
|
|
621
|
-
var PersonalAutoUsageSchema =
|
|
678
|
+
var PersonalAutoUsageSchema = import_zod2.z.enum(["pleasure", "commute", "business", "farm"]);
|
|
622
679
|
var PERSONAL_AUTO_USAGES = PersonalAutoUsageSchema.options;
|
|
623
|
-
var LossSettlementSchema =
|
|
680
|
+
var LossSettlementSchema = import_zod2.z.enum([
|
|
624
681
|
"replacement_cost",
|
|
625
682
|
"actual_cash_value",
|
|
626
683
|
"extended_replacement_cost",
|
|
627
684
|
"guaranteed_replacement_cost"
|
|
628
685
|
]);
|
|
629
686
|
var LOSS_SETTLEMENTS = LossSettlementSchema.options;
|
|
630
|
-
var BoatTypeSchema =
|
|
687
|
+
var BoatTypeSchema = import_zod2.z.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
|
|
631
688
|
var BOAT_TYPES = BoatTypeSchema.options;
|
|
632
|
-
var RVTypeSchema =
|
|
689
|
+
var RVTypeSchema = import_zod2.z.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
|
|
633
690
|
var RV_TYPES = RVTypeSchema.options;
|
|
634
|
-
var ScheduledItemCategorySchema =
|
|
691
|
+
var ScheduledItemCategorySchema = import_zod2.z.enum([
|
|
635
692
|
"jewelry",
|
|
636
693
|
"fine_art",
|
|
637
694
|
"musical_instruments",
|
|
@@ -644,691 +701,691 @@ var ScheduledItemCategorySchema = import_zod.z.enum([
|
|
|
644
701
|
"other"
|
|
645
702
|
]);
|
|
646
703
|
var SCHEDULED_ITEM_CATEGORIES = ScheduledItemCategorySchema.options;
|
|
647
|
-
var TitlePolicyTypeSchema =
|
|
704
|
+
var TitlePolicyTypeSchema = import_zod2.z.enum(["owners", "lenders"]);
|
|
648
705
|
var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
|
|
649
|
-
var PetSpeciesSchema =
|
|
706
|
+
var PetSpeciesSchema = import_zod2.z.enum(["dog", "cat", "other"]);
|
|
650
707
|
var PET_SPECIES = PetSpeciesSchema.options;
|
|
651
708
|
|
|
652
709
|
// src/schemas/shared.ts
|
|
653
|
-
var
|
|
654
|
-
var AddressSchema =
|
|
655
|
-
street1:
|
|
656
|
-
street2:
|
|
657
|
-
city:
|
|
658
|
-
state:
|
|
659
|
-
zip:
|
|
660
|
-
country:
|
|
710
|
+
var import_zod3 = require("zod");
|
|
711
|
+
var AddressSchema = import_zod3.z.object({
|
|
712
|
+
street1: import_zod3.z.string(),
|
|
713
|
+
street2: import_zod3.z.string().optional(),
|
|
714
|
+
city: import_zod3.z.string(),
|
|
715
|
+
state: import_zod3.z.string(),
|
|
716
|
+
zip: import_zod3.z.string(),
|
|
717
|
+
country: import_zod3.z.string().optional()
|
|
661
718
|
});
|
|
662
|
-
var ContactSchema =
|
|
663
|
-
name:
|
|
664
|
-
title:
|
|
665
|
-
type:
|
|
666
|
-
phone:
|
|
667
|
-
fax:
|
|
668
|
-
email:
|
|
719
|
+
var ContactSchema = import_zod3.z.object({
|
|
720
|
+
name: import_zod3.z.string().optional(),
|
|
721
|
+
title: import_zod3.z.string().optional(),
|
|
722
|
+
type: import_zod3.z.string().optional(),
|
|
723
|
+
phone: import_zod3.z.string().optional(),
|
|
724
|
+
fax: import_zod3.z.string().optional(),
|
|
725
|
+
email: import_zod3.z.string().optional(),
|
|
669
726
|
address: AddressSchema.optional(),
|
|
670
|
-
hours:
|
|
727
|
+
hours: import_zod3.z.string().optional()
|
|
671
728
|
});
|
|
672
|
-
var FormReferenceSchema =
|
|
673
|
-
formNumber:
|
|
674
|
-
editionDate:
|
|
675
|
-
title:
|
|
676
|
-
formType:
|
|
729
|
+
var FormReferenceSchema = import_zod3.z.object({
|
|
730
|
+
formNumber: import_zod3.z.string(),
|
|
731
|
+
editionDate: import_zod3.z.string().optional(),
|
|
732
|
+
title: import_zod3.z.string().optional(),
|
|
733
|
+
formType: import_zod3.z.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"])
|
|
677
734
|
});
|
|
678
|
-
var TaxFeeItemSchema =
|
|
679
|
-
name:
|
|
680
|
-
amount:
|
|
681
|
-
type:
|
|
682
|
-
description:
|
|
735
|
+
var TaxFeeItemSchema = import_zod3.z.object({
|
|
736
|
+
name: import_zod3.z.string(),
|
|
737
|
+
amount: import_zod3.z.string(),
|
|
738
|
+
type: import_zod3.z.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
|
|
739
|
+
description: import_zod3.z.string().optional()
|
|
683
740
|
});
|
|
684
|
-
var RatingBasisSchema =
|
|
741
|
+
var RatingBasisSchema = import_zod3.z.object({
|
|
685
742
|
type: RatingBasisTypeSchema,
|
|
686
|
-
amount:
|
|
687
|
-
description:
|
|
743
|
+
amount: import_zod3.z.string().optional(),
|
|
744
|
+
description: import_zod3.z.string().optional()
|
|
688
745
|
});
|
|
689
|
-
var SublimitSchema =
|
|
690
|
-
name:
|
|
691
|
-
limit:
|
|
692
|
-
appliesTo:
|
|
693
|
-
deductible:
|
|
746
|
+
var SublimitSchema = import_zod3.z.object({
|
|
747
|
+
name: import_zod3.z.string(),
|
|
748
|
+
limit: import_zod3.z.string(),
|
|
749
|
+
appliesTo: import_zod3.z.string().optional(),
|
|
750
|
+
deductible: import_zod3.z.string().optional()
|
|
694
751
|
});
|
|
695
|
-
var SharedLimitSchema =
|
|
696
|
-
description:
|
|
697
|
-
limit:
|
|
698
|
-
coverageParts:
|
|
752
|
+
var SharedLimitSchema = import_zod3.z.object({
|
|
753
|
+
description: import_zod3.z.string(),
|
|
754
|
+
limit: import_zod3.z.string(),
|
|
755
|
+
coverageParts: import_zod3.z.array(import_zod3.z.string())
|
|
699
756
|
});
|
|
700
|
-
var ExtendedReportingPeriodSchema =
|
|
701
|
-
basicDays:
|
|
702
|
-
supplementalYears:
|
|
703
|
-
supplementalPremium:
|
|
757
|
+
var ExtendedReportingPeriodSchema = import_zod3.z.object({
|
|
758
|
+
basicDays: import_zod3.z.number().optional(),
|
|
759
|
+
supplementalYears: import_zod3.z.number().optional(),
|
|
760
|
+
supplementalPremium: import_zod3.z.string().optional()
|
|
704
761
|
});
|
|
705
|
-
var NamedInsuredSchema =
|
|
706
|
-
name:
|
|
707
|
-
relationship:
|
|
762
|
+
var NamedInsuredSchema = import_zod3.z.object({
|
|
763
|
+
name: import_zod3.z.string(),
|
|
764
|
+
relationship: import_zod3.z.string().optional(),
|
|
708
765
|
address: AddressSchema.optional()
|
|
709
766
|
});
|
|
710
767
|
|
|
711
768
|
// src/schemas/coverage.ts
|
|
712
|
-
var
|
|
713
|
-
var CoverageSchema =
|
|
714
|
-
name:
|
|
715
|
-
limit:
|
|
716
|
-
deductible:
|
|
717
|
-
pageNumber:
|
|
718
|
-
sectionRef:
|
|
769
|
+
var import_zod4 = require("zod");
|
|
770
|
+
var CoverageSchema = import_zod4.z.object({
|
|
771
|
+
name: import_zod4.z.string(),
|
|
772
|
+
limit: import_zod4.z.string(),
|
|
773
|
+
deductible: import_zod4.z.string().optional(),
|
|
774
|
+
pageNumber: import_zod4.z.number().optional(),
|
|
775
|
+
sectionRef: import_zod4.z.string().optional()
|
|
719
776
|
});
|
|
720
|
-
var EnrichedCoverageSchema =
|
|
721
|
-
name:
|
|
722
|
-
coverageCode:
|
|
723
|
-
formNumber:
|
|
724
|
-
formEditionDate:
|
|
725
|
-
limit:
|
|
777
|
+
var EnrichedCoverageSchema = import_zod4.z.object({
|
|
778
|
+
name: import_zod4.z.string(),
|
|
779
|
+
coverageCode: import_zod4.z.string().optional(),
|
|
780
|
+
formNumber: import_zod4.z.string().optional(),
|
|
781
|
+
formEditionDate: import_zod4.z.string().optional(),
|
|
782
|
+
limit: import_zod4.z.string(),
|
|
726
783
|
limitType: LimitTypeSchema.optional(),
|
|
727
|
-
deductible:
|
|
784
|
+
deductible: import_zod4.z.string().optional(),
|
|
728
785
|
deductibleType: DeductibleTypeSchema.optional(),
|
|
729
|
-
sir:
|
|
730
|
-
sublimit:
|
|
731
|
-
coinsurance:
|
|
786
|
+
sir: import_zod4.z.string().optional(),
|
|
787
|
+
sublimit: import_zod4.z.string().optional(),
|
|
788
|
+
coinsurance: import_zod4.z.string().optional(),
|
|
732
789
|
valuation: ValuationMethodSchema.optional(),
|
|
733
|
-
territory:
|
|
790
|
+
territory: import_zod4.z.string().optional(),
|
|
734
791
|
trigger: CoverageTriggerSchema.optional(),
|
|
735
|
-
retroactiveDate:
|
|
736
|
-
included:
|
|
737
|
-
premium:
|
|
738
|
-
pageNumber:
|
|
739
|
-
sectionRef:
|
|
792
|
+
retroactiveDate: import_zod4.z.string().optional(),
|
|
793
|
+
included: import_zod4.z.boolean(),
|
|
794
|
+
premium: import_zod4.z.string().optional(),
|
|
795
|
+
pageNumber: import_zod4.z.number().optional(),
|
|
796
|
+
sectionRef: import_zod4.z.string().optional()
|
|
740
797
|
});
|
|
741
798
|
|
|
742
799
|
// src/schemas/endorsement.ts
|
|
743
|
-
var
|
|
744
|
-
var EndorsementPartySchema =
|
|
745
|
-
name:
|
|
800
|
+
var import_zod5 = require("zod");
|
|
801
|
+
var EndorsementPartySchema = import_zod5.z.object({
|
|
802
|
+
name: import_zod5.z.string(),
|
|
746
803
|
role: EndorsementPartyRoleSchema,
|
|
747
804
|
address: AddressSchema.optional(),
|
|
748
|
-
relationship:
|
|
749
|
-
scope:
|
|
805
|
+
relationship: import_zod5.z.string().optional(),
|
|
806
|
+
scope: import_zod5.z.string().optional()
|
|
750
807
|
});
|
|
751
|
-
var EndorsementSchema =
|
|
752
|
-
formNumber:
|
|
753
|
-
editionDate:
|
|
754
|
-
title:
|
|
808
|
+
var EndorsementSchema = import_zod5.z.object({
|
|
809
|
+
formNumber: import_zod5.z.string(),
|
|
810
|
+
editionDate: import_zod5.z.string().optional(),
|
|
811
|
+
title: import_zod5.z.string(),
|
|
755
812
|
endorsementType: EndorsementTypeSchema,
|
|
756
|
-
effectiveDate:
|
|
757
|
-
affectedCoverageParts:
|
|
758
|
-
namedParties:
|
|
759
|
-
keyTerms:
|
|
760
|
-
premiumImpact:
|
|
761
|
-
content:
|
|
762
|
-
pageStart:
|
|
763
|
-
pageEnd:
|
|
813
|
+
effectiveDate: import_zod5.z.string().optional(),
|
|
814
|
+
affectedCoverageParts: import_zod5.z.array(import_zod5.z.string()).optional(),
|
|
815
|
+
namedParties: import_zod5.z.array(EndorsementPartySchema).optional(),
|
|
816
|
+
keyTerms: import_zod5.z.array(import_zod5.z.string()).optional(),
|
|
817
|
+
premiumImpact: import_zod5.z.string().optional(),
|
|
818
|
+
content: import_zod5.z.string(),
|
|
819
|
+
pageStart: import_zod5.z.number(),
|
|
820
|
+
pageEnd: import_zod5.z.number().optional()
|
|
764
821
|
});
|
|
765
822
|
|
|
766
823
|
// src/schemas/exclusion.ts
|
|
767
|
-
var
|
|
768
|
-
var ExclusionSchema =
|
|
769
|
-
name:
|
|
770
|
-
formNumber:
|
|
771
|
-
excludedPerils:
|
|
772
|
-
isAbsolute:
|
|
773
|
-
exceptions:
|
|
774
|
-
buybackAvailable:
|
|
775
|
-
buybackEndorsement:
|
|
776
|
-
appliesTo:
|
|
777
|
-
content:
|
|
778
|
-
pageNumber:
|
|
824
|
+
var import_zod6 = require("zod");
|
|
825
|
+
var ExclusionSchema = import_zod6.z.object({
|
|
826
|
+
name: import_zod6.z.string(),
|
|
827
|
+
formNumber: import_zod6.z.string().optional(),
|
|
828
|
+
excludedPerils: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
829
|
+
isAbsolute: import_zod6.z.boolean().optional(),
|
|
830
|
+
exceptions: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
831
|
+
buybackAvailable: import_zod6.z.boolean().optional(),
|
|
832
|
+
buybackEndorsement: import_zod6.z.string().optional(),
|
|
833
|
+
appliesTo: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
834
|
+
content: import_zod6.z.string(),
|
|
835
|
+
pageNumber: import_zod6.z.number().optional()
|
|
779
836
|
});
|
|
780
837
|
|
|
781
838
|
// src/schemas/condition.ts
|
|
782
|
-
var
|
|
783
|
-
var ConditionKeyValueSchema =
|
|
784
|
-
key:
|
|
785
|
-
value:
|
|
839
|
+
var import_zod7 = require("zod");
|
|
840
|
+
var ConditionKeyValueSchema = import_zod7.z.object({
|
|
841
|
+
key: import_zod7.z.string(),
|
|
842
|
+
value: import_zod7.z.string()
|
|
786
843
|
});
|
|
787
|
-
var PolicyConditionSchema =
|
|
788
|
-
name:
|
|
844
|
+
var PolicyConditionSchema = import_zod7.z.object({
|
|
845
|
+
name: import_zod7.z.string(),
|
|
789
846
|
conditionType: ConditionTypeSchema,
|
|
790
|
-
content:
|
|
791
|
-
keyValues:
|
|
792
|
-
pageNumber:
|
|
847
|
+
content: import_zod7.z.string(),
|
|
848
|
+
keyValues: import_zod7.z.array(ConditionKeyValueSchema).optional(),
|
|
849
|
+
pageNumber: import_zod7.z.number().optional()
|
|
793
850
|
});
|
|
794
851
|
|
|
795
852
|
// src/schemas/parties.ts
|
|
796
|
-
var
|
|
797
|
-
var InsurerInfoSchema =
|
|
798
|
-
legalName:
|
|
799
|
-
naicNumber:
|
|
800
|
-
amBestRating:
|
|
801
|
-
amBestNumber:
|
|
853
|
+
var import_zod8 = require("zod");
|
|
854
|
+
var InsurerInfoSchema = import_zod8.z.object({
|
|
855
|
+
legalName: import_zod8.z.string(),
|
|
856
|
+
naicNumber: import_zod8.z.string().optional(),
|
|
857
|
+
amBestRating: import_zod8.z.string().optional(),
|
|
858
|
+
amBestNumber: import_zod8.z.string().optional(),
|
|
802
859
|
admittedStatus: AdmittedStatusSchema.optional(),
|
|
803
|
-
stateOfDomicile:
|
|
860
|
+
stateOfDomicile: import_zod8.z.string().optional()
|
|
804
861
|
});
|
|
805
|
-
var ProducerInfoSchema =
|
|
806
|
-
agencyName:
|
|
807
|
-
contactName:
|
|
808
|
-
licenseNumber:
|
|
809
|
-
phone:
|
|
810
|
-
email:
|
|
862
|
+
var ProducerInfoSchema = import_zod8.z.object({
|
|
863
|
+
agencyName: import_zod8.z.string(),
|
|
864
|
+
contactName: import_zod8.z.string().optional(),
|
|
865
|
+
licenseNumber: import_zod8.z.string().optional(),
|
|
866
|
+
phone: import_zod8.z.string().optional(),
|
|
867
|
+
email: import_zod8.z.string().optional(),
|
|
811
868
|
address: AddressSchema.optional()
|
|
812
869
|
});
|
|
813
870
|
|
|
814
871
|
// src/schemas/financial.ts
|
|
815
|
-
var
|
|
816
|
-
var PaymentInstallmentSchema =
|
|
817
|
-
dueDate:
|
|
818
|
-
amount:
|
|
819
|
-
description:
|
|
872
|
+
var import_zod9 = require("zod");
|
|
873
|
+
var PaymentInstallmentSchema = import_zod9.z.object({
|
|
874
|
+
dueDate: import_zod9.z.string(),
|
|
875
|
+
amount: import_zod9.z.string(),
|
|
876
|
+
description: import_zod9.z.string().optional()
|
|
820
877
|
});
|
|
821
|
-
var PaymentPlanSchema =
|
|
822
|
-
installments:
|
|
823
|
-
financeCharge:
|
|
878
|
+
var PaymentPlanSchema = import_zod9.z.object({
|
|
879
|
+
installments: import_zod9.z.array(PaymentInstallmentSchema),
|
|
880
|
+
financeCharge: import_zod9.z.string().optional()
|
|
824
881
|
});
|
|
825
|
-
var LocationPremiumSchema =
|
|
826
|
-
locationNumber:
|
|
827
|
-
premium:
|
|
828
|
-
description:
|
|
882
|
+
var LocationPremiumSchema = import_zod9.z.object({
|
|
883
|
+
locationNumber: import_zod9.z.number(),
|
|
884
|
+
premium: import_zod9.z.string(),
|
|
885
|
+
description: import_zod9.z.string().optional()
|
|
829
886
|
});
|
|
830
887
|
|
|
831
888
|
// src/schemas/loss-history.ts
|
|
832
|
-
var
|
|
833
|
-
var ClaimRecordSchema =
|
|
834
|
-
dateOfLoss:
|
|
835
|
-
claimNumber:
|
|
836
|
-
description:
|
|
889
|
+
var import_zod10 = require("zod");
|
|
890
|
+
var ClaimRecordSchema = import_zod10.z.object({
|
|
891
|
+
dateOfLoss: import_zod10.z.string(),
|
|
892
|
+
claimNumber: import_zod10.z.string().optional(),
|
|
893
|
+
description: import_zod10.z.string(),
|
|
837
894
|
status: ClaimStatusSchema,
|
|
838
|
-
paid:
|
|
839
|
-
reserved:
|
|
840
|
-
incurred:
|
|
841
|
-
claimant:
|
|
842
|
-
coverageLine:
|
|
895
|
+
paid: import_zod10.z.string().optional(),
|
|
896
|
+
reserved: import_zod10.z.string().optional(),
|
|
897
|
+
incurred: import_zod10.z.string().optional(),
|
|
898
|
+
claimant: import_zod10.z.string().optional(),
|
|
899
|
+
coverageLine: import_zod10.z.string().optional()
|
|
843
900
|
});
|
|
844
|
-
var LossSummarySchema =
|
|
845
|
-
period:
|
|
846
|
-
totalClaims:
|
|
847
|
-
totalIncurred:
|
|
848
|
-
totalPaid:
|
|
849
|
-
totalReserved:
|
|
850
|
-
lossRatio:
|
|
901
|
+
var LossSummarySchema = import_zod10.z.object({
|
|
902
|
+
period: import_zod10.z.string().optional(),
|
|
903
|
+
totalClaims: import_zod10.z.number().optional(),
|
|
904
|
+
totalIncurred: import_zod10.z.string().optional(),
|
|
905
|
+
totalPaid: import_zod10.z.string().optional(),
|
|
906
|
+
totalReserved: import_zod10.z.string().optional(),
|
|
907
|
+
lossRatio: import_zod10.z.string().optional()
|
|
851
908
|
});
|
|
852
|
-
var ExperienceModSchema =
|
|
853
|
-
factor:
|
|
854
|
-
effectiveDate:
|
|
855
|
-
state:
|
|
909
|
+
var ExperienceModSchema = import_zod10.z.object({
|
|
910
|
+
factor: import_zod10.z.number(),
|
|
911
|
+
effectiveDate: import_zod10.z.string().optional(),
|
|
912
|
+
state: import_zod10.z.string().optional()
|
|
856
913
|
});
|
|
857
914
|
|
|
858
915
|
// src/schemas/underwriting.ts
|
|
859
|
-
var
|
|
860
|
-
var EnrichedSubjectivitySchema =
|
|
861
|
-
description:
|
|
916
|
+
var import_zod11 = require("zod");
|
|
917
|
+
var EnrichedSubjectivitySchema = import_zod11.z.object({
|
|
918
|
+
description: import_zod11.z.string(),
|
|
862
919
|
category: SubjectivityCategorySchema.optional(),
|
|
863
|
-
dueDate:
|
|
864
|
-
status:
|
|
865
|
-
pageNumber:
|
|
920
|
+
dueDate: import_zod11.z.string().optional(),
|
|
921
|
+
status: import_zod11.z.enum(["open", "satisfied", "waived"]).optional(),
|
|
922
|
+
pageNumber: import_zod11.z.number().optional()
|
|
866
923
|
});
|
|
867
|
-
var EnrichedUnderwritingConditionSchema =
|
|
868
|
-
description:
|
|
869
|
-
category:
|
|
870
|
-
pageNumber:
|
|
924
|
+
var EnrichedUnderwritingConditionSchema = import_zod11.z.object({
|
|
925
|
+
description: import_zod11.z.string(),
|
|
926
|
+
category: import_zod11.z.string().optional(),
|
|
927
|
+
pageNumber: import_zod11.z.number().optional()
|
|
871
928
|
});
|
|
872
|
-
var BindingAuthoritySchema =
|
|
873
|
-
authorizedBy:
|
|
874
|
-
method:
|
|
875
|
-
expiration:
|
|
876
|
-
conditions:
|
|
929
|
+
var BindingAuthoritySchema = import_zod11.z.object({
|
|
930
|
+
authorizedBy: import_zod11.z.string().optional(),
|
|
931
|
+
method: import_zod11.z.string().optional(),
|
|
932
|
+
expiration: import_zod11.z.string().optional(),
|
|
933
|
+
conditions: import_zod11.z.array(import_zod11.z.string()).optional()
|
|
877
934
|
});
|
|
878
935
|
|
|
879
936
|
// src/schemas/declarations/index.ts
|
|
880
|
-
var
|
|
937
|
+
var import_zod15 = require("zod");
|
|
881
938
|
|
|
882
939
|
// src/schemas/declarations/personal.ts
|
|
883
|
-
var
|
|
940
|
+
var import_zod13 = require("zod");
|
|
884
941
|
|
|
885
942
|
// src/schemas/declarations/shared.ts
|
|
886
|
-
var
|
|
887
|
-
var EmployersLiabilityLimitsSchema =
|
|
888
|
-
eachAccident:
|
|
889
|
-
diseasePolicyLimit:
|
|
890
|
-
diseaseEachEmployee:
|
|
943
|
+
var import_zod12 = require("zod");
|
|
944
|
+
var EmployersLiabilityLimitsSchema = import_zod12.z.object({
|
|
945
|
+
eachAccident: import_zod12.z.string(),
|
|
946
|
+
diseasePolicyLimit: import_zod12.z.string(),
|
|
947
|
+
diseaseEachEmployee: import_zod12.z.string()
|
|
891
948
|
});
|
|
892
|
-
var LimitScheduleSchema =
|
|
893
|
-
perOccurrence:
|
|
894
|
-
generalAggregate:
|
|
895
|
-
productsCompletedOpsAggregate:
|
|
896
|
-
personalAdvertisingInjury:
|
|
897
|
-
eachEmployee:
|
|
898
|
-
fireDamage:
|
|
899
|
-
medicalExpense:
|
|
900
|
-
combinedSingleLimit:
|
|
901
|
-
bodilyInjuryPerPerson:
|
|
902
|
-
bodilyInjuryPerAccident:
|
|
903
|
-
propertyDamage:
|
|
904
|
-
eachOccurrenceUmbrella:
|
|
905
|
-
umbrellaAggregate:
|
|
906
|
-
umbrellaRetention:
|
|
907
|
-
statutory:
|
|
949
|
+
var LimitScheduleSchema = import_zod12.z.object({
|
|
950
|
+
perOccurrence: import_zod12.z.string().optional(),
|
|
951
|
+
generalAggregate: import_zod12.z.string().optional(),
|
|
952
|
+
productsCompletedOpsAggregate: import_zod12.z.string().optional(),
|
|
953
|
+
personalAdvertisingInjury: import_zod12.z.string().optional(),
|
|
954
|
+
eachEmployee: import_zod12.z.string().optional(),
|
|
955
|
+
fireDamage: import_zod12.z.string().optional(),
|
|
956
|
+
medicalExpense: import_zod12.z.string().optional(),
|
|
957
|
+
combinedSingleLimit: import_zod12.z.string().optional(),
|
|
958
|
+
bodilyInjuryPerPerson: import_zod12.z.string().optional(),
|
|
959
|
+
bodilyInjuryPerAccident: import_zod12.z.string().optional(),
|
|
960
|
+
propertyDamage: import_zod12.z.string().optional(),
|
|
961
|
+
eachOccurrenceUmbrella: import_zod12.z.string().optional(),
|
|
962
|
+
umbrellaAggregate: import_zod12.z.string().optional(),
|
|
963
|
+
umbrellaRetention: import_zod12.z.string().optional(),
|
|
964
|
+
statutory: import_zod12.z.boolean().optional(),
|
|
908
965
|
employersLiability: EmployersLiabilityLimitsSchema.optional(),
|
|
909
|
-
sublimits:
|
|
910
|
-
sharedLimits:
|
|
966
|
+
sublimits: import_zod12.z.array(SublimitSchema).optional(),
|
|
967
|
+
sharedLimits: import_zod12.z.array(SharedLimitSchema).optional(),
|
|
911
968
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional()
|
|
912
969
|
});
|
|
913
|
-
var DeductibleScheduleSchema =
|
|
914
|
-
perClaim:
|
|
915
|
-
perOccurrence:
|
|
916
|
-
aggregateDeductible:
|
|
917
|
-
selfInsuredRetention:
|
|
918
|
-
corridorDeductible:
|
|
919
|
-
waitingPeriod:
|
|
920
|
-
appliesTo:
|
|
970
|
+
var DeductibleScheduleSchema = import_zod12.z.object({
|
|
971
|
+
perClaim: import_zod12.z.string().optional(),
|
|
972
|
+
perOccurrence: import_zod12.z.string().optional(),
|
|
973
|
+
aggregateDeductible: import_zod12.z.string().optional(),
|
|
974
|
+
selfInsuredRetention: import_zod12.z.string().optional(),
|
|
975
|
+
corridorDeductible: import_zod12.z.string().optional(),
|
|
976
|
+
waitingPeriod: import_zod12.z.string().optional(),
|
|
977
|
+
appliesTo: import_zod12.z.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
|
|
921
978
|
});
|
|
922
|
-
var InsuredLocationSchema =
|
|
923
|
-
number:
|
|
979
|
+
var InsuredLocationSchema = import_zod12.z.object({
|
|
980
|
+
number: import_zod12.z.number(),
|
|
924
981
|
address: AddressSchema,
|
|
925
|
-
description:
|
|
926
|
-
buildingValue:
|
|
927
|
-
contentsValue:
|
|
928
|
-
businessIncomeValue:
|
|
929
|
-
constructionType:
|
|
930
|
-
yearBuilt:
|
|
931
|
-
squareFootage:
|
|
932
|
-
protectionClass:
|
|
933
|
-
sprinklered:
|
|
934
|
-
alarmType:
|
|
935
|
-
occupancy:
|
|
982
|
+
description: import_zod12.z.string().optional(),
|
|
983
|
+
buildingValue: import_zod12.z.string().optional(),
|
|
984
|
+
contentsValue: import_zod12.z.string().optional(),
|
|
985
|
+
businessIncomeValue: import_zod12.z.string().optional(),
|
|
986
|
+
constructionType: import_zod12.z.string().optional(),
|
|
987
|
+
yearBuilt: import_zod12.z.number().optional(),
|
|
988
|
+
squareFootage: import_zod12.z.number().optional(),
|
|
989
|
+
protectionClass: import_zod12.z.string().optional(),
|
|
990
|
+
sprinklered: import_zod12.z.boolean().optional(),
|
|
991
|
+
alarmType: import_zod12.z.string().optional(),
|
|
992
|
+
occupancy: import_zod12.z.string().optional()
|
|
936
993
|
});
|
|
937
|
-
var VehicleCoverageSchema =
|
|
994
|
+
var VehicleCoverageSchema = import_zod12.z.object({
|
|
938
995
|
type: VehicleCoverageTypeSchema,
|
|
939
|
-
limit:
|
|
940
|
-
deductible:
|
|
941
|
-
included:
|
|
996
|
+
limit: import_zod12.z.string().optional(),
|
|
997
|
+
deductible: import_zod12.z.string().optional(),
|
|
998
|
+
included: import_zod12.z.boolean()
|
|
942
999
|
});
|
|
943
|
-
var InsuredVehicleSchema =
|
|
944
|
-
number:
|
|
945
|
-
year:
|
|
946
|
-
make:
|
|
947
|
-
model:
|
|
948
|
-
vin:
|
|
949
|
-
costNew:
|
|
950
|
-
statedValue:
|
|
951
|
-
garageLocation:
|
|
952
|
-
coverages:
|
|
953
|
-
radius:
|
|
954
|
-
vehicleType:
|
|
1000
|
+
var InsuredVehicleSchema = import_zod12.z.object({
|
|
1001
|
+
number: import_zod12.z.number(),
|
|
1002
|
+
year: import_zod12.z.number(),
|
|
1003
|
+
make: import_zod12.z.string(),
|
|
1004
|
+
model: import_zod12.z.string(),
|
|
1005
|
+
vin: import_zod12.z.string(),
|
|
1006
|
+
costNew: import_zod12.z.string().optional(),
|
|
1007
|
+
statedValue: import_zod12.z.string().optional(),
|
|
1008
|
+
garageLocation: import_zod12.z.number().optional(),
|
|
1009
|
+
coverages: import_zod12.z.array(VehicleCoverageSchema).optional(),
|
|
1010
|
+
radius: import_zod12.z.string().optional(),
|
|
1011
|
+
vehicleType: import_zod12.z.string().optional()
|
|
955
1012
|
});
|
|
956
|
-
var ClassificationCodeSchema =
|
|
957
|
-
code:
|
|
958
|
-
description:
|
|
959
|
-
premiumBasis:
|
|
960
|
-
basisAmount:
|
|
961
|
-
rate:
|
|
962
|
-
premium:
|
|
963
|
-
locationNumber:
|
|
1013
|
+
var ClassificationCodeSchema = import_zod12.z.object({
|
|
1014
|
+
code: import_zod12.z.string(),
|
|
1015
|
+
description: import_zod12.z.string(),
|
|
1016
|
+
premiumBasis: import_zod12.z.string(),
|
|
1017
|
+
basisAmount: import_zod12.z.string().optional(),
|
|
1018
|
+
rate: import_zod12.z.string().optional(),
|
|
1019
|
+
premium: import_zod12.z.string().optional(),
|
|
1020
|
+
locationNumber: import_zod12.z.number().optional()
|
|
964
1021
|
});
|
|
965
|
-
var DwellingDetailsSchema =
|
|
1022
|
+
var DwellingDetailsSchema = import_zod12.z.object({
|
|
966
1023
|
constructionType: ConstructionTypeSchema.optional(),
|
|
967
|
-
yearBuilt:
|
|
968
|
-
squareFootage:
|
|
969
|
-
stories:
|
|
1024
|
+
yearBuilt: import_zod12.z.number().optional(),
|
|
1025
|
+
squareFootage: import_zod12.z.number().optional(),
|
|
1026
|
+
stories: import_zod12.z.number().optional(),
|
|
970
1027
|
roofType: RoofTypeSchema.optional(),
|
|
971
|
-
roofAge:
|
|
972
|
-
heatingType:
|
|
1028
|
+
roofAge: import_zod12.z.number().optional(),
|
|
1029
|
+
heatingType: import_zod12.z.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
|
|
973
1030
|
foundationType: FoundationTypeSchema.optional(),
|
|
974
|
-
plumbingType:
|
|
975
|
-
electricalType:
|
|
976
|
-
electricalAmps:
|
|
977
|
-
hasSwimmingPool:
|
|
978
|
-
poolType:
|
|
979
|
-
hasTrampoline:
|
|
980
|
-
hasDog:
|
|
981
|
-
dogBreed:
|
|
982
|
-
protectiveDevices:
|
|
983
|
-
distanceToFireStation:
|
|
984
|
-
distanceToHydrant:
|
|
985
|
-
fireProtectionClass:
|
|
1031
|
+
plumbingType: import_zod12.z.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
|
|
1032
|
+
electricalType: import_zod12.z.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
|
|
1033
|
+
electricalAmps: import_zod12.z.number().optional(),
|
|
1034
|
+
hasSwimmingPool: import_zod12.z.boolean().optional(),
|
|
1035
|
+
poolType: import_zod12.z.enum(["in_ground", "above_ground"]).optional(),
|
|
1036
|
+
hasTrampoline: import_zod12.z.boolean().optional(),
|
|
1037
|
+
hasDog: import_zod12.z.boolean().optional(),
|
|
1038
|
+
dogBreed: import_zod12.z.string().optional(),
|
|
1039
|
+
protectiveDevices: import_zod12.z.array(import_zod12.z.string()).optional(),
|
|
1040
|
+
distanceToFireStation: import_zod12.z.string().optional(),
|
|
1041
|
+
distanceToHydrant: import_zod12.z.string().optional(),
|
|
1042
|
+
fireProtectionClass: import_zod12.z.string().optional()
|
|
986
1043
|
});
|
|
987
|
-
var DriverRecordSchema =
|
|
988
|
-
name:
|
|
989
|
-
dateOfBirth:
|
|
990
|
-
licenseNumber:
|
|
991
|
-
licenseState:
|
|
992
|
-
relationship:
|
|
993
|
-
yearsLicensed:
|
|
994
|
-
gender:
|
|
995
|
-
maritalStatus:
|
|
996
|
-
goodStudentDiscount:
|
|
997
|
-
defensiveDriverDiscount:
|
|
998
|
-
violations:
|
|
999
|
-
date:
|
|
1000
|
-
type:
|
|
1001
|
-
description:
|
|
1044
|
+
var DriverRecordSchema = import_zod12.z.object({
|
|
1045
|
+
name: import_zod12.z.string(),
|
|
1046
|
+
dateOfBirth: import_zod12.z.string().optional(),
|
|
1047
|
+
licenseNumber: import_zod12.z.string().optional(),
|
|
1048
|
+
licenseState: import_zod12.z.string().optional(),
|
|
1049
|
+
relationship: import_zod12.z.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
|
|
1050
|
+
yearsLicensed: import_zod12.z.number().optional(),
|
|
1051
|
+
gender: import_zod12.z.string().optional(),
|
|
1052
|
+
maritalStatus: import_zod12.z.string().optional(),
|
|
1053
|
+
goodStudentDiscount: import_zod12.z.boolean().optional(),
|
|
1054
|
+
defensiveDriverDiscount: import_zod12.z.boolean().optional(),
|
|
1055
|
+
violations: import_zod12.z.array(import_zod12.z.object({
|
|
1056
|
+
date: import_zod12.z.string().optional(),
|
|
1057
|
+
type: import_zod12.z.string().optional(),
|
|
1058
|
+
description: import_zod12.z.string().optional()
|
|
1002
1059
|
})).optional(),
|
|
1003
|
-
accidents:
|
|
1004
|
-
date:
|
|
1005
|
-
atFault:
|
|
1006
|
-
description:
|
|
1007
|
-
amountPaid:
|
|
1060
|
+
accidents: import_zod12.z.array(import_zod12.z.object({
|
|
1061
|
+
date: import_zod12.z.string().optional(),
|
|
1062
|
+
atFault: import_zod12.z.boolean().optional(),
|
|
1063
|
+
description: import_zod12.z.string().optional(),
|
|
1064
|
+
amountPaid: import_zod12.z.string().optional()
|
|
1008
1065
|
})).optional(),
|
|
1009
|
-
sr22Required:
|
|
1066
|
+
sr22Required: import_zod12.z.boolean().optional()
|
|
1010
1067
|
});
|
|
1011
|
-
var PersonalVehicleDetailsSchema =
|
|
1012
|
-
number:
|
|
1013
|
-
year:
|
|
1014
|
-
make:
|
|
1015
|
-
model:
|
|
1016
|
-
vin:
|
|
1017
|
-
bodyType:
|
|
1068
|
+
var PersonalVehicleDetailsSchema = import_zod12.z.object({
|
|
1069
|
+
number: import_zod12.z.number().optional(),
|
|
1070
|
+
year: import_zod12.z.number().optional(),
|
|
1071
|
+
make: import_zod12.z.string().optional(),
|
|
1072
|
+
model: import_zod12.z.string().optional(),
|
|
1073
|
+
vin: import_zod12.z.string().optional(),
|
|
1074
|
+
bodyType: import_zod12.z.string().optional(),
|
|
1018
1075
|
garagingAddress: AddressSchema.optional(),
|
|
1019
1076
|
usage: PersonalAutoUsageSchema.optional(),
|
|
1020
|
-
annualMileage:
|
|
1021
|
-
odometerReading:
|
|
1022
|
-
driverAssignment:
|
|
1077
|
+
annualMileage: import_zod12.z.number().optional(),
|
|
1078
|
+
odometerReading: import_zod12.z.number().optional(),
|
|
1079
|
+
driverAssignment: import_zod12.z.string().optional(),
|
|
1023
1080
|
lienHolder: EndorsementPartySchema.optional(),
|
|
1024
|
-
collisionDeductible:
|
|
1025
|
-
comprehensiveDeductible:
|
|
1026
|
-
rentalReimbursement:
|
|
1027
|
-
towing:
|
|
1081
|
+
collisionDeductible: import_zod12.z.string().optional(),
|
|
1082
|
+
comprehensiveDeductible: import_zod12.z.string().optional(),
|
|
1083
|
+
rentalReimbursement: import_zod12.z.boolean().optional(),
|
|
1084
|
+
towing: import_zod12.z.boolean().optional()
|
|
1028
1085
|
});
|
|
1029
1086
|
|
|
1030
1087
|
// src/schemas/declarations/personal.ts
|
|
1031
|
-
var HomeownersDeclarationsSchema =
|
|
1032
|
-
line:
|
|
1088
|
+
var HomeownersDeclarationsSchema = import_zod13.z.object({
|
|
1089
|
+
line: import_zod13.z.literal("homeowners"),
|
|
1033
1090
|
formType: HomeownersFormTypeSchema,
|
|
1034
|
-
coverageA:
|
|
1035
|
-
coverageB:
|
|
1036
|
-
coverageC:
|
|
1037
|
-
coverageD:
|
|
1038
|
-
coverageE:
|
|
1039
|
-
coverageF:
|
|
1040
|
-
allPerilDeductible:
|
|
1041
|
-
windHailDeductible:
|
|
1042
|
-
hurricaneDeductible:
|
|
1091
|
+
coverageA: import_zod13.z.string().optional(),
|
|
1092
|
+
coverageB: import_zod13.z.string().optional(),
|
|
1093
|
+
coverageC: import_zod13.z.string().optional(),
|
|
1094
|
+
coverageD: import_zod13.z.string().optional(),
|
|
1095
|
+
coverageE: import_zod13.z.string().optional(),
|
|
1096
|
+
coverageF: import_zod13.z.string().optional(),
|
|
1097
|
+
allPerilDeductible: import_zod13.z.string().optional(),
|
|
1098
|
+
windHailDeductible: import_zod13.z.string().optional(),
|
|
1099
|
+
hurricaneDeductible: import_zod13.z.string().optional(),
|
|
1043
1100
|
lossSettlement: LossSettlementSchema.optional(),
|
|
1044
1101
|
dwelling: DwellingDetailsSchema,
|
|
1045
1102
|
mortgagee: EndorsementPartySchema.optional(),
|
|
1046
|
-
additionalMortgagees:
|
|
1103
|
+
additionalMortgagees: import_zod13.z.array(EndorsementPartySchema).optional()
|
|
1047
1104
|
});
|
|
1048
|
-
var PersonalAutoDeclarationsSchema =
|
|
1049
|
-
line:
|
|
1050
|
-
vehicles:
|
|
1051
|
-
drivers:
|
|
1052
|
-
liabilityLimits:
|
|
1053
|
-
bodilyInjuryPerPerson:
|
|
1054
|
-
bodilyInjuryPerAccident:
|
|
1055
|
-
propertyDamage:
|
|
1056
|
-
combinedSingleLimit:
|
|
1105
|
+
var PersonalAutoDeclarationsSchema = import_zod13.z.object({
|
|
1106
|
+
line: import_zod13.z.literal("personal_auto"),
|
|
1107
|
+
vehicles: import_zod13.z.array(PersonalVehicleDetailsSchema),
|
|
1108
|
+
drivers: import_zod13.z.array(DriverRecordSchema),
|
|
1109
|
+
liabilityLimits: import_zod13.z.object({
|
|
1110
|
+
bodilyInjuryPerPerson: import_zod13.z.string().optional(),
|
|
1111
|
+
bodilyInjuryPerAccident: import_zod13.z.string().optional(),
|
|
1112
|
+
propertyDamage: import_zod13.z.string().optional(),
|
|
1113
|
+
combinedSingleLimit: import_zod13.z.string().optional()
|
|
1057
1114
|
}).optional(),
|
|
1058
|
-
umLimits:
|
|
1059
|
-
bodilyInjuryPerPerson:
|
|
1060
|
-
bodilyInjuryPerAccident:
|
|
1115
|
+
umLimits: import_zod13.z.object({
|
|
1116
|
+
bodilyInjuryPerPerson: import_zod13.z.string().optional(),
|
|
1117
|
+
bodilyInjuryPerAccident: import_zod13.z.string().optional()
|
|
1061
1118
|
}).optional(),
|
|
1062
|
-
uimLimits:
|
|
1063
|
-
bodilyInjuryPerPerson:
|
|
1064
|
-
bodilyInjuryPerAccident:
|
|
1119
|
+
uimLimits: import_zod13.z.object({
|
|
1120
|
+
bodilyInjuryPerPerson: import_zod13.z.string().optional(),
|
|
1121
|
+
bodilyInjuryPerAccident: import_zod13.z.string().optional()
|
|
1065
1122
|
}).optional(),
|
|
1066
|
-
pipLimit:
|
|
1067
|
-
medPayLimit:
|
|
1123
|
+
pipLimit: import_zod13.z.string().optional(),
|
|
1124
|
+
medPayLimit: import_zod13.z.string().optional()
|
|
1068
1125
|
});
|
|
1069
|
-
var DwellingFireDeclarationsSchema =
|
|
1070
|
-
line:
|
|
1126
|
+
var DwellingFireDeclarationsSchema = import_zod13.z.object({
|
|
1127
|
+
line: import_zod13.z.literal("dwelling_fire"),
|
|
1071
1128
|
formType: DwellingFireFormTypeSchema,
|
|
1072
|
-
dwellingLimit:
|
|
1073
|
-
otherStructuresLimit:
|
|
1074
|
-
personalPropertyLimit:
|
|
1075
|
-
fairRentalValueLimit:
|
|
1076
|
-
liabilityLimit:
|
|
1077
|
-
medicalPaymentsLimit:
|
|
1078
|
-
deductible:
|
|
1129
|
+
dwellingLimit: import_zod13.z.string().optional(),
|
|
1130
|
+
otherStructuresLimit: import_zod13.z.string().optional(),
|
|
1131
|
+
personalPropertyLimit: import_zod13.z.string().optional(),
|
|
1132
|
+
fairRentalValueLimit: import_zod13.z.string().optional(),
|
|
1133
|
+
liabilityLimit: import_zod13.z.string().optional(),
|
|
1134
|
+
medicalPaymentsLimit: import_zod13.z.string().optional(),
|
|
1135
|
+
deductible: import_zod13.z.string().optional(),
|
|
1079
1136
|
dwelling: DwellingDetailsSchema
|
|
1080
1137
|
});
|
|
1081
|
-
var FloodDeclarationsSchema =
|
|
1082
|
-
line:
|
|
1083
|
-
programType:
|
|
1138
|
+
var FloodDeclarationsSchema = import_zod13.z.object({
|
|
1139
|
+
line: import_zod13.z.literal("flood"),
|
|
1140
|
+
programType: import_zod13.z.enum(["nfip", "private"]),
|
|
1084
1141
|
floodZone: FloodZoneSchema.optional(),
|
|
1085
|
-
communityNumber:
|
|
1086
|
-
communityRating:
|
|
1087
|
-
buildingCoverage:
|
|
1088
|
-
contentsCoverage:
|
|
1089
|
-
iccCoverage:
|
|
1090
|
-
deductible:
|
|
1091
|
-
waitingPeriodDays:
|
|
1092
|
-
elevationCertificate:
|
|
1093
|
-
elevationDifference:
|
|
1094
|
-
buildingDiagramNumber:
|
|
1095
|
-
basementOrEnclosure:
|
|
1096
|
-
postFirmConstruction:
|
|
1142
|
+
communityNumber: import_zod13.z.string().optional(),
|
|
1143
|
+
communityRating: import_zod13.z.number().optional(),
|
|
1144
|
+
buildingCoverage: import_zod13.z.string().optional(),
|
|
1145
|
+
contentsCoverage: import_zod13.z.string().optional(),
|
|
1146
|
+
iccCoverage: import_zod13.z.string().optional(),
|
|
1147
|
+
deductible: import_zod13.z.string().optional(),
|
|
1148
|
+
waitingPeriodDays: import_zod13.z.number().optional(),
|
|
1149
|
+
elevationCertificate: import_zod13.z.boolean().optional(),
|
|
1150
|
+
elevationDifference: import_zod13.z.string().optional(),
|
|
1151
|
+
buildingDiagramNumber: import_zod13.z.number().optional(),
|
|
1152
|
+
basementOrEnclosure: import_zod13.z.boolean().optional(),
|
|
1153
|
+
postFirmConstruction: import_zod13.z.boolean().optional()
|
|
1097
1154
|
});
|
|
1098
|
-
var EarthquakeDeclarationsSchema =
|
|
1099
|
-
line:
|
|
1100
|
-
dwellingCoverage:
|
|
1101
|
-
contentsCoverage:
|
|
1102
|
-
lossOfUseCoverage:
|
|
1103
|
-
deductiblePercent:
|
|
1104
|
-
retrofitDiscount:
|
|
1105
|
-
masonryVeneerCoverage:
|
|
1155
|
+
var EarthquakeDeclarationsSchema = import_zod13.z.object({
|
|
1156
|
+
line: import_zod13.z.literal("earthquake"),
|
|
1157
|
+
dwellingCoverage: import_zod13.z.string().optional(),
|
|
1158
|
+
contentsCoverage: import_zod13.z.string().optional(),
|
|
1159
|
+
lossOfUseCoverage: import_zod13.z.string().optional(),
|
|
1160
|
+
deductiblePercent: import_zod13.z.number().optional(),
|
|
1161
|
+
retrofitDiscount: import_zod13.z.boolean().optional(),
|
|
1162
|
+
masonryVeneerCoverage: import_zod13.z.boolean().optional()
|
|
1106
1163
|
});
|
|
1107
|
-
var PersonalUmbrellaDeclarationsSchema =
|
|
1108
|
-
line:
|
|
1109
|
-
perOccurrenceLimit:
|
|
1110
|
-
aggregateLimit:
|
|
1111
|
-
retainedLimit:
|
|
1112
|
-
underlyingPolicies:
|
|
1113
|
-
carrier:
|
|
1114
|
-
policyNumber:
|
|
1115
|
-
policyType:
|
|
1116
|
-
limits:
|
|
1164
|
+
var PersonalUmbrellaDeclarationsSchema = import_zod13.z.object({
|
|
1165
|
+
line: import_zod13.z.literal("personal_umbrella"),
|
|
1166
|
+
perOccurrenceLimit: import_zod13.z.string().optional(),
|
|
1167
|
+
aggregateLimit: import_zod13.z.string().optional(),
|
|
1168
|
+
retainedLimit: import_zod13.z.string().optional(),
|
|
1169
|
+
underlyingPolicies: import_zod13.z.array(import_zod13.z.object({
|
|
1170
|
+
carrier: import_zod13.z.string().optional(),
|
|
1171
|
+
policyNumber: import_zod13.z.string().optional(),
|
|
1172
|
+
policyType: import_zod13.z.string().optional(),
|
|
1173
|
+
limits: import_zod13.z.string().optional()
|
|
1117
1174
|
}))
|
|
1118
1175
|
});
|
|
1119
|
-
var PersonalArticlesDeclarationsSchema =
|
|
1120
|
-
line:
|
|
1121
|
-
scheduledItems:
|
|
1122
|
-
itemNumber:
|
|
1176
|
+
var PersonalArticlesDeclarationsSchema = import_zod13.z.object({
|
|
1177
|
+
line: import_zod13.z.literal("personal_articles"),
|
|
1178
|
+
scheduledItems: import_zod13.z.array(import_zod13.z.object({
|
|
1179
|
+
itemNumber: import_zod13.z.number().optional(),
|
|
1123
1180
|
category: ScheduledItemCategorySchema.optional(),
|
|
1124
|
-
description:
|
|
1125
|
-
appraisedValue:
|
|
1126
|
-
appraisalDate:
|
|
1181
|
+
description: import_zod13.z.string(),
|
|
1182
|
+
appraisedValue: import_zod13.z.string(),
|
|
1183
|
+
appraisalDate: import_zod13.z.string().optional()
|
|
1127
1184
|
})),
|
|
1128
|
-
blanketCoverage:
|
|
1129
|
-
deductible:
|
|
1130
|
-
worldwideCoverage:
|
|
1131
|
-
breakageCoverage:
|
|
1185
|
+
blanketCoverage: import_zod13.z.string().optional(),
|
|
1186
|
+
deductible: import_zod13.z.string().optional(),
|
|
1187
|
+
worldwideCoverage: import_zod13.z.boolean().optional(),
|
|
1188
|
+
breakageCoverage: import_zod13.z.boolean().optional()
|
|
1132
1189
|
});
|
|
1133
|
-
var WatercraftDeclarationsSchema =
|
|
1134
|
-
line:
|
|
1190
|
+
var WatercraftDeclarationsSchema = import_zod13.z.object({
|
|
1191
|
+
line: import_zod13.z.literal("watercraft"),
|
|
1135
1192
|
boatType: BoatTypeSchema.optional(),
|
|
1136
|
-
year:
|
|
1137
|
-
make:
|
|
1138
|
-
model:
|
|
1139
|
-
length:
|
|
1140
|
-
hullMaterial:
|
|
1141
|
-
hullValue:
|
|
1142
|
-
motorHorsepower:
|
|
1143
|
-
motorType:
|
|
1144
|
-
navigationLimits:
|
|
1145
|
-
layupPeriod:
|
|
1146
|
-
liabilityLimit:
|
|
1147
|
-
medicalPaymentsLimit:
|
|
1148
|
-
physicalDamageDeductible:
|
|
1149
|
-
uninsuredBoaterLimit:
|
|
1150
|
-
trailerCovered:
|
|
1151
|
-
trailerValue:
|
|
1193
|
+
year: import_zod13.z.number().optional(),
|
|
1194
|
+
make: import_zod13.z.string().optional(),
|
|
1195
|
+
model: import_zod13.z.string().optional(),
|
|
1196
|
+
length: import_zod13.z.string().optional(),
|
|
1197
|
+
hullMaterial: import_zod13.z.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
|
|
1198
|
+
hullValue: import_zod13.z.string().optional(),
|
|
1199
|
+
motorHorsepower: import_zod13.z.number().optional(),
|
|
1200
|
+
motorType: import_zod13.z.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
|
|
1201
|
+
navigationLimits: import_zod13.z.string().optional(),
|
|
1202
|
+
layupPeriod: import_zod13.z.string().optional(),
|
|
1203
|
+
liabilityLimit: import_zod13.z.string().optional(),
|
|
1204
|
+
medicalPaymentsLimit: import_zod13.z.string().optional(),
|
|
1205
|
+
physicalDamageDeductible: import_zod13.z.string().optional(),
|
|
1206
|
+
uninsuredBoaterLimit: import_zod13.z.string().optional(),
|
|
1207
|
+
trailerCovered: import_zod13.z.boolean().optional(),
|
|
1208
|
+
trailerValue: import_zod13.z.string().optional()
|
|
1152
1209
|
});
|
|
1153
|
-
var RecreationalVehicleDeclarationsSchema =
|
|
1154
|
-
line:
|
|
1210
|
+
var RecreationalVehicleDeclarationsSchema = import_zod13.z.object({
|
|
1211
|
+
line: import_zod13.z.literal("recreational_vehicle"),
|
|
1155
1212
|
vehicleType: RVTypeSchema,
|
|
1156
|
-
year:
|
|
1157
|
-
make:
|
|
1158
|
-
model:
|
|
1159
|
-
vin:
|
|
1160
|
-
value:
|
|
1161
|
-
liabilityLimit:
|
|
1162
|
-
collisionDeductible:
|
|
1163
|
-
comprehensiveDeductible:
|
|
1164
|
-
personalEffectsCoverage:
|
|
1165
|
-
fullTimerCoverage:
|
|
1213
|
+
year: import_zod13.z.number().optional(),
|
|
1214
|
+
make: import_zod13.z.string().optional(),
|
|
1215
|
+
model: import_zod13.z.string().optional(),
|
|
1216
|
+
vin: import_zod13.z.string().optional(),
|
|
1217
|
+
value: import_zod13.z.string().optional(),
|
|
1218
|
+
liabilityLimit: import_zod13.z.string().optional(),
|
|
1219
|
+
collisionDeductible: import_zod13.z.string().optional(),
|
|
1220
|
+
comprehensiveDeductible: import_zod13.z.string().optional(),
|
|
1221
|
+
personalEffectsCoverage: import_zod13.z.string().optional(),
|
|
1222
|
+
fullTimerCoverage: import_zod13.z.boolean().optional()
|
|
1166
1223
|
});
|
|
1167
|
-
var FarmRanchDeclarationsSchema =
|
|
1168
|
-
line:
|
|
1169
|
-
dwellingCoverage:
|
|
1170
|
-
farmPersonalPropertyCoverage:
|
|
1171
|
-
farmLiabilityLimit:
|
|
1172
|
-
farmAutoIncluded:
|
|
1173
|
-
livestock:
|
|
1174
|
-
type:
|
|
1175
|
-
headCount:
|
|
1176
|
-
value:
|
|
1224
|
+
var FarmRanchDeclarationsSchema = import_zod13.z.object({
|
|
1225
|
+
line: import_zod13.z.literal("farm_ranch"),
|
|
1226
|
+
dwellingCoverage: import_zod13.z.string().optional(),
|
|
1227
|
+
farmPersonalPropertyCoverage: import_zod13.z.string().optional(),
|
|
1228
|
+
farmLiabilityLimit: import_zod13.z.string().optional(),
|
|
1229
|
+
farmAutoIncluded: import_zod13.z.boolean().optional(),
|
|
1230
|
+
livestock: import_zod13.z.array(import_zod13.z.object({
|
|
1231
|
+
type: import_zod13.z.string(),
|
|
1232
|
+
headCount: import_zod13.z.number(),
|
|
1233
|
+
value: import_zod13.z.string().optional()
|
|
1177
1234
|
})).optional(),
|
|
1178
|
-
equipmentSchedule:
|
|
1179
|
-
description:
|
|
1180
|
-
value:
|
|
1235
|
+
equipmentSchedule: import_zod13.z.array(import_zod13.z.object({
|
|
1236
|
+
description: import_zod13.z.string(),
|
|
1237
|
+
value: import_zod13.z.string()
|
|
1181
1238
|
})).optional(),
|
|
1182
|
-
acreage:
|
|
1239
|
+
acreage: import_zod13.z.number().optional(),
|
|
1183
1240
|
dwelling: DwellingDetailsSchema.optional()
|
|
1184
1241
|
});
|
|
1185
|
-
var TitleDeclarationsSchema =
|
|
1186
|
-
line:
|
|
1242
|
+
var TitleDeclarationsSchema = import_zod13.z.object({
|
|
1243
|
+
line: import_zod13.z.literal("title"),
|
|
1187
1244
|
policyType: TitlePolicyTypeSchema,
|
|
1188
|
-
policyAmount:
|
|
1189
|
-
legalDescription:
|
|
1245
|
+
policyAmount: import_zod13.z.string(),
|
|
1246
|
+
legalDescription: import_zod13.z.string().optional(),
|
|
1190
1247
|
propertyAddress: AddressSchema.optional(),
|
|
1191
|
-
effectiveDate:
|
|
1192
|
-
exceptions:
|
|
1193
|
-
number:
|
|
1194
|
-
description:
|
|
1248
|
+
effectiveDate: import_zod13.z.string().optional(),
|
|
1249
|
+
exceptions: import_zod13.z.array(import_zod13.z.object({
|
|
1250
|
+
number: import_zod13.z.number(),
|
|
1251
|
+
description: import_zod13.z.string()
|
|
1195
1252
|
})).optional(),
|
|
1196
|
-
underwriter:
|
|
1253
|
+
underwriter: import_zod13.z.string().optional()
|
|
1197
1254
|
});
|
|
1198
|
-
var PetDeclarationsSchema =
|
|
1199
|
-
line:
|
|
1255
|
+
var PetDeclarationsSchema = import_zod13.z.object({
|
|
1256
|
+
line: import_zod13.z.literal("pet"),
|
|
1200
1257
|
species: PetSpeciesSchema,
|
|
1201
|
-
breed:
|
|
1202
|
-
petName:
|
|
1203
|
-
age:
|
|
1204
|
-
annualLimit:
|
|
1205
|
-
perIncidentLimit:
|
|
1206
|
-
deductible:
|
|
1207
|
-
reimbursementPercent:
|
|
1208
|
-
waitingPeriodDays:
|
|
1209
|
-
preExistingConditionsExcluded:
|
|
1210
|
-
wellnessCoverage:
|
|
1258
|
+
breed: import_zod13.z.string().optional(),
|
|
1259
|
+
petName: import_zod13.z.string().optional(),
|
|
1260
|
+
age: import_zod13.z.number().optional(),
|
|
1261
|
+
annualLimit: import_zod13.z.string().optional(),
|
|
1262
|
+
perIncidentLimit: import_zod13.z.string().optional(),
|
|
1263
|
+
deductible: import_zod13.z.string().optional(),
|
|
1264
|
+
reimbursementPercent: import_zod13.z.number().optional(),
|
|
1265
|
+
waitingPeriodDays: import_zod13.z.number().optional(),
|
|
1266
|
+
preExistingConditionsExcluded: import_zod13.z.boolean().optional(),
|
|
1267
|
+
wellnessCoverage: import_zod13.z.boolean().optional()
|
|
1211
1268
|
});
|
|
1212
|
-
var TravelDeclarationsSchema =
|
|
1213
|
-
line:
|
|
1214
|
-
tripDepartureDate:
|
|
1215
|
-
tripReturnDate:
|
|
1216
|
-
destinations:
|
|
1217
|
-
travelers:
|
|
1218
|
-
name:
|
|
1219
|
-
age:
|
|
1269
|
+
var TravelDeclarationsSchema = import_zod13.z.object({
|
|
1270
|
+
line: import_zod13.z.literal("travel"),
|
|
1271
|
+
tripDepartureDate: import_zod13.z.string().optional(),
|
|
1272
|
+
tripReturnDate: import_zod13.z.string().optional(),
|
|
1273
|
+
destinations: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
1274
|
+
travelers: import_zod13.z.array(import_zod13.z.object({
|
|
1275
|
+
name: import_zod13.z.string(),
|
|
1276
|
+
age: import_zod13.z.number().optional()
|
|
1220
1277
|
})).optional(),
|
|
1221
|
-
tripCost:
|
|
1222
|
-
tripCancellationLimit:
|
|
1223
|
-
medicalLimit:
|
|
1224
|
-
evacuationLimit:
|
|
1225
|
-
baggageLimit:
|
|
1278
|
+
tripCost: import_zod13.z.string().optional(),
|
|
1279
|
+
tripCancellationLimit: import_zod13.z.string().optional(),
|
|
1280
|
+
medicalLimit: import_zod13.z.string().optional(),
|
|
1281
|
+
evacuationLimit: import_zod13.z.string().optional(),
|
|
1282
|
+
baggageLimit: import_zod13.z.string().optional()
|
|
1226
1283
|
});
|
|
1227
|
-
var IdentityTheftDeclarationsSchema =
|
|
1228
|
-
line:
|
|
1229
|
-
coverageLimit:
|
|
1230
|
-
expenseReimbursement:
|
|
1231
|
-
creditMonitoring:
|
|
1232
|
-
restorationServices:
|
|
1233
|
-
lostWagesLimit:
|
|
1284
|
+
var IdentityTheftDeclarationsSchema = import_zod13.z.object({
|
|
1285
|
+
line: import_zod13.z.literal("identity_theft"),
|
|
1286
|
+
coverageLimit: import_zod13.z.string().optional(),
|
|
1287
|
+
expenseReimbursement: import_zod13.z.string().optional(),
|
|
1288
|
+
creditMonitoring: import_zod13.z.boolean().optional(),
|
|
1289
|
+
restorationServices: import_zod13.z.boolean().optional(),
|
|
1290
|
+
lostWagesLimit: import_zod13.z.string().optional()
|
|
1234
1291
|
});
|
|
1235
1292
|
|
|
1236
1293
|
// src/schemas/declarations/commercial.ts
|
|
1237
|
-
var
|
|
1238
|
-
var GLDeclarationsSchema =
|
|
1239
|
-
line:
|
|
1294
|
+
var import_zod14 = require("zod");
|
|
1295
|
+
var GLDeclarationsSchema = import_zod14.z.object({
|
|
1296
|
+
line: import_zod14.z.literal("gl"),
|
|
1240
1297
|
coverageForm: CoverageFormSchema.optional(),
|
|
1241
|
-
perOccurrenceLimit:
|
|
1242
|
-
generalAggregate:
|
|
1243
|
-
productsCompletedOpsAggregate:
|
|
1244
|
-
personalAdvertisingInjury:
|
|
1245
|
-
fireDamage:
|
|
1246
|
-
medicalExpense:
|
|
1298
|
+
perOccurrenceLimit: import_zod14.z.string().optional(),
|
|
1299
|
+
generalAggregate: import_zod14.z.string().optional(),
|
|
1300
|
+
productsCompletedOpsAggregate: import_zod14.z.string().optional(),
|
|
1301
|
+
personalAdvertisingInjury: import_zod14.z.string().optional(),
|
|
1302
|
+
fireDamage: import_zod14.z.string().optional(),
|
|
1303
|
+
medicalExpense: import_zod14.z.string().optional(),
|
|
1247
1304
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1248
|
-
deductible:
|
|
1249
|
-
classifications:
|
|
1250
|
-
retroactiveDate:
|
|
1305
|
+
deductible: import_zod14.z.string().optional(),
|
|
1306
|
+
classifications: import_zod14.z.array(ClassificationCodeSchema).optional(),
|
|
1307
|
+
retroactiveDate: import_zod14.z.string().optional()
|
|
1251
1308
|
});
|
|
1252
|
-
var CommercialPropertyDeclarationsSchema =
|
|
1253
|
-
line:
|
|
1254
|
-
causesOfLossForm:
|
|
1255
|
-
coinsurancePercent:
|
|
1309
|
+
var CommercialPropertyDeclarationsSchema = import_zod14.z.object({
|
|
1310
|
+
line: import_zod14.z.literal("commercial_property"),
|
|
1311
|
+
causesOfLossForm: import_zod14.z.enum(["basic", "broad", "special"]).optional(),
|
|
1312
|
+
coinsurancePercent: import_zod14.z.number().optional(),
|
|
1256
1313
|
valuationMethod: ValuationMethodSchema.optional(),
|
|
1257
|
-
locations:
|
|
1258
|
-
blanketLimit:
|
|
1259
|
-
businessIncomeLimit:
|
|
1260
|
-
extraExpenseLimit:
|
|
1314
|
+
locations: import_zod14.z.array(InsuredLocationSchema),
|
|
1315
|
+
blanketLimit: import_zod14.z.string().optional(),
|
|
1316
|
+
businessIncomeLimit: import_zod14.z.string().optional(),
|
|
1317
|
+
extraExpenseLimit: import_zod14.z.string().optional()
|
|
1261
1318
|
});
|
|
1262
|
-
var CommercialAutoDeclarationsSchema =
|
|
1263
|
-
line:
|
|
1264
|
-
vehicles:
|
|
1265
|
-
coveredAutoSymbols:
|
|
1266
|
-
liabilityLimit:
|
|
1267
|
-
umLimit:
|
|
1268
|
-
uimLimit:
|
|
1269
|
-
hiredAutoLiability:
|
|
1270
|
-
nonOwnedAutoLiability:
|
|
1319
|
+
var CommercialAutoDeclarationsSchema = import_zod14.z.object({
|
|
1320
|
+
line: import_zod14.z.literal("commercial_auto"),
|
|
1321
|
+
vehicles: import_zod14.z.array(InsuredVehicleSchema),
|
|
1322
|
+
coveredAutoSymbols: import_zod14.z.array(import_zod14.z.number()).optional(),
|
|
1323
|
+
liabilityLimit: import_zod14.z.string().optional(),
|
|
1324
|
+
umLimit: import_zod14.z.string().optional(),
|
|
1325
|
+
uimLimit: import_zod14.z.string().optional(),
|
|
1326
|
+
hiredAutoLiability: import_zod14.z.boolean().optional(),
|
|
1327
|
+
nonOwnedAutoLiability: import_zod14.z.boolean().optional()
|
|
1271
1328
|
});
|
|
1272
|
-
var WorkersCompDeclarationsSchema =
|
|
1273
|
-
line:
|
|
1274
|
-
coveredStates:
|
|
1275
|
-
classifications:
|
|
1329
|
+
var WorkersCompDeclarationsSchema = import_zod14.z.object({
|
|
1330
|
+
line: import_zod14.z.literal("workers_comp"),
|
|
1331
|
+
coveredStates: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
1332
|
+
classifications: import_zod14.z.array(ClassificationCodeSchema),
|
|
1276
1333
|
experienceMod: ExperienceModSchema.optional(),
|
|
1277
1334
|
employersLiability: EmployersLiabilityLimitsSchema.optional()
|
|
1278
1335
|
});
|
|
1279
|
-
var UmbrellaExcessDeclarationsSchema =
|
|
1280
|
-
line:
|
|
1281
|
-
perOccurrenceLimit:
|
|
1282
|
-
aggregateLimit:
|
|
1283
|
-
retention:
|
|
1284
|
-
underlyingPolicies:
|
|
1285
|
-
carrier:
|
|
1286
|
-
policyNumber:
|
|
1287
|
-
policyType:
|
|
1288
|
-
limits:
|
|
1336
|
+
var UmbrellaExcessDeclarationsSchema = import_zod14.z.object({
|
|
1337
|
+
line: import_zod14.z.literal("umbrella_excess"),
|
|
1338
|
+
perOccurrenceLimit: import_zod14.z.string().optional(),
|
|
1339
|
+
aggregateLimit: import_zod14.z.string().optional(),
|
|
1340
|
+
retention: import_zod14.z.string().optional(),
|
|
1341
|
+
underlyingPolicies: import_zod14.z.array(import_zod14.z.object({
|
|
1342
|
+
carrier: import_zod14.z.string().optional(),
|
|
1343
|
+
policyNumber: import_zod14.z.string().optional(),
|
|
1344
|
+
policyType: import_zod14.z.string().optional(),
|
|
1345
|
+
limits: import_zod14.z.string().optional()
|
|
1289
1346
|
}))
|
|
1290
1347
|
});
|
|
1291
|
-
var ProfessionalLiabilityDeclarationsSchema =
|
|
1292
|
-
line:
|
|
1293
|
-
perClaimLimit:
|
|
1294
|
-
aggregateLimit:
|
|
1295
|
-
retroactiveDate:
|
|
1348
|
+
var ProfessionalLiabilityDeclarationsSchema = import_zod14.z.object({
|
|
1349
|
+
line: import_zod14.z.literal("professional_liability"),
|
|
1350
|
+
perClaimLimit: import_zod14.z.string().optional(),
|
|
1351
|
+
aggregateLimit: import_zod14.z.string().optional(),
|
|
1352
|
+
retroactiveDate: import_zod14.z.string().optional(),
|
|
1296
1353
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1297
1354
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional()
|
|
1298
1355
|
});
|
|
1299
|
-
var CyberDeclarationsSchema =
|
|
1300
|
-
line:
|
|
1301
|
-
aggregateLimit:
|
|
1302
|
-
retroactiveDate:
|
|
1303
|
-
waitingPeriodHours:
|
|
1304
|
-
sublimits:
|
|
1305
|
-
coverageName:
|
|
1306
|
-
limit:
|
|
1356
|
+
var CyberDeclarationsSchema = import_zod14.z.object({
|
|
1357
|
+
line: import_zod14.z.literal("cyber"),
|
|
1358
|
+
aggregateLimit: import_zod14.z.string().optional(),
|
|
1359
|
+
retroactiveDate: import_zod14.z.string().optional(),
|
|
1360
|
+
waitingPeriodHours: import_zod14.z.number().optional(),
|
|
1361
|
+
sublimits: import_zod14.z.array(import_zod14.z.object({
|
|
1362
|
+
coverageName: import_zod14.z.string(),
|
|
1363
|
+
limit: import_zod14.z.string()
|
|
1307
1364
|
})).optional()
|
|
1308
1365
|
});
|
|
1309
|
-
var DODeclarationsSchema =
|
|
1310
|
-
line:
|
|
1311
|
-
sideALimit:
|
|
1312
|
-
sideBLimit:
|
|
1313
|
-
sideCLimit:
|
|
1314
|
-
sideARetention:
|
|
1315
|
-
sideBRetention:
|
|
1316
|
-
sideCRetention:
|
|
1317
|
-
continuityDate:
|
|
1366
|
+
var DODeclarationsSchema = import_zod14.z.object({
|
|
1367
|
+
line: import_zod14.z.literal("directors_officers"),
|
|
1368
|
+
sideALimit: import_zod14.z.string().optional(),
|
|
1369
|
+
sideBLimit: import_zod14.z.string().optional(),
|
|
1370
|
+
sideCLimit: import_zod14.z.string().optional(),
|
|
1371
|
+
sideARetention: import_zod14.z.string().optional(),
|
|
1372
|
+
sideBRetention: import_zod14.z.string().optional(),
|
|
1373
|
+
sideCRetention: import_zod14.z.string().optional(),
|
|
1374
|
+
continuityDate: import_zod14.z.string().optional()
|
|
1318
1375
|
});
|
|
1319
|
-
var CrimeDeclarationsSchema =
|
|
1320
|
-
line:
|
|
1321
|
-
formType:
|
|
1322
|
-
agreements:
|
|
1323
|
-
agreement:
|
|
1324
|
-
coverageName:
|
|
1325
|
-
limit:
|
|
1326
|
-
deductible:
|
|
1376
|
+
var CrimeDeclarationsSchema = import_zod14.z.object({
|
|
1377
|
+
line: import_zod14.z.literal("crime"),
|
|
1378
|
+
formType: import_zod14.z.enum(["discovery", "loss_sustained"]).optional(),
|
|
1379
|
+
agreements: import_zod14.z.array(import_zod14.z.object({
|
|
1380
|
+
agreement: import_zod14.z.string(),
|
|
1381
|
+
coverageName: import_zod14.z.string(),
|
|
1382
|
+
limit: import_zod14.z.string(),
|
|
1383
|
+
deductible: import_zod14.z.string()
|
|
1327
1384
|
}))
|
|
1328
1385
|
});
|
|
1329
1386
|
|
|
1330
1387
|
// src/schemas/declarations/index.ts
|
|
1331
|
-
var DeclarationsSchema =
|
|
1388
|
+
var DeclarationsSchema = import_zod15.z.discriminatedUnion("line", [
|
|
1332
1389
|
// Personal lines
|
|
1333
1390
|
HomeownersDeclarationsSchema,
|
|
1334
1391
|
PersonalAutoDeclarationsSchema,
|
|
@@ -1357,137 +1414,137 @@ var DeclarationsSchema = import_zod14.z.discriminatedUnion("line", [
|
|
|
1357
1414
|
]);
|
|
1358
1415
|
|
|
1359
1416
|
// src/schemas/document.ts
|
|
1360
|
-
var
|
|
1361
|
-
var SubsectionSchema =
|
|
1362
|
-
title:
|
|
1363
|
-
sectionNumber:
|
|
1364
|
-
pageNumber:
|
|
1365
|
-
content:
|
|
1417
|
+
var import_zod16 = require("zod");
|
|
1418
|
+
var SubsectionSchema = import_zod16.z.object({
|
|
1419
|
+
title: import_zod16.z.string(),
|
|
1420
|
+
sectionNumber: import_zod16.z.string().optional(),
|
|
1421
|
+
pageNumber: import_zod16.z.number().optional(),
|
|
1422
|
+
content: import_zod16.z.string()
|
|
1366
1423
|
});
|
|
1367
|
-
var SectionSchema =
|
|
1368
|
-
title:
|
|
1369
|
-
sectionNumber:
|
|
1370
|
-
pageStart:
|
|
1371
|
-
pageEnd:
|
|
1372
|
-
type:
|
|
1373
|
-
coverageType:
|
|
1374
|
-
content:
|
|
1375
|
-
subsections:
|
|
1424
|
+
var SectionSchema = import_zod16.z.object({
|
|
1425
|
+
title: import_zod16.z.string(),
|
|
1426
|
+
sectionNumber: import_zod16.z.string().optional(),
|
|
1427
|
+
pageStart: import_zod16.z.number(),
|
|
1428
|
+
pageEnd: import_zod16.z.number().optional(),
|
|
1429
|
+
type: import_zod16.z.string(),
|
|
1430
|
+
coverageType: import_zod16.z.string().optional(),
|
|
1431
|
+
content: import_zod16.z.string(),
|
|
1432
|
+
subsections: import_zod16.z.array(SubsectionSchema).optional()
|
|
1376
1433
|
});
|
|
1377
|
-
var SubjectivitySchema =
|
|
1378
|
-
description:
|
|
1379
|
-
category:
|
|
1434
|
+
var SubjectivitySchema = import_zod16.z.object({
|
|
1435
|
+
description: import_zod16.z.string(),
|
|
1436
|
+
category: import_zod16.z.string().optional()
|
|
1380
1437
|
});
|
|
1381
|
-
var UnderwritingConditionSchema =
|
|
1382
|
-
description:
|
|
1438
|
+
var UnderwritingConditionSchema = import_zod16.z.object({
|
|
1439
|
+
description: import_zod16.z.string()
|
|
1383
1440
|
});
|
|
1384
|
-
var PremiumLineSchema =
|
|
1385
|
-
line:
|
|
1386
|
-
amount:
|
|
1441
|
+
var PremiumLineSchema = import_zod16.z.object({
|
|
1442
|
+
line: import_zod16.z.string(),
|
|
1443
|
+
amount: import_zod16.z.string()
|
|
1387
1444
|
});
|
|
1388
1445
|
var BaseDocumentFields = {
|
|
1389
|
-
id:
|
|
1390
|
-
carrier:
|
|
1391
|
-
security:
|
|
1392
|
-
insuredName:
|
|
1393
|
-
premium:
|
|
1394
|
-
summary:
|
|
1395
|
-
policyTypes:
|
|
1396
|
-
coverages:
|
|
1397
|
-
sections:
|
|
1446
|
+
id: import_zod16.z.string(),
|
|
1447
|
+
carrier: import_zod16.z.string(),
|
|
1448
|
+
security: import_zod16.z.string().optional(),
|
|
1449
|
+
insuredName: import_zod16.z.string(),
|
|
1450
|
+
premium: import_zod16.z.string().optional(),
|
|
1451
|
+
summary: import_zod16.z.string().optional(),
|
|
1452
|
+
policyTypes: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1453
|
+
coverages: import_zod16.z.array(CoverageSchema),
|
|
1454
|
+
sections: import_zod16.z.array(SectionSchema).optional(),
|
|
1398
1455
|
// Enriched fields (v1.2+)
|
|
1399
|
-
carrierLegalName:
|
|
1400
|
-
carrierNaicNumber:
|
|
1401
|
-
carrierAmBestRating:
|
|
1402
|
-
carrierAdmittedStatus:
|
|
1403
|
-
mga:
|
|
1404
|
-
underwriter:
|
|
1405
|
-
brokerAgency:
|
|
1406
|
-
brokerContactName:
|
|
1407
|
-
brokerLicenseNumber:
|
|
1408
|
-
priorPolicyNumber:
|
|
1409
|
-
programName:
|
|
1410
|
-
isRenewal:
|
|
1411
|
-
isPackage:
|
|
1412
|
-
insuredDba:
|
|
1456
|
+
carrierLegalName: import_zod16.z.string().optional(),
|
|
1457
|
+
carrierNaicNumber: import_zod16.z.string().optional(),
|
|
1458
|
+
carrierAmBestRating: import_zod16.z.string().optional(),
|
|
1459
|
+
carrierAdmittedStatus: import_zod16.z.string().optional(),
|
|
1460
|
+
mga: import_zod16.z.string().optional(),
|
|
1461
|
+
underwriter: import_zod16.z.string().optional(),
|
|
1462
|
+
brokerAgency: import_zod16.z.string().optional(),
|
|
1463
|
+
brokerContactName: import_zod16.z.string().optional(),
|
|
1464
|
+
brokerLicenseNumber: import_zod16.z.string().optional(),
|
|
1465
|
+
priorPolicyNumber: import_zod16.z.string().optional(),
|
|
1466
|
+
programName: import_zod16.z.string().optional(),
|
|
1467
|
+
isRenewal: import_zod16.z.boolean().optional(),
|
|
1468
|
+
isPackage: import_zod16.z.boolean().optional(),
|
|
1469
|
+
insuredDba: import_zod16.z.string().optional(),
|
|
1413
1470
|
insuredAddress: AddressSchema.optional(),
|
|
1414
1471
|
insuredEntityType: EntityTypeSchema.optional(),
|
|
1415
|
-
additionalNamedInsureds:
|
|
1416
|
-
insuredSicCode:
|
|
1417
|
-
insuredNaicsCode:
|
|
1418
|
-
insuredFein:
|
|
1419
|
-
enrichedCoverages:
|
|
1420
|
-
endorsements:
|
|
1421
|
-
exclusions:
|
|
1422
|
-
conditions:
|
|
1472
|
+
additionalNamedInsureds: import_zod16.z.array(NamedInsuredSchema).optional(),
|
|
1473
|
+
insuredSicCode: import_zod16.z.string().optional(),
|
|
1474
|
+
insuredNaicsCode: import_zod16.z.string().optional(),
|
|
1475
|
+
insuredFein: import_zod16.z.string().optional(),
|
|
1476
|
+
enrichedCoverages: import_zod16.z.array(EnrichedCoverageSchema).optional(),
|
|
1477
|
+
endorsements: import_zod16.z.array(EndorsementSchema).optional(),
|
|
1478
|
+
exclusions: import_zod16.z.array(ExclusionSchema).optional(),
|
|
1479
|
+
conditions: import_zod16.z.array(PolicyConditionSchema).optional(),
|
|
1423
1480
|
limits: LimitScheduleSchema.optional(),
|
|
1424
1481
|
deductibles: DeductibleScheduleSchema.optional(),
|
|
1425
|
-
locations:
|
|
1426
|
-
vehicles:
|
|
1427
|
-
classifications:
|
|
1428
|
-
formInventory:
|
|
1482
|
+
locations: import_zod16.z.array(InsuredLocationSchema).optional(),
|
|
1483
|
+
vehicles: import_zod16.z.array(InsuredVehicleSchema).optional(),
|
|
1484
|
+
classifications: import_zod16.z.array(ClassificationCodeSchema).optional(),
|
|
1485
|
+
formInventory: import_zod16.z.array(FormReferenceSchema).optional(),
|
|
1429
1486
|
declarations: DeclarationsSchema.optional(),
|
|
1430
1487
|
coverageForm: CoverageFormSchema.optional(),
|
|
1431
|
-
retroactiveDate:
|
|
1488
|
+
retroactiveDate: import_zod16.z.string().optional(),
|
|
1432
1489
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional(),
|
|
1433
1490
|
insurer: InsurerInfoSchema.optional(),
|
|
1434
1491
|
producer: ProducerInfoSchema.optional(),
|
|
1435
|
-
claimsContacts:
|
|
1436
|
-
regulatoryContacts:
|
|
1437
|
-
thirdPartyAdministrators:
|
|
1438
|
-
additionalInsureds:
|
|
1439
|
-
lossPayees:
|
|
1440
|
-
mortgageHolders:
|
|
1441
|
-
taxesAndFees:
|
|
1442
|
-
totalCost:
|
|
1443
|
-
minimumPremium:
|
|
1444
|
-
depositPremium:
|
|
1492
|
+
claimsContacts: import_zod16.z.array(ContactSchema).optional(),
|
|
1493
|
+
regulatoryContacts: import_zod16.z.array(ContactSchema).optional(),
|
|
1494
|
+
thirdPartyAdministrators: import_zod16.z.array(ContactSchema).optional(),
|
|
1495
|
+
additionalInsureds: import_zod16.z.array(EndorsementPartySchema).optional(),
|
|
1496
|
+
lossPayees: import_zod16.z.array(EndorsementPartySchema).optional(),
|
|
1497
|
+
mortgageHolders: import_zod16.z.array(EndorsementPartySchema).optional(),
|
|
1498
|
+
taxesAndFees: import_zod16.z.array(TaxFeeItemSchema).optional(),
|
|
1499
|
+
totalCost: import_zod16.z.string().optional(),
|
|
1500
|
+
minimumPremium: import_zod16.z.string().optional(),
|
|
1501
|
+
depositPremium: import_zod16.z.string().optional(),
|
|
1445
1502
|
paymentPlan: PaymentPlanSchema.optional(),
|
|
1446
1503
|
auditType: AuditTypeSchema.optional(),
|
|
1447
|
-
ratingBasis:
|
|
1448
|
-
premiumByLocation:
|
|
1504
|
+
ratingBasis: import_zod16.z.array(RatingBasisSchema).optional(),
|
|
1505
|
+
premiumByLocation: import_zod16.z.array(LocationPremiumSchema).optional(),
|
|
1449
1506
|
lossSummary: LossSummarySchema.optional(),
|
|
1450
|
-
individualClaims:
|
|
1507
|
+
individualClaims: import_zod16.z.array(ClaimRecordSchema).optional(),
|
|
1451
1508
|
experienceMod: ExperienceModSchema.optional(),
|
|
1452
|
-
cancellationNoticeDays:
|
|
1453
|
-
nonrenewalNoticeDays:
|
|
1509
|
+
cancellationNoticeDays: import_zod16.z.number().optional(),
|
|
1510
|
+
nonrenewalNoticeDays: import_zod16.z.number().optional()
|
|
1454
1511
|
};
|
|
1455
|
-
var PolicyDocumentSchema =
|
|
1512
|
+
var PolicyDocumentSchema = import_zod16.z.object({
|
|
1456
1513
|
...BaseDocumentFields,
|
|
1457
|
-
type:
|
|
1458
|
-
policyNumber:
|
|
1459
|
-
effectiveDate:
|
|
1460
|
-
expirationDate:
|
|
1514
|
+
type: import_zod16.z.literal("policy"),
|
|
1515
|
+
policyNumber: import_zod16.z.string(),
|
|
1516
|
+
effectiveDate: import_zod16.z.string(),
|
|
1517
|
+
expirationDate: import_zod16.z.string().optional(),
|
|
1461
1518
|
policyTermType: PolicyTermTypeSchema.optional(),
|
|
1462
|
-
nextReviewDate:
|
|
1463
|
-
effectiveTime:
|
|
1519
|
+
nextReviewDate: import_zod16.z.string().optional(),
|
|
1520
|
+
effectiveTime: import_zod16.z.string().optional()
|
|
1464
1521
|
});
|
|
1465
|
-
var QuoteDocumentSchema =
|
|
1522
|
+
var QuoteDocumentSchema = import_zod16.z.object({
|
|
1466
1523
|
...BaseDocumentFields,
|
|
1467
|
-
type:
|
|
1468
|
-
quoteNumber:
|
|
1469
|
-
proposedEffectiveDate:
|
|
1470
|
-
proposedExpirationDate:
|
|
1471
|
-
quoteExpirationDate:
|
|
1472
|
-
subjectivities:
|
|
1473
|
-
underwritingConditions:
|
|
1474
|
-
premiumBreakdown:
|
|
1524
|
+
type: import_zod16.z.literal("quote"),
|
|
1525
|
+
quoteNumber: import_zod16.z.string(),
|
|
1526
|
+
proposedEffectiveDate: import_zod16.z.string().optional(),
|
|
1527
|
+
proposedExpirationDate: import_zod16.z.string().optional(),
|
|
1528
|
+
quoteExpirationDate: import_zod16.z.string().optional(),
|
|
1529
|
+
subjectivities: import_zod16.z.array(SubjectivitySchema).optional(),
|
|
1530
|
+
underwritingConditions: import_zod16.z.array(UnderwritingConditionSchema).optional(),
|
|
1531
|
+
premiumBreakdown: import_zod16.z.array(PremiumLineSchema).optional(),
|
|
1475
1532
|
// Enriched quote fields (v1.2+)
|
|
1476
|
-
enrichedSubjectivities:
|
|
1477
|
-
enrichedUnderwritingConditions:
|
|
1478
|
-
warrantyRequirements:
|
|
1479
|
-
lossControlRecommendations:
|
|
1533
|
+
enrichedSubjectivities: import_zod16.z.array(EnrichedSubjectivitySchema).optional(),
|
|
1534
|
+
enrichedUnderwritingConditions: import_zod16.z.array(EnrichedUnderwritingConditionSchema).optional(),
|
|
1535
|
+
warrantyRequirements: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1536
|
+
lossControlRecommendations: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1480
1537
|
bindingAuthority: BindingAuthoritySchema.optional()
|
|
1481
1538
|
});
|
|
1482
|
-
var InsuranceDocumentSchema =
|
|
1539
|
+
var InsuranceDocumentSchema = import_zod16.z.discriminatedUnion("type", [
|
|
1483
1540
|
PolicyDocumentSchema,
|
|
1484
1541
|
QuoteDocumentSchema
|
|
1485
1542
|
]);
|
|
1486
1543
|
|
|
1487
1544
|
// src/schemas/platform.ts
|
|
1488
|
-
var
|
|
1489
|
-
var PlatformSchema =
|
|
1490
|
-
var CommunicationIntentSchema =
|
|
1545
|
+
var import_zod17 = require("zod");
|
|
1546
|
+
var PlatformSchema = import_zod17.z.enum(["email", "chat", "sms", "slack", "discord"]);
|
|
1547
|
+
var CommunicationIntentSchema = import_zod17.z.enum(["direct", "mediated", "observed"]);
|
|
1491
1548
|
var PLATFORM_CONFIGS = {
|
|
1492
1549
|
email: {
|
|
1493
1550
|
supportsMarkdown: false,
|
|
@@ -1707,10 +1764,11 @@ async function runExtractor(params) {
|
|
|
1707
1764
|
[Document pages ${startPage}-${endPage} are provided as images above.]` : `${prompt}
|
|
1708
1765
|
|
|
1709
1766
|
[Document pages ${startPage}-${endPage} are provided as a PDF file above.]`;
|
|
1767
|
+
const strictSchema = toStrictSchema(schema);
|
|
1710
1768
|
const result = await withRetry(
|
|
1711
1769
|
() => generateObject({
|
|
1712
1770
|
prompt: fullPrompt,
|
|
1713
|
-
schema,
|
|
1771
|
+
schema: strictSchema,
|
|
1714
1772
|
maxTokens,
|
|
1715
1773
|
providerOptions
|
|
1716
1774
|
})
|
|
@@ -2789,11 +2847,11 @@ function getTemplate(policyType) {
|
|
|
2789
2847
|
}
|
|
2790
2848
|
|
|
2791
2849
|
// src/prompts/coordinator/classify.ts
|
|
2792
|
-
var
|
|
2793
|
-
var ClassifyResultSchema =
|
|
2794
|
-
documentType:
|
|
2795
|
-
policyTypes:
|
|
2796
|
-
confidence:
|
|
2850
|
+
var import_zod18 = require("zod");
|
|
2851
|
+
var ClassifyResultSchema = import_zod18.z.object({
|
|
2852
|
+
documentType: import_zod18.z.enum(["policy", "quote"]),
|
|
2853
|
+
policyTypes: import_zod18.z.array(PolicyTypeSchema),
|
|
2854
|
+
confidence: import_zod18.z.number()
|
|
2797
2855
|
});
|
|
2798
2856
|
function buildClassifyPrompt() {
|
|
2799
2857
|
return `You are classifying an insurance document. Examine the first few pages and determine:
|
|
@@ -2817,20 +2875,20 @@ Respond with JSON only.`;
|
|
|
2817
2875
|
}
|
|
2818
2876
|
|
|
2819
2877
|
// src/prompts/coordinator/plan.ts
|
|
2820
|
-
var
|
|
2821
|
-
var ExtractionTaskSchema =
|
|
2822
|
-
extractorName:
|
|
2823
|
-
startPage:
|
|
2824
|
-
endPage:
|
|
2825
|
-
description:
|
|
2878
|
+
var import_zod19 = require("zod");
|
|
2879
|
+
var ExtractionTaskSchema = import_zod19.z.object({
|
|
2880
|
+
extractorName: import_zod19.z.string(),
|
|
2881
|
+
startPage: import_zod19.z.number(),
|
|
2882
|
+
endPage: import_zod19.z.number(),
|
|
2883
|
+
description: import_zod19.z.string()
|
|
2826
2884
|
});
|
|
2827
|
-
var PageMapEntrySchema =
|
|
2828
|
-
section:
|
|
2829
|
-
pages:
|
|
2885
|
+
var PageMapEntrySchema = import_zod19.z.object({
|
|
2886
|
+
section: import_zod19.z.string(),
|
|
2887
|
+
pages: import_zod19.z.string()
|
|
2830
2888
|
});
|
|
2831
|
-
var ExtractionPlanSchema =
|
|
2832
|
-
tasks:
|
|
2833
|
-
pageMap:
|
|
2889
|
+
var ExtractionPlanSchema = import_zod19.z.object({
|
|
2890
|
+
tasks: import_zod19.z.array(ExtractionTaskSchema),
|
|
2891
|
+
pageMap: import_zod19.z.array(PageMapEntrySchema).optional()
|
|
2834
2892
|
});
|
|
2835
2893
|
function buildPlanPrompt(templateHints) {
|
|
2836
2894
|
return `You are planning the extraction of an insurance document. You have already classified this document. Now scan the full document and create a page map + extraction plan.
|
|
@@ -2871,15 +2929,15 @@ Respond with JSON only.`;
|
|
|
2871
2929
|
}
|
|
2872
2930
|
|
|
2873
2931
|
// src/prompts/coordinator/review.ts
|
|
2874
|
-
var
|
|
2875
|
-
var ReviewResultSchema =
|
|
2876
|
-
complete:
|
|
2877
|
-
missingFields:
|
|
2878
|
-
additionalTasks:
|
|
2879
|
-
extractorName:
|
|
2880
|
-
startPage:
|
|
2881
|
-
endPage:
|
|
2882
|
-
description:
|
|
2932
|
+
var import_zod20 = require("zod");
|
|
2933
|
+
var ReviewResultSchema = import_zod20.z.object({
|
|
2934
|
+
complete: import_zod20.z.boolean(),
|
|
2935
|
+
missingFields: import_zod20.z.array(import_zod20.z.string()),
|
|
2936
|
+
additionalTasks: import_zod20.z.array(import_zod20.z.object({
|
|
2937
|
+
extractorName: import_zod20.z.string(),
|
|
2938
|
+
startPage: import_zod20.z.number(),
|
|
2939
|
+
endPage: import_zod20.z.number(),
|
|
2940
|
+
description: import_zod20.z.string()
|
|
2883
2941
|
}))
|
|
2884
2942
|
});
|
|
2885
2943
|
function buildReviewPrompt(templateExpected, extractedKeys) {
|
|
@@ -2911,20 +2969,20 @@ Respond with JSON only.`;
|
|
|
2911
2969
|
}
|
|
2912
2970
|
|
|
2913
2971
|
// src/prompts/extractors/carrier-info.ts
|
|
2914
|
-
var
|
|
2915
|
-
var CarrierInfoSchema =
|
|
2916
|
-
carrierName:
|
|
2917
|
-
carrierLegalName:
|
|
2918
|
-
naicNumber:
|
|
2919
|
-
amBestRating:
|
|
2920
|
-
admittedStatus:
|
|
2921
|
-
mga:
|
|
2922
|
-
underwriter:
|
|
2923
|
-
policyNumber:
|
|
2924
|
-
effectiveDate:
|
|
2925
|
-
expirationDate:
|
|
2926
|
-
quoteNumber:
|
|
2927
|
-
proposedEffectiveDate:
|
|
2972
|
+
var import_zod21 = require("zod");
|
|
2973
|
+
var CarrierInfoSchema = import_zod21.z.object({
|
|
2974
|
+
carrierName: import_zod21.z.string().describe("Primary insurance company name for display"),
|
|
2975
|
+
carrierLegalName: import_zod21.z.string().optional().describe("Legal entity name of insurer"),
|
|
2976
|
+
naicNumber: import_zod21.z.string().optional().describe("NAIC company code"),
|
|
2977
|
+
amBestRating: import_zod21.z.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
|
|
2978
|
+
admittedStatus: import_zod21.z.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
|
|
2979
|
+
mga: import_zod21.z.string().optional().describe("Managing General Agent or Program Administrator name"),
|
|
2980
|
+
underwriter: import_zod21.z.string().optional().describe("Named individual underwriter"),
|
|
2981
|
+
policyNumber: import_zod21.z.string().optional().describe("Policy or quote reference number"),
|
|
2982
|
+
effectiveDate: import_zod21.z.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
|
|
2983
|
+
expirationDate: import_zod21.z.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
|
|
2984
|
+
quoteNumber: import_zod21.z.string().optional().describe("Quote or proposal reference number"),
|
|
2985
|
+
proposedEffectiveDate: import_zod21.z.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
|
|
2928
2986
|
});
|
|
2929
2987
|
function buildCarrierInfoPrompt() {
|
|
2930
2988
|
return `You are an expert insurance document analyst. Extract carrier and policy identification information from this document.
|
|
@@ -2944,18 +3002,18 @@ Return JSON only.`;
|
|
|
2944
3002
|
}
|
|
2945
3003
|
|
|
2946
3004
|
// src/prompts/extractors/named-insured.ts
|
|
2947
|
-
var
|
|
2948
|
-
var AddressSchema2 =
|
|
2949
|
-
street1:
|
|
2950
|
-
city:
|
|
2951
|
-
state:
|
|
2952
|
-
zip:
|
|
3005
|
+
var import_zod22 = require("zod");
|
|
3006
|
+
var AddressSchema2 = import_zod22.z.object({
|
|
3007
|
+
street1: import_zod22.z.string(),
|
|
3008
|
+
city: import_zod22.z.string(),
|
|
3009
|
+
state: import_zod22.z.string(),
|
|
3010
|
+
zip: import_zod22.z.string()
|
|
2953
3011
|
});
|
|
2954
|
-
var NamedInsuredSchema2 =
|
|
2955
|
-
insuredName:
|
|
2956
|
-
insuredDba:
|
|
3012
|
+
var NamedInsuredSchema2 = import_zod22.z.object({
|
|
3013
|
+
insuredName: import_zod22.z.string().describe("Name of primary named insured"),
|
|
3014
|
+
insuredDba: import_zod22.z.string().optional().describe("Doing-business-as name"),
|
|
2957
3015
|
insuredAddress: AddressSchema2.optional().describe("Primary insured mailing address"),
|
|
2958
|
-
insuredEntityType:
|
|
3016
|
+
insuredEntityType: import_zod22.z.enum([
|
|
2959
3017
|
"corporation",
|
|
2960
3018
|
"llc",
|
|
2961
3019
|
"partnership",
|
|
@@ -2968,13 +3026,13 @@ var NamedInsuredSchema2 = import_zod21.z.object({
|
|
|
2968
3026
|
"married_couple",
|
|
2969
3027
|
"other"
|
|
2970
3028
|
]).optional().describe("Legal entity type of the insured"),
|
|
2971
|
-
insuredFein:
|
|
2972
|
-
insuredSicCode:
|
|
2973
|
-
insuredNaicsCode:
|
|
2974
|
-
additionalNamedInsureds:
|
|
2975
|
-
|
|
2976
|
-
name:
|
|
2977
|
-
relationship:
|
|
3029
|
+
insuredFein: import_zod22.z.string().optional().describe("Federal Employer Identification Number"),
|
|
3030
|
+
insuredSicCode: import_zod22.z.string().optional().describe("SIC code"),
|
|
3031
|
+
insuredNaicsCode: import_zod22.z.string().optional().describe("NAICS code"),
|
|
3032
|
+
additionalNamedInsureds: import_zod22.z.array(
|
|
3033
|
+
import_zod22.z.object({
|
|
3034
|
+
name: import_zod22.z.string(),
|
|
3035
|
+
relationship: import_zod22.z.string().optional().describe("e.g. subsidiary, affiliate"),
|
|
2978
3036
|
address: AddressSchema2.optional()
|
|
2979
3037
|
})
|
|
2980
3038
|
).optional().describe("Additional named insureds listed on the policy")
|
|
@@ -2995,19 +3053,19 @@ Return JSON only.`;
|
|
|
2995
3053
|
}
|
|
2996
3054
|
|
|
2997
3055
|
// src/prompts/extractors/coverage-limits.ts
|
|
2998
|
-
var
|
|
2999
|
-
var CoverageLimitsSchema =
|
|
3000
|
-
coverages:
|
|
3001
|
-
|
|
3002
|
-
name:
|
|
3003
|
-
limit:
|
|
3004
|
-
deductible:
|
|
3005
|
-
coverageCode:
|
|
3006
|
-
formNumber:
|
|
3056
|
+
var import_zod23 = require("zod");
|
|
3057
|
+
var CoverageLimitsSchema = import_zod23.z.object({
|
|
3058
|
+
coverages: import_zod23.z.array(
|
|
3059
|
+
import_zod23.z.object({
|
|
3060
|
+
name: import_zod23.z.string().describe("Coverage name"),
|
|
3061
|
+
limit: import_zod23.z.string().describe("Coverage limit, e.g. '$1,000,000'"),
|
|
3062
|
+
deductible: import_zod23.z.string().optional().describe("Deductible amount"),
|
|
3063
|
+
coverageCode: import_zod23.z.string().optional().describe("Coverage code or class code"),
|
|
3064
|
+
formNumber: import_zod23.z.string().optional().describe("Associated form number, e.g. 'CG 00 01'")
|
|
3007
3065
|
})
|
|
3008
3066
|
).describe("All coverages with their limits"),
|
|
3009
|
-
coverageForm:
|
|
3010
|
-
retroactiveDate:
|
|
3067
|
+
coverageForm: import_zod23.z.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
|
|
3068
|
+
retroactiveDate: import_zod23.z.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
|
|
3011
3069
|
});
|
|
3012
3070
|
function buildCoverageLimitsPrompt() {
|
|
3013
3071
|
return `You are an expert insurance document analyst. Extract all coverage limits and deductibles from this document.
|
|
@@ -3028,31 +3086,75 @@ Return JSON only.`;
|
|
|
3028
3086
|
}
|
|
3029
3087
|
|
|
3030
3088
|
// src/prompts/extractors/endorsements.ts
|
|
3031
|
-
var
|
|
3032
|
-
var EndorsementsSchema =
|
|
3033
|
-
endorsements:
|
|
3034
|
-
|
|
3035
|
-
formNumber:
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3089
|
+
var import_zod24 = require("zod");
|
|
3090
|
+
var EndorsementsSchema = import_zod24.z.object({
|
|
3091
|
+
endorsements: import_zod24.z.array(
|
|
3092
|
+
import_zod24.z.object({
|
|
3093
|
+
formNumber: import_zod24.z.string().describe("Form number, e.g. 'CG 21 47'"),
|
|
3094
|
+
editionDate: import_zod24.z.string().optional().describe("Edition date, e.g. '12 07'"),
|
|
3095
|
+
title: import_zod24.z.string().describe("Endorsement title"),
|
|
3096
|
+
endorsementType: import_zod24.z.enum([
|
|
3097
|
+
"additional_insured",
|
|
3098
|
+
"waiver_of_subrogation",
|
|
3099
|
+
"primary_noncontributory",
|
|
3100
|
+
"blanket_additional_insured",
|
|
3101
|
+
"loss_payee",
|
|
3102
|
+
"mortgage_holder",
|
|
3103
|
+
"broadening",
|
|
3104
|
+
"restriction",
|
|
3105
|
+
"exclusion",
|
|
3106
|
+
"amendatory",
|
|
3107
|
+
"notice_of_cancellation",
|
|
3108
|
+
"designated_premises",
|
|
3109
|
+
"classification_change",
|
|
3110
|
+
"schedule_update",
|
|
3111
|
+
"deductible_change",
|
|
3112
|
+
"limit_change",
|
|
3113
|
+
"territorial_extension",
|
|
3114
|
+
"other"
|
|
3115
|
+
]).describe("Endorsement type classification"),
|
|
3116
|
+
effectiveDate: import_zod24.z.string().optional().describe("Endorsement effective date"),
|
|
3117
|
+
affectedCoverageParts: import_zod24.z.array(import_zod24.z.string()).optional().describe("Coverage parts affected by this endorsement"),
|
|
3118
|
+
namedParties: import_zod24.z.array(
|
|
3119
|
+
import_zod24.z.object({
|
|
3120
|
+
name: import_zod24.z.string().describe("Party name"),
|
|
3121
|
+
role: import_zod24.z.enum([
|
|
3122
|
+
"additional_insured",
|
|
3123
|
+
"loss_payee",
|
|
3124
|
+
"mortgage_holder",
|
|
3125
|
+
"certificate_holder",
|
|
3126
|
+
"waiver_beneficiary",
|
|
3127
|
+
"designated_person",
|
|
3128
|
+
"other"
|
|
3129
|
+
]).describe("Party role"),
|
|
3130
|
+
relationship: import_zod24.z.string().optional().describe("Relationship to insured"),
|
|
3131
|
+
scope: import_zod24.z.string().optional().describe("Scope of coverage for this party")
|
|
3132
|
+
})
|
|
3133
|
+
).optional().describe("Named parties (additional insureds, loss payees, etc.)"),
|
|
3134
|
+
keyTerms: import_zod24.z.array(import_zod24.z.string()).optional().describe("Key terms or notable provisions in the endorsement"),
|
|
3135
|
+
premiumImpact: import_zod24.z.string().optional().describe("Additional premium or credit"),
|
|
3136
|
+
content: import_zod24.z.string().describe("Full verbatim text of the endorsement"),
|
|
3137
|
+
pageStart: import_zod24.z.number().describe("Starting page number of this endorsement"),
|
|
3138
|
+
pageEnd: import_zod24.z.number().optional().describe("Ending page number of this endorsement")
|
|
3042
3139
|
})
|
|
3043
3140
|
).describe("All endorsements found in the document")
|
|
3044
3141
|
});
|
|
3045
3142
|
function buildEndorsementsPrompt() {
|
|
3046
3143
|
return `You are an expert insurance document analyst. Extract ALL endorsements from this document. Preserve original language verbatim.
|
|
3047
3144
|
|
|
3048
|
-
|
|
3049
|
-
-
|
|
3050
|
-
-
|
|
3051
|
-
-
|
|
3052
|
-
-
|
|
3053
|
-
-
|
|
3054
|
-
-
|
|
3055
|
-
-
|
|
3145
|
+
For EACH endorsement, extract:
|
|
3146
|
+
- formNumber: the form identifier (e.g. "CG 21 47") \u2014 REQUIRED
|
|
3147
|
+
- editionDate: the edition date if present (e.g. "12 07")
|
|
3148
|
+
- title: endorsement title \u2014 REQUIRED
|
|
3149
|
+
- endorsementType: classify as one of: additional_insured, waiver_of_subrogation, primary_noncontributory, blanket_additional_insured, loss_payee, mortgage_holder, broadening, restriction, exclusion, amendatory, notice_of_cancellation, designated_premises, classification_change, schedule_update, deductible_change, limit_change, territorial_extension, other
|
|
3150
|
+
- effectiveDate: endorsement effective date if shown
|
|
3151
|
+
- affectedCoverageParts: which coverage parts are modified
|
|
3152
|
+
- namedParties: for each party, extract name, role (additional_insured, loss_payee, mortgage_holder, certificate_holder, waiver_beneficiary, designated_person, other), relationship, and scope
|
|
3153
|
+
- keyTerms: notable provisions or key terms
|
|
3154
|
+
- premiumImpact: additional premium or credit if shown
|
|
3155
|
+
- content: full verbatim text \u2014 REQUIRED
|
|
3156
|
+
- pageStart: page number where endorsement begins \u2014 REQUIRED
|
|
3157
|
+
- pageEnd: page number where endorsement ends
|
|
3056
3158
|
|
|
3057
3159
|
PERSONAL LINES ENDORSEMENT RECOGNITION:
|
|
3058
3160
|
- HO 04 XX series: homeowners endorsements
|
|
@@ -3064,27 +3166,43 @@ Return JSON only.`;
|
|
|
3064
3166
|
}
|
|
3065
3167
|
|
|
3066
3168
|
// src/prompts/extractors/exclusions.ts
|
|
3067
|
-
var
|
|
3068
|
-
var ExclusionsSchema =
|
|
3069
|
-
exclusions:
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3169
|
+
var import_zod25 = require("zod");
|
|
3170
|
+
var ExclusionsSchema = import_zod25.z.object({
|
|
3171
|
+
exclusions: import_zod25.z.array(
|
|
3172
|
+
import_zod25.z.object({
|
|
3173
|
+
name: import_zod25.z.string().describe("Exclusion title or short description"),
|
|
3174
|
+
formNumber: import_zod25.z.string().optional().describe("Form number if part of a named endorsement"),
|
|
3175
|
+
excludedPerils: import_zod25.z.array(import_zod25.z.string()).optional().describe("Specific perils excluded"),
|
|
3176
|
+
isAbsolute: import_zod25.z.boolean().optional().describe("Whether the exclusion is absolute (no exceptions)"),
|
|
3177
|
+
exceptions: import_zod25.z.array(import_zod25.z.string()).optional().describe("Exceptions to the exclusion, if any"),
|
|
3178
|
+
buybackAvailable: import_zod25.z.boolean().optional().describe("Whether coverage can be bought back via endorsement"),
|
|
3179
|
+
buybackEndorsement: import_zod25.z.string().optional().describe("Form number of the buyback endorsement if available"),
|
|
3180
|
+
appliesTo: import_zod25.z.array(import_zod25.z.string()).optional().describe("Coverage types this exclusion applies to"),
|
|
3181
|
+
content: import_zod25.z.string().describe("Full verbatim exclusion text"),
|
|
3182
|
+
pageNumber: import_zod25.z.number().optional().describe("Page number where exclusion appears")
|
|
3075
3183
|
})
|
|
3076
3184
|
).describe("All exclusions found in the document")
|
|
3077
3185
|
});
|
|
3078
3186
|
function buildExclusionsPrompt() {
|
|
3079
3187
|
return `You are an expert insurance document analyst. Extract ALL exclusions from this document. Preserve original language verbatim.
|
|
3080
3188
|
|
|
3189
|
+
For EACH exclusion, extract:
|
|
3190
|
+
- name: exclusion title or short description \u2014 REQUIRED
|
|
3191
|
+
- formNumber: form number if the exclusion is part of a named endorsement
|
|
3192
|
+
- excludedPerils: specific perils being excluded
|
|
3193
|
+
- isAbsolute: true if the exclusion has no exceptions, false if exceptions exist
|
|
3194
|
+
- exceptions: any exceptions to the exclusion (things still covered despite the exclusion)
|
|
3195
|
+
- buybackAvailable: whether coverage can be purchased back via endorsement
|
|
3196
|
+
- buybackEndorsement: the form number of the buyback endorsement if known
|
|
3197
|
+
- appliesTo: which coverage types or lines this exclusion applies to (as an array)
|
|
3198
|
+
- content: full verbatim exclusion text \u2014 REQUIRED
|
|
3199
|
+
- pageNumber: page number where the exclusion appears
|
|
3200
|
+
|
|
3081
3201
|
Focus on:
|
|
3082
3202
|
- Named exclusions from exclusion schedules
|
|
3083
3203
|
- Exclusions embedded within endorsements
|
|
3084
3204
|
- Exclusions within insuring agreements or conditions if clearly labeled
|
|
3085
3205
|
- Full verbatim exclusion text \u2014 do not summarize
|
|
3086
|
-
- Form number if the exclusion is part of a named endorsement
|
|
3087
|
-
- Which coverage line the exclusion applies to, if specific
|
|
3088
3206
|
|
|
3089
3207
|
Common personal lines exclusion patterns: animal liability, business pursuits, home daycare, watercraft, aircraft.
|
|
3090
3208
|
|
|
@@ -3092,73 +3210,92 @@ Return JSON only.`;
|
|
|
3092
3210
|
}
|
|
3093
3211
|
|
|
3094
3212
|
// src/prompts/extractors/conditions.ts
|
|
3095
|
-
var
|
|
3096
|
-
var ConditionsSchema =
|
|
3097
|
-
conditions:
|
|
3098
|
-
|
|
3099
|
-
|
|
3213
|
+
var import_zod26 = require("zod");
|
|
3214
|
+
var ConditionsSchema = import_zod26.z.object({
|
|
3215
|
+
conditions: import_zod26.z.array(
|
|
3216
|
+
import_zod26.z.object({
|
|
3217
|
+
name: import_zod26.z.string().describe("Condition title"),
|
|
3218
|
+
conditionType: import_zod26.z.enum([
|
|
3100
3219
|
"duties_after_loss",
|
|
3101
|
-
"
|
|
3220
|
+
"notice_requirements",
|
|
3221
|
+
"other_insurance",
|
|
3102
3222
|
"cancellation",
|
|
3103
3223
|
"nonrenewal",
|
|
3104
|
-
"subrogation",
|
|
3105
|
-
"other_insurance",
|
|
3106
3224
|
"transfer_of_rights",
|
|
3107
|
-
"examination_under_oath",
|
|
3108
|
-
"arbitration",
|
|
3109
|
-
"suit_against_us",
|
|
3110
3225
|
"liberalization",
|
|
3226
|
+
"arbitration",
|
|
3227
|
+
"concealment_fraud",
|
|
3228
|
+
"examination_under_oath",
|
|
3229
|
+
"legal_action",
|
|
3230
|
+
"loss_payment",
|
|
3231
|
+
"appraisal",
|
|
3232
|
+
"mortgage_holders",
|
|
3233
|
+
"policy_territory",
|
|
3234
|
+
"separation_of_insureds",
|
|
3111
3235
|
"other"
|
|
3112
|
-
]).
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3236
|
+
]).describe("Condition category"),
|
|
3237
|
+
content: import_zod26.z.string().describe("Full verbatim condition text"),
|
|
3238
|
+
keyValues: import_zod26.z.array(
|
|
3239
|
+
import_zod26.z.object({
|
|
3240
|
+
key: import_zod26.z.string().describe("Key name (e.g. 'noticePeriod', 'suitDeadline')"),
|
|
3241
|
+
value: import_zod26.z.string().describe("Value (e.g. '30 days', '2 years')")
|
|
3242
|
+
})
|
|
3243
|
+
).optional().describe("Key values extracted from the condition (notice periods, deadlines, etc.)"),
|
|
3244
|
+
pageNumber: import_zod26.z.number().optional().describe("Page number where condition appears")
|
|
3116
3245
|
})
|
|
3117
3246
|
).describe("All policy conditions found in the document")
|
|
3118
3247
|
});
|
|
3119
3248
|
function buildConditionsPrompt() {
|
|
3120
3249
|
return `You are an expert insurance document analyst. Extract ALL policy conditions from this document. Preserve original language verbatim.
|
|
3121
3250
|
|
|
3251
|
+
For EACH condition, extract:
|
|
3252
|
+
- name: condition title \u2014 REQUIRED
|
|
3253
|
+
- conditionType: classify as one of: duties_after_loss, notice_requirements, other_insurance, cancellation, nonrenewal, transfer_of_rights, liberalization, arbitration, concealment_fraud, examination_under_oath, legal_action, loss_payment, appraisal, mortgage_holders, policy_territory, separation_of_insureds, other \u2014 REQUIRED
|
|
3254
|
+
- content: full verbatim condition text \u2014 REQUIRED
|
|
3255
|
+
- keyValues: extract specific values as key-value pairs (e.g. noticePeriod: "30 days", suitDeadline: "2 years")
|
|
3256
|
+
- pageNumber: page number where the condition appears
|
|
3257
|
+
|
|
3122
3258
|
Focus on:
|
|
3123
3259
|
- Duties after loss / notice of occurrence conditions
|
|
3124
|
-
-
|
|
3125
|
-
- Cancellation and nonrenewal conditions (extract notice period in days)
|
|
3126
|
-
- Subrogation / transfer of rights
|
|
3260
|
+
- Notice requirements (extract notice period as keyValue)
|
|
3261
|
+
- Cancellation and nonrenewal conditions (extract notice period in days as keyValue)
|
|
3127
3262
|
- Other insurance clause
|
|
3263
|
+
- Subrogation / transfer of rights
|
|
3128
3264
|
- Examination under oath
|
|
3129
3265
|
- Arbitration or appraisal provisions
|
|
3130
3266
|
- Suit against us / legal action conditions
|
|
3131
3267
|
- Liberalization clause
|
|
3268
|
+
- Concealment or fraud clause
|
|
3269
|
+
- Loss payment conditions
|
|
3270
|
+
- Mortgage holders clause
|
|
3132
3271
|
- Any other named conditions
|
|
3133
3272
|
|
|
3134
|
-
For cancellation and nonrenewal conditions, extract the specific notice period in days if stated.
|
|
3135
|
-
|
|
3136
3273
|
Return JSON only.`;
|
|
3137
3274
|
}
|
|
3138
3275
|
|
|
3139
3276
|
// src/prompts/extractors/premium-breakdown.ts
|
|
3140
|
-
var
|
|
3141
|
-
var PremiumBreakdownSchema =
|
|
3142
|
-
premium:
|
|
3143
|
-
totalCost:
|
|
3144
|
-
premiumBreakdown:
|
|
3145
|
-
|
|
3146
|
-
line:
|
|
3147
|
-
amount:
|
|
3277
|
+
var import_zod27 = require("zod");
|
|
3278
|
+
var PremiumBreakdownSchema = import_zod27.z.object({
|
|
3279
|
+
premium: import_zod27.z.string().optional().describe("Total premium amount, e.g. '$5,000'"),
|
|
3280
|
+
totalCost: import_zod27.z.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
|
|
3281
|
+
premiumBreakdown: import_zod27.z.array(
|
|
3282
|
+
import_zod27.z.object({
|
|
3283
|
+
line: import_zod27.z.string().describe("Coverage line name"),
|
|
3284
|
+
amount: import_zod27.z.string().describe("Premium amount for this line")
|
|
3148
3285
|
})
|
|
3149
3286
|
).optional().describe("Per-coverage-line premium breakdown"),
|
|
3150
|
-
taxesAndFees:
|
|
3151
|
-
|
|
3152
|
-
name:
|
|
3153
|
-
amount:
|
|
3154
|
-
type:
|
|
3287
|
+
taxesAndFees: import_zod27.z.array(
|
|
3288
|
+
import_zod27.z.object({
|
|
3289
|
+
name: import_zod27.z.string().describe("Fee or tax name"),
|
|
3290
|
+
amount: import_zod27.z.string().describe("Dollar amount"),
|
|
3291
|
+
type: import_zod27.z.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
|
|
3155
3292
|
})
|
|
3156
3293
|
).optional().describe("Taxes, fees, surcharges, and assessments"),
|
|
3157
|
-
minimumPremium:
|
|
3158
|
-
depositPremium:
|
|
3159
|
-
paymentPlan:
|
|
3160
|
-
auditType:
|
|
3161
|
-
ratingBasis:
|
|
3294
|
+
minimumPremium: import_zod27.z.string().optional().describe("Minimum premium if stated"),
|
|
3295
|
+
depositPremium: import_zod27.z.string().optional().describe("Deposit premium if stated"),
|
|
3296
|
+
paymentPlan: import_zod27.z.string().optional().describe("Payment plan description"),
|
|
3297
|
+
auditType: import_zod27.z.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
|
|
3298
|
+
ratingBasis: import_zod27.z.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
|
|
3162
3299
|
});
|
|
3163
3300
|
function buildPremiumBreakdownPrompt() {
|
|
3164
3301
|
return `You are an expert insurance document analyst. Extract all premium and cost information from this document.
|
|
@@ -3178,14 +3315,14 @@ Return JSON only.`;
|
|
|
3178
3315
|
}
|
|
3179
3316
|
|
|
3180
3317
|
// src/prompts/extractors/declarations.ts
|
|
3181
|
-
var
|
|
3182
|
-
var DeclarationsFieldSchema =
|
|
3183
|
-
field:
|
|
3184
|
-
value:
|
|
3185
|
-
section:
|
|
3318
|
+
var import_zod28 = require("zod");
|
|
3319
|
+
var DeclarationsFieldSchema = import_zod28.z.object({
|
|
3320
|
+
field: import_zod28.z.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
|
|
3321
|
+
value: import_zod28.z.string().describe("Extracted value exactly as it appears in the document"),
|
|
3322
|
+
section: import_zod28.z.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
|
|
3186
3323
|
});
|
|
3187
|
-
var DeclarationsExtractSchema =
|
|
3188
|
-
fields:
|
|
3324
|
+
var DeclarationsExtractSchema = import_zod28.z.object({
|
|
3325
|
+
fields: import_zod28.z.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
|
|
3189
3326
|
});
|
|
3190
3327
|
function buildDeclarationsPrompt() {
|
|
3191
3328
|
return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
|
|
@@ -3225,21 +3362,21 @@ Preserve original values exactly as they appear. Return JSON only.`;
|
|
|
3225
3362
|
}
|
|
3226
3363
|
|
|
3227
3364
|
// src/prompts/extractors/loss-history.ts
|
|
3228
|
-
var
|
|
3229
|
-
var LossHistorySchema =
|
|
3230
|
-
lossSummary:
|
|
3231
|
-
individualClaims:
|
|
3232
|
-
|
|
3233
|
-
date:
|
|
3234
|
-
type:
|
|
3235
|
-
description:
|
|
3236
|
-
amountPaid:
|
|
3237
|
-
amountReserved:
|
|
3238
|
-
status:
|
|
3239
|
-
claimNumber:
|
|
3365
|
+
var import_zod29 = require("zod");
|
|
3366
|
+
var LossHistorySchema = import_zod29.z.object({
|
|
3367
|
+
lossSummary: import_zod29.z.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
|
|
3368
|
+
individualClaims: import_zod29.z.array(
|
|
3369
|
+
import_zod29.z.object({
|
|
3370
|
+
date: import_zod29.z.string().optional().describe("Date of loss or claim"),
|
|
3371
|
+
type: import_zod29.z.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
|
|
3372
|
+
description: import_zod29.z.string().optional().describe("Brief description of the claim"),
|
|
3373
|
+
amountPaid: import_zod29.z.string().optional().describe("Amount paid"),
|
|
3374
|
+
amountReserved: import_zod29.z.string().optional().describe("Amount reserved"),
|
|
3375
|
+
status: import_zod29.z.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
|
|
3376
|
+
claimNumber: import_zod29.z.string().optional().describe("Claim reference number")
|
|
3240
3377
|
})
|
|
3241
3378
|
).optional().describe("Individual claim records"),
|
|
3242
|
-
experienceMod:
|
|
3379
|
+
experienceMod: import_zod29.z.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
|
|
3243
3380
|
});
|
|
3244
3381
|
function buildLossHistoryPrompt() {
|
|
3245
3382
|
return `You are an expert insurance document analyst. Extract all loss history and claims information from this document.
|
|
@@ -3256,18 +3393,18 @@ Return JSON only.`;
|
|
|
3256
3393
|
}
|
|
3257
3394
|
|
|
3258
3395
|
// src/prompts/extractors/sections.ts
|
|
3259
|
-
var
|
|
3260
|
-
var SubsectionSchema2 =
|
|
3261
|
-
title:
|
|
3262
|
-
sectionNumber:
|
|
3263
|
-
pageNumber:
|
|
3264
|
-
content:
|
|
3396
|
+
var import_zod30 = require("zod");
|
|
3397
|
+
var SubsectionSchema2 = import_zod30.z.object({
|
|
3398
|
+
title: import_zod30.z.string().describe("Subsection title"),
|
|
3399
|
+
sectionNumber: import_zod30.z.string().optional().describe("Subsection number"),
|
|
3400
|
+
pageNumber: import_zod30.z.number().optional().describe("Page number"),
|
|
3401
|
+
content: import_zod30.z.string().describe("Full verbatim text")
|
|
3265
3402
|
});
|
|
3266
|
-
var SectionsSchema =
|
|
3267
|
-
sections:
|
|
3268
|
-
|
|
3269
|
-
title:
|
|
3270
|
-
type:
|
|
3403
|
+
var SectionsSchema = import_zod30.z.object({
|
|
3404
|
+
sections: import_zod30.z.array(
|
|
3405
|
+
import_zod30.z.object({
|
|
3406
|
+
title: import_zod30.z.string().describe("Section title"),
|
|
3407
|
+
type: import_zod30.z.enum([
|
|
3271
3408
|
"declarations",
|
|
3272
3409
|
"insuring_agreement",
|
|
3273
3410
|
"policy_form",
|
|
@@ -3281,10 +3418,10 @@ var SectionsSchema = import_zod29.z.object({
|
|
|
3281
3418
|
"regulatory",
|
|
3282
3419
|
"other"
|
|
3283
3420
|
]).describe("Section type classification"),
|
|
3284
|
-
content:
|
|
3285
|
-
pageStart:
|
|
3286
|
-
pageEnd:
|
|
3287
|
-
subsections:
|
|
3421
|
+
content: import_zod30.z.string().describe("Full verbatim text of the section"),
|
|
3422
|
+
pageStart: import_zod30.z.number().describe("Starting page number"),
|
|
3423
|
+
pageEnd: import_zod30.z.number().optional().describe("Ending page number"),
|
|
3424
|
+
subsections: import_zod30.z.array(SubsectionSchema2).optional().describe("Subsections within this section")
|
|
3288
3425
|
})
|
|
3289
3426
|
).describe("All document sections")
|
|
3290
3427
|
});
|
|
@@ -3308,20 +3445,20 @@ Return JSON only.`;
|
|
|
3308
3445
|
}
|
|
3309
3446
|
|
|
3310
3447
|
// src/prompts/extractors/supplementary.ts
|
|
3311
|
-
var
|
|
3312
|
-
var ContactSchema2 =
|
|
3313
|
-
name:
|
|
3314
|
-
phone:
|
|
3315
|
-
email:
|
|
3316
|
-
address:
|
|
3317
|
-
type:
|
|
3448
|
+
var import_zod31 = require("zod");
|
|
3449
|
+
var ContactSchema2 = import_zod31.z.object({
|
|
3450
|
+
name: import_zod31.z.string().optional().describe("Organization or person name"),
|
|
3451
|
+
phone: import_zod31.z.string().optional().describe("Phone number"),
|
|
3452
|
+
email: import_zod31.z.string().optional().describe("Email address"),
|
|
3453
|
+
address: import_zod31.z.string().optional().describe("Mailing address"),
|
|
3454
|
+
type: import_zod31.z.string().optional().describe("Contact type, e.g. 'State Department of Insurance'")
|
|
3318
3455
|
});
|
|
3319
|
-
var SupplementarySchema =
|
|
3320
|
-
regulatoryContacts:
|
|
3321
|
-
claimsContacts:
|
|
3322
|
-
thirdPartyAdministrators:
|
|
3323
|
-
cancellationNoticeDays:
|
|
3324
|
-
nonrenewalNoticeDays:
|
|
3456
|
+
var SupplementarySchema = import_zod31.z.object({
|
|
3457
|
+
regulatoryContacts: import_zod31.z.array(ContactSchema2).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
|
|
3458
|
+
claimsContacts: import_zod31.z.array(ContactSchema2).optional().describe("Claims reporting contacts and instructions"),
|
|
3459
|
+
thirdPartyAdministrators: import_zod31.z.array(ContactSchema2).optional().describe("Third-party administrators for claims handling"),
|
|
3460
|
+
cancellationNoticeDays: import_zod31.z.number().optional().describe("Required notice period for cancellation in days"),
|
|
3461
|
+
nonrenewalNoticeDays: import_zod31.z.number().optional().describe("Required notice period for nonrenewal in days")
|
|
3325
3462
|
});
|
|
3326
3463
|
function buildSupplementaryPrompt() {
|
|
3327
3464
|
return `You are an expert insurance document analyst. Extract supplementary and regulatory information from this document.
|
|
@@ -3823,8 +3960,8 @@ Respond with JSON only:
|
|
|
3823
3960
|
}`;
|
|
3824
3961
|
|
|
3825
3962
|
// src/schemas/application.ts
|
|
3826
|
-
var
|
|
3827
|
-
var FieldTypeSchema =
|
|
3963
|
+
var import_zod32 = require("zod");
|
|
3964
|
+
var FieldTypeSchema = import_zod32.z.enum([
|
|
3828
3965
|
"text",
|
|
3829
3966
|
"numeric",
|
|
3830
3967
|
"currency",
|
|
@@ -3833,100 +3970,100 @@ var FieldTypeSchema = import_zod31.z.enum([
|
|
|
3833
3970
|
"table",
|
|
3834
3971
|
"declaration"
|
|
3835
3972
|
]);
|
|
3836
|
-
var ApplicationFieldSchema =
|
|
3837
|
-
id:
|
|
3838
|
-
label:
|
|
3839
|
-
section:
|
|
3973
|
+
var ApplicationFieldSchema = import_zod32.z.object({
|
|
3974
|
+
id: import_zod32.z.string(),
|
|
3975
|
+
label: import_zod32.z.string(),
|
|
3976
|
+
section: import_zod32.z.string(),
|
|
3840
3977
|
fieldType: FieldTypeSchema,
|
|
3841
|
-
required:
|
|
3842
|
-
options:
|
|
3843
|
-
columns:
|
|
3844
|
-
requiresExplanationIfYes:
|
|
3845
|
-
condition:
|
|
3846
|
-
dependsOn:
|
|
3847
|
-
whenValue:
|
|
3978
|
+
required: import_zod32.z.boolean(),
|
|
3979
|
+
options: import_zod32.z.array(import_zod32.z.string()).optional(),
|
|
3980
|
+
columns: import_zod32.z.array(import_zod32.z.string()).optional(),
|
|
3981
|
+
requiresExplanationIfYes: import_zod32.z.boolean().optional(),
|
|
3982
|
+
condition: import_zod32.z.object({
|
|
3983
|
+
dependsOn: import_zod32.z.string(),
|
|
3984
|
+
whenValue: import_zod32.z.string()
|
|
3848
3985
|
}).optional(),
|
|
3849
|
-
value:
|
|
3850
|
-
source:
|
|
3851
|
-
confidence:
|
|
3986
|
+
value: import_zod32.z.string().optional(),
|
|
3987
|
+
source: import_zod32.z.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
|
|
3988
|
+
confidence: import_zod32.z.enum(["confirmed", "high", "medium", "low"]).optional()
|
|
3852
3989
|
});
|
|
3853
|
-
var ApplicationClassifyResultSchema =
|
|
3854
|
-
isApplication:
|
|
3855
|
-
confidence:
|
|
3856
|
-
applicationType:
|
|
3990
|
+
var ApplicationClassifyResultSchema = import_zod32.z.object({
|
|
3991
|
+
isApplication: import_zod32.z.boolean(),
|
|
3992
|
+
confidence: import_zod32.z.number().min(0).max(1),
|
|
3993
|
+
applicationType: import_zod32.z.string().nullable()
|
|
3857
3994
|
});
|
|
3858
|
-
var FieldExtractionResultSchema =
|
|
3859
|
-
fields:
|
|
3995
|
+
var FieldExtractionResultSchema = import_zod32.z.object({
|
|
3996
|
+
fields: import_zod32.z.array(ApplicationFieldSchema)
|
|
3860
3997
|
});
|
|
3861
|
-
var AutoFillMatchSchema =
|
|
3862
|
-
fieldId:
|
|
3863
|
-
value:
|
|
3864
|
-
confidence:
|
|
3865
|
-
contextKey:
|
|
3998
|
+
var AutoFillMatchSchema = import_zod32.z.object({
|
|
3999
|
+
fieldId: import_zod32.z.string(),
|
|
4000
|
+
value: import_zod32.z.string(),
|
|
4001
|
+
confidence: import_zod32.z.enum(["confirmed"]),
|
|
4002
|
+
contextKey: import_zod32.z.string()
|
|
3866
4003
|
});
|
|
3867
|
-
var AutoFillResultSchema =
|
|
3868
|
-
matches:
|
|
4004
|
+
var AutoFillResultSchema = import_zod32.z.object({
|
|
4005
|
+
matches: import_zod32.z.array(AutoFillMatchSchema)
|
|
3869
4006
|
});
|
|
3870
|
-
var QuestionBatchResultSchema =
|
|
3871
|
-
batches:
|
|
4007
|
+
var QuestionBatchResultSchema = import_zod32.z.object({
|
|
4008
|
+
batches: import_zod32.z.array(import_zod32.z.array(import_zod32.z.string()).describe("Array of field IDs in this batch"))
|
|
3872
4009
|
});
|
|
3873
|
-
var LookupRequestSchema =
|
|
3874
|
-
type:
|
|
3875
|
-
description:
|
|
3876
|
-
url:
|
|
3877
|
-
targetFieldIds:
|
|
4010
|
+
var LookupRequestSchema = import_zod32.z.object({
|
|
4011
|
+
type: import_zod32.z.string().describe("Type of lookup: 'records', 'website', 'policy'"),
|
|
4012
|
+
description: import_zod32.z.string(),
|
|
4013
|
+
url: import_zod32.z.string().optional(),
|
|
4014
|
+
targetFieldIds: import_zod32.z.array(import_zod32.z.string())
|
|
3878
4015
|
});
|
|
3879
|
-
var ReplyIntentSchema =
|
|
3880
|
-
primaryIntent:
|
|
3881
|
-
hasAnswers:
|
|
3882
|
-
questionText:
|
|
3883
|
-
questionFieldIds:
|
|
3884
|
-
lookupRequests:
|
|
4016
|
+
var ReplyIntentSchema = import_zod32.z.object({
|
|
4017
|
+
primaryIntent: import_zod32.z.enum(["answers_only", "question", "lookup_request", "mixed"]),
|
|
4018
|
+
hasAnswers: import_zod32.z.boolean(),
|
|
4019
|
+
questionText: import_zod32.z.string().optional(),
|
|
4020
|
+
questionFieldIds: import_zod32.z.array(import_zod32.z.string()).optional(),
|
|
4021
|
+
lookupRequests: import_zod32.z.array(LookupRequestSchema).optional()
|
|
3885
4022
|
});
|
|
3886
|
-
var ParsedAnswerSchema =
|
|
3887
|
-
fieldId:
|
|
3888
|
-
value:
|
|
3889
|
-
explanation:
|
|
4023
|
+
var ParsedAnswerSchema = import_zod32.z.object({
|
|
4024
|
+
fieldId: import_zod32.z.string(),
|
|
4025
|
+
value: import_zod32.z.string(),
|
|
4026
|
+
explanation: import_zod32.z.string().optional()
|
|
3890
4027
|
});
|
|
3891
|
-
var AnswerParsingResultSchema =
|
|
3892
|
-
answers:
|
|
3893
|
-
unanswered:
|
|
4028
|
+
var AnswerParsingResultSchema = import_zod32.z.object({
|
|
4029
|
+
answers: import_zod32.z.array(ParsedAnswerSchema),
|
|
4030
|
+
unanswered: import_zod32.z.array(import_zod32.z.string()).describe("Field IDs that were not answered")
|
|
3894
4031
|
});
|
|
3895
|
-
var LookupFillSchema =
|
|
3896
|
-
fieldId:
|
|
3897
|
-
value:
|
|
3898
|
-
source:
|
|
4032
|
+
var LookupFillSchema = import_zod32.z.object({
|
|
4033
|
+
fieldId: import_zod32.z.string(),
|
|
4034
|
+
value: import_zod32.z.string(),
|
|
4035
|
+
source: import_zod32.z.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'")
|
|
3899
4036
|
});
|
|
3900
|
-
var LookupFillResultSchema =
|
|
3901
|
-
fills:
|
|
3902
|
-
unfillable:
|
|
3903
|
-
explanation:
|
|
4037
|
+
var LookupFillResultSchema = import_zod32.z.object({
|
|
4038
|
+
fills: import_zod32.z.array(LookupFillSchema),
|
|
4039
|
+
unfillable: import_zod32.z.array(import_zod32.z.string()),
|
|
4040
|
+
explanation: import_zod32.z.string().optional()
|
|
3904
4041
|
});
|
|
3905
|
-
var FlatPdfPlacementSchema =
|
|
3906
|
-
fieldId:
|
|
3907
|
-
page:
|
|
3908
|
-
x:
|
|
3909
|
-
y:
|
|
3910
|
-
text:
|
|
3911
|
-
fontSize:
|
|
3912
|
-
isCheckmark:
|
|
4042
|
+
var FlatPdfPlacementSchema = import_zod32.z.object({
|
|
4043
|
+
fieldId: import_zod32.z.string(),
|
|
4044
|
+
page: import_zod32.z.number(),
|
|
4045
|
+
x: import_zod32.z.number().describe("Percentage from left edge (0-100)"),
|
|
4046
|
+
y: import_zod32.z.number().describe("Percentage from top edge (0-100)"),
|
|
4047
|
+
text: import_zod32.z.string(),
|
|
4048
|
+
fontSize: import_zod32.z.number().optional(),
|
|
4049
|
+
isCheckmark: import_zod32.z.boolean().optional()
|
|
3913
4050
|
});
|
|
3914
|
-
var AcroFormMappingSchema =
|
|
3915
|
-
fieldId:
|
|
3916
|
-
acroFormName:
|
|
3917
|
-
value:
|
|
4051
|
+
var AcroFormMappingSchema = import_zod32.z.object({
|
|
4052
|
+
fieldId: import_zod32.z.string(),
|
|
4053
|
+
acroFormName: import_zod32.z.string(),
|
|
4054
|
+
value: import_zod32.z.string()
|
|
3918
4055
|
});
|
|
3919
|
-
var ApplicationStateSchema =
|
|
3920
|
-
id:
|
|
3921
|
-
pdfBase64:
|
|
3922
|
-
title:
|
|
3923
|
-
applicationType:
|
|
3924
|
-
fields:
|
|
3925
|
-
batches:
|
|
3926
|
-
currentBatchIndex:
|
|
3927
|
-
status:
|
|
3928
|
-
createdAt:
|
|
3929
|
-
updatedAt:
|
|
4056
|
+
var ApplicationStateSchema = import_zod32.z.object({
|
|
4057
|
+
id: import_zod32.z.string(),
|
|
4058
|
+
pdfBase64: import_zod32.z.string().optional().describe("Original PDF, omitted after extraction"),
|
|
4059
|
+
title: import_zod32.z.string().optional(),
|
|
4060
|
+
applicationType: import_zod32.z.string().nullable().optional(),
|
|
4061
|
+
fields: import_zod32.z.array(ApplicationFieldSchema),
|
|
4062
|
+
batches: import_zod32.z.array(import_zod32.z.array(import_zod32.z.string())).optional(),
|
|
4063
|
+
currentBatchIndex: import_zod32.z.number().default(0),
|
|
4064
|
+
status: import_zod32.z.enum(["classifying", "extracting", "auto_filling", "batching", "collecting", "confirming", "mapping", "complete"]),
|
|
4065
|
+
createdAt: import_zod32.z.number(),
|
|
4066
|
+
updatedAt: import_zod32.z.number()
|
|
3930
4067
|
});
|
|
3931
4068
|
|
|
3932
4069
|
// src/application/agents/classifier.ts
|
|
@@ -4954,73 +5091,73 @@ Respond with the final answer, deduplicated citations array, overall confidence
|
|
|
4954
5091
|
}
|
|
4955
5092
|
|
|
4956
5093
|
// src/schemas/query.ts
|
|
4957
|
-
var
|
|
4958
|
-
var QueryIntentSchema =
|
|
5094
|
+
var import_zod33 = require("zod");
|
|
5095
|
+
var QueryIntentSchema = import_zod33.z.enum([
|
|
4959
5096
|
"policy_question",
|
|
4960
5097
|
"coverage_comparison",
|
|
4961
5098
|
"document_search",
|
|
4962
5099
|
"claims_inquiry",
|
|
4963
5100
|
"general_knowledge"
|
|
4964
5101
|
]);
|
|
4965
|
-
var SubQuestionSchema =
|
|
4966
|
-
question:
|
|
5102
|
+
var SubQuestionSchema = import_zod33.z.object({
|
|
5103
|
+
question: import_zod33.z.string().describe("Atomic sub-question to retrieve and answer independently"),
|
|
4967
5104
|
intent: QueryIntentSchema,
|
|
4968
|
-
chunkTypes:
|
|
4969
|
-
documentFilters:
|
|
4970
|
-
type:
|
|
4971
|
-
carrier:
|
|
4972
|
-
insuredName:
|
|
4973
|
-
policyNumber:
|
|
4974
|
-
quoteNumber:
|
|
5105
|
+
chunkTypes: import_zod33.z.array(import_zod33.z.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
|
|
5106
|
+
documentFilters: import_zod33.z.object({
|
|
5107
|
+
type: import_zod33.z.enum(["policy", "quote"]).optional(),
|
|
5108
|
+
carrier: import_zod33.z.string().optional(),
|
|
5109
|
+
insuredName: import_zod33.z.string().optional(),
|
|
5110
|
+
policyNumber: import_zod33.z.string().optional(),
|
|
5111
|
+
quoteNumber: import_zod33.z.string().optional()
|
|
4975
5112
|
}).optional().describe("Structured filters to narrow document lookup")
|
|
4976
5113
|
});
|
|
4977
|
-
var QueryClassifyResultSchema =
|
|
5114
|
+
var QueryClassifyResultSchema = import_zod33.z.object({
|
|
4978
5115
|
intent: QueryIntentSchema,
|
|
4979
|
-
subQuestions:
|
|
4980
|
-
requiresDocumentLookup:
|
|
4981
|
-
requiresChunkSearch:
|
|
4982
|
-
requiresConversationHistory:
|
|
5116
|
+
subQuestions: import_zod33.z.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
|
|
5117
|
+
requiresDocumentLookup: import_zod33.z.boolean().describe("Whether structured document lookup is needed"),
|
|
5118
|
+
requiresChunkSearch: import_zod33.z.boolean().describe("Whether semantic chunk search is needed"),
|
|
5119
|
+
requiresConversationHistory: import_zod33.z.boolean().describe("Whether conversation history is relevant")
|
|
4983
5120
|
});
|
|
4984
|
-
var EvidenceItemSchema =
|
|
4985
|
-
source:
|
|
4986
|
-
chunkId:
|
|
4987
|
-
documentId:
|
|
4988
|
-
turnId:
|
|
4989
|
-
text:
|
|
4990
|
-
relevance:
|
|
4991
|
-
metadata:
|
|
5121
|
+
var EvidenceItemSchema = import_zod33.z.object({
|
|
5122
|
+
source: import_zod33.z.enum(["chunk", "document", "conversation"]),
|
|
5123
|
+
chunkId: import_zod33.z.string().optional(),
|
|
5124
|
+
documentId: import_zod33.z.string().optional(),
|
|
5125
|
+
turnId: import_zod33.z.string().optional(),
|
|
5126
|
+
text: import_zod33.z.string().describe("Text excerpt from the source"),
|
|
5127
|
+
relevance: import_zod33.z.number().min(0).max(1),
|
|
5128
|
+
metadata: import_zod33.z.array(import_zod33.z.object({ key: import_zod33.z.string(), value: import_zod33.z.string() })).optional()
|
|
4992
5129
|
});
|
|
4993
|
-
var RetrievalResultSchema =
|
|
4994
|
-
subQuestion:
|
|
4995
|
-
evidence:
|
|
5130
|
+
var RetrievalResultSchema = import_zod33.z.object({
|
|
5131
|
+
subQuestion: import_zod33.z.string(),
|
|
5132
|
+
evidence: import_zod33.z.array(EvidenceItemSchema)
|
|
4996
5133
|
});
|
|
4997
|
-
var CitationSchema =
|
|
4998
|
-
index:
|
|
4999
|
-
chunkId:
|
|
5000
|
-
documentId:
|
|
5001
|
-
documentType:
|
|
5002
|
-
field:
|
|
5003
|
-
quote:
|
|
5004
|
-
relevance:
|
|
5134
|
+
var CitationSchema = import_zod33.z.object({
|
|
5135
|
+
index: import_zod33.z.number().describe("Citation number [1], [2], etc."),
|
|
5136
|
+
chunkId: import_zod33.z.string().describe("Source chunk ID, e.g. doc-123:coverage:2"),
|
|
5137
|
+
documentId: import_zod33.z.string(),
|
|
5138
|
+
documentType: import_zod33.z.enum(["policy", "quote"]).optional(),
|
|
5139
|
+
field: import_zod33.z.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
|
|
5140
|
+
quote: import_zod33.z.string().describe("Exact text from source that supports the claim"),
|
|
5141
|
+
relevance: import_zod33.z.number().min(0).max(1)
|
|
5005
5142
|
});
|
|
5006
|
-
var SubAnswerSchema =
|
|
5007
|
-
subQuestion:
|
|
5008
|
-
answer:
|
|
5009
|
-
citations:
|
|
5010
|
-
confidence:
|
|
5011
|
-
needsMoreContext:
|
|
5143
|
+
var SubAnswerSchema = import_zod33.z.object({
|
|
5144
|
+
subQuestion: import_zod33.z.string(),
|
|
5145
|
+
answer: import_zod33.z.string(),
|
|
5146
|
+
citations: import_zod33.z.array(CitationSchema),
|
|
5147
|
+
confidence: import_zod33.z.number().min(0).max(1),
|
|
5148
|
+
needsMoreContext: import_zod33.z.boolean().describe("True if evidence was insufficient to answer fully")
|
|
5012
5149
|
});
|
|
5013
|
-
var VerifyResultSchema =
|
|
5014
|
-
approved:
|
|
5015
|
-
issues:
|
|
5016
|
-
retrySubQuestions:
|
|
5150
|
+
var VerifyResultSchema = import_zod33.z.object({
|
|
5151
|
+
approved: import_zod33.z.boolean().describe("Whether all sub-answers are adequately grounded"),
|
|
5152
|
+
issues: import_zod33.z.array(import_zod33.z.string()).describe("Specific grounding or consistency issues found"),
|
|
5153
|
+
retrySubQuestions: import_zod33.z.array(import_zod33.z.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
|
|
5017
5154
|
});
|
|
5018
|
-
var QueryResultSchema =
|
|
5019
|
-
answer:
|
|
5020
|
-
citations:
|
|
5155
|
+
var QueryResultSchema = import_zod33.z.object({
|
|
5156
|
+
answer: import_zod33.z.string(),
|
|
5157
|
+
citations: import_zod33.z.array(CitationSchema),
|
|
5021
5158
|
intent: QueryIntentSchema,
|
|
5022
|
-
confidence:
|
|
5023
|
-
followUp:
|
|
5159
|
+
confidence: import_zod33.z.number().min(0).max(1),
|
|
5160
|
+
followUp: import_zod33.z.string().optional().describe("Suggested follow-up question if applicable")
|
|
5024
5161
|
});
|
|
5025
5162
|
|
|
5026
5163
|
// src/query/retriever.ts
|
|
@@ -5902,6 +6039,7 @@ var AGENT_TOOLS = [
|
|
|
5902
6039
|
safeGenerateObject,
|
|
5903
6040
|
sanitizeNulls,
|
|
5904
6041
|
stripFences,
|
|
6042
|
+
toStrictSchema,
|
|
5905
6043
|
withRetry
|
|
5906
6044
|
});
|
|
5907
6045
|
//# sourceMappingURL=index.js.map
|