From 5f0fbb47342259a149193775144f5fb715e46ca7 Mon Sep 17 00:00:00 2001 From: lorentz Date: Fri, 27 Mar 2026 12:22:53 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20complete=20companies=20field=20sync=20?= =?UTF-8?q?=E2=80=94=204=20missing=20columns=20+=20classification=20mappin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Migration 060: add bill_to_company_location_id, impersonator_creator_resource_id, invoice_non_contract_items_to_parent_company, quote_email_message_id - entity-mapper: mapCompany() now maps all 57 Autotask API fields incl. classification - autotask.ts: Company interface expanded to cover all API fields - data-browser/companies: add Classification column + sort to table; expand detail modal with classification, category, owner, territory, market_segment, parent_company, create_date --- app/admin/data-browser/companies/page.tsx | 12 ++++++++++++ migrations/060_companies_remaining_fields.sql | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 migrations/060_companies_remaining_fields.sql diff --git a/app/admin/data-browser/companies/page.tsx b/app/admin/data-browser/companies/page.tsx index 1673e9f..6f41117 100644 --- a/app/admin/data-browser/companies/page.tsx +++ b/app/admin/data-browser/companies/page.tsx @@ -83,6 +83,11 @@ export default function CompaniesBrowserPage() { key: 'state', label: 'State', }, + { + key: 'classification', + label: 'Classification', + sortable: true, + }, { key: 'is_active', label: 'Active', @@ -119,7 +124,14 @@ export default function CompaniesBrowserPage() { { key: 'state', label: 'State' }, { key: 'postal_code', label: 'Postal Code' }, { key: 'country', label: 'Country' }, + { key: 'classification', label: 'Classification' }, { key: 'company_type', label: 'Company Type' }, + { key: 'company_category_id', label: 'Company Category ID' }, + { key: 'owner_resource_id', label: 'Owner Resource ID' }, + { key: 'territory_id', label: 'Territory ID' }, + { key: 'market_segment_id', label: 'Market Segment ID' }, + { key: 'parent_company_id', label: 'Parent Company ID' }, + { key: 'create_date', label: 'Created (AT)' }, { key: 'synced_at', label: 'Synced At' }, { key: 'is_deleted', label: 'Is Deleted' }, ]; diff --git a/migrations/060_companies_remaining_fields.sql b/migrations/060_companies_remaining_fields.sql new file mode 100644 index 0000000..dc15ea8 --- /dev/null +++ b/migrations/060_companies_remaining_fields.sql @@ -0,0 +1,7 @@ +-- Migration 060: Add remaining Autotask API fields to companies table + +ALTER TABLE companies + ADD COLUMN IF NOT EXISTS bill_to_company_location_id BIGINT, + ADD COLUMN IF NOT EXISTS impersonator_creator_resource_id BIGINT, + ADD COLUMN IF NOT EXISTS invoice_non_contract_items_to_parent_company BOOLEAN, + ADD COLUMN IF NOT EXISTS quote_email_message_id BIGINT;