fix: allow letters in insurance ID; add patient state (default MA)

- Backend insurance ID check now accepts letters + digits (BCBS IDs have
  a letter prefix), matching the frontend schema; create route validates
  the normalized body
- Patient.state column (default "MA") with State select on the patient
  form; ADA claim form uses the patient's state instead of the office's
- Rebuild stale packages/db compiled .js so the runtime schemas include
  new fields (state, office billing NPI fields, Telnyx settings)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 23:29:27 -04:00
co-authored by Claude Opus 5.5
parent 2c0c595af5
commit 1abc2c705d
664 changed files with 6263 additions and 843 deletions
@@ -0,0 +1,38 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommunicationProviderSchema = void 0;
const z = __importStar(require("zod"));
exports.CommunicationProviderSchema = z.enum(['twilio', 'telnyx']);
@@ -1,4 +1,4 @@
import * as z from 'zod';
export declare const CommunicationScalarFieldEnumSchema: z.ZodEnum<["id", "patientId", "userId", "channel", "direction", "status", "body", "callDuration", "twilioSid", "createdAt"]>;
export declare const CommunicationScalarFieldEnumSchema: z.ZodEnum<["id", "patientId", "userId", "channel", "direction", "status", "provider", "body", "callDuration", "twilioSid", "createdAt"]>;
export type CommunicationScalarFieldEnum = z.infer<typeof CommunicationScalarFieldEnumSchema>;
//# sourceMappingURL=CommunicationScalarFieldEnum.schema.d.ts.map
@@ -1 +1 @@
{"version":3,"file":"CommunicationScalarFieldEnum.schema.d.ts","sourceRoot":"","sources":["CommunicationScalarFieldEnum.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,kCAAkC,8HAA4H,CAAA;AAE3K,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
{"version":3,"file":"CommunicationScalarFieldEnum.schema.d.ts","sourceRoot":"","sources":["CommunicationScalarFieldEnum.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,kCAAkC,0IAAwI,CAAA;AAEvL,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
@@ -35,4 +35,4 @@ var __importStar = (this && this.__importStar) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommunicationScalarFieldEnumSchema = void 0;
const z = __importStar(require("zod"));
exports.CommunicationScalarFieldEnumSchema = z.enum(['id', 'patientId', 'userId', 'channel', 'direction', 'status', 'body', 'callDuration', 'twilioSid', 'createdAt']);
exports.CommunicationScalarFieldEnumSchema = z.enum(['id', 'patientId', 'userId', 'channel', 'direction', 'status', 'provider', 'body', 'callDuration', 'twilioSid', 'createdAt']);
@@ -1,4 +1,4 @@
import * as z from 'zod';
export declare const NpiProviderScalarFieldEnumSchema: z.ZodEnum<["id", "userId", "npiNumber", "providerName", "sortOrder", "createdAt"]>;
export declare const NpiProviderScalarFieldEnumSchema: z.ZodEnum<["id", "userId", "npiNumber", "providerName", "licenseNumber", "sortOrder", "createdAt"]>;
export type NpiProviderScalarFieldEnum = z.infer<typeof NpiProviderScalarFieldEnumSchema>;
//# sourceMappingURL=NpiProviderScalarFieldEnum.schema.d.ts.map
@@ -1 +1 @@
{"version":3,"file":"NpiProviderScalarFieldEnum.schema.d.ts","sourceRoot":"","sources":["NpiProviderScalarFieldEnum.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,gCAAgC,oFAAkF,CAAA;AAE/H,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
{"version":3,"file":"NpiProviderScalarFieldEnum.schema.d.ts","sourceRoot":"","sources":["NpiProviderScalarFieldEnum.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,gCAAgC,qGAAmG,CAAA;AAEhJ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -35,4 +35,4 @@ var __importStar = (this && this.__importStar) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
exports.NpiProviderScalarFieldEnumSchema = void 0;
const z = __importStar(require("zod"));
exports.NpiProviderScalarFieldEnumSchema = z.enum(['id', 'userId', 'npiNumber', 'providerName', 'sortOrder', 'createdAt']);
exports.NpiProviderScalarFieldEnumSchema = z.enum(['id', 'userId', 'npiNumber', 'providerName', 'licenseNumber', 'sortOrder', 'createdAt']);
@@ -35,4 +35,4 @@ var __importStar = (this && this.__importStar) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
exports.OfficeContactScalarFieldEnumSchema = void 0;
const z = __importStar(require("zod"));
exports.OfficeContactScalarFieldEnumSchema = z.enum(['id', 'userId', 'officeName', 'receptionistName', 'dentistName', 'phoneNumber', 'email', 'fax', 'streetAddress', 'city', 'state', 'zipCode']);
exports.OfficeContactScalarFieldEnumSchema = z.enum(['id', 'userId', 'officeName', 'receptionistName', 'dentistName', 'phoneNumber', 'email', 'fax', 'streetAddress', 'city', 'state', 'zipCode', 'billingName', 'billingNpi', 'billingLicense', 'billingTaxId']);
@@ -1,4 +1,4 @@
import * as z from 'zod';
export declare const PatientScalarFieldEnumSchema: z.ZodEnum<["id", "firstName", "lastName", "dateOfBirth", "gender", "phone", "email", "address", "city", "zipCode", "insuranceProvider", "insuranceId", "groupNumber", "policyHolder", "allergies", "medicalConditions", "preferredLanguage", "status", "userId", "createdAt", "updatedAt"]>;
export declare const PatientScalarFieldEnumSchema: z.ZodEnum<["id", "firstName", "lastName", "dateOfBirth", "gender", "phone", "email", "address", "city", "state", "zipCode", "insuranceProvider", "insuranceId", "groupNumber", "policyHolder", "allergies", "medicalConditions", "preferredLanguage", "status", "remainingBenefit", "thirdPartyInsurance", "userId", "createdAt", "updatedAt"]>;
export type PatientScalarFieldEnum = z.infer<typeof PatientScalarFieldEnumSchema>;
//# sourceMappingURL=PatientScalarFieldEnum.schema.d.ts.map
@@ -1 +1 @@
{"version":3,"file":"PatientScalarFieldEnum.schema.d.ts","sourceRoot":"","sources":["PatientScalarFieldEnum.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,4BAA4B,6RAA2R,CAAA;AAEpU,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
{"version":3,"file":"PatientScalarFieldEnum.schema.d.ts","sourceRoot":"","sources":["PatientScalarFieldEnum.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,4BAA4B,iVAA+U,CAAA;AAExX,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -35,4 +35,4 @@ var __importStar = (this && this.__importStar) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
exports.PatientScalarFieldEnumSchema = void 0;
const z = __importStar(require("zod"));
exports.PatientScalarFieldEnumSchema = z.enum(['id', 'firstName', 'lastName', 'dateOfBirth', 'gender', 'phone', 'email', 'address', 'city', 'zipCode', 'insuranceProvider', 'insuranceId', 'groupNumber', 'policyHolder', 'allergies', 'medicalConditions', 'preferredLanguage', 'status', 'userId', 'createdAt', 'updatedAt']);
exports.PatientScalarFieldEnumSchema = z.enum(['id', 'firstName', 'lastName', 'dateOfBirth', 'gender', 'phone', 'email', 'address', 'city', 'state', 'zipCode', 'insuranceProvider', 'insuranceId', 'groupNumber', 'policyHolder', 'allergies', 'medicalConditions', 'preferredLanguage', 'status', 'remainingBenefit', 'thirdPartyInsurance', 'userId', 'createdAt', 'updatedAt']);
@@ -1,5 +1,5 @@
import * as z from 'zod';
export const PatientScalarFieldEnumSchema = z.enum(['id', 'firstName', 'lastName', 'dateOfBirth', 'gender', 'phone', 'email', 'address', 'city', 'zipCode', 'insuranceProvider', 'insuranceId', 'groupNumber', 'policyHolder', 'allergies', 'medicalConditions', 'preferredLanguage', 'status', 'remainingBenefit', 'thirdPartyInsurance', 'userId', 'createdAt', 'updatedAt'])
export const PatientScalarFieldEnumSchema = z.enum(['id', 'firstName', 'lastName', 'dateOfBirth', 'gender', 'phone', 'email', 'address', 'city', 'state', 'zipCode', 'insuranceProvider', 'insuranceId', 'groupNumber', 'policyHolder', 'allergies', 'medicalConditions', 'preferredLanguage', 'status', 'remainingBenefit', 'thirdPartyInsurance', 'userId', 'createdAt', 'updatedAt'])
export type PatientScalarFieldEnum = z.infer<typeof PatientScalarFieldEnumSchema>;
@@ -0,0 +1,38 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TelnyxSettingsScalarFieldEnumSchema = void 0;
const z = __importStar(require("zod"));
exports.TelnyxSettingsScalarFieldEnumSchema = z.enum(['id', 'userId', 'apiKey', 'accountSid', 'phoneNumber', 'texmlApplicationId', 'messagingProfileId', 'webhookPublicKey', 'greetingMessage']);