on the admin dashboard create a tab called "Flows" and add the estimate
This commit is contained in:
@@ -23,6 +23,19 @@ function seed() {
|
||||
)
|
||||
`);
|
||||
|
||||
// Create flows table
|
||||
db.exec(`
|
||||
CREATE TABLE IF NOT EXISTS flows (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT,
|
||||
path TEXT NOT NULL,
|
||||
createdAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updatedAt DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
`);
|
||||
|
||||
|
||||
// Check if the hourly_rate setting already exists
|
||||
const settingStmt = db.prepare('SELECT * FROM settings WHERE key = ?');
|
||||
const hourlyRateSetting = settingStmt.get('hourly_rate');
|
||||
@@ -98,6 +111,20 @@ function seed() {
|
||||
console.log('Default email template updated.');
|
||||
}
|
||||
|
||||
// Seed default flow
|
||||
const flowStmt = db.prepare('SELECT * FROM flows WHERE id = ?');
|
||||
const defaultFlow = flowStmt.get(1);
|
||||
|
||||
if (!defaultFlow) {
|
||||
const insertFlow = db.prepare(
|
||||
"INSERT INTO flows (id, name, description, path) VALUES (?, ?, ?, ?)"
|
||||
);
|
||||
insertFlow.run(1, 'Cost Estimator', 'The main cost estimation tool for clients.', '/');
|
||||
console.log('Default flow created.');
|
||||
} else {
|
||||
console.log('Default flow already exists.');
|
||||
}
|
||||
|
||||
|
||||
console.log('Seeding complete.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user