Socket
Book a DemoInstallSign in
Socket

@socotra/ec-react-schemas

Package Overview
Dependencies
Maintainers
9
Versions
293
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@socotra/ec-react-schemas

latest
Source
npmnpm
Version
2.26.0
Version published
Maintainers
9
Created
Source

title: Schemas description: Schemas for the @socotra/ec-react-schemas package.

EC React Schemas

Schemas for the Socotra Insurance Suite

This package provides a comprehensive collection of zod schemas that define the core data structures for Socotra's Enterprise Components. These schemas are fundamental to ensuring type safety, data integrity, and validation across the platform, from backend services to frontend components.

Core Philosophy

Zod Schemas are powerful tools for data validation and type inference. They are used to define the structure of the data that is passed into and out of the library. They are also used to define the structure of the data that is stored in the database.

By leveraging the power of Zod, we can ensure that the data that is passed into and out of the library is always valid and of the correct type. This is especially important for complex data structures that are used in the library, such as policies, accounts, and transactions.

Key Features

  • Domain Schemas: Business-specific data models (e.g., Policies, Invoices, Accounts).
  • Config Schemas: Structures for configuration objects (e.g., Product and UI configurations).
  • Service Schemas: Data contracts for API requests and responses.
  • Shared Schemas: Common, reusable data structures used across multiple domains.

Installation

This package has a peer dependency on zod. Install both packages in your project:

npm i @socotra/ec-react-schemas zod

Usage

Import schemas directly from the package to use them for data validation, type inference, or in conjunction with libraries like react-hook-form.

import { policyResponseSchema } from '@socotra/ec-react-schemas';
import { z } from 'zod/v4';

type Policy = z.infer<typeof policyResponseSchema>;

function validatePolicy(data: unknown): Policy {
  return policyResponseSchema.parse(data);
}

Documentation

The documentation for this package is generated from a script that must be run after the package is built.

To contribute to the documentation, clone the repo and run the following command after adding, updating, or removing schemas:

git clone https://github.com/socotra/ec-react.git
cd ec-react/packages/schemas
pnpm run docs:generate

This will update the README.md file with the documentation for the schemas. Copy and paste this file into ec-react/packages/docs/src/schemas/index.md

Finally, run pnpm run sync to update the documentation in the README.md files of this and other packages.

Follow instructions in the packages/docs/README.md file to build the documentation and update the Socotra Documentation repo.

Available Schemas

Accounts

account-request.ts

Zod SchemaType
accountStateEnumSchemaAccountStateEnum
accountCreateSchemaAccountCreateRequest
accountUpdateSchemaAccountUpdateRequest

Billings

credit-distribution-request-schema.ts

Zod SchemaType
creditDistributionRequestSchemaCreditDistributionRequest

credit-distribution-response-schema.ts

Zod SchemaType
creditDistributionResponseSchemaCreditDistributionResponse

credit-distribution-reverse-request.ts

Zod SchemaType
creditDistributionReverseRequestSchemaCreditDistributionReverseRequest

credit-distribution-schemas.ts

Zod SchemaType
creditDistributionStateEnumSchemaCreditDistributionStateEnum

delinquency-schemas.ts

Zod SchemaType
advanceLapseToEnumSchema
delinquencyLevelEnumSchema
delinquencyStateEnumSchema
delinquencyReferenceTypeEnumSchema
delinquencySettingsSchemaDelinquencySettings
delinquencyReferenceSchemaDelinquencyReferenceType
delinquencyResponseSchemaDelinquencyResponse
AdvanceLapseTo
DelinquencyLevel
DelinquencyState
DelinquencyReference

ledger-account-response-schema.ts

Zod SchemaType
ledgerAccountResponseSchemaLedgerAccountResponse

ledger-account-schemas.ts

Zod SchemaType
ledgerAccountReferenceTypeEnumSchemaLedgerAccountReferenceTypeEnum
ledgerAccountAccountingTypeEnumSchemaLedgerAccountAccountingTypeEnum
ledgerAccountLineItemSchemaLedgerAccountLineItem

payment-request-schema.ts

Zod SchemaType
PaymentRequestSchemaPaymentRequest

payment-schemas.ts

Zod SchemaType
creditItemContainerTypeEnumSchemaCreditItemContainerTypeEnum
creditItemSchemaCreditItem
transactionMethodEnumSchemaTransactionMethodEnum
paymentStateEnumSchema
paymentStateEnum

Charges

charge-enums.ts

Zod SchemaType
chargeCategoryEnumSchema
chargeCategorySchemaChargeCategory

charge-response-schema.ts

Zod SchemaType
chargeResponseSchemaChargeResponse

Config

account-evaluate-constraints-request.ts

Zod SchemaType
accountEvaluateConstraintsRequestSchemaAccountEvaluateConstraintsRequest

account-schema.ts

Zod SchemaType
accountConfigSchemaAccountConfigRecord
accountConfigRecordSchema
AccountConfig

auto-renewal-plan-schema.ts

Zod SchemaType
autoRenewalPlanSchemaAutoRenewalPlan
autoRenewalPlanRecordsSchema

bootstrap.ts

Zod SchemaType
bootstrapResourceGroupSchemaBootstrapResourceGroup
bootstrapResourceInstanceBootstrapResourceInstance
bootstrapResourcesSchemaBootstrapResources
bootstrapSchemaBootstrap

constraint-schema.ts

Zod SchemaType
constraintConfigSchemaConstraintConfig

constraint-tables-schema.ts

Zod SchemaType
constraintTablesSchemaConstraintTables

coverage-terms-schema.ts

Zod SchemaType
CoverageTermValueSchemaCoverageTermValue
coverageTermOptionSchemaCoverageTermOption
coverageTermSchemaCoverageTermsConfigRecord
coverageTermsRecordSchema
CoverageTermsConfig

data-model-schema.ts

Zod SchemaType
dataModelSchemaDataModel

data-type-schema.ts

Zod SchemaType
dataTypeConfigSchemaDataTypeConfigRecord
dataTypesRecordSchema
DataTypeConfig

delinquency-plan-schema.ts

Zod SchemaType
delinquencyLevelSchema
advanceLapseToSchema
delinquencyPlanSchemaDelinquencyPlan
delinquencyPlanRecordsSchema

element-schema.ts

Zod SchemaType
elementConfigSchemaElementConfigRecord
elementConfigRecordSchema
ElementConfig

dependency-map-response.ts

Zod SchemaType
dependencyMapResponseSchemaDependencyMapResponse

evaluate-constraint-request.ts

Zod SchemaType
evaluateConstraintsRequestSchemaEvaluateConstraintsRequest

evaluate-constraint-response.ts

Zod SchemaType
evaluateConstraintsResponseSchemaEvaluateConstraintsResponse

field-schema.ts

Zod SchemaType
fieldConfigSchemaFieldConfigRecord
fieldConfigRecordSchema
FieldConfig

payment-schema.ts

Zod SchemaType
paymentConfigSchemaPaymentConfig
paymentConfigRecordSchemaPaymentConfigRecord

product-schema.ts

Zod SchemaType
productConfigSchemaProductConfigRecord
productConfigRecordSchema
ProductConfig

quantifiers.ts

Zod SchemaType
quantifiersSchemaQuantifiers
optionalQuantifiersSchemaOptionalQuantifiers

reversal-type-schema.ts

Zod SchemaType
reversalCreditTypeEnumSchemaReversalCreditTypeEnum
reversalTypeSchemaReversalType
reversalTypesRecordsSchema
ReversalTypeConfigRecord

tenant-schema.ts

Zod SchemaType
tenantBaseConfigSchemaTenantBaseConfig

transaction-types-schema.ts

Zod SchemaType
transactionTypeCategorySchemaTransactionTypeCategory
transactionTypeSchemaTransactionType
transactionTypesRecordsSchema
TransactionTypeConfigRecord

Documents

document-response.ts

Zod SchemaType
documentInstanceResponseSchemaDocumentInstanceResponse

Policies

policy-schemas.ts

Zod SchemaType
policyBillingLevelEnumSchema
policyBillingTriggerEnumSchema
PolicyBillingLevel
PolicyBillingTrigger

policy-snapshot-response.ts

Zod SchemaType
policySnapshotResponseSchemaPolicySnapshotResponse

policy-term-response.ts

Zod SchemaType
policyTermResponseSchemaPolicyTermResponse
policyTermSummaryResponsePolicyTermSummaryResponse

policy-term-schemas.ts

Zod SchemaType
documentSummarySchemaDocumentSummary
elementSummarySchemaElementSummary
subsegmentSummarySchemaSubsegmentSummary

term-schemas.ts

Zod SchemaType
documentSummarySchemaDocumentSummary
elementSummarySchemaElementSummary
subsegmentSummarySchemaSubsegmentSummary
DocumentState
DocumentReference

term-summary.ts

Zod SchemaType
termSummarySchemaTermSummary

transaction-snapshot-response.ts

Zod SchemaType
segmentResponseSchemaSegmentResponse
transactionSnapshotResponseSchemaTransactionSnapshotResponse

transaction-underwriting-response.ts

Zod SchemaType
transactionUnderwritingFlagsResponseTransactionUnderwritingFlagsResponse

Quotes

quote-price-response.ts

Zod SchemaType
quotePriceChargeCategoryEnum
quotePriceChargeResponseSchemaQuotePriceChargeResponse
quotePriceResponseSchemaQuotePriceResponse
QuotePriceChargeCategory

quote-request.ts

Zod SchemaType
quoteRequestSchemaQuoteRequest

quote-schemas.ts

Zod SchemaType
quoteStateSchemaQuoteState
quoteBillingTriggerEnumSchema
quoteBillingLevelEnumSchema
QuoteBillingTrigger
QuoteBillingLevel

quote-underwriting-response.ts

Zod SchemaType
quoteUnderwritingFlagsResponseQuoteUnderwritingFlagsResponse

reset-quote-request.ts

Zod SchemaType
resetQuoteFlagsActionEnumSchema
resetQuoteRequestSchemaResetQuoteRequest
ResetQuoteFlagsAction

Shared

anchor-mode.ts

Zod SchemaType
anchorModeEnumSchema
AnchorMode

anchor-type.ts

Zod SchemaType
anchorTypeEnumSchema
AnchorType

billing-level.ts

Zod SchemaType
billingLevelEnumSchema
BillingLevel

cadence.ts

Zod SchemaType
cadenceEnumSchema
Cadence

currencies.ts

Zod SchemaType
currencyEnumSchema
CurrencyType

days.ts

Zod SchemaType
dayOfWeekEnumSchema
weekOfMonthEnumSchema
DayOfWeek
WeekOfMonth

document-reference-type.ts

Zod SchemaType
documentReferenceTypeEnumSchema
DocumentReference

document-state.ts

Zod SchemaType
documentStateEnumSchema
DocumentState

element-request.ts

Zod SchemaType
elementCreateRequestSchemaElementCreateRequest
elementRequestSchemaElementRequest

element-response.ts

Zod SchemaType
elementResponseSchemaElementResponse

field-values.ts

Zod SchemaType
PrimitiveValue
DataFieldValue

preferences-response.ts

Zod SchemaType
preferencesResponseSchemaPreferencesResponse

timezones.ts

Zod SchemaType
timezoneEnumSchema
TimezoneType

underwriting-flag-response.ts

Zod SchemaType
underwritingFlagEnumSchemaUnderwritingFlagEnum
underwritingFlagResponseSchemaUnderwritingFlagResponse

underwriting-flags-request.ts

Zod SchemaType
underwritingFlagCreateRequestSchemaUnderwritingFlagCreateRequest
underwritingFlagsUpdateRequestSchemaUnderwritingFlagsUpdateRequest

validation-result.ts

Zod SchemaType
ulidSchema
validationItemSchemaValidationItem
validationResultSchemaValidationResult

Transactions

add-change-instruction-create-request.ts

Zod SchemaType
addChangeInstructionCreateRequestSchemaAddChangeInstructionCreateRequest

add-change-instruction-response.ts

Zod SchemaType
addChangeInstructionResponseSchemaAddChangeInstructionResponse

delete-change-instruction-create-request.ts

Zod SchemaType
deleteChangeInstructionCreateRequestSchemaDeleteChangeInstructionCreateRequest

delete-change-instruction-response.ts

Zod SchemaType
deleteChangeInstructionResponseSchemaDeleteChangeInstructionResponse

modify-change-instruction-create-request.ts

Zod SchemaType
modifyChangeInstructionCreateRequestSchemaModifyChangeInstructionCreateRequest

modify-change-instruction-response.ts

Zod SchemaType
modifyChangeInstructionResponseSchemaModifyChangeInstructionResponse

params-change-instruction-create-request.ts

Zod SchemaType
paramsChangeInstructionCreateRequestSchemaParamsChangeInstructionCreateRequest

params-change-instruction-response.ts

Zod SchemaType
paramsChangeInstructionResponseSchemaParamsChangeInstructionResponse

policy-transaction-response.ts

Zod SchemaType
policyTransactionResponseSchemaPolicyTransactionResponse

reset-transaction-options-request.ts

Zod SchemaType
resetTransactionOptionsRequestSchemaResetTransactionOptionsRequest

transaction-enums.ts

Zod SchemaType
transactionStateEnumSchema
transactionCategoryEnumSchema
TransactionCategory
TransactionState

transaction-price-response.ts

Zod SchemaType
transactionPriceResponseSchemaTransactionPriceResponse

transaction-underwriting-response.ts

Zod SchemaType
transactionUnderwritingResponseSchemaTransactionUnderwritingResponse

FAQs

Package last updated on 09 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts