From 12cf010229a308aa2035de91a0845bf8fd2d1255 Mon Sep 17 00:00:00 2001 From: important-new Date: Tue, 14 Jul 2026 09:56:06 +0800 Subject: [PATCH 1/5] feat(db): add lint:naming gate (boolean columns must be is_/has_) --- package.json | 3 +- scripts/check-naming.mjs | 62 ++++++++++++++++++++++++ tests/unit/platform/check-naming.spec.ts | 57 ++++++++++++++++++++++ 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 scripts/check-naming.mjs create mode 100644 tests/unit/platform/check-naming.spec.ts diff --git a/package.json b/package.json index d875c5b8..83b9f7c1 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,9 @@ "type-check": "react-router typegen && npm run type-check:app && npm run type-check:api", "type-check:app": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc -p tsconfig.json --noEmit --incremental --tsBuildInfoFile ./.tsbuildinfo.app", "type-check:api": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc -p tsconfig.api.json --noEmit --incremental --tsBuildInfoFile ./.tsbuildinfo.api", - "lint": "eslint . --cache && npm run lint:ds && npm run lint:svg && npm run lint:erasure && npm run lint:migrefs && npm run lint:filesize && npm run lint:dup && npm run lint:tenant-scope && npm run lint:tests && npm run lint:deadcode && npm run lint:timestamps", + "lint": "eslint . --cache && npm run lint:ds && npm run lint:svg && npm run lint:erasure && npm run lint:migrefs && npm run lint:filesize && npm run lint:dup && npm run lint:tenant-scope && npm run lint:tests && npm run lint:deadcode && npm run lint:timestamps && npm run lint:naming", "lint:ds": "node scripts/check-ds-tokens.mjs", + "lint:naming": "node scripts/check-naming.mjs", "lint:svg": "node scripts/check-svg-dimensions.mjs", "lint:erasure": "node scripts/check-erasure-manifest.mjs", "lint:migrefs": "node scripts/check-migration-refs.mjs", diff --git a/scripts/check-naming.mjs b/scripts/check-naming.mjs new file mode 100644 index 00000000..0ac03f60 --- /dev/null +++ b/scripts/check-naming.mjs @@ -0,0 +1,62 @@ +#!/usr/bin/env node +/** + * Boolean-column naming gate (#227, see CLAUDE.md "Schema Rules" → Naming). + * Every `integer(..., { mode: 'boolean' })` SQL column name MUST start with + * `is_` or `has_` so booleans read as predicates at the DB layer. This gate + * only inspects the SQL-name string (the `integer('', …)` argument); + * the camelCase JS property is unconstrained. + * + * A line can opt out with a trailing `// naming-lint-ok: ` comment. + */ +import { readFileSync, readdirSync, statSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { join } from 'node:path'; + +/** @returns {string[]} human-readable violation messages */ +export function findNamingViolations(source, filename) { + const out = []; + const lines = source.split('\n'); + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + if (/naming-lint-ok:/.test(line)) continue; + const m = line.match(/integer\('([a-z0-9_]+)'[^)]*mode:\s*'boolean'/); + if (m && !/^(is_|has_)/.test(m[1])) { + out.push(`${filename}:${i + 1} boolean column '${m[1]}' must start with is_/has_`); + } + } + return out; +} + +// Recursively collect *.ts files under a directory. Node 22 on this repo does +// not export `globSync` from `node:fs` (mirrors scripts/check-timestamps.mjs). +function collectTsFiles(dir) { + const out = []; + let entries; + try { + entries = readdirSync(dir); + } catch { + return out; + } + for (const entry of entries) { + const full = join(dir, entry); + const stat = statSync(full); + if (stat.isDirectory()) { + out.push(...collectTsFiles(full)); + } else if (entry.endsWith('.ts')) { + out.push(full); + } + } + return out; +} + +// CLI +if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) { + const files = collectTsFiles('server/lib/db/schema'); + let violations = []; + for (const f of files) violations = violations.concat(findNamingViolations(readFileSync(f, 'utf8'), f)); + if (violations.length) { + console.error('naming gate FAILED:\n' + violations.join('\n')); + process.exit(1); + } + console.log(`naming gate OK (${files.length} schema files)`); +} diff --git a/tests/unit/platform/check-naming.spec.ts b/tests/unit/platform/check-naming.spec.ts new file mode 100644 index 00000000..808be441 --- /dev/null +++ b/tests/unit/platform/check-naming.spec.ts @@ -0,0 +1,57 @@ +/** + * Unit tests for the boolean-column naming gate. + * + * Tests the exported `findNamingViolations` function from + * `scripts/check-naming.mjs` using string fixtures. Per CLAUDE.md "Schema + * Rules" → Naming (#227), every `integer(..., { mode: 'boolean' })` SQL column + * name MUST start with `is_`/`has_`. The gate inspects only the SQL-name + * string, not the camelCase JS property. + */ +import { describe, it, expect, beforeAll } from 'vitest'; +import { pathToFileURL } from 'node:url'; +import path from 'node:path'; + +// Load the exported function from the .mjs script at runtime, inside beforeAll +// (see check-timestamps.spec.ts for why the import is deferred). +let findNamingViolations: (source: string, filename: string) => string[]; + +beforeAll(async () => { + const scriptPath = path.resolve( + import.meta.dirname ?? path.join(process.cwd()), + '../../../scripts/check-naming.mjs', + ); + // @vite-ignore — load the .mjs via native Node import; vitest's transform + // cannot process this script (esbuild target) and throws a SyntaxError. + ({ findNamingViolations } = await import(/* @vite-ignore */ pathToFileURL(scriptPath).href)); +}); + +describe('check-naming gate', () => { + it('passes an is_ boolean column', () => { + const src = `active: integer('is_active', { mode: 'boolean' }).notNull(),`; + expect(findNamingViolations(src, 'x.ts')).toEqual([]); + }); + it('passes a has_ boolean column', () => { + const src = `x: integer('has_sender_attached', { mode: 'boolean' }),`; + expect(findNamingViolations(src, 'x.ts')).toEqual([]); + }); + it('flags a bare boolean column name', () => { + const src = `active: integer('active', { mode: 'boolean' }).notNull(),`; + expect(findNamingViolations(src, 'x.ts')).toHaveLength(1); + }); + it('flags a verb-prefixed boolean (enable_/block_/show_)', () => { + const src = [ + `enableRepairList: integer('enable_repair_list', { mode: 'boolean' }),`, + `blockUnpaid: integer('block_unpaid', { mode: 'boolean' }),`, + `showEstimates: integer('show_estimates', { mode: 'boolean' }),`, + ].join('\n'); + expect(findNamingViolations(src, 'x.ts')).toHaveLength(3); + }); + it('does NOT flag non-boolean integer columns', () => { + const src = `sortOrder: integer('sort_order').notNull().default(0),`; + expect(findNamingViolations(src, 'x.ts')).toEqual([]); + }); + it('respects // naming-lint-ok exemption', () => { + const src = `legacyFlag: integer('active', { mode: 'boolean' }), // naming-lint-ok: frozen legacy column`; + expect(findNamingViolations(src, 'x.ts')).toEqual([]); + }); +}); From 6943366995ab83a29d46918e65cca2ebbef6c904 Mon Sep 17 00:00:00 2001 From: important-new Date: Tue, 14 Jul 2026 10:04:31 +0800 Subject: [PATCH 2/5] docs(db): OI boolean column rename map (is_/has_) --- .../notes/2026-07-14-oi-boolean-rename-map.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/superpowers/notes/2026-07-14-oi-boolean-rename-map.md diff --git a/docs/superpowers/notes/2026-07-14-oi-boolean-rename-map.md b/docs/superpowers/notes/2026-07-14-oi-boolean-rename-map.md new file mode 100644 index 00000000..2d13cc2b --- /dev/null +++ b/docs/superpowers/notes/2026-07-14-oi-boolean-rename-map.md @@ -0,0 +1,67 @@ +# OI Boolean Column Rename Map (is_/has_) — #227 + +Authoritative old→new SQL-column-name map for the `is_*` / `has_*` boolean +naming normalization. **Only the `integer('', …)` string changes;** +the camelCase JS property (first column) is unchanged, so all consumer code is +untouched. Each row maps to exactly one `ALTER TABLE RENAME COLUMN` +statement in `migrations/0001_boolean_columns_is_has.sql`. + +Already-compliant booleans (`is_available`, `is_default`, `is_seed`, +`is_seeded`, `is_amendment`, `is_managed`, …) are omitted — no change needed. + +| schema file | JS prop | table | old SQL | new SQL | +|---|---|---|---|---| +| commercial-subtypes.ts | disabled | `commercial_subtypes` | `disabled` | `is_disabled` | +| compliance.ts | senderAttached | `messaging_compliance` | `sender_attached` | `has_sender_attached` | +| inspection/automation.ts | active | `automations` | `active` | `is_active` | +| inspection/automation.ts | active | `event_types` | `active` | `is_active` | +| inspection/automation.ts | enabled | `inspection_types` | `enabled` | `is_enabled` | +| inspection/core.ts | paymentRequired | `inspections` | `payment_required` | `is_payment_required` | +| inspection/core.ts | agreementRequired | `inspections` | `agreement_required` | `is_agreement_required` | +| inspection/core.ts | autoSignOnPublish | `inspections` | `auto_sign_on_publish` | `is_auto_sign_on_publish` | +| inspection/core.ts | disableAutomations | `inspections` | `disable_automations` | `is_automations_disabled` | +| inspection/core.ts | teamMode | `inspections` | `team_mode` | `is_team_mode` | +| inspection/defect-category.ts | drivesSummary | `defect_categories` | `drives_summary` | `is_summary_driver` | +| inspection/services.ts | active | `services` | `active` | `is_active` | +| inspection/services.ts | active | `discount_codes` | `active` | `is_active` | +| inspection/template-rating.ts | featured | `templates` | `featured` | `is_featured` | +| marketplace.ts | featured | `marketplace_templates` | `featured` | `is_featured` | +| marketplace.ts | featured | `marketplace_libraries` | `featured` | `is_featured` | +| pca-compliance.ts | dualRole | `report_signoff` | `dual_role` | `is_dual_role` | +| pca-compliance.ts | requested | `document_review_items` | `requested` | `is_requested` | +| pca-compliance.ts | received | `document_review_items` | `received` | `is_received` | +| pca-compliance.ts | reviewed | `document_review_items` | `reviewed` | `is_reviewed` | +| pca-compliance.ts | na | `document_review_items` | `na` | `is_na` | +| qbo.ts | syncEnabled | `qbo_connections` | `sync_enabled` | `is_sync_enabled` | +| qbo.ts | resolved | `qbo_sync_errors` | `resolved` | `is_resolved` | +| tenant/core.ts | pdfShowFooter | `tenant_configs` | `pdf_show_footer` | `is_pdf_footer_shown` | +| tenant/core.ts | pdfShowPageNumbers | `tenant_configs` | `pdf_show_page_numbers` | `is_pdf_page_numbers_shown` | +| tenant/core.ts | pdfShowLicense | `tenant_configs` | `pdf_show_license` | `is_pdf_license_shown` | +| tenant/core.ts | showEstimates | `tenant_configs` | `show_estimates` | `is_estimates_shown` | +| tenant/core.ts | enableRepairList | `tenant_configs` | `enable_repair_list` | `is_repair_list_enabled` | +| tenant/core.ts | enableCustomerRepairExport | `tenant_configs` | `enable_customer_repair_export` | `is_customer_repair_export_enabled` | +| tenant/core.ts | blockUnpaid | `tenant_configs` | `block_unpaid` | `is_unpaid_blocked` | +| tenant/core.ts | blockUnsignedAgreement | `tenant_configs` | `block_unsigned_agreement` | `is_unsigned_agreement_blocked` | +| tenant/core.ts | conciergeReviewRequired | `tenant_configs` | `concierge_review_required` | `is_concierge_review_required` | +| tenant/core.ts | allowInspectorChoice | `tenant_configs` | `allow_inspector_choice` | `is_inspector_choice_allowed` | +| tenant/core.ts | enablePdfPipeline | `tenant_configs` | `enable_pdf_pipeline` | `is_pdf_pipeline_enabled` | +| tenant/core.ts | teamModeDefault | `tenant_configs` | `team_mode_default` | `is_team_mode_default` | +| tenant/core.ts | apprenticeReviewRequired | `tenant_configs` | `apprentice_review_required` | `is_apprentice_review_required` | +| tenant/core.ts | guestInvitesEnabled | `tenant_configs` | `guest_invites_enabled` | `is_guest_invites_enabled` | +| tenant/core.ts | collabEditing | `tenant_configs` | `collab_editing` | `is_collab_editing_enabled` | +| tenant/core.ts | managedEligible | `tenant_configs` | `managed_eligible` | `is_managed_eligible` | +| tenant/core.ts | reserveScheduleEnabled | `tenant_configs` | `reserve_schedule_enabled` | `is_reserve_schedule_enabled` | +| tenant/core.ts | enabled | `email_templates` | `enabled` | `is_enabled` | +| tenant/integration.ts | ok | `integration_test_results` | `ok` | `is_ok` | +| tenant/user.ts | signatureEnabled | `users` | `signature_enabled` | `is_signature_enabled` | +| tenant/user.ts | totpEnabled | `users` | `totp_enabled` | `is_totp_enabled` | +| tenant/user.ts | notifyOnReferral | `users` | `notify_on_referral` | `is_referral_notification_enabled` | +| tenant/user.ts | notifyOnReport | `users` | `notify_on_report` | `is_report_notification_enabled` | +| tenant/user.ts | notifyOnPaid | `users` | `notify_on_paid` | `is_paid_notification_enabled` | + +**47 renames.** The last 10 (`dual_role`, `requested`/`received`/`reviewed`/`na`, +`team_mode_default`, `guest_invites_enabled`, `reserve_schedule_enabled`, +`notify_on_report`, `notify_on_paid`) were added by the commercial-PCA epic +after the original Plan-2 draft; they follow the same convention (simple +prefix, or `_enabled`/`_shown`/`_disabled` state-oriented phrasing to match the +sibling columns already in the plan's map). From c991466ffb6fee4546aee3378a217ea06ed41788 Mon Sep 17 00:00:00 2001 From: important-new Date: Tue, 14 Jul 2026 10:04:41 +0800 Subject: [PATCH 3/5] refactor(db): rename boolean SQL columns to is_/has_ (RENAME COLUMN, JS props unchanged) --- migrations/0001_boolean_columns_is_has.sql | 52 + migrations/meta/0001_snapshot.json | 9402 +++++++++++++++++ migrations/meta/_journal.json | 9 +- server/lib/db/schema/commercial-subtypes.ts | 2 +- server/lib/db/schema/compliance.ts | 2 +- server/lib/db/schema/inspection/automation.ts | 6 +- server/lib/db/schema/inspection/core.ts | 10 +- .../db/schema/inspection/defect-category.ts | 2 +- server/lib/db/schema/inspection/services.ts | 4 +- .../db/schema/inspection/template-rating.ts | 2 +- server/lib/db/schema/marketplace.ts | 4 +- server/lib/db/schema/pca-compliance.ts | 10 +- server/lib/db/schema/qbo.ts | 4 +- server/lib/db/schema/tenant/core.ts | 36 +- server/lib/db/schema/tenant/integration.ts | 2 +- server/lib/db/schema/tenant/user.ts | 10 +- 16 files changed, 9509 insertions(+), 48 deletions(-) create mode 100644 migrations/0001_boolean_columns_is_has.sql create mode 100644 migrations/meta/0001_snapshot.json diff --git a/migrations/0001_boolean_columns_is_has.sql b/migrations/0001_boolean_columns_is_has.sql new file mode 100644 index 00000000..296df183 --- /dev/null +++ b/migrations/0001_boolean_columns_is_has.sql @@ -0,0 +1,52 @@ +-- Boolean column naming normalization (#227): every boolean SQL column is +-- renamed to the is_/has_ predicate convention. Data-preserving native SQLite +-- RENAME COLUMN (no table rebuild, no FK-drop risk on D1). The Drizzle JS +-- property names are unchanged, so no consumer code moves with this migration. +-- Old→new map: docs/superpowers/notes/2026-07-14-oi-boolean-rename-map.md +ALTER TABLE `commercial_subtypes` RENAME COLUMN `disabled` TO `is_disabled`; +ALTER TABLE `messaging_compliance` RENAME COLUMN `sender_attached` TO `has_sender_attached`; +ALTER TABLE `automations` RENAME COLUMN `active` TO `is_active`; +ALTER TABLE `event_types` RENAME COLUMN `active` TO `is_active`; +ALTER TABLE `inspection_types` RENAME COLUMN `enabled` TO `is_enabled`; +ALTER TABLE `inspections` RENAME COLUMN `payment_required` TO `is_payment_required`; +ALTER TABLE `inspections` RENAME COLUMN `agreement_required` TO `is_agreement_required`; +ALTER TABLE `inspections` RENAME COLUMN `auto_sign_on_publish` TO `is_auto_sign_on_publish`; +ALTER TABLE `inspections` RENAME COLUMN `disable_automations` TO `is_automations_disabled`; +ALTER TABLE `inspections` RENAME COLUMN `team_mode` TO `is_team_mode`; +ALTER TABLE `defect_categories` RENAME COLUMN `drives_summary` TO `is_summary_driver`; +ALTER TABLE `services` RENAME COLUMN `active` TO `is_active`; +ALTER TABLE `discount_codes` RENAME COLUMN `active` TO `is_active`; +ALTER TABLE `templates` RENAME COLUMN `featured` TO `is_featured`; +ALTER TABLE `marketplace_templates` RENAME COLUMN `featured` TO `is_featured`; +ALTER TABLE `marketplace_libraries` RENAME COLUMN `featured` TO `is_featured`; +ALTER TABLE `report_signoff` RENAME COLUMN `dual_role` TO `is_dual_role`; +ALTER TABLE `document_review_items` RENAME COLUMN `requested` TO `is_requested`; +ALTER TABLE `document_review_items` RENAME COLUMN `received` TO `is_received`; +ALTER TABLE `document_review_items` RENAME COLUMN `reviewed` TO `is_reviewed`; +ALTER TABLE `document_review_items` RENAME COLUMN `na` TO `is_na`; +ALTER TABLE `qbo_connections` RENAME COLUMN `sync_enabled` TO `is_sync_enabled`; +ALTER TABLE `qbo_sync_errors` RENAME COLUMN `resolved` TO `is_resolved`; +ALTER TABLE `tenant_configs` RENAME COLUMN `pdf_show_footer` TO `is_pdf_footer_shown`; +ALTER TABLE `tenant_configs` RENAME COLUMN `pdf_show_page_numbers` TO `is_pdf_page_numbers_shown`; +ALTER TABLE `tenant_configs` RENAME COLUMN `pdf_show_license` TO `is_pdf_license_shown`; +ALTER TABLE `tenant_configs` RENAME COLUMN `show_estimates` TO `is_estimates_shown`; +ALTER TABLE `tenant_configs` RENAME COLUMN `enable_repair_list` TO `is_repair_list_enabled`; +ALTER TABLE `tenant_configs` RENAME COLUMN `enable_customer_repair_export` TO `is_customer_repair_export_enabled`; +ALTER TABLE `tenant_configs` RENAME COLUMN `block_unpaid` TO `is_unpaid_blocked`; +ALTER TABLE `tenant_configs` RENAME COLUMN `block_unsigned_agreement` TO `is_unsigned_agreement_blocked`; +ALTER TABLE `tenant_configs` RENAME COLUMN `concierge_review_required` TO `is_concierge_review_required`; +ALTER TABLE `tenant_configs` RENAME COLUMN `allow_inspector_choice` TO `is_inspector_choice_allowed`; +ALTER TABLE `tenant_configs` RENAME COLUMN `enable_pdf_pipeline` TO `is_pdf_pipeline_enabled`; +ALTER TABLE `tenant_configs` RENAME COLUMN `team_mode_default` TO `is_team_mode_default`; +ALTER TABLE `tenant_configs` RENAME COLUMN `apprentice_review_required` TO `is_apprentice_review_required`; +ALTER TABLE `tenant_configs` RENAME COLUMN `guest_invites_enabled` TO `is_guest_invites_enabled`; +ALTER TABLE `tenant_configs` RENAME COLUMN `collab_editing` TO `is_collab_editing_enabled`; +ALTER TABLE `tenant_configs` RENAME COLUMN `managed_eligible` TO `is_managed_eligible`; +ALTER TABLE `tenant_configs` RENAME COLUMN `reserve_schedule_enabled` TO `is_reserve_schedule_enabled`; +ALTER TABLE `email_templates` RENAME COLUMN `enabled` TO `is_enabled`; +ALTER TABLE `integration_test_results` RENAME COLUMN `ok` TO `is_ok`; +ALTER TABLE `users` RENAME COLUMN `signature_enabled` TO `is_signature_enabled`; +ALTER TABLE `users` RENAME COLUMN `totp_enabled` TO `is_totp_enabled`; +ALTER TABLE `users` RENAME COLUMN `notify_on_referral` TO `is_referral_notification_enabled`; +ALTER TABLE `users` RENAME COLUMN `notify_on_report` TO `is_report_notification_enabled`; +ALTER TABLE `users` RENAME COLUMN `notify_on_paid` TO `is_paid_notification_enabled`; diff --git a/migrations/meta/0001_snapshot.json b/migrations/meta/0001_snapshot.json new file mode 100644 index 00000000..cb4e8bae --- /dev/null +++ b/migrations/meta/0001_snapshot.json @@ -0,0 +1,9402 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "172ae479-54d3-4f2a-bfd7-d5ec51e2529f", + "prevId": "e782a15b-2dbc-41a9-8db3-6456ff9a3a8b", + "tables": { + "agreement_requests": { + "name": "agreement_requests", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agreement_id": { + "name": "agreement_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client_email": { + "name": "client_email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client_name": { + "name": "client_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "signature_base64": { + "name": "signature_base64", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "signed_at": { + "name": "signed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "viewed_at": { + "name": "viewed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sent_at": { + "name": "sent_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inspector_signature_base64": { + "name": "inspector_signature_base64", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inspector_signed_at": { + "name": "inspector_signed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inspector_user_id": { + "name": "inspector_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "verification_token": { + "name": "verification_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content_snapshot": { + "name": "content_snapshot", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "completion_policy": { + "name": "completion_policy", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'all'" + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "purged_at": { + "name": "purged_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "agreement_requests_token_unique": { + "name": "agreement_requests_token_unique", + "columns": [ + "token" + ], + "isUnique": true + }, + "idx_agreement_requests_verify_token": { + "name": "idx_agreement_requests_verify_token", + "columns": [ + "verification_token" + ], + "isUnique": true + }, + "idx_agreement_requests_tenant": { + "name": "idx_agreement_requests_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_agreement_requests_inspection": { + "name": "idx_agreement_requests_inspection", + "columns": [ + "inspection_id" + ], + "isUnique": false + }, + "idx_agreement_requests_token_hash": { + "name": "idx_agreement_requests_token_hash", + "columns": [ + "token_hash" + ], + "isUnique": true + } + }, + "foreignKeys": { + "agreement_requests_tenant_id_tenants_id_fk": { + "name": "agreement_requests_tenant_id_tenants_id_fk", + "tableFrom": "agreement_requests", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "agreement_requests_inspection_id_inspections_id_fk": { + "name": "agreement_requests_inspection_id_inspections_id_fk", + "tableFrom": "agreement_requests", + "tableTo": "inspections", + "columnsFrom": [ + "inspection_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "agreement_requests_agreement_id_agreements_id_fk": { + "name": "agreement_requests_agreement_id_agreements_id_fk", + "tableFrom": "agreement_requests", + "tableTo": "agreements", + "columnsFrom": [ + "agreement_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "agreement_requests_inspector_user_id_users_id_fk": { + "name": "agreement_requests_inspector_user_id_users_id_fk", + "tableFrom": "agreement_requests", + "tableTo": "users", + "columnsFrom": [ + "inspector_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "agreement_signers": { + "name": "agreement_signers", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "request_id": { + "name": "request_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'client'" + }, + "contact_id": { + "name": "contact_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token_enc": { + "name": "token_enc", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "signature_base64": { + "name": "signature_base64", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "signed_at": { + "name": "signed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "viewed_at": { + "name": "viewed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "channel": { + "name": "channel", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "on_behalf_of": { + "name": "on_behalf_of", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "on_behalf_disclaimer": { + "name": "on_behalf_disclaimer", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_reminded_at": { + "name": "last_reminded_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_agreement_signers_tenant_request": { + "name": "idx_agreement_signers_tenant_request", + "columns": [ + "tenant_id", + "request_id" + ], + "isUnique": false + }, + "idx_agreement_signers_request_email": { + "name": "idx_agreement_signers_request_email", + "columns": [ + "request_id", + "email" + ], + "isUnique": true + }, + "idx_agreement_signers_token_hash": { + "name": "idx_agreement_signers_token_hash", + "columns": [ + "token_hash" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "agreements": { + "name": "agreements", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_agreements_tenant": { + "name": "idx_agreements_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "agreements_tenant_id_tenants_id_fk": { + "name": "agreements_tenant_id_tenants_id_fk", + "tableFrom": "agreements", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "automation_logs": { + "name": "automation_logs", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "automation_id": { + "name": "automation_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "recipient": { + "name": "recipient", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "channel": { + "name": "channel", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'email'" + }, + "send_at": { + "name": "send_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "delivered_at": { + "name": "delivered_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_automation_logs_pending": { + "name": "idx_automation_logs_pending", + "columns": [ + "tenant_id", + "status", + "send_at" + ], + "isUnique": false + }, + "idx_automation_logs_insp": { + "name": "idx_automation_logs_insp", + "columns": [ + "inspection_id" + ], + "isUnique": false + }, + "uq_automation_logs_event": { + "name": "uq_automation_logs_event", + "columns": [ + "automation_id", + "inspection_id", + "event_id" + ], + "isUnique": true, + "where": "event_id IS NOT NULL" + } + }, + "foreignKeys": { + "automation_logs_tenant_id_tenants_id_fk": { + "name": "automation_logs_tenant_id_tenants_id_fk", + "tableFrom": "automation_logs", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "automations": { + "name": "automations", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "trigger": { + "name": "trigger", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "recipient": { + "name": "recipient", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "delay_minutes": { + "name": "delay_minutes", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "subject_template": { + "name": "subject_template", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "body_template": { + "name": "body_template", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email_template_id": { + "name": "email_template_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "conditions": { + "name": "conditions", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "channels": { + "name": "channels", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[\"email\"]'" + }, + "sms_body": { + "name": "sms_body", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sms_template_id": { + "name": "sms_template_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_active": { + "name": "is_active", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "is_default": { + "name": "is_default", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_automations_tenant": { + "name": "idx_automations_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "automations_tenant_id_tenants_id_fk": { + "name": "automations_tenant_id_tenants_id_fk", + "tableFrom": "automations", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "availability": { + "name": "availability", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspector_id": { + "name": "inspector_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "day_of_week": { + "name": "day_of_week", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "start_time": { + "name": "start_time", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "end_time": { + "name": "end_time", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_availability_inspector": { + "name": "idx_availability_inspector", + "columns": [ + "inspector_id" + ], + "isUnique": false + }, + "idx_availability_window_unique": { + "name": "idx_availability_window_unique", + "columns": [ + "inspector_id", + "day_of_week", + "start_time" + ], + "isUnique": true + } + }, + "foreignKeys": { + "availability_tenant_id_tenants_id_fk": { + "name": "availability_tenant_id_tenants_id_fk", + "tableFrom": "availability", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "availability_inspector_id_users_id_fk": { + "name": "availability_inspector_id_users_id_fk", + "tableFrom": "availability", + "tableTo": "users", + "columnsFrom": [ + "inspector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "availability_overrides": { + "name": "availability_overrides", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspector_id": { + "name": "inspector_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_available": { + "name": "is_available", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "start_time": { + "name": "start_time", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "end_time": { + "name": "end_time", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_avail_overrides_insp": { + "name": "idx_avail_overrides_insp", + "columns": [ + "inspector_id" + ], + "isUnique": false + }, + "idx_avail_overrides_block_unique": { + "name": "idx_avail_overrides_block_unique", + "columns": [ + "inspector_id", + "date" + ], + "isUnique": true, + "where": "is_available = 0" + } + }, + "foreignKeys": { + "availability_overrides_tenant_id_tenants_id_fk": { + "name": "availability_overrides_tenant_id_tenants_id_fk", + "tableFrom": "availability_overrides", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "availability_overrides_inspector_id_users_id_fk": { + "name": "availability_overrides_inspector_id_users_id_fk", + "tableFrom": "availability_overrides", + "tableTo": "users", + "columnsFrom": [ + "inspector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "comment_usage": { + "name": "comment_usage", + "columns": { + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "comment_id": { + "name": "comment_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "use_count": { + "name": "use_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "last_used_at": { + "name": "last_used_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_comment_usage_user_last_used": { + "name": "idx_comment_usage_user_last_used", + "columns": [ + "tenant_id", + "user_id", + "last_used_at" + ], + "isUnique": false + } + }, + "foreignKeys": { + "comment_usage_comment_id_comments_id_fk": { + "name": "comment_usage_comment_id_comments_id_fk", + "tableFrom": "comment_usage", + "tableTo": "comments", + "columnsFrom": [ + "comment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "comment_usage_tenant_id_user_id_comment_id_pk": { + "columns": [ + "tenant_id", + "user_id", + "comment_id" + ], + "name": "comment_usage_tenant_id_user_id_comment_id_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "comments": { + "name": "comments", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rating_bucket": { + "name": "rating_bucket", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "section": { + "name": "section", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "library_id": { + "name": "library_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "section_ids": { + "name": "section_ids", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "item_labels": { + "name": "item_labels", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "trigger_code": { + "name": "trigger_code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "search_keywords": { + "name": "search_keywords", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "item_label": { + "name": "item_label", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "severity": { + "name": "severity", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "repair_summary": { + "name": "repair_summary", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "estimate_min_cents": { + "name": "estimate_min_cents", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "estimate_max_cents": { + "name": "estimate_max_cents", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "recommended_contractor_type_id": { + "name": "recommended_contractor_type_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_comments_tenant": { + "name": "idx_comments_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_comments_rating_bucket": { + "name": "idx_comments_rating_bucket", + "columns": [ + "tenant_id", + "rating_bucket" + ], + "isUnique": false + }, + "idx_comments_library_id": { + "name": "idx_comments_library_id", + "columns": [ + "library_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "comments_tenant_id_tenants_id_fk": { + "name": "comments_tenant_id_tenants_id_fk", + "tableFrom": "comments", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "commercial_subtypes": { + "name": "commercial_subtypes", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "based_on": { + "name": "based_on", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_disabled": { + "name": "is_disabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_commercial_subtypes_tenant_name": { + "name": "idx_commercial_subtypes_tenant_name", + "columns": [ + "tenant_id", + "name" + ], + "isUnique": true + } + }, + "foreignKeys": { + "commercial_subtypes_tenant_id_tenants_id_fk": { + "name": "commercial_subtypes_tenant_id_tenants_id_fk", + "tableFrom": "commercial_subtypes", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "concierge_confirm_tokens": { + "name": "concierge_confirm_tokens", + "columns": { + "token": { + "name": "token", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client_email": { + "name": "client_email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "confirmed_at": { + "name": "confirmed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_concierge_tokens_expiry": { + "name": "idx_concierge_tokens_expiry", + "columns": [ + "expires_at" + ], + "isUnique": false + }, + "idx_concierge_confirm_token_hash": { + "name": "idx_concierge_confirm_token_hash", + "columns": [ + "token_hash" + ], + "isUnique": true + } + }, + "foreignKeys": { + "concierge_confirm_tokens_inspection_id_inspections_id_fk": { + "name": "concierge_confirm_tokens_inspection_id_inspections_id_fk", + "tableFrom": "concierge_confirm_tokens", + "tableTo": "inspections", + "columnsFrom": [ + "inspection_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "contacts": { + "name": "contacts", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'client'" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "phone": { + "name": "phone", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "agency": { + "name": "agency", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "archived_at": { + "name": "archived_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_contacts_type": { + "name": "idx_contacts_type", + "columns": [ + "tenant_id", + "type" + ], + "isUnique": false + }, + "idx_contacts_tenant": { + "name": "idx_contacts_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "uq_contacts_tenant_email": { + "name": "uq_contacts_tenant_email", + "columns": [ + "tenant_id", + "email" + ], + "isUnique": true, + "where": "email IS NOT NULL AND archived_at IS NULL" + } + }, + "foreignKeys": { + "contacts_tenant_id_tenants_id_fk": { + "name": "contacts_tenant_id_tenants_id_fk", + "tableFrom": "contacts", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "contractor_types": { + "name": "contractor_types", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_contractor_types_tenant": { + "name": "idx_contractor_types_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "cost_items": { + "name": "cost_items", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "building_id": { + "name": "building_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "instance_index": { + "name": "instance_index", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "unit_id": { + "name": "unit_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "finding_key": { + "name": "finding_key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "system": { + "name": "system", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "component": { + "name": "component", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "cost_method": { + "name": "cost_method", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "uom": { + "name": "uom", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "unit_cost_cents": { + "name": "unit_cost_cents", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lump_sum_cents": { + "name": "lump_sum_cents", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "eul": { + "name": "eul", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "eff_age": { + "name": "eff_age", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rul": { + "name": "rul", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "suggested_remedy": { + "name": "suggested_remedy", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "section_ref": { + "name": "section_ref", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "photo_ref": { + "name": "photo_ref", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_cost_items_tenant_inspection": { + "name": "idx_cost_items_tenant_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + }, + "idx_cost_items_finding_key": { + "name": "idx_cost_items_finding_key", + "columns": [ + "finding_key" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "defect_categories": { + "name": "defect_categories", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'#6b7280'" + }, + "is_summary_driver": { + "name": "is_summary_driver", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "is_seed": { + "name": "is_seed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_defect_categories_tenant": { + "name": "idx_defect_categories_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "discount_codes": { + "name": "discount_codes", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "max_uses": { + "name": "max_uses", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "uses_count": { + "name": "uses_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_active": { + "name": "is_active", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_discount_codes_tenant": { + "name": "idx_discount_codes_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "uq_discount_codes_code_tenant": { + "name": "uq_discount_codes_code_tenant", + "columns": [ + "upper(code)", + "tenant_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "discount_codes_tenant_id_tenants_id_fk": { + "name": "discount_codes_tenant_id_tenants_id_fk", + "tableFrom": "discount_codes", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "document_review_items": { + "name": "document_review_items", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "document_key": { + "name": "document_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_requested": { + "name": "is_requested", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_received": { + "name": "is_received", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_reviewed": { + "name": "is_reviewed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_na": { + "name": "is_na", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "idx_doc_review_inspection": { + "name": "idx_doc_review_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + }, + "uq_doc_review_item": { + "name": "uq_doc_review_item", + "columns": [ + "inspection_id", + "document_key" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "email_suppressions": { + "name": "email_suppressions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_provider": { + "name": "source_provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider_event_id": { + "name": "provider_event_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_email_suppressions_email": { + "name": "idx_email_suppressions_email", + "columns": [ + "tenant_id", + "email" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "erasure_log": { + "name": "erasure_log", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject_email": { + "name": "subject_email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "requested_by": { + "name": "requested_by", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "identity_basis": { + "name": "identity_basis", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "decisions_json": { + "name": "decisions_json", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "retained_count": { + "name": "retained_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "anonymized_count": { + "name": "anonymized_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "deleted_count": { + "name": "deleted_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "response_note": { + "name": "response_note", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_erasure_log_tenant": { + "name": "idx_erasure_log_tenant", + "columns": [ + "tenant_id", + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "esign_audit_logs": { + "name": "esign_audit_logs", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "request_id": { + "name": "request_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "event": { + "name": "event", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "payload_json": { + "name": "payload_json", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "prev_hash": { + "name": "prev_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "signature": { + "name": "signature", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_fingerprint": { + "name": "key_fingerprint", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_esign_audit_logs_request": { + "name": "idx_esign_audit_logs_request", + "columns": [ + "tenant_id", + "request_id", + "created_at" + ], + "isUnique": false + }, + "idx_esign_audit_logs_event_dedup": { + "name": "idx_esign_audit_logs_event_dedup", + "columns": [ + "tenant_id", + "request_id", + "event" + ], + "isUnique": true, + "where": "event NOT LIKE 'signer.%'" + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "event_types": { + "name": "event_types", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "default_duration_min": { + "name": "default_duration_min", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 30 + }, + "default_price_cents": { + "name": "default_price_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'#6366f1'" + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "is_active": { + "name": "is_active", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "uq_event_types_tenant_slug": { + "name": "uq_event_types_tenant_slug", + "columns": [ + "tenant_id", + "slug" + ], + "isUnique": true + } + }, + "foreignKeys": { + "event_types_tenant_id_tenants_id_fk": { + "name": "event_types_tenant_id_tenants_id_fk", + "tableFrom": "event_types", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_access_tokens": { + "name": "inspection_access_tokens", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "recipient_email": { + "name": "recipient_email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'client'" + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token_enc": { + "name": "token_enc", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_iat_token": { + "name": "idx_iat_token", + "columns": [ + "token" + ], + "isUnique": true + }, + "idx_iat_inspection": { + "name": "idx_iat_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + }, + "idx_iat_recipient": { + "name": "idx_iat_recipient", + "columns": [ + "inspection_id", + "recipient_email" + ], + "isUnique": true + }, + "idx_iat_token_hash": { + "name": "idx_iat_token_hash", + "columns": [ + "token_hash" + ], + "isUnique": true + } + }, + "foreignKeys": { + "inspection_access_tokens_tenant_id_tenants_id_fk": { + "name": "inspection_access_tokens_tenant_id_tenants_id_fk", + "tableFrom": "inspection_access_tokens", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_events": { + "name": "inspection_events", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "event_type_id": { + "name": "event_type_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspector_id": { + "name": "inspector_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "scheduled_at": { + "name": "scheduled_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "duration_min": { + "name": "duration_min", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "price_cents": { + "name": "price_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'scheduled'" + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "completed_at": { + "name": "completed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "results_received_at": { + "name": "results_received_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cancelled_at": { + "name": "cancelled_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gcal_event_id": { + "name": "gcal_event_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_inspection_events_scheduled": { + "name": "idx_inspection_events_scheduled", + "columns": [ + "tenant_id", + "scheduled_at" + ], + "isUnique": false + }, + "idx_inspection_events_inspection": { + "name": "idx_inspection_events_inspection", + "columns": [ + "inspection_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "inspection_events_tenant_id_tenants_id_fk": { + "name": "inspection_events_tenant_id_tenants_id_fk", + "tableFrom": "inspection_events", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspection_events_inspection_id_inspections_id_fk": { + "name": "inspection_events_inspection_id_inspections_id_fk", + "tableFrom": "inspection_events", + "tableTo": "inspections", + "columnsFrom": [ + "inspection_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "inspection_events_event_type_id_event_types_id_fk": { + "name": "inspection_events_event_type_id_event_types_id_fk", + "tableFrom": "inspection_events", + "tableTo": "event_types", + "columnsFrom": [ + "event_type_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspection_events_inspector_id_users_id_fk": { + "name": "inspection_events_inspector_id_users_id_fk", + "tableFrom": "inspection_events", + "tableTo": "users", + "columnsFrom": [ + "inspector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_inspectors": { + "name": "inspection_inspectors", + "columns": { + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'lead'" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_insp_inspectors_tenant_user": { + "name": "idx_insp_inspectors_tenant_user", + "columns": [ + "tenant_id", + "user_id" + ], + "isUnique": false + }, + "idx_insp_inspectors_user": { + "name": "idx_insp_inspectors_user", + "columns": [ + "user_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "inspection_inspectors_inspection_id_user_id_pk": { + "columns": [ + "inspection_id", + "user_id" + ], + "name": "inspection_inspectors_inspection_id_user_id_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_item_tag_links": { + "name": "inspection_item_tag_links", + "columns": { + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "item_id": { + "name": "item_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tag_id": { + "name": "tag_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_tag_links_tenant": { + "name": "idx_tag_links_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_tag_links_tag": { + "name": "idx_tag_links_tag", + "columns": [ + "tag_id" + ], + "isUnique": false + }, + "idx_tag_links_inspection_item": { + "name": "idx_tag_links_inspection_item", + "columns": [ + "inspection_id", + "item_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "inspection_item_tag_links_inspection_id_item_id_tag_id_pk": { + "columns": [ + "inspection_id", + "item_id", + "tag_id" + ], + "name": "inspection_item_tag_links_inspection_id_item_id_tag_id_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_media_pool": { + "name": "inspection_media_pool", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "r2_key": { + "name": "r2_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "exif_data": { + "name": "exif_data", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "annotations": { + "name": "annotations", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "caption": { + "name": "caption", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "media_type": { + "name": "media_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'photo'" + }, + "stream_uid": { + "name": "stream_uid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "poster_pct": { + "name": "poster_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "duration_sec": { + "name": "duration_sec", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'stream'" + }, + "poster_key": { + "name": "poster_key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_media_pool_tenant": { + "name": "idx_media_pool_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_media_pool_inspection": { + "name": "idx_media_pool_inspection", + "columns": [ + "inspection_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_messages": { + "name": "inspection_messages", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "from_role": { + "name": "from_role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "from_name": { + "name": "from_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "attachments": { + "name": "attachments", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "read_at": { + "name": "read_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_msg_inspection": { + "name": "idx_msg_inspection", + "columns": [ + "inspection_id", + "created_at" + ], + "isUnique": false + }, + "idx_msg_unread": { + "name": "idx_msg_unread", + "columns": [ + "tenant_id", + "inspection_id", + "from_role" + ], + "isUnique": false, + "where": "\"inspection_messages\".\"read_at\" IS NULL" + } + }, + "foreignKeys": { + "inspection_messages_tenant_id_tenants_id_fk": { + "name": "inspection_messages_tenant_id_tenants_id_fk", + "tableFrom": "inspection_messages", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspection_messages_inspection_id_inspections_id_fk": { + "name": "inspection_messages_inspection_id_inspections_id_fk", + "tableFrom": "inspection_messages", + "tableTo": "inspections", + "columnsFrom": [ + "inspection_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_requests": { + "name": "inspection_requests", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client_name": { + "name": "client_name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client_email": { + "name": "client_email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client_phone": { + "name": "client_phone", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "property_address": { + "name": "property_address", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "property_city": { + "name": "property_city", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "property_state": { + "name": "property_state", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "property_zip": { + "name": "property_zip", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "scheduled_at": { + "name": "scheduled_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "total_amount_cents": { + "name": "total_amount_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "payment_status": { + "name": "payment_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'unpaid'" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_inspection_requests_tenant": { + "name": "idx_inspection_requests_tenant", + "columns": [ + "tenant_id", + "status", + "scheduled_at" + ], + "isUnique": false + }, + "idx_inspection_requests_email": { + "name": "idx_inspection_requests_email", + "columns": [ + "tenant_id", + "client_email" + ], + "isUnique": false + } + }, + "foreignKeys": { + "inspection_requests_tenant_id_tenants_id_fk": { + "name": "inspection_requests_tenant_id_tenants_id_fk", + "tableFrom": "inspection_requests", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_results": { + "name": "inspection_results", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "data": { + "name": "data", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ydoc_state": { + "name": "ydoc_state", + "type": "blob", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_synced_at": { + "name": "last_synced_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rating_system_id": { + "name": "rating_system_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rating_system_snapshot": { + "name": "rating_system_snapshot", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_results_tenant": { + "name": "idx_results_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_results_inspection": { + "name": "idx_results_inspection", + "columns": [ + "inspection_id" + ], + "isUnique": false + }, + "uq_results_inspection": { + "name": "uq_results_inspection", + "columns": [ + "inspection_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "inspection_results_tenant_id_tenants_id_fk": { + "name": "inspection_results_tenant_id_tenants_id_fk", + "tableFrom": "inspection_results", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspection_results_inspection_id_inspections_id_fk": { + "name": "inspection_results_inspection_id_inspections_id_fk", + "tableFrom": "inspection_results", + "tableTo": "inspections", + "columnsFrom": [ + "inspection_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_services": { + "name": "inspection_services", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "service_id": { + "name": "service_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "price_override_cents": { + "name": "price_override_cents", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name_snapshot": { + "name": "name_snapshot", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "price_snapshot_cents": { + "name": "price_snapshot_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_insp_services_tenant": { + "name": "idx_insp_services_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_insp_services_insp": { + "name": "idx_insp_services_insp", + "columns": [ + "inspection_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "inspection_services_tenant_id_tenants_id_fk": { + "name": "inspection_services_tenant_id_tenants_id_fk", + "tableFrom": "inspection_services", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspection_services_inspection_id_inspections_id_fk": { + "name": "inspection_services_inspection_id_inspections_id_fk", + "tableFrom": "inspection_services", + "tableTo": "inspections", + "columnsFrom": [ + "inspection_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "inspection_services_service_id_services_id_fk": { + "name": "inspection_services_service_id_services_id_fk", + "tableFrom": "inspection_services", + "tableTo": "services", + "columnsFrom": [ + "service_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_types": { + "name": "inspection_types", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "based_on": { + "name": "based_on", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_enabled": { + "name": "is_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_inspection_types_tenant_name": { + "name": "idx_inspection_types_tenant_name", + "columns": [ + "tenant_id", + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspection_units": { + "name": "inspection_units", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "parent_unit_id": { + "name": "parent_unit_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'unit'" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch() * 1000)" + }, + "attrs": { + "name": "attrs", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_inspection_units_tenant_inspection": { + "name": "idx_inspection_units_tenant_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + }, + "idx_inspection_units_parent": { + "name": "idx_inspection_units_parent", + "columns": [ + "parent_unit_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inspections": { + "name": "inspections", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspector_id": { + "name": "inspector_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "property_address": { + "name": "property_address", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "address_place_id": { + "name": "address_place_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_street": { + "name": "address_street", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_city": { + "name": "address_city", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_state": { + "name": "address_state", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_zip": { + "name": "address_zip", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_county": { + "name": "address_county", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_lat": { + "name": "address_lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_lng": { + "name": "address_lng", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "address_geocoded_at": { + "name": "address_geocoded_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client_contact_id": { + "name": "client_contact_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client_name": { + "name": "client_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client_email": { + "name": "client_email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client_phone": { + "name": "client_phone", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "template_id": { + "name": "template_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'requested'" + }, + "report_status": { + "name": "report_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'in_progress'" + }, + "payment_status": { + "name": "payment_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'unpaid'" + }, + "referred_by_agent_id": { + "name": "referred_by_agent_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "price_cents": { + "name": "price_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "confirmed_at": { + "name": "confirmed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cancel_reason": { + "name": "cancel_reason", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cancel_notes": { + "name": "cancel_notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_payment_required": { + "name": "is_payment_required", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_agreement_required": { + "name": "is_agreement_required", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_auto_sign_on_publish": { + "name": "is_auto_sign_on_publish", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "discount_code_id": { + "name": "discount_code_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "discount_amount_cents": { + "name": "discount_amount_cents", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "closing_date": { + "name": "closing_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "referral_source": { + "name": "referral_source", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reference_number": { + "name": "reference_number", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "internal_notes": { + "name": "internal_notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "year_built": { + "name": "year_built", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sqft": { + "name": "sqft", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "foundation_type": { + "name": "foundation_type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bedrooms": { + "name": "bedrooms", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bathrooms": { + "name": "bathrooms", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lot_size": { + "name": "lot_size", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "property_facts": { + "name": "property_facts", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cover_photo_id": { + "name": "cover_photo_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cover_crop": { + "name": "cover_crop", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cover_image_key": { + "name": "cover_image_key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "unit": { + "name": "unit", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "commercial_subtype": { + "name": "commercial_subtype", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "report_tier": { + "name": "report_tier", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "selling_agent_id": { + "name": "selling_agent_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_automations_disabled": { + "name": "is_automations_disabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "template_snapshot": { + "name": "template_snapshot", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "template_snapshot_version": { + "name": "template_snapshot_version", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": 1 + }, + "report_theme_override": { + "name": "report_theme_override", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "require_defect_fields_override": { + "name": "require_defect_fields_override", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "request_id": { + "name": "request_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "concierge_status": { + "name": "concierge_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_team_mode": { + "name": "is_team_mode", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "lead_inspector_id": { + "name": "lead_inspector_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "helper_inspector_ids": { + "name": "helper_inspector_ids", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "data_version": { + "name": "data_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "source_inspection_id": { + "name": "source_inspection_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "root_inspection_id": { + "name": "root_inspection_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reinspection_round": { + "name": "reinspection_round", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "unit_inspection_mode": { + "name": "unit_inspection_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'tagged'" + }, + "location_options": { + "name": "location_options", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sampling_declaration": { + "name": "sampling_declaration", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pca_narrative": { + "name": "pca_narrative", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deviations": { + "name": "deviations", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "report_photo_mode": { + "name": "report_photo_mode", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_inspections_tenant": { + "name": "idx_inspections_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_inspections_request": { + "name": "idx_inspections_request", + "columns": [ + "request_id" + ], + "isUnique": false + }, + "idx_inspections_inspector": { + "name": "idx_inspections_inspector", + "columns": [ + "inspector_id" + ], + "isUnique": false + }, + "idx_inspections_agent": { + "name": "idx_inspections_agent", + "columns": [ + "referred_by_agent_id" + ], + "isUnique": false + }, + "idx_inspections_tenant_status": { + "name": "idx_inspections_tenant_status", + "columns": [ + "tenant_id", + "status" + ], + "isUnique": false + }, + "idx_inspections_tenant_date": { + "name": "idx_inspections_tenant_date", + "columns": [ + "tenant_id", + "date" + ], + "isUnique": false + }, + "idx_inspections_tenant_client_email": { + "name": "idx_inspections_tenant_client_email", + "columns": [ + "tenant_id", + "client_email" + ], + "isUnique": false + }, + "idx_inspections_inspector_date": { + "name": "idx_inspections_inspector_date", + "columns": [ + "inspector_id", + "date" + ], + "isUnique": false + }, + "idx_inspections_root": { + "name": "idx_inspections_root", + "columns": [ + "root_inspection_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "inspections_tenant_id_tenants_id_fk": { + "name": "inspections_tenant_id_tenants_id_fk", + "tableFrom": "inspections", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspections_inspector_id_users_id_fk": { + "name": "inspections_inspector_id_users_id_fk", + "tableFrom": "inspections", + "tableTo": "users", + "columnsFrom": [ + "inspector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspections_template_id_templates_id_fk": { + "name": "inspections_template_id_templates_id_fk", + "tableFrom": "inspections", + "tableTo": "templates", + "columnsFrom": [ + "template_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspections_discount_code_id_discount_codes_id_fk": { + "name": "inspections_discount_code_id_discount_codes_id_fk", + "tableFrom": "inspections", + "tableTo": "discount_codes", + "columnsFrom": [ + "discount_code_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspections_selling_agent_id_contacts_id_fk": { + "name": "inspections_selling_agent_id_contacts_id_fk", + "tableFrom": "inspections", + "tableTo": "contacts", + "columnsFrom": [ + "selling_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "inspections_request_id_inspection_requests_id_fk": { + "name": "inspections_request_id_inspection_requests_id_fk", + "tableFrom": "inspections", + "tableTo": "inspection_requests", + "columnsFrom": [ + "request_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "invoices": { + "name": "invoices", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "contact_id": { + "name": "contact_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client_name": { + "name": "client_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client_email": { + "name": "client_email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount_cents": { + "name": "amount_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "line_items": { + "name": "line_items", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "due_date": { + "name": "due_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sent_at": { + "name": "sent_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "paid_at": { + "name": "paid_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method": { + "name": "payment_method", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "partial_paid_at": { + "name": "partial_paid_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "voided_at": { + "name": "voided_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "qbo_sync_status": { + "name": "qbo_sync_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_invoices_tenant": { + "name": "idx_invoices_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_invoices_inspection": { + "name": "idx_invoices_inspection", + "columns": [ + "inspection_id" + ], + "isUnique": false + }, + "idx_invoices_contact": { + "name": "idx_invoices_contact", + "columns": [ + "tenant_id", + "contact_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "invoices_tenant_id_tenants_id_fk": { + "name": "invoices_tenant_id_tenants_id_fk", + "tableFrom": "invoices", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "invoices_inspection_id_inspections_id_fk": { + "name": "invoices_inspection_id_inspections_id_fk", + "tableFrom": "invoices", + "tableTo": "inspections", + "columnsFrom": [ + "inspection_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "invoices_contact_id_contacts_id_fk": { + "name": "invoices_contact_id_contacts_id_fk", + "tableFrom": "invoices", + "tableTo": "contacts", + "columnsFrom": [ + "contact_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "marketplace_libraries": { + "name": "marketplace_libraries", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "semver": { + "name": "semver", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "schema": { + "name": "schema", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'system'" + }, + "changelog": { + "name": "changelog", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "download_count": { + "name": "download_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "is_featured": { + "name": "is_featured", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_marketplace_libraries_kind_featured": { + "name": "idx_marketplace_libraries_kind_featured", + "columns": [ + "kind", + "is_featured" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "marketplace_templates": { + "name": "marketplace_templates", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "semver": { + "name": "semver", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "schema": { + "name": "schema", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'system'" + }, + "changelog": { + "name": "changelog", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "download_count": { + "name": "download_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "is_featured": { + "name": "is_featured", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "message_templates": { + "name": "message_templates", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "channel": { + "name": "channel", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "variables": { + "name": "variables", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_seeded": { + "name": "is_seeded", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_message_templates_tenant_channel": { + "name": "idx_message_templates_tenant_channel", + "columns": [ + "tenant_id", + "channel" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "messaging_compliance": { + "name": "messaging_compliance", + "columns": { + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "mode": { + "name": "mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'own'" + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subaccount_sid": { + "name": "subaccount_sid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_profile_sid": { + "name": "customer_profile_sid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_profile_status": { + "name": "customer_profile_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "brand_sid": { + "name": "brand_sid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "brand_status": { + "name": "brand_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "campaign_sid": { + "name": "campaign_sid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "campaign_status": { + "name": "campaign_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tfv_sid": { + "name": "tfv_sid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tfv_status": { + "name": "tfv_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "messaging_resource_sid": { + "name": "messaging_resource_sid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider_meta": { + "name": "provider_meta", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provisioned_number": { + "name": "provisioned_number", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provisioned_number_sid": { + "name": "provisioned_number_sid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "has_sender_attached": { + "name": "has_sender_attached", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "compliance_status": { + "name": "compliance_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'not_started'" + }, + "rejection_reason": { + "name": "rejection_reason", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_sync_at": { + "name": "last_sync_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "observer_links": { + "name": "observer_links", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch() * 1000)" + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_viewed_at": { + "name": "last_viewed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "token_enc": { + "name": "token_enc", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "observer_links_token_unique": { + "name": "observer_links_token_unique", + "columns": [ + "token" + ], + "isUnique": true + }, + "idx_observer_links_inspection": { + "name": "idx_observer_links_inspection", + "columns": [ + "inspection_id" + ], + "isUnique": false + }, + "idx_observer_links_token_hash": { + "name": "idx_observer_links_token_hash", + "columns": [ + "token_hash" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "orphaned_media": { + "name": "orphaned_media", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "r2_key": { + "name": "r2_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "first_seen_at": { + "name": "first_seen_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_orphaned_media_key": { + "name": "idx_orphaned_media_key", + "columns": [ + "tenant_id", + "r2_key" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "processed_webhook_events": { + "name": "processed_webhook_events", + "columns": { + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "received_at": { + "name": "received_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "psq_responses": { + "name": "psq_responses", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "responses": { + "name": "responses", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'sent'" + }, + "share_token": { + "name": "share_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sent_at": { + "name": "sent_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "received_at": { + "name": "received_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "uq_psq_inspection": { + "name": "uq_psq_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": true + }, + "idx_psq_share_token": { + "name": "idx_psq_share_token", + "columns": [ + "share_token" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "qbo_connections": { + "name": "qbo_connections", + "columns": { + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "realm_id": { + "name": "realm_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "company_name": { + "name": "company_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "access_token_enc": { + "name": "access_token_enc", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "refresh_token_enc": { + "name": "refresh_token_enc", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "token_expires_at": { + "name": "token_expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "last_sync_at": { + "name": "last_sync_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_sync_enabled": { + "name": "is_sync_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "default_item_id": { + "name": "default_item_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'1'" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "qbo_entity_map": { + "name": "qbo_entity_map", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "oi_type": { + "name": "oi_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "oi_id": { + "name": "oi_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "qbo_type": { + "name": "qbo_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "qbo_id": { + "name": "qbo_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "qbo_sync_token": { + "name": "qbo_sync_token", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "synced_at": { + "name": "synced_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_qbo_entity_map_qbo": { + "name": "idx_qbo_entity_map_qbo", + "columns": [ + "tenant_id", + "qbo_type", + "qbo_id" + ], + "isUnique": true + }, + "idx_qbo_entity_map_oi": { + "name": "idx_qbo_entity_map_oi", + "columns": [ + "tenant_id", + "oi_type", + "oi_id" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "qbo_sync_errors": { + "name": "qbo_sync_errors", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "oi_type": { + "name": "oi_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "oi_id": { + "name": "oi_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "error_code": { + "name": "error_code", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "error_msg": { + "name": "error_msg", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "retries": { + "name": "retries", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "is_resolved": { + "name": "is_resolved", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "rating_systems": { + "name": "rating_systems", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "levels": { + "name": "levels", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_default": { + "name": "is_default", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_seed": { + "name": "is_seed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_rating_systems_tenant_slug": { + "name": "idx_rating_systems_tenant_slug", + "columns": [ + "tenant_id", + "slug" + ], + "isUnique": true + }, + "idx_rating_systems_tenant": { + "name": "idx_rating_systems_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "rating_systems_tenant_id_tenants_id_fk": { + "name": "rating_systems_tenant_id_tenants_id_fk", + "tableFrom": "rating_systems", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "repair_request_items": { + "name": "repair_request_items", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "repair_request_id": { + "name": "repair_request_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "finding_key": { + "name": "finding_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "section_title": { + "name": "section_title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "item_label": { + "name": "item_label", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "comment_snapshot": { + "name": "comment_snapshot", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "requested_credit_cents": { + "name": "requested_credit_cents", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "idx_repair_request_items_rr": { + "name": "idx_repair_request_items_rr", + "columns": [ + "repair_request_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "repair_requests": { + "name": "repair_requests", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_by_kind": { + "name": "created_by_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_by_ref": { + "name": "created_by_ref", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "custom_intro": { + "name": "custom_intro", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "share_token": { + "name": "share_token", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_repair_requests_inspection": { + "name": "idx_repair_requests_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + }, + "idx_repair_requests_share_token": { + "name": "idx_repair_requests_share_token", + "columns": [ + "share_token" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "report_exports": { + "name": "report_exports", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "format": { + "name": "format", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "r2_key": { + "name": "r2_key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_report_exports_inspection": { + "name": "idx_report_exports_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "report_pdfs": { + "name": "report_pdfs", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "r2_key": { + "name": "r2_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rendered_at": { + "name": "rendered_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_version": { + "name": "source_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "version_number": { + "name": "version_number", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'ready'" + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "uq_report_pdfs_inspection_type": { + "name": "uq_report_pdfs_inspection_type", + "columns": [ + "inspection_id", + "type", + "version_number" + ], + "isUnique": true + }, + "idx_report_pdfs_tenant": { + "name": "idx_report_pdfs_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_report_pdfs_status": { + "name": "idx_report_pdfs_status", + "columns": [ + "status" + ], + "isUnique": false + }, + "idx_report_pdfs_content_hash": { + "name": "idx_report_pdfs_content_hash", + "columns": [ + "inspection_id", + "type", + "content_hash" + ], + "isUnique": false + } + }, + "foreignKeys": { + "report_pdfs_tenant_id_tenants_id_fk": { + "name": "report_pdfs_tenant_id_tenants_id_fk", + "tableFrom": "report_pdfs", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "report_signoff": { + "name": "report_signoff", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "person_id": { + "name": "person_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "license": { + "name": "license", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "qualifications_ref": { + "name": "qualifications_ref", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "signed_at": { + "name": "signed_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "signature_ref": { + "name": "signature_ref", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_dual_role": { + "name": "is_dual_role", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "idx_report_signoff_inspection": { + "name": "idx_report_signoff_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + }, + "uq_report_signoff_role": { + "name": "uq_report_signoff_role", + "columns": [ + "inspection_id", + "role" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "report_versions": { + "name": "report_versions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "version_number": { + "name": "version_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "snapshot_json": { + "name": "snapshot_json", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "prev_hash": { + "name": "prev_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "signature": { + "name": "signature", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "key_fingerprint": { + "name": "key_fingerprint", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_amendment": { + "name": "is_amendment", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "verification_token": { + "name": "verification_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "published_at": { + "name": "published_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "published_by": { + "name": "published_by", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch() * 1000)" + } + }, + "indexes": { + "idx_report_versions_inspection": { + "name": "idx_report_versions_inspection", + "columns": [ + "inspection_id", + "version_number" + ], + "isUnique": false + }, + "uq_report_versions_inspection_version": { + "name": "uq_report_versions_inspection_version", + "columns": [ + "inspection_id", + "version_number" + ], + "isUnique": true + }, + "idx_report_versions_verify_token": { + "name": "idx_report_versions_verify_token", + "columns": [ + "verification_token" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "service_inspectors": { + "name": "service_inspectors", + "columns": { + "service_id": { + "name": "service_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_service_inspectors_tenant": { + "name": "idx_service_inspectors_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "service_inspectors_service_id_user_id_pk": { + "columns": [ + "service_id", + "user_id" + ], + "name": "service_inspectors_service_id_user_id_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "services": { + "name": "services", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "price_cents": { + "name": "price_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "duration_minutes": { + "name": "duration_minutes", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "template_id": { + "name": "template_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "agreement_id": { + "name": "agreement_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_active": { + "name": "is_active", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_services_tenant": { + "name": "idx_services_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "services_tenant_id_tenants_id_fk": { + "name": "services_tenant_id_tenants_id_fk", + "tableFrom": "services", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "services_template_id_templates_id_fk": { + "name": "services_template_id_templates_id_fk", + "tableFrom": "services", + "tableTo": "templates", + "columnsFrom": [ + "template_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "services_agreement_id_agreements_id_fk": { + "name": "services_agreement_id_agreements_id_fk", + "tableFrom": "services", + "tableTo": "agreements", + "columnsFrom": [ + "agreement_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "signing_keys": { + "name": "signing_keys", + "columns": { + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "public_key": { + "name": "public_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "private_key_enc": { + "name": "private_key_enc", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "private_key_iv": { + "name": "private_key_iv", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "fingerprint": { + "name": "fingerprint", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "algorithm": { + "name": "algorithm", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'Ed25519'" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rotated_at": { + "name": "rotated_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "signing_keys_tenant_id_tenants_id_fk": { + "name": "signing_keys_tenant_id_tenants_id_fk", + "tableFrom": "signing_keys", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sms_consent_log": { + "name": "sms_consent_log", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "contact_id": { + "name": "contact_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "recipient_type": { + "name": "recipient_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "disclosure_version": { + "name": "disclosure_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "captured_via": { + "name": "captured_via", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_sms_consent_contact": { + "name": "idx_sms_consent_contact", + "columns": [ + "tenant_id", + "contact_id", + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sms_delivery_status": { + "name": "sms_delivery_status", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider_message_id": { + "name": "provider_message_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "error_code": { + "name": "error_code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_sms_delivery_status_msg": { + "name": "idx_sms_delivery_status_msg", + "columns": [ + "tenant_id", + "provider_message_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sms_disclosure_versions": { + "name": "sms_disclosure_versions", + "columns": { + "version": { + "name": "version", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "published_at": { + "name": "published_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tags": { + "name": "tags", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_seed": { + "name": "is_seed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_tags_tenant_name": { + "name": "idx_tags_tenant_name", + "columns": [ + "tenant_id", + "name" + ], + "isUnique": true + }, + "idx_tags_tenant": { + "name": "idx_tags_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "templates": { + "name": "templates", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "schema": { + "name": "schema", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rating_system_id": { + "name": "rating_system_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "commercial_subtype": { + "name": "commercial_subtype", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_featured": { + "name": "is_featured", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "idx_templates_tenant": { + "name": "idx_templates_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_templates_rating_system": { + "name": "idx_templates_rating_system", + "columns": [ + "rating_system_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "templates_tenant_id_tenants_id_fk": { + "name": "templates_tenant_id_tenants_id_fk", + "tableFrom": "templates", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tenant_library_imports": { + "name": "tenant_library_imports", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "library_id": { + "name": "library_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "imported_semver": { + "name": "imported_semver", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "imported_at": { + "name": "imported_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "row_count": { + "name": "row_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "uq_tenant_library_import": { + "name": "uq_tenant_library_import", + "columns": [ + "tenant_id", + "library_id" + ], + "isUnique": true + }, + "idx_tenant_library_imports_tenant": { + "name": "idx_tenant_library_imports_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tenant_marketplace_import_history": { + "name": "tenant_marketplace_import_history", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "library_id": { + "name": "library_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "template_id": { + "name": "template_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_version": { + "name": "source_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "target_version": { + "name": "target_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rows_affected": { + "name": "rows_affected", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_marketplace_history_tenant": { + "name": "idx_marketplace_history_tenant", + "columns": [ + "tenant_id", + "created_at" + ], + "isUnique": false + }, + "idx_marketplace_history_template": { + "name": "idx_marketplace_history_template", + "columns": [ + "template_id" + ], + "isUnique": false + }, + "idx_marketplace_history_library": { + "name": "idx_marketplace_history_library", + "columns": [ + "library_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tenant_marketplace_imports": { + "name": "tenant_marketplace_imports", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "marketplace_template_id": { + "name": "marketplace_template_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "imported_semver": { + "name": "imported_semver", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "local_template_id": { + "name": "local_template_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "imported_at": { + "name": "imported_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_mkt_imports_tmpl": { + "name": "idx_mkt_imports_tmpl", + "columns": [ + "marketplace_template_id" + ], + "isUnique": false + }, + "idx_mkt_imports_tenant": { + "name": "idx_mkt_imports_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "tenant_marketplace_imports_marketplace_template_id_marketplace_templates_id_fk": { + "name": "tenant_marketplace_imports_marketplace_template_id_marketplace_templates_id_fk", + "tableFrom": "tenant_marketplace_imports", + "tableTo": "marketplace_templates", + "columnsFrom": [ + "marketplace_template_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "tenant_marketplace_imports_local_template_id_templates_id_fk": { + "name": "tenant_marketplace_imports_local_template_id_templates_id_fk", + "tableFrom": "tenant_marketplace_imports", + "tableTo": "templates", + "columnsFrom": [ + "local_template_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "usage_counters": { + "name": "usage_counters", + "columns": { + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "metric": { + "name": "metric", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "period_key": { + "name": "period_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_usage_counters_tenant": { + "name": "idx_usage_counters_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_counters_tenant_id_metric_period_key_pk": { + "columns": [ + "tenant_id", + "metric", + "period_key" + ], + "name": "usage_counters_tenant_id_metric_period_key_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "user_identity_links": { + "name": "user_identity_links", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "primary_user_id": { + "name": "primary_user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "linked_user_id": { + "name": "linked_user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "linked_tenant_id": { + "name": "linked_tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "linked_role": { + "name": "linked_role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "linked_display_name": { + "name": "linked_display_name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch() * 1000)" + } + }, + "indexes": { + "idx_user_identity_links_primary": { + "name": "idx_user_identity_links_primary", + "columns": [ + "primary_user_id" + ], + "isUnique": false + }, + "uq_user_identity_links_primary_linked": { + "name": "uq_user_identity_links_primary_linked", + "columns": [ + "primary_user_id", + "linked_user_id" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "email_templates": { + "name": "email_templates", + "columns": { + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "trigger": { + "name": "trigger", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blocks": { + "name": "blocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_enabled": { + "name": "is_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "email_templates_tenant_id_tenants_id_fk": { + "name": "email_templates_tenant_id_tenants_id_fk", + "tableFrom": "email_templates", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "email_templates_tenant_id_trigger_pk": { + "columns": [ + "tenant_id", + "trigger" + ], + "name": "email_templates_tenant_id_trigger_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tenant_configs": { + "name": "tenant_configs", + "columns": { + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "company_name": { + "name": "company_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "primary_color": { + "name": "primary_color", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "logo_url": { + "name": "logo_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "support_email": { + "name": "support_email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "company_address": { + "name": "company_address", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_pdf_footer_shown": { + "name": "is_pdf_footer_shown", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "is_pdf_page_numbers_shown": { + "name": "is_pdf_page_numbers_shown", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "is_pdf_license_shown": { + "name": "is_pdf_license_shown", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "sender_email": { + "name": "sender_email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reply_to": { + "name": "reply_to", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email_mode": { + "name": "email_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'platform'" + }, + "video_mode": { + "name": "video_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'r2'" + }, + "sms_mode": { + "name": "sms_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'platform'" + }, + "sender_display_name": { + "name": "sender_display_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "point_of_contact": { + "name": "point_of_contact", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'company'" + }, + "billing_url": { + "name": "billing_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "review_url": { + "name": "review_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "company_phone": { + "name": "company_phone", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "integration_config": { + "name": "integration_config", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "secrets_enc": { + "name": "secrets_enc", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dek_enc": { + "name": "dek_enc", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ics_token": { + "name": "ics_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "widget_allowed_origins": { + "name": "widget_allowed_origins", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "report_theme": { + "name": "report_theme", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'modern'" + }, + "attention_thresholds": { + "name": "attention_thresholds", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'{\"agreement_unsigned_h\":72,\"invoice_overdue_h\":72,\"report_unpublished_h\":72}'" + }, + "inspection_prefs": { + "name": "inspection_prefs", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_estimates_shown": { + "name": "is_estimates_shown", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_repair_list_enabled": { + "name": "is_repair_list_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_customer_repair_export_enabled": { + "name": "is_customer_repair_export_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_unpaid_blocked": { + "name": "is_unpaid_blocked", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_unsigned_agreement_blocked": { + "name": "is_unsigned_agreement_blocked", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "custom_referral_sources": { + "name": "custom_referral_sources", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dashboard_column_prefs": { + "name": "dashboard_column_prefs", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_concierge_review_required": { + "name": "is_concierge_review_required", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_inspector_choice_allowed": { + "name": "is_inspector_choice_allowed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_pdf_pipeline_enabled": { + "name": "is_pdf_pipeline_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_team_mode_default": { + "name": "is_team_mode_default", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_apprentice_review_required": { + "name": "is_apprentice_review_required", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_guest_invites_enabled": { + "name": "is_guest_invites_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "require_defect_fields": { + "name": "require_defect_fields", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'none'" + }, + "agreement_retention_years": { + "name": "agreement_retention_years", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 6 + }, + "reinspection_statuses": { + "name": "reinspection_statuses", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_collab_editing_enabled": { + "name": "is_collab_editing_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sms_byo_provider": { + "name": "sms_byo_provider", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email_byo_provider": { + "name": "email_byo_provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'resend'" + }, + "is_managed_eligible": { + "name": "is_managed_eligible", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "managed_provider": { + "name": "managed_provider", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'twilio'" + }, + "is_reserve_schedule_enabled": { + "name": "is_reserve_schedule_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "reserve_term_years": { + "name": "reserve_term_years", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 12 + }, + "inflation_rate_bps": { + "name": "inflation_rate_bps", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "tenant_configs_tenant_id_tenants_id_fk": { + "name": "tenant_configs_tenant_id_tenants_id_fk", + "tableFrom": "tenant_configs", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tenants": { + "name": "tenants", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tier": { + "name": "tier", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'free'" + }, + "stripe_connect_account_id": { + "name": "stripe_connect_account_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "max_users": { + "name": "max_users", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 5 + }, + "deployment_mode": { + "name": "deployment_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'shared'" + }, + "applied_cmd_seq": { + "name": "applied_cmd_seq", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "applied_cred_seq": { + "name": "applied_cred_seq", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "tenants_slug_unique": { + "name": "tenants_slug_unique", + "columns": [ + "slug" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "agent_invites": { + "name": "agent_invites", + "columns": { + "token": { + "name": "token", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspector_contact_id": { + "name": "inspector_contact_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "invited_by_user_id": { + "name": "invited_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "accepted_at": { + "name": "accepted_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_agent_invites_email": { + "name": "idx_agent_invites_email", + "columns": [ + "email" + ], + "isUnique": false + }, + "idx_agent_invites_tenant": { + "name": "idx_agent_invites_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_agent_invites_expiration": { + "name": "idx_agent_invites_expiration", + "columns": [ + "expires_at" + ], + "isUnique": false + } + }, + "foreignKeys": { + "agent_invites_tenant_id_tenants_id_fk": { + "name": "agent_invites_tenant_id_tenants_id_fk", + "tableFrom": "agent_invites", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "agent_invites_invited_by_user_id_users_id_fk": { + "name": "agent_invites_invited_by_user_id_users_id_fk", + "tableFrom": "agent_invites", + "tableTo": "users", + "columnsFrom": [ + "invited_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tenant_invites": { + "name": "tenant_invites", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'inspector'" + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mentor_id": { + "name": "mentor_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "assigned_section_ids": { + "name": "assigned_section_ids", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "permission_overrides": { + "name": "permission_overrides", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_invites_tenant": { + "name": "idx_invites_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "uq_tenant_invites_pending_email": { + "name": "uq_tenant_invites_pending_email", + "columns": [ + "tenant_id", + "email" + ], + "isUnique": true, + "where": "status = 'pending'" + } + }, + "foreignKeys": { + "tenant_invites_tenant_id_tenants_id_fk": { + "name": "tenant_invites_tenant_id_tenants_id_fk", + "tableFrom": "tenant_invites", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "users": { + "name": "users", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "password_hash": { + "name": "password_hash", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "phone": { + "name": "phone", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "license_number": { + "name": "license_number", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "photo_url": { + "name": "photo_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "default_signature_base64": { + "name": "default_signature_base64", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_signature_enabled": { + "name": "is_signature_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'manager'" + }, + "google_refresh_token": { + "name": "google_refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "google_calendar_id": { + "name": "google_calendar_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "onboarding_state": { + "name": "onboarding_state", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "totp_secret": { + "name": "totp_secret", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_totp_enabled": { + "name": "is_totp_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "totp_recovery_codes": { + "name": "totp_recovery_codes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "totp_verified_at": { + "name": "totp_verified_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_referral_notification_enabled": { + "name": "is_referral_notification_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "is_report_notification_enabled": { + "name": "is_report_notification_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "is_paid_notification_enabled": { + "name": "is_paid_notification_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "last_active_at": { + "name": "last_active_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mentor_id": { + "name": "mentor_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "assigned_section_ids": { + "name": "assigned_section_ids", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "terms_accepted": { + "name": "terms_accepted", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "permission_overrides": { + "name": "permission_overrides", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_users_deleted_at": { + "name": "idx_users_deleted_at", + "columns": [ + "deleted_at" + ], + "isUnique": false + }, + "uq_users_tenant_email": { + "name": "uq_users_tenant_email", + "columns": [ + "tenant_id", + "email" + ], + "isUnique": true, + "where": "deleted_at IS NULL" + }, + "idx_users_tenant": { + "name": "idx_users_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_users_slug_per_tenant": { + "name": "idx_users_slug_per_tenant", + "columns": [ + "tenant_id", + "slug" + ], + "isUnique": true + }, + "idx_users_email": { + "name": "idx_users_email", + "columns": [ + "email" + ], + "isUnique": false + } + }, + "foreignKeys": { + "users_tenant_id_tenants_id_fk": { + "name": "users_tenant_id_tenants_id_fk", + "tableFrom": "users", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "agent_tenant_links": { + "name": "agent_tenant_links", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "agent_user_id": { + "name": "agent_user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspector_contact_id": { + "name": "inspector_contact_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'active'" + }, + "invited_by_user_id": { + "name": "invited_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_agent_tenant_unique": { + "name": "idx_agent_tenant_unique", + "columns": [ + "agent_user_id", + "tenant_id" + ], + "isUnique": true + }, + "idx_agent_tenant_by_tenant": { + "name": "idx_agent_tenant_by_tenant", + "columns": [ + "tenant_id", + "status" + ], + "isUnique": false + }, + "idx_agent_tenant_by_agent": { + "name": "idx_agent_tenant_by_agent", + "columns": [ + "agent_user_id", + "status" + ], + "isUnique": false + } + }, + "foreignKeys": { + "agent_tenant_links_agent_user_id_users_id_fk": { + "name": "agent_tenant_links_agent_user_id_users_id_fk", + "tableFrom": "agent_tenant_links", + "tableTo": "users", + "columnsFrom": [ + "agent_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "agent_tenant_links_tenant_id_tenants_id_fk": { + "name": "agent_tenant_links_tenant_id_tenants_id_fk", + "tableFrom": "agent_tenant_links", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "audit_logs": { + "name": "audit_logs", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "entity_type": { + "name": "entity_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "entity_id": { + "name": "entity_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inspector_slug": { + "name": "inspector_slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_audit_tenant_created": { + "name": "idx_audit_tenant_created", + "columns": [ + "tenant_id", + "created_at" + ], + "isUnique": false + }, + "idx_audit_entity": { + "name": "idx_audit_entity", + "columns": [ + "entity_type", + "entity_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "audit_logs_tenant_id_tenants_id_fk": { + "name": "audit_logs_tenant_id_tenants_id_fk", + "tableFrom": "audit_logs", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "integration_test_results": { + "name": "integration_test_results", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "target": { + "name": "target", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_ok": { + "name": "is_ok", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "detail": { + "name": "detail", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tested_by_user_id": { + "name": "tested_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tested_at": { + "name": "tested_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_integration_test_tenant_target": { + "name": "idx_integration_test_tenant_target", + "columns": [ + "tenant_id", + "target", + "tested_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "notifications": { + "name": "notifications", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "entity_type": { + "name": "entity_type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "entity_id": { + "name": "entity_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "read_at": { + "name": "read_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "archived_at": { + "name": "archived_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_notifications_tenant_user_created": { + "name": "idx_notifications_tenant_user_created", + "columns": [ + "tenant_id", + "user_id", + "created_at" + ], + "isUnique": false + }, + "idx_notifications_tenant_user_unread": { + "name": "idx_notifications_tenant_user_unread", + "columns": [ + "tenant_id", + "user_id", + "read_at" + ], + "isUnique": false + } + }, + "foreignKeys": { + "notifications_tenant_id_tenants_id_fk": { + "name": "notifications_tenant_id_tenants_id_fk", + "tableFrom": "notifications", + "tableTo": "tenants", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notifications_user_id_users_id_fk": { + "name": "notifications_user_id_users_id_fk", + "tableFrom": "notifications", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "parked_cmd_events": { + "name": "parked_cmd_events", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "envelope": { + "name": "envelope", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "received_at": { + "name": "received_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_parked_cmd_events_received_at": { + "name": "idx_parked_cmd_events_received_at", + "columns": [ + "received_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "processed_cmd_events": { + "name": "processed_cmd_events", + "columns": { + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "cmd_type": { + "name": "cmd_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "processed_at": { + "name": "processed_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "slug_reservations": { + "name": "slug_reservations", + "columns": { + "slug": { + "name": "slug", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sync_outbox": { + "name": "sync_outbox", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "event_type": { + "name": "event_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "payload": { + "name": "payload", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "attempts": { + "name": "attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "last_tried_at": { + "name": "last_tried_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_sync_outbox_status_created": { + "name": "idx_sync_outbox_status_created", + "columns": [ + "status", + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tenant_destruction_records": { + "name": "tenant_destruction_records", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tenant_slug": { + "name": "tenant_slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rows_deleted": { + "name": "rows_deleted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "r2_objects": { + "name": "r2_objects", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "r2_bytes": { + "name": "r2_bytes", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "kv_keys": { + "name": "kv_keys", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "destroyed_at": { + "name": "destroyed_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_destruction_tenant": { + "name": "idx_destruction_tenant", + "columns": [ + "tenant_id" + ], + "isUnique": false + }, + "idx_destruction_destroyed_at": { + "name": "idx_destruction_destroyed_at", + "columns": [ + "destroyed_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "client_uploads": { + "name": "client_uploads", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "inspection_id": { + "name": "inspection_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "uploaded_by_kind": { + "name": "uploaded_by_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "uploaded_by_ref": { + "name": "uploaded_by_ref", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "uploaded_by_name": { + "name": "uploaded_by_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "r2_key": { + "name": "r2_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "filename": { + "name": "filename", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content_type": { + "name": "content_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "idx_client_uploads_inspection": { + "name": "idx_client_uploads_inspection", + "columns": [ + "tenant_id", + "inspection_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": { + "uq_discount_codes_code_tenant": { + "columns": { + "upper(code)": { + "isExpression": true + } + } + } + } + } +} diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json index 2af4ec1f..2b392e3a 100644 --- a/migrations/meta/_journal.json +++ b/migrations/meta/_journal.json @@ -8,6 +8,13 @@ "when": 1783955772843, "tag": "0000_baseline", "breakpoints": true + }, + { + "idx": 1, + "version": "6", + "when": 1783994575393, + "tag": "0001_boolean_columns_is_has", + "breakpoints": true } ] -} \ No newline at end of file +} diff --git a/server/lib/db/schema/commercial-subtypes.ts b/server/lib/db/schema/commercial-subtypes.ts index 8ee82d1a..9d1b3198 100644 --- a/server/lib/db/schema/commercial-subtypes.ts +++ b/server/lib/db/schema/commercial-subtypes.ts @@ -7,7 +7,7 @@ export const commercialSubtypes = sqliteTable('commercial_subtypes', { name: text('name').notNull(), basedOn: text('based_on'), description: text('description'), - disabled: integer('disabled', { mode: 'boolean' }).notNull().default(false), + disabled: integer('is_disabled', { mode: 'boolean' }).notNull().default(false), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => ({ tenantNameUnique: uniqueIndex('idx_commercial_subtypes_tenant_name').on(t.tenantId, t.name), diff --git a/server/lib/db/schema/compliance.ts b/server/lib/db/schema/compliance.ts index cc46575a..336f85f4 100644 --- a/server/lib/db/schema/compliance.ts +++ b/server/lib/db/schema/compliance.ts @@ -102,7 +102,7 @@ export const messagingCompliance = sqliteTable('messaging_compliance', { // buy step persists provisionedNumberSid BEFORE attachSender, so this separate // marker lets a crash-resumed run re-run only the attach (without re-buying) — // attachSender is not assumed idempotent, so it is guarded on its own flag. - senderAttached: integer('sender_attached', { mode: 'boolean' }).notNull().default(false), + senderAttached: integer('has_sender_attached', { mode: 'boolean' }).notNull().default(false), complianceStatus: text('compliance_status', { enum: ['not_started', 'profile_pending', 'brand_pending', 'campaign_pending', 'tfv_pending', 'approved', 'rejected'], }).notNull().default('not_started'), diff --git a/server/lib/db/schema/inspection/automation.ts b/server/lib/db/schema/inspection/automation.ts index e5bb6150..0eb43ee9 100644 --- a/server/lib/db/schema/inspection/automation.ts +++ b/server/lib/db/schema/inspection/automation.ts @@ -46,7 +46,7 @@ export const automations = sqliteTable('automations', { // SP2 — references a message_templates(channel='sms') row for the SMS channel. // Null = no SMS template selected. smsTemplateId: text('sms_template_id'), - active: integer('active', { mode: 'boolean' }).notNull().default(true), + active: integer('is_active', { mode: 'boolean' }).notNull().default(true), isDefault: integer('is_default', { mode: 'boolean' }).notNull().default(false), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => [ @@ -89,7 +89,7 @@ export const eventTypes = sqliteTable('event_types', { defaultPriceCents: integer('default_price_cents').notNull().default(0), color: text('color').notNull().default('#6366f1'), sortOrder: integer('sort_order').notNull().default(0), - active: integer('active', { mode: 'boolean' }).notNull().default(true), + active: integer('is_active', { mode: 'boolean' }).notNull().default(true), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => [ uniqueIndex('uq_event_types_tenant_slug').on(t.tenantId, t.slug), @@ -105,7 +105,7 @@ export const inspectionTypes = sqliteTable('inspection_types', { name: text('name').notNull(), basedOn: text('based_on'), description: text('description'), - enabled: integer('enabled', { mode: 'boolean' }).notNull().default(true), + enabled: integer('is_enabled', { mode: 'boolean' }).notNull().default(true), sortOrder: integer('sort_order').notNull().default(0), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => [ diff --git a/server/lib/db/schema/inspection/core.ts b/server/lib/db/schema/inspection/core.ts index 8c7dde93..5b339723 100644 --- a/server/lib/db/schema/inspection/core.ts +++ b/server/lib/db/schema/inspection/core.ts @@ -48,11 +48,11 @@ export const inspections = sqliteTable('inspections', { confirmedAt: integer('confirmed_at', { mode: 'timestamp_ms' }), cancelReason: text('cancel_reason'), cancelNotes: text('cancel_notes'), // Spec 3A - paymentRequired: integer('payment_required', { mode: 'boolean' }).notNull().default(false), - agreementRequired: integer('agreement_required', { mode: 'boolean' }).notNull().default(false), + paymentRequired: integer('is_payment_required', { mode: 'boolean' }).notNull().default(false), + agreementRequired: integer('is_agreement_required', { mode: 'boolean' }).notNull().default(false), // Spec 5H D2 — when true, InspectionService.publish() auto-injects the // inspector's users.default_signature_base64 into inspection_results.data._inspector_signature. - autoSignOnPublish: integer('auto_sign_on_publish', { mode: 'boolean' }).notNull().default(false), + autoSignOnPublish: integer('is_auto_sign_on_publish', { mode: 'boolean' }).notNull().default(false), discountCodeId: text('discount_code_id').references(() => discountCodes.id), discountAmount: integer('discount_amount_cents'), // Calendar-semantic YYYY-MM-DD (real-estate closing date, no time) — intentionally @@ -100,7 +100,7 @@ export const inspections = sqliteTable('inspections', { reportTier: text('report_tier', { enum: ['light_commercial', 'full_pca'] }), county: text('county'), sellingAgentId: text('selling_agent_id').references(() => contacts.id), - disableAutomations: integer('disable_automations', { mode: 'boolean' }).notNull().default(false), + disableAutomations: integer('is_automations_disabled', { mode: 'boolean' }).notNull().default(false), templateSnapshot: text('template_snapshot', { mode: 'json' }), templateSnapshotVersion: integer('template_snapshot_version').default(1), reportThemeOverride: text('report_theme_override', { enum: ['modern', 'classic', 'minimal'] }), @@ -123,7 +123,7 @@ export const inspections = sqliteTable('inspections', { // (see InspectionService.patchItem) for offline-queue staleness checks. // Superseded by the Yjs state vector under collab editing (#181); // column frozen — stop writes once the DO is the authority. - teamMode: integer('team_mode', { mode: 'boolean' }).notNull().default(false), + teamMode: integer('is_team_mode', { mode: 'boolean' }).notNull().default(false), leadInspectorId: text('lead_inspector_id'), helperInspectorIds: text('helper_inspector_ids').notNull().default('[]'), dataVersion: integer('data_version').notNull().default(0), diff --git a/server/lib/db/schema/inspection/defect-category.ts b/server/lib/db/schema/inspection/defect-category.ts index 99f26aa3..92019793 100644 --- a/server/lib/db/schema/inspection/defect-category.ts +++ b/server/lib/db/schema/inspection/defect-category.ts @@ -12,7 +12,7 @@ export const defectCategories = sqliteTable('defect_categories', { name: text('name').notNull(), color: text('color').notNull().default('#6b7280'), // When true, defects in this category are pulled into the report Summary. - drivesSummary: integer('drives_summary', { mode: 'boolean' }).notNull().default(true), + drivesSummary: integer('is_summary_driver', { mode: 'boolean' }).notNull().default(true), sortOrder: integer('sort_order').notNull().default(0), // Seed rows (maintenance/recommendation/safety) — not user-deletable in the UI. isSeed: integer('is_seed', { mode: 'boolean' }).notNull().default(false), diff --git a/server/lib/db/schema/inspection/services.ts b/server/lib/db/schema/inspection/services.ts index 0d9b9851..5cb02644 100644 --- a/server/lib/db/schema/inspection/services.ts +++ b/server/lib/db/schema/inspection/services.ts @@ -14,7 +14,7 @@ export const services = sqliteTable('services', { durationMinutes: integer('duration_minutes'), templateId: text('template_id').references(() => templates.id), agreementId: text('agreement_id').references(() => agreements.id), - active: integer('active', { mode: 'boolean' }).notNull().default(true), + active: integer('is_active', { mode: 'boolean' }).notNull().default(true), sortOrder: integer('sort_order').notNull().default(0), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => [ @@ -46,7 +46,7 @@ export const discountCodes = sqliteTable('discount_codes', { maxUses: integer('max_uses'), usesCount: integer('uses_count').notNull().default(0), expiresAt: integer('expires_at', { mode: 'timestamp_ms' }), - active: integer('active', { mode: 'boolean' }).notNull().default(true), + active: integer('is_active', { mode: 'boolean' }).notNull().default(true), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => [ index('idx_discount_codes_tenant').on(t.tenantId), diff --git a/server/lib/db/schema/inspection/template-rating.ts b/server/lib/db/schema/inspection/template-rating.ts index 0d3c997e..3f35db67 100644 --- a/server/lib/db/schema/inspection/template-rating.ts +++ b/server/lib/db/schema/inspection/template-rating.ts @@ -32,7 +32,7 @@ export const templates = sqliteTable('templates', { propertyType: text('property_type'), commercialSubtype: text('commercial_subtype'), description: text('description'), - featured: integer('featured', { mode: 'boolean' }).notNull().default(false), + featured: integer('is_featured', { mode: 'boolean' }).notNull().default(false), }, (t) => [ index('idx_templates_tenant').on(t.tenantId), index('idx_templates_rating_system').on(t.ratingSystemId), diff --git a/server/lib/db/schema/marketplace.ts b/server/lib/db/schema/marketplace.ts index 626edf65..0bfb34b7 100644 --- a/server/lib/db/schema/marketplace.ts +++ b/server/lib/db/schema/marketplace.ts @@ -10,7 +10,7 @@ export const marketplaceTemplates = sqliteTable('marketplace_templates', { authorId: text('author_id').notNull().default('system'), changelog: text('changelog'), downloadCount: integer('download_count').notNull().default(0), - featured: integer('featured', { mode: 'boolean' }).notNull().default(false), + featured: integer('is_featured', { mode: 'boolean' }).notNull().default(false), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(), }); @@ -39,7 +39,7 @@ export const marketplaceLibraries = sqliteTable('marketplace_libraries', { authorId: text('author_id').notNull().default('system'), changelog: text('changelog'), downloadCount: integer('download_count').notNull().default(0), - featured: integer('featured', { mode: 'boolean' }).notNull().default(false), + featured: integer('is_featured', { mode: 'boolean' }).notNull().default(false), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => [ diff --git a/server/lib/db/schema/pca-compliance.ts b/server/lib/db/schema/pca-compliance.ts index 8424cb2c..35772b84 100644 --- a/server/lib/db/schema/pca-compliance.ts +++ b/server/lib/db/schema/pca-compliance.ts @@ -32,7 +32,7 @@ export const reportSignoff = sqliteTable('report_signoff', { signedAt: integer('signed_at', { mode: 'timestamp_ms' }).notNull(), // base64url Ed25519 signature over the attestation payload. signatureRef: text('signature_ref').notNull(), - dualRole: integer('dual_role', { mode: 'boolean' }).notNull().default(false), + dualRole: integer('is_dual_role', { mode: 'boolean' }).notNull().default(false), }, (t) => [ index('idx_report_signoff_inspection').on(t.tenantId, t.inspectionId), uniqueIndex('uq_report_signoff_role').on(t.inspectionId, t.role), @@ -77,10 +77,10 @@ export const documentReviewItems = sqliteTable('document_review_items', { // Stable key from the seed catalog (server/lib/pca-document-catalog.ts). documentKey: text('document_key').notNull(), label: text('label').notNull(), - requested: integer('requested', { mode: 'boolean' }).notNull().default(false), - received: integer('received', { mode: 'boolean' }).notNull().default(false), - reviewed: integer('reviewed', { mode: 'boolean' }).notNull().default(false), - na: integer('na', { mode: 'boolean' }).notNull().default(false), + requested: integer('is_requested', { mode: 'boolean' }).notNull().default(false), + received: integer('is_received', { mode: 'boolean' }).notNull().default(false), + reviewed: integer('is_reviewed', { mode: 'boolean' }).notNull().default(false), + na: integer('is_na', { mode: 'boolean' }).notNull().default(false), notes: text('notes'), sortOrder: integer('sort_order').notNull().default(0), }, (t) => [ diff --git a/server/lib/db/schema/qbo.ts b/server/lib/db/schema/qbo.ts index 5f3234ae..1e06cad8 100644 --- a/server/lib/db/schema/qbo.ts +++ b/server/lib/db/schema/qbo.ts @@ -9,7 +9,7 @@ export const qboConnections = sqliteTable('qbo_connections', { tokenExpiresAt: integer('token_expires_at', { mode: 'timestamp_ms' }).notNull(), refreshTokenExpiresAt: integer('refresh_token_expires_at', { mode: 'timestamp_ms' }).notNull(), lastSyncAt: integer('last_sync_at', { mode: 'timestamp_ms' }), - syncEnabled: integer('sync_enabled', { mode: 'boolean' }).notNull().default(true), + syncEnabled: integer('is_sync_enabled', { mode: 'boolean' }).notNull().default(true), defaultItemId: text('default_item_id').notNull().default('1'), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), }); @@ -36,7 +36,7 @@ export const qboSyncErrors = sqliteTable('qbo_sync_errors', { errorCode: text('error_code').notNull(), errorMsg: text('error_msg').notNull(), retries: integer('retries').notNull().default(0), - resolved: integer('resolved', { mode: 'boolean' }).notNull().default(false), + resolved: integer('is_resolved', { mode: 'boolean' }).notNull().default(false), createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(), }); diff --git a/server/lib/db/schema/tenant/core.ts b/server/lib/db/schema/tenant/core.ts index e5e5cda0..4726ddac 100644 --- a/server/lib/db/schema/tenant/core.ts +++ b/server/lib/db/schema/tenant/core.ts @@ -35,9 +35,9 @@ export const tenantConfigs = sqliteTable('tenant_configs', { // booleans gate footer / page-number / inspector-license rendering. Defaults // preserve the prior always-on behaviour. companyAddress: text('company_address'), - pdfShowFooter: integer('pdf_show_footer', { mode: 'boolean' }).notNull().default(true), - pdfShowPageNumbers: integer('pdf_show_page_numbers', { mode: 'boolean' }).notNull().default(true), - pdfShowLicense: integer('pdf_show_license', { mode: 'boolean' }).notNull().default(true), + pdfShowFooter: integer('is_pdf_footer_shown', { mode: 'boolean' }).notNull().default(true), + pdfShowPageNumbers: integer('is_pdf_page_numbers_shown', { mode: 'boolean' }).notNull().default(true), + pdfShowLicense: integer('is_pdf_license_shown', { mode: 'boolean' }).notNull().default(true), // C-10 ③-D (B-4 / A-7) — tenant transactional-email identity. `senderEmail` // is the From: address; `replyTo` is the Reply-To: header. Both null until // the workspace configures them in Settings → Communication. @@ -97,23 +97,23 @@ export const tenantConfigs = sqliteTable('tenant_configs', { .$type<{ cloneDefault: 'rating' | 'rating_notes' | 'all'; autoAdvanceDelayMs: number; pinnedTagIds: string[] }>(), // Sprint 2 S2-4 — when true, published reports render the per-defect // "Estimated cost: $X – $Y" badge. - showEstimates: integer('show_estimates', { mode: 'boolean' }).notNull().default(false), + showEstimates: integer('is_estimates_shown', { mode: 'boolean' }).notNull().default(false), // Track E1 (ITB §11, UC-ITB-07) — when true, the published report sub-nav // exposes a "Repair List" tab. Default OFF — opt-in for realtors who want // a separate punch-list view rather than the full narrative report. - enableRepairList: integer('enable_repair_list', { mode: 'boolean' }).notNull().default(false), + enableRepairList: integer('is_repair_list_enabled', { mode: 'boolean' }).notNull().default(false), // Sprint 3 S3-2 — when true, the public report viewer surfaces a // "Generate repair request" link that takes the customer to a print- // friendly export they can hand off to a contractor (or email back to // themselves). Defaults OFF so existing tenants opt in deliberately. - enableCustomerRepairExport: integer('enable_customer_repair_export', { mode: 'boolean' }).notNull().default(false), + enableCustomerRepairExport: integer('is_customer_repair_export_enabled', { mode: 'boolean' }).notNull().default(false), // Round-2 backlog #10 — when true, every NEW inspection inherits // paymentRequired = true at creation time. Per-inspection override // remains; Stripe webhook auto-flips paymentStatus to 'paid'. - blockUnpaid: integer('block_unpaid', { mode: 'boolean' }).notNull().default(false), + blockUnpaid: integer('is_unpaid_blocked', { mode: 'boolean' }).notNull().default(false), // Round-2 backlog #10 — when true, every NEW inspection inherits // agreementRequired = true at creation time. - blockUnsignedAgreement: integer('block_unsigned_agreement', { mode: 'boolean' }).notNull().default(false), + blockUnsignedAgreement: integer('is_unsigned_agreement_blocked', { mode: 'boolean' }).notNull().default(false), // Round-2 backlog G3 (Spectora §4.1, ITB UC-ITB-10) — tenant-defined // referral sources that extend the seven seeds (Realtor / Past Client / // Google Search / Facebook / Yelp / Walk-in / Other). NULL = no extras. @@ -127,24 +127,24 @@ export const tenantConfigs = sqliteTable('tenant_configs', { // Default 0 (false) = HomeGauge-style auto-confirm: agent submits -> // magic-link goes to client immediately. 1 (true) = Spectora reviewer // mode: inspector must approve the draft before the client gets the link. - conciergeReviewRequired: integer('concierge_review_required', { mode: 'boolean' }).notNull().default(false), + conciergeReviewRequired: integer('is_concierge_review_required', { mode: 'boolean' }).notNull().default(false), // IA-26 — company-level booking page: when true the public /book/:tenant // wizard shows an inspector dropdown ("Allow choice of inspectors", // Spectora-style). Default OFF = pure auto-assign (first available). - allowInspectorChoice: integer('allow_inspector_choice', { mode: 'boolean' }).notNull().default(false), + allowInspectorChoice: integer('is_inspector_choice_allowed', { mode: 'boolean' }).notNull().default(false), // Workers Paid PDF pipeline opt-in. // Default 0 (OFF) — keeps the Free-plan path cost-free (window.print() // fallback in the viewer is unaffected). Tenants on Workers Paid flip // this in Settings -> Reports to enable Browser-Rendering background // PDF generation at publish time + the Refresh PDFs / Download PDF // dropdown in the report viewer. - enablePdfPipeline: integer('enable_pdf_pipeline', { mode: 'boolean' }).notNull().default(false), + enablePdfPipeline: integer('is_pdf_pipeline_enabled', { mode: 'boolean' }).notNull().default(false), // Design System 0520 subsystem C P10 — /team Defaults section toggles. - teamModeDefault: integer('team_mode_default', { mode: 'boolean' }).notNull().default(false), + teamModeDefault: integer('is_team_mode_default', { mode: 'boolean' }).notNull().default(false), // DEAD (2026-06-13, apprentice subsystem removed) — no reads/writes - apprenticeReviewRequired: integer('apprentice_review_required', { mode: 'boolean' }).notNull().default(false), + apprenticeReviewRequired: integer('is_apprentice_review_required', { mode: 'boolean' }).notNull().default(false), // DEAD (2026-06-13, guest removal) — no reads/writes - guestInvitesEnabled: integer('guest_invites_enabled', { mode: 'boolean' }).notNull().default(true), + guestInvitesEnabled: integer('is_guest_invites_enabled', { mode: 'boolean' }).notNull().default(true), // Track H (IA-7 / P-6②) — which defect fields the publish gate REQUIRES. // Tenant default; per-inspection override on inspections.require_defect_ // fields_override (the blockUnpaid → paymentRequired inheritance pattern). @@ -165,7 +165,7 @@ export const tenantConfigs = sqliteTable('tenant_configs', { // Per-tenant operator toggle; default ON (#181 Phase 5) — new tenants get collab // unless they explicitly opt out. The legacy CAS path stays available until // Tasks 14/15 retire it. - collabEditing: integer('collab_editing', { mode: 'boolean' }).notNull().default(true), + collabEditing: integer('is_collab_editing_enabled', { mode: 'boolean' }).notNull().default(true), updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(), // SMS BYO provider choice — which carrier the tenant's own TWILIO_*/TELNYX_* // secrets belong to. NULL while not in own/managed mode. @@ -178,7 +178,7 @@ export const tenantConfigs = sqliteTable('tenant_configs', { // Managed SMS eligibility flag — set true by portal billing sync or a platform // admin to enable managed compliance for the tenant. Default false = // not eligible; provision routes fail closed until this is explicitly set. - managedEligible: integer('managed_eligible', { mode: 'boolean' }).notNull().default(false), + managedEligible: integer('is_managed_eligible', { mode: 'boolean' }).notNull().default(false), // Managed-compliance carrier choice — which ISV provider runs the tenant's // managed (managed_shared / managed_dedicated) compliance provisioning + cron // sweep + webhook reception. Distinct from `smsByoProvider` (the BYO SEND @@ -187,7 +187,7 @@ export const tenantConfigs = sqliteTable('tenant_configs', { managedProvider: text('managed_provider', { enum: ['twilio', 'telnyx'] }).notNull().default('twilio'), // Commercial PCA Phase C — Capital Replacement Reserve Schedule (TABLE 2). // Opt-in (default off): ASTM baseline reports render TABLE 1 only. - reserveScheduleEnabled: integer('reserve_schedule_enabled', { mode: 'boolean' }).notNull().default(false), + reserveScheduleEnabled: integer('is_reserve_schedule_enabled', { mode: 'boolean' }).notNull().default(false), // Projected term in years. Default 12 is INDUSTRY CONVENTION, not ASTM — // the term is user-defined (see roadmap terminology correction). reserveTermYears: integer('reserve_term_years').notNull().default(12), @@ -208,7 +208,7 @@ export const emailTemplates = sqliteTable('email_templates', { trigger: text('trigger').notNull(), subject: text('subject'), blocks: text('blocks', { mode: 'json' }).$type>(), - enabled: integer('enabled', { mode: 'boolean' }).notNull().default(true), + enabled: integer('is_enabled', { mode: 'boolean' }).notNull().default(true), updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(), }, (t) => ({ pk: primaryKey({ columns: [t.tenantId, t.trigger] }), diff --git a/server/lib/db/schema/tenant/integration.ts b/server/lib/db/schema/tenant/integration.ts index c956286d..9488248a 100644 --- a/server/lib/db/schema/tenant/integration.ts +++ b/server/lib/db/schema/tenant/integration.ts @@ -163,7 +163,7 @@ export const integrationTestResults = sqliteTable('integration_test_results', { // Optional provider variant within a target (e.g. twilio/telnyx, resend/sendgrid/ // postmark/mailgun). NULL for single-provider targets (stripe, gemini). provider: text('provider'), - ok: integer('ok', { mode: 'boolean' }).notNull(), + ok: integer('is_ok', { mode: 'boolean' }).notNull(), // Non-sensitive outcome summary (success blurb or provider error message). detail: text('detail'), // User who ran the probe (JWT sub); NULL if unknown. diff --git a/server/lib/db/schema/tenant/user.ts b/server/lib/db/schema/tenant/user.ts index cc7d645f..e20de940 100644 --- a/server/lib/db/schema/tenant/user.ts +++ b/server/lib/db/schema/tenant/user.ts @@ -25,7 +25,7 @@ export const users = sqliteTable('users', { defaultSignatureBase64: text('default_signature_base64'), // 2026-06-14 — per-inspector opt-in for the business-card email footer // (independent of Point of Contact). Default true preserves prior behaviour. - signatureEnabled: integer('signature_enabled', { mode: 'boolean' }).notNull().default(true), + signatureEnabled: integer('is_signature_enabled', { mode: 'boolean' }).notNull().default(true), // FROZEN for inspectors (2026-06-06, DB-12/IA-26): the per-inspector // booking slug is retired — /book/:tenant is the canonical public entry // and no inspector-facing route writes this column anymore. Live READERS @@ -45,7 +45,7 @@ export const users = sqliteTable('users', { createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(), // Spec 4A — TOTP 2FA. All fields are per-user opt-in; nullable until enabled. totpSecret: text('totp_secret'), - totpEnabled: integer('totp_enabled', { mode: 'boolean' }).notNull().default(false), + totpEnabled: integer('is_totp_enabled', { mode: 'boolean' }).notNull().default(false), totpRecoveryCodes: text('totp_recovery_codes'), totpVerifiedAt: integer('totp_verified_at', { mode: 'timestamp_ms' }), // Agent Accounts A2 — per-user notification preferences. Default ON for @@ -53,9 +53,9 @@ export const users = sqliteTable('users', { // inspector forwards the receipt manually if the agent wants visibility). // Read by EmailService.sendNewReferral / sendReportReady / sendInvoicePaid // before delivery; written from /agent-settings/profile (agent-side toggles). - notifyOnReferral: integer('notify_on_referral', { mode: 'boolean' }).notNull().default(true), - notifyOnReport: integer('notify_on_report', { mode: 'boolean' }).notNull().default(true), - notifyOnPaid: integer('notify_on_paid', { mode: 'boolean' }).notNull().default(false), + notifyOnReferral: integer('is_referral_notification_enabled', { mode: 'boolean' }).notNull().default(true), + notifyOnReport: integer('is_report_notification_enabled', { mode: 'boolean' }).notNull().default(true), + notifyOnPaid: integer('is_paid_notification_enabled', { mode: 'boolean' }).notNull().default(false), // Design System 0520 subsystem B phase 1 — debounced "user last active" // timestamp updated by touch-last-active middleware (30s debounce window // per worker isolate). Powers TeamStrip "last active Nm ago" pill and the From 463f7049b176b4a26b4beaaf9a901e4a6d6c6f39 Mon Sep 17 00:00:00 2001 From: important-new Date: Tue, 14 Jul 2026 10:15:35 +0800 Subject: [PATCH 4/5] test(db): update hand-written SQL fixtures + schema-name assertions for is_/has_ boolean rename --- tests/helpers/inline-ddl.ts | 2 +- tests/unit/agents/agent-notification-prefs-schema.spec.ts | 8 ++++---- tests/unit/concierge/concierge-schema.spec.ts | 8 ++++---- .../tenancy/tenant-config-allow-inspector-choice.spec.ts | 6 +++--- tests/workers/cmd-consumer.spec.ts | 2 +- tests/workers/cmd-fixtures.spec.ts | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/helpers/inline-ddl.ts b/tests/helpers/inline-ddl.ts index d4ebc95b..4a793723 100644 --- a/tests/helpers/inline-ddl.ts +++ b/tests/helpers/inline-ddl.ts @@ -15,4 +15,4 @@ * instead of a real-workerd failure. Both consumers import this single source. */ export const TENANT_CONFIGS_TEST_DDL = - 'CREATE TABLE IF NOT EXISTS tenant_configs (tenant_id TEXT PRIMARY KEY, company_name TEXT, primary_color TEXT, logo_url TEXT, support_email TEXT, sender_email TEXT, reply_to TEXT, email_mode TEXT, video_mode TEXT, sms_mode TEXT, sender_display_name TEXT, point_of_contact TEXT, billing_url TEXT, review_url TEXT, company_phone TEXT, integration_config TEXT, secrets TEXT, secrets_enc TEXT, dek_enc TEXT, ics_token TEXT, widget_allowed_origins TEXT, report_theme TEXT, attention_thresholds TEXT, inspection_prefs TEXT, show_estimates INTEGER, enable_repair_list INTEGER, enable_customer_repair_export INTEGER, block_unpaid INTEGER, block_unsigned_agreement INTEGER, custom_referral_sources TEXT, dashboard_column_prefs TEXT, concierge_review_required INTEGER, allow_inspector_choice INTEGER, enable_pdf_pipeline INTEGER, auto_sign_on_publish_default INTEGER, team_mode_default TEXT, apprentice_review_required INTEGER, guest_invites_enabled INTEGER, require_defect_fields TEXT, agreement_retention_years INTEGER, reinspection_statuses TEXT, collab_editing INTEGER NOT NULL DEFAULT 1, company_address TEXT, pdf_show_footer INTEGER, pdf_show_page_numbers INTEGER, pdf_show_license INTEGER, sms_byo_provider TEXT, email_byo_provider TEXT, managed_eligible INTEGER NOT NULL DEFAULT 0, managed_provider TEXT NOT NULL DEFAULT \'twilio\', reserve_schedule_enabled INTEGER, reserve_term_years INTEGER, inflation_rate_bps INTEGER, updated_at INTEGER);'; + 'CREATE TABLE IF NOT EXISTS tenant_configs (tenant_id TEXT PRIMARY KEY, company_name TEXT, primary_color TEXT, logo_url TEXT, support_email TEXT, sender_email TEXT, reply_to TEXT, email_mode TEXT, video_mode TEXT, sms_mode TEXT, sender_display_name TEXT, point_of_contact TEXT, billing_url TEXT, review_url TEXT, company_phone TEXT, integration_config TEXT, secrets TEXT, secrets_enc TEXT, dek_enc TEXT, ics_token TEXT, widget_allowed_origins TEXT, report_theme TEXT, attention_thresholds TEXT, inspection_prefs TEXT, is_estimates_shown INTEGER, is_repair_list_enabled INTEGER, is_customer_repair_export_enabled INTEGER, is_unpaid_blocked INTEGER, is_unsigned_agreement_blocked INTEGER, custom_referral_sources TEXT, dashboard_column_prefs TEXT, is_concierge_review_required INTEGER, is_inspector_choice_allowed INTEGER, is_pdf_pipeline_enabled INTEGER, auto_sign_on_publish_default INTEGER, is_team_mode_default TEXT, is_apprentice_review_required INTEGER, is_guest_invites_enabled INTEGER, require_defect_fields TEXT, agreement_retention_years INTEGER, reinspection_statuses TEXT, is_collab_editing_enabled INTEGER NOT NULL DEFAULT 1, company_address TEXT, is_pdf_footer_shown INTEGER, is_pdf_page_numbers_shown INTEGER, is_pdf_license_shown INTEGER, sms_byo_provider TEXT, email_byo_provider TEXT, is_managed_eligible INTEGER NOT NULL DEFAULT 0, managed_provider TEXT NOT NULL DEFAULT \'twilio\', is_reserve_schedule_enabled INTEGER, reserve_term_years INTEGER, inflation_rate_bps INTEGER, updated_at INTEGER);'; diff --git a/tests/unit/agents/agent-notification-prefs-schema.spec.ts b/tests/unit/agents/agent-notification-prefs-schema.spec.ts index f5023509..38b0fbfb 100644 --- a/tests/unit/agents/agent-notification-prefs-schema.spec.ts +++ b/tests/unit/agents/agent-notification-prefs-schema.spec.ts @@ -2,10 +2,10 @@ import { describe, it, expect } from 'vitest'; import { users } from '../../../server/lib/db/schema/tenant'; describe('users — A2 notification prefs schema', () => { - it('declares notify_on_referral, notify_on_report, notify_on_paid', () => { + it('declares is_referral_notification_enabled, is_report_notification_enabled, is_paid_notification_enabled', () => { const t = users as unknown as Record; - expect(t.notifyOnReferral?.name).toBe('notify_on_referral'); - expect(t.notifyOnReport?.name).toBe('notify_on_report'); - expect(t.notifyOnPaid?.name).toBe('notify_on_paid'); + expect(t.notifyOnReferral?.name).toBe('is_referral_notification_enabled'); + expect(t.notifyOnReport?.name).toBe('is_report_notification_enabled'); + expect(t.notifyOnPaid?.name).toBe('is_paid_notification_enabled'); }); }); diff --git a/tests/unit/concierge/concierge-schema.spec.ts b/tests/unit/concierge/concierge-schema.spec.ts index 1dc78683..fc07fcf1 100644 --- a/tests/unit/concierge/concierge-schema.spec.ts +++ b/tests/unit/concierge/concierge-schema.spec.ts @@ -8,7 +8,7 @@ import * as schema from '../../../server/lib/db/schema'; * * Verifies: * 1. inspections.concierge_status (nullable text) - * 2. tenant_configs.concierge_review_required (boolean default false) + * 2. tenant_configs.is_concierge_review_required (boolean default false) * 3. concierge_confirm_tokens table with expected columns + index */ describe('concierge schema — A3', () => { @@ -17,9 +17,9 @@ describe('concierge schema — A3', () => { expect(t.conciergeStatus?.name).toBe('concierge_status'); }); - it('tenant_configs has conciergeReviewRequired column mapping concierge_review_required', () => { + it('tenant_configs has conciergeReviewRequired column mapping is_concierge_review_required', () => { const t = tenantConfigs as unknown as Record; - expect(t.conciergeReviewRequired?.name).toBe('concierge_review_required'); + expect(t.conciergeReviewRequired?.name).toBe('is_concierge_review_required'); }); it('concierge_confirm_tokens table is exported with token primary key', () => { @@ -56,7 +56,7 @@ describe('concierge schema — A3', () => { const cfg = await fixture.db.select().from(schema.tenantConfigs).all(); expect(cfg.length).toBeGreaterThan(0); - // Default for concierge_review_required is 0 (false) per migration. + // Default for is_concierge_review_required is 0 (false) per migration. expect(!!cfg[0].conciergeReviewRequired).toBe(false); // Insert a token row to confirm the new table is wired and queryable. diff --git a/tests/unit/tenancy/tenant-config-allow-inspector-choice.spec.ts b/tests/unit/tenancy/tenant-config-allow-inspector-choice.spec.ts index 7bd6ad64..00643a6c 100644 --- a/tests/unit/tenancy/tenant-config-allow-inspector-choice.spec.ts +++ b/tests/unit/tenancy/tenant-config-allow-inspector-choice.spec.ts @@ -8,14 +8,14 @@ import * as schema from '../../../server/lib/db/schema'; * IA-26 — tenant-config allowInspectorChoice column + PATCH/GET round-trip. * * Verifies: - * 1. tenantConfigs schema has allowInspectorChoice column mapped to allow_inspector_choice. + * 1. tenantConfigs schema has allowInspectorChoice column mapped to is_inspector_choice_allowed. * 2. Default value is false (migration default). * 3. Updating to true and reading back returns true (PATCH → GET round-trip). */ describe('tenant-config allowInspectorChoice — IA-26', () => { - it('tenantConfigs schema has allowInspectorChoice column mapping allow_inspector_choice', () => { + it('tenantConfigs schema has allowInspectorChoice column mapping is_inspector_choice_allowed', () => { const t = tenantConfigs as unknown as Record; - expect(t.allowInspectorChoice?.name).toBe('allow_inspector_choice'); + expect(t.allowInspectorChoice?.name).toBe('is_inspector_choice_allowed'); }); it('default for allowInspectorChoice is false, and PATCH → GET round-trip reads back true', async () => { diff --git a/tests/workers/cmd-consumer.spec.ts b/tests/workers/cmd-consumer.spec.ts index 121d2416..cc03a3e6 100644 --- a/tests/workers/cmd-consumer.spec.ts +++ b/tests/workers/cmd-consumer.spec.ts @@ -48,7 +48,7 @@ async function seedSchema(): Promise { "CREATE TABLE IF NOT EXISTS sync_outbox (id TEXT PRIMARY KEY, event_type TEXT NOT NULL, payload TEXT NOT NULL, status TEXT NOT NULL DEFAULT 'pending', attempts INTEGER NOT NULL DEFAULT 0, created_at INTEGER NOT NULL, last_tried_at INTEGER, last_error TEXT);", ); await b.DB.exec( - "CREATE TABLE IF NOT EXISTS users (id TEXT PRIMARY KEY, tenant_id TEXT, email TEXT NOT NULL, password_hash TEXT NOT NULL, name TEXT, phone TEXT, license_number TEXT, photo_url TEXT, default_signature_base64 TEXT, signature_enabled INTEGER NOT NULL DEFAULT true, bio TEXT, service_areas TEXT, slug TEXT, role TEXT NOT NULL DEFAULT 'admin', google_refresh_token TEXT, google_calendar_id TEXT, google_access_token TEXT, google_token_expiry INTEGER, locale TEXT, onboarding_state TEXT, created_at INTEGER NOT NULL, totp_secret TEXT, totp_enabled INTEGER NOT NULL DEFAULT false, totp_recovery_codes TEXT, totp_verified_at INTEGER, notify_on_referral INTEGER NOT NULL DEFAULT true, notify_on_report INTEGER NOT NULL DEFAULT true, notify_on_paid INTEGER NOT NULL DEFAULT false, last_active_at INTEGER, mentor_id TEXT, assigned_section_ids TEXT NOT NULL DEFAULT '[]', expires_at INTEGER, signup_role TEXT, deleted_at INTEGER, terms_accepted TEXT, permission_overrides TEXT);", + "CREATE TABLE IF NOT EXISTS users (id TEXT PRIMARY KEY, tenant_id TEXT, email TEXT NOT NULL, password_hash TEXT NOT NULL, name TEXT, phone TEXT, license_number TEXT, photo_url TEXT, default_signature_base64 TEXT, is_signature_enabled INTEGER NOT NULL DEFAULT true, bio TEXT, service_areas TEXT, slug TEXT, role TEXT NOT NULL DEFAULT 'admin', google_refresh_token TEXT, google_calendar_id TEXT, google_access_token TEXT, google_token_expiry INTEGER, locale TEXT, onboarding_state TEXT, created_at INTEGER NOT NULL, totp_secret TEXT, is_totp_enabled INTEGER NOT NULL DEFAULT false, totp_recovery_codes TEXT, totp_verified_at INTEGER, is_referral_notification_enabled INTEGER NOT NULL DEFAULT true, is_report_notification_enabled INTEGER NOT NULL DEFAULT true, is_paid_notification_enabled INTEGER NOT NULL DEFAULT false, last_active_at INTEGER, mentor_id TEXT, assigned_section_ids TEXT NOT NULL DEFAULT '[]', expires_at INTEGER, signup_role TEXT, deleted_at INTEGER, terms_accepted TEXT, permission_overrides TEXT);", ); await b.DB.exec( 'CREATE TABLE IF NOT EXISTS processed_cmd_events (event_id TEXT PRIMARY KEY, cmd_type TEXT NOT NULL, processed_at INTEGER NOT NULL);', diff --git a/tests/workers/cmd-fixtures.spec.ts b/tests/workers/cmd-fixtures.spec.ts index 30c1acd3..2a1f3650 100644 --- a/tests/workers/cmd-fixtures.spec.ts +++ b/tests/workers/cmd-fixtures.spec.ts @@ -36,7 +36,7 @@ describe('cmd golden fixtures — consumer can apply every fixture (A-21)', () = // Full users DDL (mirrors cmd-consumer.spec.ts) — the replyto fixture // carries credentials, and the drizzle insert binds every column. await b.DB.exec( - "CREATE TABLE IF NOT EXISTS users (id TEXT PRIMARY KEY, tenant_id TEXT, email TEXT NOT NULL, password_hash TEXT NOT NULL, name TEXT, phone TEXT, license_number TEXT, photo_url TEXT, default_signature_base64 TEXT, signature_enabled INTEGER NOT NULL DEFAULT true, bio TEXT, service_areas TEXT, slug TEXT, role TEXT NOT NULL DEFAULT 'admin', google_refresh_token TEXT, google_calendar_id TEXT, google_access_token TEXT, google_token_expiry INTEGER, locale TEXT, onboarding_state TEXT, created_at INTEGER NOT NULL, totp_secret TEXT, totp_enabled INTEGER NOT NULL DEFAULT false, totp_recovery_codes TEXT, totp_verified_at INTEGER, notify_on_referral INTEGER NOT NULL DEFAULT true, notify_on_report INTEGER NOT NULL DEFAULT true, notify_on_paid INTEGER NOT NULL DEFAULT false, last_active_at INTEGER, mentor_id TEXT, assigned_section_ids TEXT NOT NULL DEFAULT '[]', expires_at INTEGER, signup_role TEXT, deleted_at INTEGER, terms_accepted TEXT, permission_overrides TEXT);", + "CREATE TABLE IF NOT EXISTS users (id TEXT PRIMARY KEY, tenant_id TEXT, email TEXT NOT NULL, password_hash TEXT NOT NULL, name TEXT, phone TEXT, license_number TEXT, photo_url TEXT, default_signature_base64 TEXT, is_signature_enabled INTEGER NOT NULL DEFAULT true, bio TEXT, service_areas TEXT, slug TEXT, role TEXT NOT NULL DEFAULT 'admin', google_refresh_token TEXT, google_calendar_id TEXT, google_access_token TEXT, google_token_expiry INTEGER, locale TEXT, onboarding_state TEXT, created_at INTEGER NOT NULL, totp_secret TEXT, is_totp_enabled INTEGER NOT NULL DEFAULT false, totp_recovery_codes TEXT, totp_verified_at INTEGER, is_referral_notification_enabled INTEGER NOT NULL DEFAULT true, is_report_notification_enabled INTEGER NOT NULL DEFAULT true, is_paid_notification_enabled INTEGER NOT NULL DEFAULT false, last_active_at INTEGER, mentor_id TEXT, assigned_section_ids TEXT NOT NULL DEFAULT '[]', expires_at INTEGER, signup_role TEXT, deleted_at INTEGER, terms_accepted TEXT, permission_overrides TEXT);", ); await b.DB.exec('CREATE TABLE IF NOT EXISTS processed_cmd_events (event_id TEXT PRIMARY KEY, cmd_type TEXT NOT NULL, processed_at INTEGER NOT NULL);'); await b.DB.exec('CREATE TABLE IF NOT EXISTS parked_cmd_events (id TEXT PRIMARY KEY, envelope TEXT NOT NULL, reason TEXT NOT NULL, received_at INTEGER NOT NULL);'); From eb3c8035e60f0c837e36de5b0967cf7354e8d4ef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 02:39:56 +0000 Subject: [PATCH 5/5] chore(main): release openinspection 1.0.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 190 ++++++++++++++++++++++++++++++++++ package-lock.json | 4 +- package.json | 2 +- 4 files changed, 194 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 57929fd3..11fea0fb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{ ".": "1.0.0-rc.1" } +{".":"1.0.0"} diff --git a/CHANGELOG.md b/CHANGELOG.md index 89dfda87..e7dbd67a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,196 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.0](https://github.com/important-new/OpenInspection/compare/openinspection-v1.0.0-rc.1...openinspection-v1.0.0) (2026-07-14) + + +### Features + +* **#181:** collaborative editing Phases 4–6 + offline media (version history, default-on, legacy retirement, offline upload) ([#194](https://github.com/important-new/OpenInspection/issues/194)) ([c293821](https://github.com/important-new/OpenInspection/commit/c293821a7e4d6e643b00b18c1166000d8a1e5f87)) +* **#181:** collaborative inspection editing — Yjs + Durable Objects (Phases 1–3, flag default-off) ([#191](https://github.com/important-new/OpenInspection/issues/191)) ([6d6ce46](https://github.com/important-new/OpenInspection/commit/6d6ce46b02cd70cd79b7c0711365a2e40263c7c3)) +* **agent:** ⌘K palette + clickable referral rows (UC-A-6 + UC-A-4) ([bc1d408](https://github.com/important-new/OpenInspection/commit/bc1d408bc7a8e063fae9b972c5da61faa80ac647)) +* **agent:** recommendations export view (UC-A-5) ([a561413](https://github.com/important-new/OpenInspection/commit/a561413a6119b9b6059f6f1546759926b1756e54)) +* **api:** POST /api/inspections/templates/import-spectora ([#59](https://github.com/important-new/OpenInspection/issues/59)) ([f7e3dd4](https://github.com/important-new/OpenInspection/commit/f7e3dd4bf897fbd316e8d8079f5cb32214bc7daf)) +* booking IA restructure + inspection editor gaps + seed templates ([#92](https://github.com/important-new/OpenInspection/issues/92)) ([86b7f88](https://github.com/important-new/OpenInspection/commit/86b7f88749513ba7a738c87d3811a2477dcfe027)) +* BreadcrumbDropdown for multi-unit navigation ([#81](https://github.com/important-new/OpenInspection/issues/81)) ([29224f5](https://github.com/important-new/OpenInspection/commit/29224f58f7467138e1e75c5d9df0d06c2f510a5b)) +* cascade delete triggers for tenant purge ([#77](https://github.com/important-new/OpenInspection/issues/77)) ([d6ea711](https://github.com/important-new/OpenInspection/commit/d6ea7117957c0231c68d28ca3742c7d5ab813132)) +* client documents — per-inspection shared document area (portal Hub + inspector hub) ([#158](https://github.com/important-new/OpenInspection/issues/158)) ([72776cb](https://github.com/important-new/OpenInspection/commit/72776cb548cf75eaa3fc2196b797f81ba873a857)) +* close deferred Commercial PCA report items (property facts, docx stress, gated Paged.js TOC) ([#239](https://github.com/important-new/OpenInspection/issues/239)) ([e24c2e2](https://github.com/important-new/OpenInspection/commit/e24c2e2adb40e2437ee707179cd78331457e0b37)) +* complete commercial PCA report + self-hoster release contract ([#237](https://github.com/important-new/OpenInspection/issues/237)) ([aa5107f](https://github.com/important-new/OpenInspection/commit/aa5107f8697b7e2e3b27b4b0011f123ef1dd1359)) +* **core:** implement secure multi-tenant sync and integration signature verification ([6ff8456](https://github.com/important-new/OpenInspection/commit/6ff845635b4c39c8ec9e6f648d70b78bae460e6e)) +* **core:** modernize saas backup/restore and harden infrastructure setup ([3c9f1c8](https://github.com/important-new/OpenInspection/commit/3c9f1c87f03b60da8968459064f62df4c8ca2d66)) +* **core:** QuickBooks Online integration + complete dark mode ([#42](https://github.com/important-new/OpenInspection/issues/42)) ([37160d3](https://github.com/important-new/OpenInspection/commit/37160d39cef55935492d6c59e29137629667cde0)) +* **core:** settings page for UI-managed env vars with AES-256-GCM encryption ([84328dc](https://github.com/important-new/OpenInspection/commit/84328dc3137e84187f277a5ead66048048d754f9)) +* **core:** warn before changing an existing booking slug ([ed46ca7](https://github.com/important-new/OpenInspection/commit/ed46ca7d94786cb5bda5b03f12aab8dbfc3968cd)) +* **dashboard:** M2 visual alignment — Good-morning header + closing urgency + row typography ([#46](https://github.com/important-new/OpenInspection/issues/46)) ([3633315](https://github.com/important-new/OpenInspection/commit/3633315b923085302e721194f1097f119b9156cd)) +* **db:** add lint:naming gate (boolean columns must be is_/has_) ([12cf010](https://github.com/important-new/OpenInspection/commit/12cf010229a308aa2035de91a0845bf8fd2d1255)) +* **deploy:** rename resources with standalone prefix ([37142f6](https://github.com/important-new/OpenInspection/commit/37142f6840d2059c0da523a6a69012a18265a2d3)) +* **deploy:** rename resources with standalone prefix ([366e6c1](https://github.com/important-new/OpenInspection/commit/366e6c1e8c96a0f6c0e504e247b48bf7b64dabdd)) +* **deploy:** standalone resource naming and simplified wrangler.toml vars ([167100f](https://github.com/important-new/OpenInspection/commit/167100f0b64e750189600503ac64c01cfddb4926)) +* **deploy:** use standalone resource naming ([898f2bc](https://github.com/important-new/OpenInspection/commit/898f2bcead552b559b98123b2bc1bce6d2bbcad8)) +* **deploy:** use standalone resource naming and remove unnecessary preview R2 bucket ([d87412b](https://github.com/important-new/OpenInspection/commit/d87412b4a5fa15227b7d3696fc349ceebc1740c6)) +* **email:** pluggable email providers + BYO provider choice (Resend/SendGrid/Postmark/Mailgun) ([#195](https://github.com/important-new/OpenInspection/issues/195)) ([#206](https://github.com/important-new/OpenInspection/issues/206)) ([16ca2e7](https://github.com/important-new/OpenInspection/commit/16ca2e7eaa5e43e2e71f2e0156e36e886a7d935e)) +* FIELD placeholder system + publish gate ([#82](https://github.com/important-new/OpenInspection/issues/82)) ([849c7e6](https://github.com/important-new/OpenInspection/commit/849c7e6bd48ad915ab48596b6a1960c1086c4699)) +* Foundation layer + editor 4-column + visual compaction ([#79](https://github.com/important-new/OpenInspection/issues/79)) ([2c945e5](https://github.com/important-new/OpenInspection/commit/2c945e556f3ff0bb9fbb5397b30a1b4e173054b2)) +* free-tier usage quotas (5 inspections / 50 platform SMS / 50 platform emails) ([#217](https://github.com/important-new/OpenInspection/issues/217)) ([a68c66d](https://github.com/important-new/OpenInspection/commit/a68c66da8cfa333d9b5f97b0394b9d49bc749dcb)) +* Gap 16 completion + Settings + Comments filter ([#88](https://github.com/important-new/OpenInspection/issues/88)) ([1212ed7](https://github.com/important-new/OpenInspection/commit/1212ed73766da9e9263857238e9a910de50c7cc2)) +* **husky:** add 1MB bundle size limit check in pre-commit hook ([8705ceb](https://github.com/important-new/OpenInspection/commit/8705ceb4de632d7f0244ba4123d445f24b8c599e)) +* **import:** Spectora converter handles rating_levels, disclaimer, description ([#61](https://github.com/important-new/OpenInspection/issues/61)) ([f5584f5](https://github.com/important-new/OpenInspection/commit/f5584f5377688e550c04c8cf5a9c23b7ad6fb2d3)) +* **import:** Spectora export → v2 schema converter (+ tests) ([#58](https://github.com/important-new/OpenInspection/issues/58)) ([c383876](https://github.com/important-new/OpenInspection/commit/c383876f1945628d1ba83aa982ac093f60971443)) +* initial open-source release of OpenInspection core ([7509d2c](https://github.com/important-new/OpenInspection/commit/7509d2cde5495a6595cb3731d45d5e32e09f544c)) +* inspection detail hub + Reports retirement + contact detail ([#111](https://github.com/important-new/OpenInspection/issues/111)) ([#129](https://github.com/important-new/OpenInspection/issues/129)) ([8017561](https://github.com/important-new/OpenInspection/commit/80175615e3eee4effb429fd2dd94c5bc7932de81)) +* **inspection-edit:** delete section / item + save-back / save-as new template ([1d2bd6e](https://github.com/important-new/OpenInspection/commit/1d2bd6ecebf985a83594928c35a627ee9bc4347c)) +* **inspection-edit:** gate rating buttons to rich items, surface non-rich types ([#54](https://github.com/important-new/OpenInspection/issues/54)) ([907c47e](https://github.com/important-new/OpenInspection/commit/907c47eece658b2bfcd1ec696d0807b903881962)) +* **inspection-edit:** inline + Add item button + type-picker modal ([5e506e2](https://github.com/important-new/OpenInspection/commit/5e506e25868ee5f8f491e033ea5c05b435f01ae4)) +* **inspection-edit:** inline + Add section button + prompt modal ([964eb3f](https://github.com/important-new/OpenInspection/commit/964eb3fae584080901c96d00d6ae55fe2eba5755)) +* **inspection-edit:** M11 keyboard ergonomics — R repeat, J/K nav ([#47](https://github.com/important-new/OpenInspection/issues/47)) ([8bb9a3a](https://github.com/important-new/OpenInspection/commit/8bb9a3aa5997dafd44cf026c75f57f1e8b192d75)) +* **inspection-edit:** real input controls for boolean / number / text / textarea / date items ([#55](https://github.com/important-new/OpenInspection/issues/55)) ([f7f49eb](https://github.com/important-new/OpenInspection/commit/f7f49ebca9f7fe90fe3d258faa50e98ae5a007cc)) +* **inspection-edit:** select / multi_select / photo_only controls ([#56](https://github.com/important-new/OpenInspection/issues/56)) ([adb140a](https://github.com/important-new/OpenInspection/commit/adb140ae3267d89fbd4c05ea1a572087ccdccce8)) +* **inspection:** PATCH /:id/template-snapshot — phase 1 of inline-edit ([60603be](https://github.com/important-new/OpenInspection/commit/60603bef8d1af8205db712e5d57875c03c120cd7)) +* **inspection:** rating-system swap endpoint + snapshot-first report-data ([1476f91](https://github.com/important-new/OpenInspection/commit/1476f919702334eae551f11d5b847448c6f0f775)) +* **integration:** tenants by-email lookup for cross-tenant client magic-links (P4) ([#188](https://github.com/important-new/OpenInspection/issues/188)) ([bc1e80b](https://github.com/important-new/OpenInspection/commit/bc1e80bdfb6d3126e1d8f38a4608da483ff66210)) +* **isolation:** implement ScopedDB and multi-tenant security hardening ([38b3fc1](https://github.com/important-new/OpenInspection/commit/38b3fc1e57a08721c342fe90ed2e9cea559401dc)) +* **mcp:** Phase E — Resources, Prompts, extended-tier + UI polish ([#211](https://github.com/important-new/OpenInspection/issues/211)) ([45fcc74](https://github.com/important-new/OpenInspection/commit/45fcc74494d55fc006dabdc7abf632a20b08b811)) +* **mcp:** remote MCP server + OAuth 2.1 (flag-gated, default off) ([#210](https://github.com/important-new/OpenInspection/issues/210)) ([2f7e6de](https://github.com/important-new/OpenInspection/commit/2f7e6de9431beaf1edcc2d09bc5e7d8169ad412a)) +* merge open-source and SaaS branches into unified deployable build ([c7af25d](https://github.com/important-new/OpenInspection/commit/c7af25d3bd2365cb57456604dec0ede1ca4ec77d)) +* messaging-compliance provider abstraction, webhooks, template library, settings connection-test history ([#208](https://github.com/important-new/OpenInspection/issues/208)) ([a12e7af](https://github.com/important-new/OpenInspection/commit/a12e7af7d1b3c999d3dcc18b1ca1f8997a4ddbba)) +* multi-workspace identity sync + shared-SaaS login UX + Sign Out fix ([#76](https://github.com/important-new/OpenInspection/issues/76)) ([f727658](https://github.com/important-new/OpenInspection/commit/f7276580a4a66248c40f8a1336e55bdcb6597b2c)) +* P1 enhancements — Icon system + Card view + Batch rating ([#84](https://github.com/important-new/OpenInspection/issues/84)) ([a7db1aa](https://github.com/important-new/OpenInspection/commit/a7db1aa905917cfbce64659ddf0dc7a9804582f9)) +* P2 advanced features — Subtypes + SpeedMode + ConflictResolver ([#85](https://github.com/important-new/OpenInspection/issues/85)) ([72b4c13](https://github.com/important-new/OpenInspection/commit/72b4c1358a047bf931fe60d6be80fc5e6fdf32c0)) +* P3 — Resolvers + Comments tagging + Report D7 + InviteSeatModal ([#86](https://github.com/important-new/OpenInspection/issues/86)) ([0e4318d](https://github.com/important-new/OpenInspection/commit/0e4318d16b5d0f0ee8026662e1d28269cd88de23)) +* **pca:** persist commercial subtype-preset property facts (Building Profile editing) ([#243](https://github.com/important-new/OpenInspection/issues/243)) ([5e900d2](https://github.com/important-new/OpenInspection/commit/5e900d2761af2da56cb15686008556bdc5cee3a7)) +* per-tenant usage metering + self-service usage view ([#139](https://github.com/important-new/OpenInspection/issues/139)) ([d22b0de](https://github.com/important-new/OpenInspection/commit/d22b0de170cb67a41f0c10a215d10455c8e1878c)) +* **pwa:** register /sw.js on every page load ([f14fb04](https://github.com/important-new/OpenInspection/commit/f14fb04b424c7307df6ff68660de5e1bc60c1bcf)) +* Remix frontend migration + dual Worker architecture ([#91](https://github.com/important-new/OpenInspection/issues/91)) ([cba21ae](https://github.com/important-new/OpenInspection/commit/cba21ae572b63a93b882ee3320974a126dbdd02e)) +* remove per-tenant Google Analytics (GA4) tracking ([#100](https://github.com/important-new/OpenInspection/issues/100)) ([68ae463](https://github.com/important-new/OpenInspection/commit/68ae4630e30733a7a73e943a2bece660e7507c25)) +* remove Tailwind CSS build result styles and utility classes file from git ([8d13df1](https://github.com/important-new/OpenInspection/commit/8d13df1c34be5f22fca5677eaaec33c09dd14ce5)) +* **report-gate:** contact rows + amount on CTA + display font (BUG [#22](https://github.com/important-new/OpenInspection/issues/22)) ([37d4efb](https://github.com/important-new/OpenInspection/commit/37d4efbbfcf1c124e169547c465bc13a7585a1f4)) +* **report-print:** paginated PDF layout + tenant PDF settings + editor Preview PDF ([#164](https://github.com/important-new/OpenInspection/issues/164)) ([b6165c8](https://github.com/important-new/OpenInspection/commit/b6165c8be6b24664adb560117c2052002cdb0704)) +* **report:** Commercial PCA Phase C — dual-table Cost Engine (Opinion of Cost + Reserve Schedule) ([#232](https://github.com/important-new/OpenInspection/issues/232)) ([908c85e](https://github.com/important-new/OpenInspection/commit/908c85ee7b5ed2f304c54c42fd8d91e99b6bb927)) +* **report:** customer Reply + Share entry points (UC-C-6, UC-C-7) ([c87a408](https://github.com/important-new/OpenInspection/commit/c87a408866fc16638145723fdb79f193656d1dc5)) +* **report:** expose enableRepairList + enableCustomerRepairExport in report data ([#156](https://github.com/important-new/OpenInspection/issues/156)) ([9177d86](https://github.com/important-new/OpenInspection/commit/9177d860af7c0dbf9e11acecdb3e3a19b380dfe5)) +* **report:** show non-rich item values on the customer-facing report ([#63](https://github.com/important-new/OpenInspection/issues/63)) ([32d3c3e](https://github.com/important-new/OpenInspection/commit/32d3c3e97e5758c832699ccf365d1d35e97a3fd2)) +* **reports:** make Workers Paid PDF pipeline opt-in (default OFF) ([a74d9e0](https://github.com/important-new/OpenInspection/commit/a74d9e050f74ab97d43ee3545f4eb9d9c65554c9)) +* **reports:** support per-inspection and per-tenant report theme override ([eb0be29](https://github.com/important-new/OpenInspection/commit/eb0be29f821676a288ca2bc8b44b29b05a4679bb)) +* **saas:** enforce strict multi-tenant isolation and persistent id sync ([6ba2f13](https://github.com/important-new/OpenInspection/commit/6ba2f13129f973a5bdc32f882d2f3adcb5cb6c81)) +* **saas:** implement portal integration and background synchronization architecture ([cb38936](https://github.com/important-new/OpenInspection/commit/cb389364d7a5b41062c10b487a4e5063af6b824c)) +* security hardening, safeISODate, unified login page ([#16](https://github.com/important-new/OpenInspection/issues/16)) ([0fef86f](https://github.com/important-new/OpenInspection/commit/0fef86f06506d9d153c8b76911bfed488765a822)) +* seed template ID unification + findings key migration ([#87](https://github.com/important-new/OpenInspection/issues/87)) ([4a25079](https://github.com/important-new/OpenInspection/commit/4a25079f06bbc5ab945342c24b21b60a2a07c987)) +* **seed:** default automations, agreement, and services for new tenants ([8123f00](https://github.com/important-new/OpenInspection/commit/8123f0019ce16c22a48b8a62ea03546daed5965e)) +* **settings-sheet:** rating-system dropdown with severity-bucket remap warning ([fe001d2](https://github.com/important-new/OpenInspection/commit/fe001d282a389c21229439c8defb08800138aa92)) +* **settings-sheet:** replace window.confirm with custom 3-option modal ([e1f97bb](https://github.com/important-new/OpenInspection/commit/e1f97bb80061374f8590e0a7bdd8428fd260b388)) +* **settings:** toggle to enable client Repair Request Builder (enableCustomerRepairExport) ([#151](https://github.com/important-new/OpenInspection/issues/151)) ([4591bc3](https://github.com/important-new/OpenInspection/commit/4591bc3eca0186887d1d1ba059b98060f57f8fbd)) +* Shortcuts popover (Gap 9) ([#83](https://github.com/important-new/OpenInspection/issues/83)) ([fdedf5f](https://github.com/important-new/OpenInspection/commit/fdedf5fc62edfcc3c789e48ef46608ac57b61b6d)) +* **sms:** MessagingProvider abstraction + BYO Twilio/Telnyx provider choice ([#205](https://github.com/important-new/OpenInspection/issues/205)) ([b3e23d0](https://github.com/important-new/OpenInspection/commit/b3e23d0866b58bd7a613e10e07dfe1745725eb1e)) +* **template-editor:** per-item canned-comment editor UI ([#57](https://github.com/important-new/OpenInspection/issues/57)) ([b330fcc](https://github.com/important-new/OpenInspection/commit/b330fcc18e8bf1fa3332348854c1ed7a3c4e310a)) +* **template-schema:** accept full ratingSystem shape ([#52](https://github.com/important-new/OpenInspection/issues/52)) ([4c64482](https://github.com/important-new/OpenInspection/commit/4c6448247b7d6e47d9bfc082df22ce8a2a0ac3d2)) +* **template-schema:** accept section.source for Spectora-style imports ([#53](https://github.com/important-new/OpenInspection/issues/53)) ([c872a07](https://github.com/important-new/OpenInspection/commit/c872a07db2fb9daf42dc19d08933618ab88d6cf0)) +* **template-schema:** expand v2 to keep editor's full feature set ([#51](https://github.com/important-new/OpenInspection/issues/51)) ([76c95aa](https://github.com/important-new/OpenInspection/commit/76c95aa9bbbf8b942bb6f7e58182b3106d9b885a)) +* **templates:** "Import from Spectora" button + paste-JSON modal ([#60](https://github.com/important-new/OpenInspection/issues/60)) ([c1e90b3](https://github.com/important-new/OpenInspection/commit/c1e90b3b711b1583a89acc6d6a6b32e4f46a477b)) +* **templates:** "Try with sample" link in the Spectora import modal ([#62](https://github.com/important-new/OpenInspection/issues/62)) ([db746f2](https://github.com/important-new/OpenInspection/commit/db746f289d2adbb77b8ad18714cda4d92eb01282)) +* tenant suspension middleware + amber banner ([#78](https://github.com/important-new/OpenInspection/issues/78)) ([a71380f](https://github.com/important-new/OpenInspection/commit/a71380f3e4bcb7037b3fd52a9d64fccb779c1565)) +* **uc-a-1:** thread referredByAgentId through multi-service bookings ([38fe8b8](https://github.com/important-new/OpenInspection/commit/38fe8b80559c06d08ee9395a8f1d16a037c20abf)) +* **uc-a-1:** wire ?ref=<agentSlug> through public booking endpoint ([3941dd7](https://github.com/important-new/OpenInspection/commit/3941dd7a686a1d418bf45a972ec654dca526a73f)) +* **ui:** dark mode with FOUC prevention and system preference sync ([#37](https://github.com/important-new/OpenInspection/issues/37)) ([3dc251a](https://github.com/important-new/OpenInspection/commit/3dc251ac6c0f6c951ba0f74b8cccb9707f510acb)) +* **ui:** PDF download button + 3-way color scheme toggle (auto/dark/light) ([#38](https://github.com/important-new/OpenInspection/issues/38)) ([263bbfa](https://github.com/important-new/OpenInspection/commit/263bbfaa5d62bcd20e4757247d8c2ac24dc2da09)) +* **ui:** theme dropdown menu + fix Inspections sidebar icon ([#41](https://github.com/important-new/OpenInspection/issues/41)) ([0de3511](https://github.com/important-new/OpenInspection/commit/0de3511ff1ecb165c4108b25404a18847f383413)) +* unified client portal foundation (magic-link + My Inspections + Hub + report-email repoint) ([#157](https://github.com/important-new/OpenInspection/issues/157)) ([bea61cf](https://github.com/important-new/OpenInspection/commit/bea61cf0f6524398476b3a2a2c0e1101480b8bdd)) +* **ux:** eliminate SSR page-transition lag + loading states ([#202](https://github.com/important-new/OpenInspection/issues/202)) ([#209](https://github.com/important-new/OpenInspection/issues/209)) ([e25621f](https://github.com/important-new/OpenInspection/commit/e25621fae8d7397dfb7ee931f0aabc190ca372c7)) + + +### Bug Fixes + +* **a2+a1:** inviter resolution + standalone booking-link host ([0481c97](https://github.com/important-new/OpenInspection/commit/0481c9748e08f0c9f3cdc100bd42087aad6d7e2a)) +* add test-results/ to .gitignore ([c6d552f](https://github.com/important-new/OpenInspection/commit/c6d552f77b74f8978fa65ba4d03616b21fa227f1)) +* **agent-dashboard:** correct escaped quote syntax error in leaderboard template ([f7e6a74](https://github.com/important-new/OpenInspection/commit/f7e6a743acb861166e4e07d5c236a9ee64c2ceb8)) +* AI Suggest binding + ? shortcut bleed-over (BUG [#26](https://github.com/important-new/OpenInspection/issues/26) + [#27](https://github.com/important-new/OpenInspection/issues/27)) ([2632241](https://github.com/important-new/OpenInspection/commit/263224190202cc7503ad7924fb36e84746225824)) +* **auth+ui:** unblock browser-auth admin routes + sync Property Info widget on async load ([38a63a0](https://github.com/important-new/OpenInspection/commit/38a63a0f7a412ed3538ebe8b23963b02993ae024)) +* **auth:** expose /setup POST at root and issue JWT on initialization ([a4fb316](https://github.com/important-new/OpenInspection/commit/a4fb3163ed375cb06db298c3f66c01481725ea43)) +* **auth:** remove SETUP_CODE env var dependency, rely solely on KV for verification ([58deadf](https://github.com/important-new/OpenInspection/commit/58deadfac5349404aa233e91fd939a3b3a0c5efc)) +* **auth:** strictly require setup code and improve /setup page guidance ([3a47cfd](https://github.com/important-new/OpenInspection/commit/3a47cfd93f9cd813e83c0793c006b27bd2dddbf4)) +* **automation:** keep cron flush query under D1 100-column result-set cap ([#229](https://github.com/important-new/OpenInspection/issues/229)) ([bb2b598](https://github.com/important-new/OpenInspection/commit/bb2b59800f4a3350e7f62701d2a096955cd7af46)) +* **automations:** await fireAutomation so the trigger actually runs ([5022131](https://github.com/important-new/OpenInspection/commit/5022131e2f0fb689e387a39190953258e8d94d34)) +* **calendar:** subtitle no longer dissonant when current week empty but month grid full (BUG [#23](https://github.com/important-new/OpenInspection/issues/23)) ([27a4be8](https://github.com/important-new/OpenInspection/commit/27a4be8679c4f8cc266a49b1524cd17d5ca3ead4)) +* **cheatsheet:** drop stale "(coming soon)" on ⌘K row (BUG [#25](https://github.com/important-new/OpenInspection/issues/25)) ([c902e31](https://github.com/important-new/OpenInspection/commit/c902e31d9cbde22a75ccd36bb2815a42ec0abe27)) +* **concierge:** redirect to /report/<id> instead of nonexistent /r/<id> ([b6b596b](https://github.com/important-new/OpenInspection/commit/b6b596bdf183ae6afb31d83fbdd213b8d8d514a5)) +* **conflict-modal:** dark mode pre sections + continuous empty-conflict cleanup ([#45](https://github.com/important-new/OpenInspection/issues/45)) ([17ba254](https://github.com/important-new/OpenInspection/commit/17ba254d73f483d59a87898cb12800f0cf8c971c)) +* **core:** add missing route imports and optimize deployment script ([42dd8d3](https://github.com/important-new/OpenInspection/commit/42dd8d3e717206e3edebc32074a0f73a86a30aba)) +* **core:** remove Tailwind CDN, rely on CLI-built styles.css ([6f17691](https://github.com/important-new/OpenInspection/commit/6f176918cff3a2fdb8baf819e8d6ccbebb1134bb)) +* **core:** sync route import refinements from saas ([319cbff](https://github.com/important-new/OpenInspection/commit/319cbff1ceec54a40d689d386f39561dea25169c)) +* **core:** wire scheduled handler + chunk D1 seed insert + harden trigger ([4746942](https://github.com/important-new/OpenInspection/commit/47469420b6a89cd4cba6236076c3d4eb64510890)) +* count client inspections by email in ContactService ([bdfbc42](https://github.com/important-new/OpenInspection/commit/bdfbc4212235c37aa1f911204079d8c1fb7ed575)) +* **deploy:** cleanup orphaned KV and extend setup code TTL ([c7819e5](https://github.com/important-new/OpenInspection/commit/c7819e5ae3e38b3ae2b8c5241e24f817cd383c86)) +* **deploy:** cleanup orphaned KV and extend setup code TTL ([33d4e3b](https://github.com/important-new/OpenInspection/commit/33d4e3b1f8b4ee9815ede2184bbfaff17d0878e9)) +* **deploy:** downgrade eslint to v9 for compatibility with eslint-plugin-import ([545fb0a](https://github.com/important-new/OpenInspection/commit/545fb0aa88b11814e7c257aeab1d03c199a75afb)) +* **deploy:** downgrade eslint to v9 for deploy button compatibility ([7f17543](https://github.com/important-new/OpenInspection/commit/7f17543e2f7244f2ed3b0c1bb5d6f2b6ce03d9f5)) +* **deploy:** downgrade eslint v10 to v9 with synced lock file ([67de7fe](https://github.com/important-new/OpenInspection/commit/67de7fedf4c01e23606aae1be74d85371bc46db0)) +* **deploy:** fix setup code not being written to KV ([60669c4](https://github.com/important-new/OpenInspection/commit/60669c46bcf45321ee5594695d997e7b834c51c7)) +* **deploy:** replace --batch with --yes for wrangler d1 migrations ([62a884d](https://github.com/important-new/OpenInspection/commit/62a884dbb80c26dbeef64dfe25bf1c2cdb28b08f)) +* **deploy:** replace --batch with --yes for wrangler d1 migrations in CI/CD ([b749adc](https://github.com/important-new/OpenInspection/commit/b749adcac52d9d4a135cf012592179bbbf302531)) +* **deploy:** sync package-lock.json with eslint v9 ([bd5bf7e](https://github.com/important-new/OpenInspection/commit/bd5bf7ea30c2ebe527e7a2a04e9aa81ab484d1e6)) +* **deploy:** sync package-lock.json with eslint v9 downgrade ([71b08b3](https://github.com/important-new/OpenInspection/commit/71b08b3d7e6c68425722c83717450ef1df66447f)) +* **deploy:** use setup-cloudflare script and add placeholder IDs ([f883d7d](https://github.com/important-new/OpenInspection/commit/f883d7d2c8881714042930ef14b1325cf6ab815b)) +* **deploy:** use setup-cloudflare script and add placeholder IDs to wrangler.toml ([5d01279](https://github.com/important-new/OpenInspection/commit/5d01279789fccf4713162cf02a433b2d7528dd39)) +* **deps:** bump hono to ^4.12.21 and uuid to ^11.1.1 (Dependabot [#8](https://github.com/important-new/OpenInspection/issues/8)-12) ([b035802](https://github.com/important-new/OpenInspection/commit/b0358028462f04b91910a60753ecbb18063de5e4)) +* **deps:** bump hono to 4.12.24 and uuid to 11.1.1 (Dependabot [#8](https://github.com/important-new/OpenInspection/issues/8)-12) ([6b152ed](https://github.com/important-new/OpenInspection/commit/6b152edc18ea922fa515183c0ecd9d938fc1bd6d)) +* downgrade ESLint v10 to v9 with synced lock file ([68d2827](https://github.com/important-new/OpenInspection/commit/68d2827bf093f8f2f6ecce925630de13e7128fbc)) +* **e2e:** resolve E2E test infrastructure and missing auth middleware ([e3df02f](https://github.com/important-new/OpenInspection/commit/e3df02f5ee632f00c1eb2e4f4b95052e9e71acab)) +* editor field-readiness + DB schema batch + offline queue + wizard People step ([#107](https://github.com/important-new/OpenInspection/issues/107)) ([558710c](https://github.com/important-new/OpenInspection/commit/558710c5952cd6c3432b4e599d7629b5e2133447)) +* **husky:** check bundle gzip size against 1MiB limit ([99a80bc](https://github.com/important-new/OpenInspection/commit/99a80bc1fc3a57cd4948ff2a917c9fcbc7f530e1)) +* **husky:** cross-platform pre-commit hook (Windows/macOS/Linux) ([4ff32f7](https://github.com/important-new/OpenInspection/commit/4ff32f7aa7d8cface7e2bb5e8b45e5971351b78f)) +* **husky:** simplify bundle check to only validate gzip size ([3d4d184](https://github.com/important-new/OpenInspection/commit/3d4d184c113ea438aed38e1df3fa20952bf678f9)) +* **inspection-edit:** count non-rich item values toward completion % ([#67](https://github.com/important-new/OpenInspection/issues/67)) ([275cfe1](https://github.com/important-new/OpenInspection/commit/275cfe1acce88294d20dbfb9e50010d535bffcec)) +* **lint:** resolve all ESLint and TypeScript errors for pre-commit compliance ([1041efe](https://github.com/important-new/OpenInspection/commit/1041efe7d576ae0225a5e311e034652f50130344)) +* **m2m:** key tenant upsert on stable id, self-heal slug ([#104](https://github.com/important-new/OpenInspection/issues/104)) ([05efd83](https://github.com/important-new/OpenInspection/commit/05efd83b0b756257b72ac6fac2c7a7b756bf905c)) +* **merge:** resolve type errors and lint warning after saas/opensource merge ([78fd1e8](https://github.com/important-new/OpenInspection/commit/78fd1e855e5c54603e340b6c3567bd01c0418aa7)) +* **migration:** defer_foreign_keys in 0055 users rebuild for D1 prod ([54a4f30](https://github.com/important-new/OpenInspection/commit/54a4f30479fb05482461b02ffa6acd384b4c388b)) +* **offline:** MemoryQueueStorage.putWrite/coalesce now shallow-copies the ([a0dc813](https://github.com/important-new/OpenInspection/commit/a0dc813bb8b80f3fcedb956417b6a581670d6fa7)) +* **offline:** MemoryQueueStorage.putWrite/coalesce now shallow-copies the ([de968a9](https://github.com/important-new/OpenInspection/commit/de968a97832dfc55f5472a825b2909f4ac36058f)) +* **offline:** MemoryQueueStorage.putWrite/coalesce now shallow-copies the ([ccb13f5](https://github.com/important-new/OpenInspection/commit/ccb13f5d5922326ad0950e5858046cdd5cef2723)) +* **offline:** MemoryQueueStorage.putWrite/coalesce now shallow-copies the ([558710c](https://github.com/important-new/OpenInspection/commit/558710c5952cd6c3432b4e599d7629b5e2133447)) +* **oi:** point "Switch workspace" links at /company/switch ([#212](https://github.com/important-new/OpenInspection/issues/212)) ([cda88bc](https://github.com/important-new/OpenInspection/commit/cda88bcb0f346ca0cbd8d51dbc606318b1a44d6f)) +* **pca:** harden report export on constrained Browser Rendering / Images (PDF TOC degrade + Word-export memory) ([#242](https://github.com/important-new/OpenInspection/issues/242)) ([df6f808](https://github.com/important-new/OpenInspection/commit/df6f8082cc79c4239a682287543cda045fa360db)) +* **publish-modal:** bump label contrast so the form does not read disabled (BUG [#24](https://github.com/important-new/OpenInspection/issues/24)) ([2e083c4](https://github.com/important-new/OpenInspection/commit/2e083c424a863d6d2b3632daa1230595dbcc34d7)) +* **report-card-stack:** actually surface non-rich item values on /report/:id ([#64](https://github.com/important-new/OpenInspection/issues/64)) ([a65f22e](https://github.com/important-new/OpenInspection/commit/a65f22e1d87933a8098d31e7cc0aea6baacca6ca)) +* **report-utils:** completionPercent counts non-rich item values ([#68](https://github.com/important-new/OpenInspection/issues/68)) ([86c0175](https://github.com/important-new/OpenInspection/commit/86c017513b42c3e8497e0dde585c825e673cf5f7)) +* **report-viewer:** 8-tier rating labels + JSX parse for x-on:click.stop ([b82bf59](https://github.com/important-new/OpenInspection/commit/b82bf59ed9f914da85cf54179be128b2a98b4267)) +* **report-viewer:** also use templateSnapshot in the published view ([ee88f64](https://github.com/important-new/OpenInspection/commit/ee88f6449b64a7d2ac3aa8be832d4fc2f2199597)) +* **report-viewer:** drop jarring REDACTED fallback + surface inspector name ([c2352cc](https://github.com/important-new/OpenInspection/commit/c2352ccac5306f509276a7110ea4879840dcd3ae)) +* **report-viewer:** isolate from global dark-mode color scheme ([5217d5a](https://github.com/important-new/OpenInspection/commit/5217d5a270f4da51a698c4a688bbeb2c0399ebcd)) +* **report-viewer:** wire data-theme variables to actual rendered surfaces ([828d413](https://github.com/important-new/OpenInspection/commit/828d41368b453be08b16f846a182300002d0e6f6)) +* **report-viewer:** wire display font + accent through the cover hero ([f030ce4](https://github.com/important-new/OpenInspection/commit/f030ce4132611bd21310d1450d0c1fdcc2612a96)) +* **report.template:** keep non-rich items that have only a captured value ([#66](https://github.com/important-new/OpenInspection/issues/66)) ([b585549](https://github.com/important-new/OpenInspection/commit/b5855494030c27d96ea30f93916ff705d4481ea0)) +* **report:** honor agent-view token on public /report/:id route (BUG [#21](https://github.com/important-new/OpenInspection/issues/21)) ([85dff9e](https://github.com/important-new/OpenInspection/commit/85dff9e76da8d02eb47bdd469a8fc318e3d9f70b)) +* resolve 6 code scanning alerts + 1 dependabot vulnerability ([#93](https://github.com/important-new/OpenInspection/issues/93)) ([d307d7e](https://github.com/important-new/OpenInspection/commit/d307d7e0b841ef34ea2fbbffa66b044b54106dc9)) +* resolve Wrangler config parsing error for Cloudflare Deploy button ([5b64ca6](https://github.com/important-new/OpenInspection/commit/5b64ca6b64c52279e2136f3a71a6fb2ae9e42d4b)) +* **routing:** role-aware redirects + agent-aware setup gate + tenant-router public allowlist ([80ae81d](https://github.com/important-new/OpenInspection/commit/80ae81d9036b01fc27d05bed0c78ad411148a70f)) +* **security:** enforce Turnstile verification and fix dashboard.js syntax error ([48f0d07](https://github.com/important-new/OpenInspection/commit/48f0d07b11979d36ef2d81952627fa7856ba56ab)) +* **security:** enforce Turnstile verification on booking endpoint ([d3d0376](https://github.com/important-new/OpenInspection/commit/d3d0376169f8c1df7f248c8d64f6d383607e8b83)) +* **security:** harden tenant isolation and add missing schema indexes ([aa0697c](https://github.com/important-new/OpenInspection/commit/aa0697c54896a8613ce59fba5c007da2e659917c)) +* **seed:** log silently-swallowed seedDefaultComments failures ([e34fd87](https://github.com/important-new/OpenInspection/commit/e34fd87e497df02f9da451cdee069bd421bd26fb)) +* **seed:** per-row INSERT loop for automations (D1 compound-SELECT cap) ([71d71f9](https://github.com/important-new/OpenInspection/commit/71d71f9de462080c349a62ededa08768520f18c2)) +* **settings:** conform-native checkboxes for report-feature flags so they save+round-trip ([#155](https://github.com/important-new/OpenInspection/issues/155)) ([8a6b9c6](https://github.com/important-new/OpenInspection/commit/8a6b9c6b35045bfe813700e2fb1c9e3e03d90cb4)) +* **settings:** make Email/SMS delivery copy + guardrails provider-aware ([#207](https://github.com/important-new/OpenInspection/issues/207)) ([0079b68](https://github.com/important-new/OpenInspection/commit/0079b68d1f82722f669591363f8b189285a4c9a4)) +* **settings:** remove boolean flags from workspace conform schema so checkbox saves persist ([#153](https://github.com/important-new/OpenInspection/issues/153)) ([097a544](https://github.com/important-new/OpenInspection/commit/097a544e3828b7767fb49b97490afc674425ac3d)) +* **settings:** unwrap nested branding GET so workspace fields read back correctly ([#154](https://github.com/important-new/OpenInspection/issues/154)) ([4becea9](https://github.com/important-new/OpenInspection/commit/4becea96a3d1bbdfcc7ea4629365d0b60b60069c)) +* **settings:** use literal name attrs for repair-feature checkboxes so they persist ([#152](https://github.com/important-new/OpenInspection/issues/152)) ([be88f8d](https://github.com/important-new/OpenInspection/commit/be88f8d73d110bfe34cb6b86df4b7b290361a28d)) +* **setup+display:** require admin name + drop email-as-fallback on public surfaces ([5be91a6](https://github.com/important-new/OpenInspection/commit/5be91a647dd41b7b5b316ac90ab03d8f4401a6e2)) +* sidebar FOUC + page header consistency + merge create buttons ([#89](https://github.com/important-new/OpenInspection/issues/89)) ([614a6ae](https://github.com/important-new/OpenInspection/commit/614a6aec3fb0daa761131483490cec3d8261dd1c)) +* **sms:** brand booking opt-in with company name + add OPTOUT/REVOKE stop keywords ([#193](https://github.com/important-new/OpenInspection/issues/193)) ([78d93e1](https://github.com/important-new/OpenInspection/commit/78d93e1d02320da605cf9fa2fdb8d008fc0c27f5)) +* **sms:** toll-free verification compliance — HELP reply, opt-in legal links, message frequency ([#192](https://github.com/important-new/OpenInspection/issues/192)) ([5ced75f](https://github.com/important-new/OpenInspection/commit/5ced75f15a3d80b19d9da846a02087a502168a81)) +* **tags:** add dark mode variants to tag color pills ([#44](https://github.com/important-new/OpenInspection/issues/44)) ([26a8bbc](https://github.com/important-new/OpenInspection/commit/26a8bbc61b0c2364fd931c6b397455e4e092fbe5)) +* **template-editor:** create + edit work end-to-end; v2 schema only ([#48](https://github.com/important-new/OpenInspection/issues/48)) ([6aeb582](https://github.com/important-new/OpenInspection/commit/6aeb58294de42778751c250c7464a88a2616ae12)) +* **template-editor:** save normalizer + collision-proof IDs ([#49](https://github.com/important-new/OpenInspection/issues/49)) ([ee89a4a](https://github.com/important-new/OpenInspection/commit/ee89a4a13f324e0b5fb5ffce9f295d6421950395)) +* UI/endpoint bug batch (B-1, B-4–B-10) + nav-skeleton anti-flicker ([#102](https://github.com/important-new/OpenInspection/issues/102)) ([fe9c3d6](https://github.com/important-new/OpenInspection/commit/fe9c3d6b61f3d7ee03978926f9852f7d123b96f5)) +* **ui:** dark mode — library pages, marketplace, 404, table rows, FullCalendar ([#43](https://github.com/important-new/OpenInspection/issues/43)) ([ad42d6e](https://github.com/important-new/OpenInspection/commit/ad42d6ecc1e587b72ac86effa3fdc6ae79594644)) +* **ui:** dark mode overrides for bg-surface-50/100/200 palette ([#39](https://github.com/important-new/OpenInspection/issues/39)) ([003b49e](https://github.com/important-new/OpenInspection/commit/003b49efed029a17078e5f57156f1e1d91f0da81)) +* **ui:** dark mode overrides for ink-* text and bg palette ([#40](https://github.com/important-new/OpenInspection/issues/40)) ([594a652](https://github.com/important-new/OpenInspection/commit/594a65209dba8592f4315b8e1acce1f6488f5ef4)) + + +### Reverts + +* **husky:** restore shell-based pre-commit hook, fix wrangler dry-run hang ([b451b4c](https://github.com/important-new/OpenInspection/commit/b451b4c82c12cc4da7142974c666ec69dba49bd2)) + ## [1.0.0] - 2026-07-12 First stable release. Consolidates the work landed since `1.0.0-rc.1`; diff --git a/package-lock.json b/package-lock.json index 0e6bd65c..9cf4c559 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openinspection", - "version": "1.0.0-rc.1", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openinspection", - "version": "1.0.0-rc.1", + "version": "1.0.0", "dependencies": { "@cloudflare/workers-oauth-provider": "^0.8.1", "@conform-to/react": "^1.19.4", diff --git a/package.json b/package.json index 83b9f7c1..72527672 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openinspection", - "version": "1.0.0-rc.1", + "version": "1.0.0", "private": false, "type": "module", "repository": {