fix: extract appointmentDate for multi_claim/batch_claim/preauth intents
The classifier prompt only told the AI that appointmentDate applies to schedule_appointment/claim_only/check_and_claim, so a trailing date like "all on 6/23/26" was dropped for multi-patient claims even though the workflow already reads c.appointmentDate for those intents and silently defaulted to today. Also add Prisma config/seed scripts and shopping-vendor types/schema updates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
54
packages/db/prisma/seed.js
Normal file
54
packages/db/prisma/seed.js
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const dotenv_1 = __importDefault(require("dotenv"));
|
||||
const path_1 = __importDefault(require("path"));
|
||||
dotenv_1.default.config({ path: path_1.default.resolve(__dirname, ".env") });
|
||||
const prisma_1 = require("../generated/prisma");
|
||||
const adapter_pg_1 = require("@prisma/adapter-pg");
|
||||
const bcrypt_1 = __importDefault(require("bcrypt"));
|
||||
const adapter = new adapter_pg_1.PrismaPg({ connectionString: process.env.DATABASE_URL });
|
||||
const prisma = new prisma_1.PrismaClient({ adapter });
|
||||
function main() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const hashedPassword = yield bcrypt_1.default.hash("123456", 10);
|
||||
const admin = yield prisma.user.upsert({
|
||||
where: { username: "admin" },
|
||||
update: {},
|
||||
create: { username: "admin", password: hashedPassword },
|
||||
});
|
||||
console.log("Seed complete: admin user created (username: admin, password: 123456)");
|
||||
// Seed 5 default staff members — rename these to real staff names in Settings
|
||||
const defaultStaff = ["A", "B", "C", "D", "E"];
|
||||
for (const name of defaultStaff) {
|
||||
const existing = yield prisma.staff.findFirst({
|
||||
where: { userId: admin.id, name },
|
||||
});
|
||||
if (!existing) {
|
||||
yield prisma.staff.create({
|
||||
data: { userId: admin.id, name, role: "Staff" },
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log("Seed complete: 5 default staff members created (A, B, C, D, E)");
|
||||
});
|
||||
}
|
||||
main()
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(() => __awaiter(void 0, void 0, void 0, function* () {
|
||||
yield prisma.$disconnect();
|
||||
}));
|
||||
Reference in New Issue
Block a user