CREATE TABLE `transactions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `location_id` int(10) unsigned DEFAULT NULL,
  `is_kitchen_order` tinyint(1) NOT NULL DEFAULT 0,
  `res_table_id` int(10) unsigned DEFAULT NULL COMMENT 'fields to restaurant module',
  `res_waiter_id` int(10) unsigned DEFAULT NULL COMMENT 'fields to restaurant module',
  `res_order_status` enum('received','cooked','served') DEFAULT NULL,
  `type` varchar(191) DEFAULT NULL,
  `sub_type` varchar(20) DEFAULT NULL,
  `status` varchar(191) NOT NULL,
  `sub_status` varchar(191) DEFAULT NULL,
  `is_quotation` tinyint(1) NOT NULL DEFAULT 0,
  `payment_status` enum('paid','due','partial') DEFAULT NULL,
  `adjustment_type` enum('normal','abnormal') DEFAULT NULL,
  `contact_id` int(11) unsigned DEFAULT NULL,
  `customer_group_id` int(11) DEFAULT NULL COMMENT 'used to add customer group while selling',
  `invoice_no` varchar(191) DEFAULT NULL,
  `ref_no` varchar(191) DEFAULT NULL,
  `source` varchar(191) DEFAULT NULL,
  `subscription_no` varchar(191) DEFAULT NULL,
  `subscription_repeat_on` varchar(191) DEFAULT NULL,
  `transaction_date` datetime NOT NULL,
  `total_before_tax` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Total before the purchase/invoice tax, this includeds the indivisual product tax',
  `tax_id` int(10) unsigned DEFAULT NULL,
  `tax_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `discount_type` enum('fixed','percentage') DEFAULT NULL,
  `discount_amount` decimal(22,4) DEFAULT 0.0000,
  `rp_redeemed` int(11) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `rp_redeemed_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'rp is the short form of reward points',
  `shipping_details` varchar(191) DEFAULT NULL,
  `shipping_address` text DEFAULT NULL,
  `delivery_date` datetime DEFAULT NULL,
  `shipping_status` varchar(191) DEFAULT NULL,
  `delivered_to` varchar(191) DEFAULT NULL,
  `delivery_person` bigint(20) DEFAULT NULL,
  `shipping_charges` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `shipping_custom_field_1` varchar(191) DEFAULT NULL,
  `shipping_custom_field_2` varchar(191) DEFAULT NULL,
  `shipping_custom_field_3` varchar(191) DEFAULT NULL,
  `shipping_custom_field_4` varchar(191) DEFAULT NULL,
  `shipping_custom_field_5` varchar(191) DEFAULT NULL,
  `additional_notes` text DEFAULT NULL,
  `staff_note` text DEFAULT NULL,
  `is_export` tinyint(1) NOT NULL DEFAULT 0,
  `export_custom_fields_info` longtext DEFAULT NULL,
  `round_off_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Difference of rounded total and actual total',
  `additional_expense_key_1` varchar(191) DEFAULT NULL,
  `additional_expense_value_1` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `additional_expense_key_2` varchar(191) DEFAULT NULL,
  `additional_expense_value_2` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `additional_expense_key_3` varchar(191) DEFAULT NULL,
  `additional_expense_value_3` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `additional_expense_key_4` varchar(191) DEFAULT NULL,
  `additional_expense_value_4` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `final_total` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `expense_category_id` int(10) unsigned DEFAULT NULL,
  `expense_sub_category_id` int(11) DEFAULT NULL,
  `expense_for` int(10) unsigned DEFAULT NULL,
  `commission_agent` int(11) DEFAULT NULL,
  `document` varchar(191) DEFAULT NULL,
  `is_direct_sale` tinyint(1) NOT NULL DEFAULT 0,
  `is_suspend` tinyint(1) NOT NULL DEFAULT 0,
  `exchange_rate` decimal(20,3) NOT NULL DEFAULT 1.000,
  `total_amount_recovered` decimal(22,4) DEFAULT NULL COMMENT 'Used for stock adjustment.',
  `transfer_parent_id` int(11) DEFAULT NULL,
  `return_parent_id` int(11) DEFAULT NULL,
  `opening_stock_product_id` int(11) DEFAULT NULL,
  `created_by` int(10) unsigned NOT NULL,
  `purchase_requisition_ids` text DEFAULT NULL,
  `essentials_duration` decimal(8,2) NOT NULL,
  `essentials_duration_unit` varchar(20) DEFAULT NULL,
  `essentials_amount_per_unit_duration` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `essentials_allowances` text DEFAULT NULL,
  `essentials_deductions` text DEFAULT NULL,
  `crm_is_order_request` tinyint(1) NOT NULL DEFAULT 0,
  `prefer_payment_method` varchar(191) DEFAULT NULL,
  `prefer_payment_account` int(11) DEFAULT NULL,
  `sales_order_ids` text DEFAULT NULL,
  `purchase_order_ids` text DEFAULT NULL,
  `custom_field_1` varchar(191) DEFAULT NULL,
  `custom_field_2` varchar(191) DEFAULT NULL,
  `custom_field_3` varchar(191) DEFAULT NULL,
  `custom_field_4` varchar(191) DEFAULT NULL,
  `import_batch` int(11) DEFAULT NULL,
  `import_time` datetime DEFAULT NULL,
  `types_of_service_id` int(11) DEFAULT NULL,
  `packing_charge` decimal(22,4) DEFAULT NULL,
  `packing_charge_type` enum('fixed','percent') DEFAULT NULL,
  `service_custom_field_1` text DEFAULT NULL,
  `service_custom_field_2` text DEFAULT NULL,
  `service_custom_field_3` text DEFAULT NULL,
  `service_custom_field_4` text DEFAULT NULL,
  `service_custom_field_5` text DEFAULT NULL,
  `service_custom_field_6` text DEFAULT NULL,
  `is_created_from_api` tinyint(1) NOT NULL DEFAULT 0,
  `rp_earned` int(11) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `order_addresses` text DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 0,
  `recur_interval` double(22,4) DEFAULT NULL,
  `recur_interval_type` enum('days','months','years') DEFAULT NULL,
  `recur_repetitions` int(11) DEFAULT NULL,
  `recur_stopped_on` datetime DEFAULT NULL,
  `recur_parent_id` int(11) DEFAULT NULL,
  `invoice_token` varchar(191) DEFAULT NULL,
  `pay_term_number` int(11) DEFAULT NULL,
  `pay_term_type` enum('days','months') DEFAULT NULL,
  `selling_price_group_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transactions_tax_id_foreign` (`tax_id`),
  KEY `transactions_business_id_index` (`business_id`),
  KEY `transactions_type_index` (`type`),
  KEY `transactions_contact_id_index` (`contact_id`),
  KEY `transactions_transaction_date_index` (`transaction_date`),
  KEY `transactions_created_by_index` (`created_by`),
  KEY `transactions_location_id_index` (`location_id`),
  KEY `transactions_expense_for_foreign` (`expense_for`),
  KEY `transactions_expense_category_id_index` (`expense_category_id`),
  KEY `transactions_sub_type_index` (`sub_type`),
  KEY `transactions_return_parent_id_index` (`return_parent_id`),
  KEY `type` (`type`),
  KEY `transactions_status_index` (`status`),
  KEY `transactions_sub_status_index` (`sub_status`),
  KEY `transactions_res_table_id_index` (`res_table_id`),
  KEY `transactions_res_waiter_id_index` (`res_waiter_id`),
  KEY `transactions_res_order_status_index` (`res_order_status`),
  KEY `transactions_payment_status_index` (`payment_status`),
  KEY `transactions_discount_type_index` (`discount_type`),
  KEY `transactions_commission_agent_index` (`commission_agent`),
  KEY `transactions_transfer_parent_id_index` (`transfer_parent_id`),
  KEY `transactions_types_of_service_id_index` (`types_of_service_id`),
  KEY `transactions_packing_charge_type_index` (`packing_charge_type`),
  KEY `transactions_recur_parent_id_index` (`recur_parent_id`),
  KEY `transactions_selling_price_group_id_index` (`selling_price_group_id`),
  KEY `transactions_delivery_date_index` (`delivery_date`),
  KEY `transactions_delivery_person_index` (`delivery_person`),
  CONSTRAINT `transactions_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transactions_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transactions_expense_category_id_foreign` FOREIGN KEY (`expense_category_id`) REFERENCES `expense_categories` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transactions_expense_for_foreign` FOREIGN KEY (`expense_for`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transactions_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`),
  CONSTRAINT `transactions_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `tax_rates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=295362 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `transactions` VALUES (295355,10,31,0,NULL,NULL,NULL,'sell',NULL,'final',NULL,0,'paid',NULL,6092,NULL,'VET-INV-0001',NULL,NULL,NULL,NULL,'2026-06-15 00:11:55',550.0000,NULL,0.0000,NULL,0.0000,0,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,550.0000,NULL,NULL,NULL,NULL,NULL,0,0,1.000,NULL,NULL,NULL,NULL,195,NULL,0.00,NULL,0.0000,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-14 21:11:55','2026-06-14 21:11:55'),(295356,10,31,0,NULL,NULL,NULL,'sell',NULL,'final',NULL,0,'paid',NULL,6093,NULL,'VET-INV-0002',NULL,NULL,NULL,NULL,'2026-06-12 00:11:55',300.0000,NULL,0.0000,NULL,0.0000,0,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,300.0000,NULL,NULL,NULL,NULL,NULL,0,0,1.000,NULL,NULL,NULL,NULL,195,NULL,0.00,NULL,0.0000,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-11 21:11:55','2026-06-11 21:11:55'),(295357,10,31,0,NULL,NULL,NULL,'sell',NULL,'final',NULL,0,'paid',NULL,6094,NULL,'VET-INV-0003',NULL,NULL,NULL,NULL,'2026-06-09 00:11:55',3100.0000,NULL,0.0000,NULL,0.0000,0,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,3100.0000,NULL,NULL,NULL,NULL,NULL,0,0,1.000,NULL,NULL,NULL,NULL,195,NULL,0.00,NULL,0.0000,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-08 21:11:55','2026-06-08 21:11:55'),(295358,10,31,0,NULL,NULL,NULL,'sell',NULL,'final',NULL,0,'partial',NULL,6095,NULL,'VET-INV-0004',NULL,NULL,NULL,NULL,'2026-06-06 00:11:55',3100.0000,NULL,0.0000,NULL,0.0000,0,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,3100.0000,NULL,NULL,NULL,NULL,NULL,0,0,1.000,NULL,NULL,NULL,NULL,195,NULL,0.00,NULL,0.0000,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-05 21:11:55','2026-06-05 21:11:55'),(295359,10,31,0,NULL,NULL,NULL,'sell',NULL,'final',NULL,0,'due',NULL,6096,NULL,'VET-INV-0005',NULL,NULL,NULL,NULL,'2026-06-03 00:11:55',450.0000,NULL,0.0000,NULL,0.0000,0,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,450.0000,NULL,NULL,NULL,NULL,NULL,0,0,1.000,NULL,NULL,NULL,NULL,195,NULL,0.00,NULL,0.0000,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-02 21:11:55','2026-06-02 21:11:55'),(295360,10,33,0,NULL,NULL,NULL,'purchase',NULL,'received',NULL,0,'paid',NULL,6089,NULL,NULL,'VET-PO-0001',NULL,NULL,NULL,'2026-05-29 00:11:55',33000.0000,NULL,0.0000,NULL,0.0000,0,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,33000.0000,NULL,NULL,NULL,NULL,NULL,0,0,1.000,NULL,NULL,NULL,NULL,195,NULL,0.00,NULL,0.0000,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-28 21:11:55','2026-05-28 21:11:55'),(295361,10,31,0,NULL,NULL,NULL,'sell',NULL,'final',NULL,0,NULL,NULL,6094,NULL,'ADM-ADM-0003',NULL,NULL,NULL,NULL,'2026-06-19 00:44:29',900.0000,NULL,0.0000,NULL,0.0000,0,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,0.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,NULL,0.0000,900.0000,NULL,NULL,NULL,NULL,NULL,0,0,1.000,NULL,NULL,NULL,NULL,195,NULL,0.00,NULL,0.0000,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'ab40378a5ab69822dfda9cf23cd7a402',NULL,NULL,NULL,'2026-06-18 21:44:29','2026-06-18 21:44:29');
CREATE TABLE `types_of_services` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `business_id` int(11) NOT NULL,
  `location_price_group` text DEFAULT NULL,
  `packing_charge` decimal(22,4) DEFAULT NULL,
  `packing_charge_type` enum('fixed','percent') DEFAULT NULL,
  `enable_custom_fields` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `types_of_services_business_id_index` (`business_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `units` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `actual_name` varchar(191) NOT NULL,
  `short_name` varchar(191) NOT NULL,
  `allow_decimal` tinyint(1) NOT NULL,
  `base_unit_id` int(11) DEFAULT NULL,
  `base_unit_multiplier` decimal(20,4) DEFAULT NULL,
  `created_by` int(10) unsigned NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `units_business_id_foreign` (`business_id`),
  KEY `units_created_by_foreign` (`created_by`),
  KEY `units_base_unit_id_index` (`base_unit_id`),
  CONSTRAINT `units_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `units_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `units` VALUES (5,5,'Pieces','Pc(s)',0,NULL,NULL,164,NULL,'2026-06-15 17:18:42','2026-06-15 17:18:42'),(6,6,'Pieces','Pc(s)',0,NULL,NULL,171,NULL,'2026-06-17 20:54:54','2026-06-17 20:54:54'),(7,7,'Pieces','Pc(s)',0,NULL,NULL,177,NULL,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(8,8,'Pieces','Pc(s)',0,NULL,NULL,183,NULL,'2026-06-17 20:58:10','2026-06-17 20:58:10'),(9,9,'Pieces','Pc(s)',0,NULL,NULL,189,NULL,'2026-06-17 21:00:01','2026-06-17 21:00:01'),(10,10,'Pieces','Pc(s)',0,NULL,NULL,195,NULL,'2026-06-17 21:11:53','2026-06-17 21:11:53');
CREATE TABLE `urology_patient_profiles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `clc_patient_id` int(10) unsigned NOT NULL,
  `psa` decimal(8,2) DEFAULT NULL,
  `ipss` int(11) DEFAULT NULL,
  `luts` varchar(40) DEFAULT NULL,
  `uroflow` varchar(120) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `urology_patient_profiles_clc_patient_id_unique` (`clc_patient_id`),
  CONSTRAINT `urology_patient_profiles_clc_patient_id_foreign` FOREIGN KEY (`clc_patient_id`) REFERENCES `clc_patients` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `user_contact_access` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_contact_access_user_id_index` (`user_id`),
  KEY `user_contact_access_contact_id_index` (`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2377 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_type` varchar(191) NOT NULL DEFAULT 'user',
  `surname` char(10) DEFAULT NULL,
  `first_name` varchar(191) NOT NULL,
  `last_name` varchar(191) DEFAULT NULL,
  `username` varchar(191) DEFAULT NULL,
  `email` varchar(191) DEFAULT NULL,
  `password` varchar(191) DEFAULT NULL,
  `language` char(7) NOT NULL DEFAULT 'en',
  `contact_no` char(15) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `business_id` int(10) unsigned DEFAULT NULL,
  `available_at` datetime DEFAULT NULL COMMENT 'Service staff avilable at. Calculated from product preparation_time_in_minutes',
  `paused_at` datetime DEFAULT NULL COMMENT 'Service staff available time paused at, Will be nulled on resume.',
  `essentials_department_id` int(11) DEFAULT NULL,
  `essentials_designation_id` int(11) DEFAULT NULL,
  `essentials_salary` decimal(22,4) DEFAULT NULL,
  `essentials_pay_period` varchar(191) DEFAULT NULL,
  `essentials_pay_cycle` varchar(191) DEFAULT NULL,
  `max_sales_discount_percent` decimal(5,2) DEFAULT NULL,
  `allow_login` tinyint(1) NOT NULL DEFAULT 1,
  `status` enum('active','inactive','terminated') NOT NULL DEFAULT 'active',
  `is_enable_service_staff_pin` tinyint(1) NOT NULL DEFAULT 0,
  `service_staff_pin` text DEFAULT NULL,
  `crm_contact_id` int(10) unsigned DEFAULT NULL,
  `is_cmmsn_agnt` tinyint(1) NOT NULL DEFAULT 0,
  `cmmsn_percent` decimal(4,2) NOT NULL DEFAULT 0.00,
  `selected_contacts` tinyint(1) NOT NULL DEFAULT 0,
  `dob` date DEFAULT NULL,
  `gender` varchar(191) DEFAULT NULL,
  `marital_status` enum('married','unmarried','divorced') DEFAULT NULL,
  `blood_group` char(10) DEFAULT NULL,
  `contact_number` char(20) DEFAULT NULL,
  `alt_number` varchar(191) DEFAULT NULL,
  `family_number` varchar(191) DEFAULT NULL,
  `fb_link` varchar(191) DEFAULT NULL,
  `twitter_link` varchar(191) DEFAULT NULL,
  `social_media_1` varchar(191) DEFAULT NULL,
  `social_media_2` varchar(191) DEFAULT NULL,
  `permanent_address` text DEFAULT NULL,
  `current_address` text DEFAULT NULL,
  `guardian_name` varchar(191) DEFAULT NULL,
  `custom_field_1` varchar(191) DEFAULT NULL,
  `custom_field_2` varchar(191) DEFAULT NULL,
  `custom_field_3` varchar(191) DEFAULT NULL,
  `custom_field_4` varchar(191) DEFAULT NULL,
  `bank_details` longtext DEFAULT NULL,
  `id_proof_name` varchar(191) DEFAULT NULL,
  `id_proof_number` varchar(191) DEFAULT NULL,
  `location_id` int(11) DEFAULT NULL COMMENT 'user primary work location',
  `crm_department` varchar(191) DEFAULT NULL COMMENT 'Contact person''s department',
  `crm_designation` varchar(191) DEFAULT NULL COMMENT 'Contact person''s designation',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_username_unique` (`username`),
  KEY `users_business_id_foreign` (`business_id`),
  KEY `users_user_type_index` (`user_type`),
  KEY `users_crm_contact_id_foreign` (`crm_contact_id`),
  KEY `users_crm_contact_id_index` (`crm_contact_id`),
  KEY `users_essentials_department_id_index` (`essentials_department_id`),
  KEY `users_essentials_designation_id_index` (`essentials_designation_id`),
  CONSTRAINT `users_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `users_crm_contact_id_foreign` FOREIGN KEY (`crm_contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=219 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `users` VALUES (195,'user','Dr','Hossam','Makram','vetone','owner@vetone.test','$2y$10$O7F4wdYvXK9JXVA9IozFUuHISEt8F0M6FMR5qc1zVJiowcStvtdHW','en',NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'active',0,NULL,NULL,0,0.00,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:53','2026-06-23 22:38:32'),(196,'user','Dr','Yasmin','Fahmy','vet.yasmin','vet1@vetone.test','$2y$10$MqJLqAr1sAj0TAxtsWVVvuBpBuf5/xfHduBsOZFU0T9Sb1J5xVW.q','en',NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'active',0,NULL,NULL,0,0.00,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(197,'user','Dr','Omar','Sherif','vet.omar','vet2@vetone.test','$2y$10$F3WoE4aO/.OdeTUtfFki8uzAe14ebSbONk3pjTHaSMDPPm4Fum08C','en',NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'active',0,NULL,NULL,0,0.00,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(198,'user','Ms','Salma','Adel','reception.vetone','reception@vetone.test','$2y$10$EZ7KiXUIVHPbkf1LlFn5BunHUbEbHYHwvvCEDxMULGiUMIk/jHucy','en',NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'active',0,NULL,NULL,0,0.00,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(199,'user','Mr','Hany','Naguib','pharmacist.vetone','pharmacy@vetone.test','$2y$10$teoAP89KvIp8DXRwmPIEZOr53erdKBHetpvuaP01rOr8ibjZxDnhK','en',NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'active',0,NULL,NULL,0,0.00,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(200,'user','Mr','Tarek','Fouad','accountant.vetone','accountant@vetone.test','$2y$10$Gfsw/iAP8sF14LORK67aLuMclUV5KvbOI3aAqEhEG4g0p/E0566Ci','en',NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'active',0,NULL,NULL,0,0.00,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(201,'user','Demo','Admin',NULL,'demo_vet_admin','demo_vet_admin@demo.local','$2y$10$GtuwdcowxTeMP7a/Ws9Ip.MKjbCDE2IaT0daNWZJ8iAjaDlj3HhN2','en',NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'active',0,NULL,NULL,0,0.00,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-06-24 21:46:15','2026-06-24 21:46:15');
CREATE TABLE `va_admission_care_plan` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admission_id` int(10) unsigned NOT NULL,
  `care_task_type_id` int(10) unsigned NOT NULL,
  `times_per_day` tinyint(3) unsigned NOT NULL DEFAULT 1,
  `schedule_times` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`schedule_times`)),
  `instructions` varchar(500) DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_admission_care_plan_admission_id_index` (`admission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_admission_care_plan` VALUES (8,19,1,3,'[\"08:00\",\"14:00\",\"20:00\"]','Offer food; record intake.',1,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(9,19,2,4,'[\"06:00\",\"12:00\",\"18:00\",\"23:00\"]','Refresh water; check hydration.',1,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(10,21,1,3,'[\"08:00\",\"14:00\",\"20:00\"]','Offer food; record intake.',1,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(11,21,2,4,'[\"06:00\",\"12:00\",\"18:00\",\"23:00\"]','Refresh water; check hydration.',1,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `va_admission_fluids` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admission_id` int(10) unsigned NOT NULL,
  `fluid_type` varchar(80) NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `rate_ml_per_hr` decimal(8,2) NOT NULL,
  `rate_ml_per_kg_per_hr` decimal(6,2) DEFAULT NULL,
  `bag_size_ml` decimal(8,2) NOT NULL,
  `started_at` datetime NOT NULL,
  `estimated_end_at` datetime DEFAULT NULL,
  `ended_at` datetime DEFAULT NULL,
  `total_volume_given_ml` decimal(10,2) NOT NULL DEFAULT 0.00,
  `notes` varchar(500) DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_admission_fluids_admission_id_active_index` (`admission_id`,`active`),
  KEY `va_admission_fluids_admission_id_index` (`admission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_admission_fluids` VALUES (2,19,'Lactated Ringer\'s',NULL,60.00,NULL,1000.00,'2026-06-17 20:11:55','2026-06-18 12:51:55',NULL,0.00,NULL,1,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(3,21,'Lactated Ringer\'s',NULL,60.00,NULL,1000.00,'2026-06-17 20:11:55','2026-06-18 12:51:55',NULL,0.00,NULL,1,195,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `va_admission_medications` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admission_id` int(10) unsigned NOT NULL,
  `medicine_id` int(10) unsigned DEFAULT NULL,
  `medicine_name` varchar(150) NOT NULL,
  `route` enum('PO','IV','SC','IM','topical','inhalation','PR','other') NOT NULL DEFAULT 'PO',
  `dose_mg_per_kg` decimal(10,4) DEFAULT NULL,
  `dose_total_mg` decimal(10,4) DEFAULT NULL,
  `concentration_mg_per_ml` decimal(10,4) DEFAULT NULL,
  `volume_per_dose_ml` decimal(10,4) DEFAULT NULL,
  `weight_kg_used` decimal(8,2) DEFAULT NULL,
  `frequency_hours` tinyint(3) unsigned NOT NULL DEFAULT 8,
  `duration_hours` smallint(5) unsigned DEFAULT NULL,
  `start_at` datetime NOT NULL,
  `end_at` datetime DEFAULT NULL,
  `notes` varchar(500) DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_admission_medications_admission_id_active_index` (`admission_id`,`active`),
  KEY `va_admission_medications_admission_id_index` (`admission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_admission_medications` VALUES (4,19,479,'Amoxicillin','PO',NULL,250.0000,NULL,NULL,NULL,8,NULL,'2026-06-16 00:11:55','2026-06-21 00:11:55',NULL,1,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(5,19,557,'Buprenorphine','IV',NULL,NULL,NULL,0.3000,NULL,8,NULL,'2026-06-16 00:11:55','2026-06-21 00:11:55',NULL,1,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(6,21,479,'Amoxicillin','PO',NULL,250.0000,NULL,NULL,NULL,8,NULL,'2026-06-17 00:11:55','2026-06-22 00:11:55',NULL,1,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(7,21,557,'Buprenorphine','IV',NULL,NULL,NULL,0.3000,NULL,8,NULL,'2026-06-17 00:11:55','2026-06-22 00:11:55',NULL,1,195,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `va_admission_reasons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_admission_reasons_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_admission_reasons` VALUES (1,NULL,'Hospitalization for Observation','active',1,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(2,NULL,'Post-Surgical Recovery','active',2,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(3,NULL,'IV Fluid Therapy','active',3,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(4,NULL,'Severe Dehydration','active',4,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(5,NULL,'Gastrointestinal Upset','active',5,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(6,NULL,'Critical / Emergency Care','active',6,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(7,NULL,'Isolation (Infectious)','active',7,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(8,NULL,'Boarding','active',8,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(9,NULL,'Wound Management','active',9,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(10,NULL,'Seizure Monitoring','active',10,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(11,NULL,'Pain Management','active',11,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(12,NULL,'Nutritional Support','active',12,'2026-06-18 22:57:08','2026-06-18 22:57:08');
CREATE TABLE `va_admission_vitals` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admission_id` int(10) unsigned NOT NULL,
  `recorded_at` datetime NOT NULL,
  `temperature` decimal(5,2) DEFAULT NULL,
  `weight_kg` decimal(8,2) DEFAULT NULL,
  `heart_rate` smallint(5) unsigned DEFAULT NULL,
  `respiratory_rate` smallint(5) unsigned DEFAULT NULL,
  `notes` varchar(500) DEFAULT NULL,
  `recorded_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_admission_vitals_admission_id_recorded_at_index` (`admission_id`,`recorded_at`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_admission_vitals` VALUES (4,21,'2026-06-19 00:41:58',999.99,999999.99,65535,65535,'423423',195,'2026-06-18 21:41:58','2026-06-18 21:41:58');
CREATE TABLE `va_admissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `admission_no` varchar(30) NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `ward_id` int(10) unsigned DEFAULT NULL,
  `type` enum('hospitalization','boarding','surgery_recovery','observation','isolation') NOT NULL DEFAULT 'hospitalization',
  `reason` varchar(255) DEFAULT NULL,
  `diagnosis` text DEFAULT NULL,
  `admitting_doctor_id` int(10) unsigned DEFAULT NULL,
  `attending_doctor_id` int(10) unsigned DEFAULT NULL,
  `admitted_at` datetime NOT NULL,
  `expected_discharge_at` datetime DEFAULT NULL,
  `discharged_at` datetime DEFAULT NULL,
  `status` enum('admitted','discharged','transferred','deceased') NOT NULL DEFAULT 'admitted',
  `deposit_amount` decimal(22,4) DEFAULT NULL,
  `deposit_status` enum('pending','paid','waived') NOT NULL DEFAULT 'pending',
  `daily_rate` decimal(22,4) DEFAULT NULL,
  `daily_rate_product_id` int(10) unsigned DEFAULT NULL,
  `last_daily_post_date` date DEFAULT NULL,
  `discharge_summary` text DEFAULT NULL,
  `erp_sell_id` int(10) unsigned DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `va_admissions_admission_no_unique` (`admission_no`),
  KEY `va_admissions_business_id_status_index` (`business_id`,`status`),
  KEY `va_admissions_business_id_pet_id_index` (`business_id`,`pet_id`),
  KEY `va_admissions_ward_id_index` (`ward_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_admissions` VALUES (19,10,'ADM-0001',70,6092,NULL,18,'surgery_recovery','Surgery recovery','Post-operative recovery (spay)',19,19,'2026-06-16 00:11:55','2026-06-19 00:11:55',NULL,'admitted',1000.0000,'pending',300.0000,15915,NULL,NULL,NULL,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(20,10,'ADM-0002',71,6093,NULL,20,'boarding','Boarding','Under observation',19,20,'2026-06-08 00:11:55','2026-06-11 00:11:55','2026-06-13 00:11:55','discharged',1000.0000,'pending',300.0000,15915,NULL,'Recovered well; discharged with home-care instructions.',NULL,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(21,10,'ADM-0003',72,6094,NULL,19,'observation','Observation','Under observation',19,21,'2026-06-17 00:11:55','2026-06-20 00:11:55','2026-06-19 00:44:29','discharged',1000.0000,'pending',300.0000,15915,'2026-06-19',NULL,295361,195,'2026-06-17 21:11:55','2026-06-18 21:44:29');
CREATE TABLE `va_alerts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `admission_id` int(10) unsigned NOT NULL,
  `severity` enum('info','warn','critical') NOT NULL DEFAULT 'warn',
  `source` varchar(30) NOT NULL,
  `source_ref` varchar(60) DEFAULT NULL,
  `message` varchar(255) NOT NULL,
  `raised_at` datetime NOT NULL,
  `acknowledged_at` datetime DEFAULT NULL,
  `acknowledged_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `va_alerts_dedup` (`admission_id`,`source`,`source_ref`),
  KEY `va_alerts_admission_id_acknowledged_at_index` (`admission_id`,`acknowledged_at`),
  KEY `va_alerts_business_id_index` (`business_id`),
  KEY `va_alerts_admission_id_index` (`admission_id`),
  KEY `va_alerts_severity_index` (`severity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `va_care_logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admission_id` int(10) unsigned NOT NULL,
  `care_plan_id` int(10) unsigned DEFAULT NULL,
  `care_task_type_id` int(10) unsigned NOT NULL,
  `care_date` date NOT NULL,
  `slot_index` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `status` enum('done','skipped') NOT NULL DEFAULT 'done',
  `done_at` datetime DEFAULT NULL,
  `done_by` int(10) unsigned DEFAULT NULL,
  `notes` varchar(500) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `billed_sell_line_id` bigint(20) unsigned DEFAULT NULL,
  `billed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_care_logs_admission_id_care_date_index` (`admission_id`,`care_date`),
  KEY `va_care_logs_care_plan_id_care_date_slot_index_index` (`care_plan_id`,`care_date`,`slot_index`),
  KEY `va_care_logs_billed_sell_line_id_index` (`billed_sell_line_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_care_logs` VALUES (16,21,10,1,'2026-06-19',0,'done','2026-06-19 00:41:38',195,NULL,'2026-06-18 21:41:38','2026-06-18 21:41:38',NULL,NULL),(17,21,10,1,'2026-06-19',1,'done','2026-06-19 00:41:40',195,NULL,'2026-06-18 21:41:40','2026-06-18 21:41:40',NULL,NULL),(18,21,11,2,'2026-06-19',0,'done','2026-06-19 00:41:42',195,NULL,'2026-06-18 21:41:43','2026-06-18 21:41:43',NULL,NULL);
CREATE TABLE `va_care_task_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `category` enum('feeding','hydration','exercise','medication','hygiene','vitals','observation','other') NOT NULL DEFAULT 'other',
  `icon` varchar(40) NOT NULL DEFAULT 'fa-clipboard-check',
  `color` varchar(20) NOT NULL DEFAULT '#3b82f6',
  `product_id` int(10) unsigned DEFAULT NULL,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_care_task_types_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_care_task_types` VALUES (1,NULL,'Feeding','feeding','fa-utensils','#f59e0b',NULL,1,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(2,NULL,'Water / Hydration','hydration','fa-tint','#0ea5e9',NULL,2,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(3,NULL,'Walk / Exercise','exercise','fa-walking','#22c55e',NULL,3,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(4,NULL,'Cage / Kennel Clean','hygiene','fa-broom','#8b5cf6',NULL,4,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(5,NULL,'Litter Change','hygiene','fa-trash','#a855f7',NULL,5,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(6,NULL,'Medication','medication','fa-pills','#ef4444',NULL,6,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(7,NULL,'Temperature Check','vitals','fa-thermometer-half','#f43f5e',NULL,7,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(8,NULL,'Weight Check','vitals','fa-weight','#06b6d4',NULL,8,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(9,NULL,'Wound Dressing','hygiene','fa-band-aid','#fb923c',NULL,9,'active','2026-05-21 12:29:03','2026-05-21 12:29:03'),(10,NULL,'General Observation','observation','fa-eye','#64748b',NULL,10,'active','2026-05-21 12:29:03','2026-05-21 12:29:03');
CREATE TABLE `va_diagnoses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_diagnoses_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_diagnoses` VALUES (1,NULL,'Gastroenteritis','active',1,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(2,NULL,'Parvovirus','active',2,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(3,NULL,'Renal Failure','active',3,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(4,NULL,'Pancreatitis','active',4,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(5,NULL,'Diabetic Ketoacidosis','active',5,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(6,NULL,'Pneumonia','active',6,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(7,NULL,'Heatstroke','active',7,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(8,NULL,'Fracture','active',8,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(9,NULL,'Foreign Body Obstruction','active',9,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(10,NULL,'Tick-borne Disease','active',10,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(11,NULL,'Urinary Obstruction','active',11,'2026-06-18 22:57:08','2026-06-18 22:57:08'),(12,NULL,'Toxin Ingestion','active',12,'2026-06-18 22:57:08','2026-06-18 22:57:08');
CREATE TABLE `va_discharge_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(120) NOT NULL,
  `species` varchar(40) DEFAULT NULL,
  `body` longtext DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_discharge_templates_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_discharge_templates` VALUES (1,NULL,'Standard discharge — general',NULL,'Dear {{owner.name}},\n\n{{pet.name}} was admitted to {{clinic_name}} under reference {{admission_no}} and has now been cleared for discharge.\n\nCLINICAL SUMMARY\n{{discharge_summary}}\n\nMEDICATIONS TO CONTINUE AT HOME\n{{medications_list}}\n\nHOME CARE\n• Rest in a quiet area for the next 48 hours.\n• Offer small, frequent meals and free access to clean water.\n• Monitor appetite, water intake, urination and bowel movements daily.\n• Restrict strenuous activity until cleared by the veterinarian.\n\nWHEN TO CALL US IMMEDIATELY\n• Refusal to eat or drink for more than 24 hours\n• Repeated vomiting or diarrhoea\n• Lethargy, collapse, or laboured breathing\n• Bleeding from any wound or surgical site\n• Sudden change in behaviour\n\nFOLLOW-UP\nA re-check appointment has been scheduled for {{follow_up_date}}.\nPlease call {{clinic_name}} on the number on this discharge sheet if you cannot keep it or have any concerns.\n\nThank you for trusting us with {{pet.name}}\'s care.\n\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(2,NULL,'Post-operative discharge',NULL,'Dear {{owner.name}},\n\n{{pet.name}} has recovered from anaesthesia and is being discharged following the procedure performed today at {{clinic_name}} (admission {{admission_no}}).\n\nWHAT WE DID\n{{discharge_summary}}\n\nMEDICATIONS PRESCRIBED\n{{medications_list}}\n\nWOUND / SURGICAL SITE CARE\n• Check the incision twice daily for redness, swelling, discharge or the wound opening.\n• Keep the area clean and DRY — no bathing for 10 days.\n• Use the e-collar (cone) AT ALL TIMES to prevent licking, including overnight.\n• Do not allow {{pet.name}} to scratch or chew at sutures.\n\nACTIVITY RESTRICTION (10–14 days)\n• Lead-walks only for toilet breaks — no free running, jumping, stairs, or play.\n• Crate or small-room confinement when unsupervised.\n• Use a harness rather than a collar if there are neck/throat sutures.\n\nDIET\n• Offer a small amount of bland food (boiled chicken + rice / prescription recovery diet) this evening.\n• Return to the normal diet tomorrow if there is no vomiting.\n\nCALL US URGENTLY IF YOU SEE\n• The incision opening, bleeding, or discharging pus\n• Persistent vomiting, refusal to eat, or marked lethargy after 24 hours\n• Significant pain not relieved by the prescribed analgesia\n\nSUTURE REMOVAL / RE-CHECK\n{{follow_up_date}} — please bring {{pet.name}} back for wound assessment and suture removal.\n\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(3,NULL,'GI illness recovery (vomiting / diarrhoea)',NULL,'Dear {{owner.name}},\n\n{{pet.name}} has responded well to treatment and is well enough to continue recovery at home (admission {{admission_no}}, {{clinic_name}}).\n\nWHAT WE TREATED\n{{discharge_summary}}\n\nMEDICATIONS TO GIVE\n{{medications_list}}\n\nFEEDING THE NEXT 5 DAYS\n1. TODAY — Offer 1–2 tablespoons of a bland diet (boiled white chicken + plain rice, or the prescription GI diet provided) every 2–3 hours.\n2. TOMORROW — Increase portion size if tolerated; still little and often.\n3. DAYS 3–5 — Gradually mix the normal food back in (25% → 50% → 75% → 100%).\n4. Offer water freely but in small amounts at a time to avoid triggering vomiting.\n\nWATCH OUT FOR\n• More than one vomit in 24 hours after discharge\n• Diarrhoea lasting beyond 48 hours, or containing fresh blood\n• Refusal to drink water\n• Marked lethargy, weakness, or pale gums\n\nCALL THE CLINIC IMMEDIATELY if any of the above appear.\n\nFOLLOW-UP\n{{follow_up_date}} — please bring {{pet.name}} back for a recovery check.\n\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(4,NULL,'In-patient parvovirus / severe infection (canine)','canine','Dear {{owner.name}},\n\n{{pet.name}} has been treated at {{clinic_name}} for a severe infection requiring inpatient support (admission {{admission_no}}) and is now stable enough to recover at home.\n\nWHAT WE TREATED\n{{discharge_summary}}\n\nMEDICATIONS — IMPORTANT\n{{medications_list}}\n\nISOLATION\n• Parvovirus and similar pathogens are shed for several weeks. Keep {{pet.name}} away from other dogs, especially puppies, for the next 4 weeks.\n• Clean food/water bowls and bedding daily with a 1:30 dilution of household bleach.\n• Discard or thoroughly disinfect any toys or fabric items the dog used while sick.\n• Disinfect floors and crates with the same bleach dilution; allow 10 minutes of contact time.\n\nHOME CARE\n• Continue small frequent meals of the prescription recovery diet for 7 days.\n• Offer water but watch for return of vomiting.\n• Crate rest with short, lead-only toilet trips for 5 days.\n\nCALL US IMMEDIATELY IF\n• Vomiting or diarrhoea returns\n• {{pet.name}} stops drinking water\n• Marked lethargy, collapse, or pale gums\n• Blood appears in stool or vomit\n\nFOLLOW-UP\n{{follow_up_date}} — recheck visit. Please also confirm/complete the vaccination schedule once recovery is full.\n\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(5,NULL,'URI / cat-flu recovery (feline)','feline','Dear {{owner.name}},\n\n{{pet.name}} has improved enough to continue recovery at home after treatment for upper respiratory infection at {{clinic_name}} (admission {{admission_no}}).\n\nWHAT WE TREATED\n{{discharge_summary}}\n\nMEDICATIONS\n{{medications_list}}\n\nHOME CARE\n• Keep {{pet.name}} indoors and warm; rest is the most important treatment.\n• Wipe the eyes and nose gently with a soft cloth dampened in warm water two to three times a day.\n• Offer strongly-scented food slightly warmed — cats with blocked noses won\'t eat what they can\'t smell.\n• Provide a quiet, low-traffic spot to rest, away from other cats if possible (URI is contagious to other cats).\n• Encourage water intake — wet food, water fountains, or chicken broth (no onion / garlic).\n\nCALL US IF\n• {{pet.name}} stops eating for more than 24 hours\n• Breathing becomes laboured or noisy\n• Eyes become red, swollen, or have thick discharge\n• Lethargy worsens rather than improves\n\nFOLLOW-UP\n{{follow_up_date}} — recheck and, if applicable, complete the vaccination schedule.\n\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(6,NULL,'Diabetic stabilisation discharge',NULL,'Dear {{owner.name}},\n\n{{pet.name}} has been stabilised on insulin during this admission ({{admission_no}}) and is now ready to continue daily management at home.\n\nWHAT WE DID\n{{discharge_summary}}\n\nINSULIN & MEDICATIONS\n{{medications_list}}\n\nDAILY MANAGEMENT\n• Give insulin AT THE SAME TIMES every day, immediately AFTER {{pet.name}} has eaten the meal we discussed.\n• Always store insulin in the fridge; roll the vial gently before drawing up — do NOT shake.\n• Use a fresh needle every time.\n• Feed the prescribed diet ONLY — no table scraps, no treats unless they are diabetic-safe.\n\nGLUCOSE MONITORING\n• Watch for signs of LOW blood sugar (weakness, wobbliness, drooling, seizure). If you see any: rub honey or syrup on the gums and call the clinic immediately.\n• Watch for signs of HIGH blood sugar (excess thirst, excess urination, weight loss). Call the clinic if these return.\n• Keep a simple log of meals, insulin dose, and any signs noted.\n\nCALL US RIGHT AWAY IF\n• {{pet.name}} refuses food (do NOT give insulin on an empty stomach without checking with us)\n• Any vomiting, diarrhoea, weakness, or collapse\n• Sudden change in behaviour, drinking, or urination\n\nFOLLOW-UP\n{{follow_up_date}} — glucose curve / re-check. Long-term diabetic care requires regular adjustments; please keep this appointment.\n\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(7,NULL,'Boarding stay — courtesy summary',NULL,'Dear {{owner.name}},\n\nThank you for entrusting {{pet.name}} to {{clinic_name}} during their boarding stay ({{admission_no}}).\n\nSTAY SUMMARY\n{{discharge_summary}}\n\nITEMS GOING HOME\n{{medications_list}}\n\nOBSERVATIONS DURING THE STAY\n• Appetite, water intake, urination and bowel movements were monitored daily. No abnormalities were noted unless specifically mentioned above.\n• Any medications given during the stay are listed above. Continue them at home until finished or instructed otherwise.\n\nAT HOME\n• Expect {{pet.name}} to be tired for 24–48 hours after a stay — this is normal.\n• Offer the usual diet in smaller portions tonight and return to the normal routine tomorrow.\n• Watch for any changes in appetite, behaviour or stool over the next 3 days and let us know.\n\nNEXT VISIT\n{{follow_up_date}} — your next planned appointment.\n\nWe look forward to seeing {{pet.name}} again.\n\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(8,NULL,'Deceased pet — condolence letter',NULL,'Dear {{owner.name}},\n\nIt is with great sadness that we write to confirm the passing of {{pet.name}} at {{clinic_name}} (admission {{admission_no}}).\n\nCIRCUMSTANCES\n{{discharge_summary}}\n\nARRANGEMENTS\n• If you have chosen cremation, the practice will contact you when {{pet.name}}\'s ashes are ready for collection.\n• If you have chosen home burial or another arrangement, please follow the instructions provided to you in person at the clinic.\n\nWE ARE HERE FOR YOU\nThe loss of a beloved companion is profoundly painful. Please do not hesitate to contact the clinic if you have any further questions about the care provided, or if there is anything we can do to support you at this time.\n\nWith our deepest condolences,\n{{clinic_name}}\n{{today}}','active','2026-05-29 00:03:52','2026-05-29 00:03:52');
CREATE TABLE `va_fluid_bag_changes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `fluid_id` int(10) unsigned NOT NULL,
  `changed_at` datetime NOT NULL,
  `new_bag_size_ml` decimal(8,2) NOT NULL,
  `volume_consumed_ml` decimal(10,2) DEFAULT NULL,
  `given_by` int(10) unsigned DEFAULT NULL,
  `notes` varchar(500) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `billed_sell_line_id` bigint(20) unsigned DEFAULT NULL,
  `billed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_fluid_bag_changes_fluid_id_index` (`fluid_id`),
  KEY `va_fluid_bag_changes_billed_sell_line_id_index` (`billed_sell_line_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `va_medication_administrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admission_medication_id` int(10) unsigned NOT NULL,
  `due_at` datetime NOT NULL,
  `administered_at` datetime DEFAULT NULL,
  `actual_volume_ml` decimal(10,4) DEFAULT NULL,
  `actual_dose_mg` decimal(10,4) DEFAULT NULL,
  `status` enum('pending','given','missed','refused','rescheduled') NOT NULL DEFAULT 'pending',
  `given_by` int(10) unsigned DEFAULT NULL,
  `notes` varchar(500) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `billed_sell_line_id` bigint(20) unsigned DEFAULT NULL,
  `billed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_medication_administrations_billed_sell_line_id_index` (`billed_sell_line_id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_medication_administrations` VALUES (1,4,'2026-06-16 00:11:55','2026-06-16 00:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(2,4,'2026-06-16 08:11:55','2026-06-16 08:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(3,4,'2026-06-16 16:11:55','2026-06-16 16:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(4,4,'2026-06-17 00:11:55','2026-06-17 00:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(5,4,'2026-06-17 08:11:55','2026-06-17 08:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(6,4,'2026-06-17 16:11:55','2026-06-17 16:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(7,4,'2026-06-18 00:11:55','2026-06-18 00:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(8,4,'2026-06-18 08:11:55',NULL,NULL,NULL,'pending',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(9,5,'2026-06-16 00:11:55','2026-06-16 00:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(10,5,'2026-06-16 08:11:55','2026-06-16 08:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(11,5,'2026-06-16 16:11:55','2026-06-16 16:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(12,5,'2026-06-17 00:11:55','2026-06-17 00:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(13,5,'2026-06-17 08:11:55','2026-06-17 08:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(14,5,'2026-06-17 16:11:55','2026-06-17 16:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(15,5,'2026-06-18 00:11:55','2026-06-18 00:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(16,5,'2026-06-18 08:11:55',NULL,NULL,NULL,'pending',NULL,NULL,'2026-06-17 21:11:55','2026-06-18 00:26:57',NULL,NULL),(17,6,'2026-06-17 00:11:55','2026-06-17 00:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(18,6,'2026-06-17 08:11:55','2026-06-17 08:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(19,6,'2026-06-17 16:11:55','2026-06-17 16:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(20,6,'2026-06-18 00:11:55','2026-06-18 00:16:55',NULL,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(21,6,'2026-06-18 08:11:55',NULL,NULL,NULL,'pending',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(22,7,'2026-06-17 00:11:55','2026-06-17 00:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(23,7,'2026-06-17 08:11:55','2026-06-17 08:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(24,7,'2026-06-17 16:11:55','2026-06-17 16:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(25,7,'2026-06-18 00:11:55','2026-06-18 00:16:55',0.3000,NULL,'given',196,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(26,7,'2026-06-18 08:11:55','2026-06-19 00:42:15',NULL,NULL,'refused',195,NULL,'2026-06-17 21:11:55','2026-06-18 21:42:15',NULL,NULL);
CREATE TABLE `va_protocol_applications` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admission_id` int(10) unsigned NOT NULL,
  `protocol_id` int(10) unsigned NOT NULL,
  `expanded_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`expanded_ids`)),
  `applied_by` int(10) unsigned DEFAULT NULL,
  `applied_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_protocol_applications_admission_id_index` (`admission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `va_protocol_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `protocol_id` int(10) unsigned NOT NULL,
  `kind` enum('care_task','medication','fluid') NOT NULL,
  `care_task_type_id` int(10) unsigned DEFAULT NULL,
  `medicine_id` int(10) unsigned DEFAULT NULL,
  `label` varchar(150) DEFAULT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_protocol_items_protocol_id_index` (`protocol_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_protocol_items` VALUES (1,1,'fluid',NULL,NULL,'LRS bolus + maintenance','{\"fluid_type\":\"LRS\",\"rate_ml_per_hr\":60,\"bag_size_ml\":1000}',1,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(2,1,'medication',NULL,NULL,'Maropitant','{\"medicine_name\":\"Maropitant\",\"route\":\"IV\",\"dose_mg_per_kg\":1,\"concentration_mg_per_ml\":10,\"frequency_hours\":24,\"duration_hours\":96}',2,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(3,1,'medication',NULL,NULL,'Ampicillin','{\"medicine_name\":\"Ampicillin\",\"route\":\"IV\",\"dose_mg_per_kg\":22,\"concentration_mg_per_ml\":250,\"frequency_hours\":8,\"duration_hours\":120}',3,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(4,1,'care_task',NULL,NULL,'Vitals q4h','{\"task_name\":\"Temperature Check\",\"times_per_day\":6,\"schedule_times\":[\"04:00\",\"08:00\",\"12:00\",\"16:00\",\"20:00\",\"00:00\"]}',4,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(5,2,'medication',NULL,NULL,'Doxycycline','{\"medicine_name\":\"Doxycycline\",\"route\":\"PO\",\"dose_mg_per_kg\":5,\"frequency_hours\":24,\"duration_hours\":240}',1,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(6,2,'care_task',NULL,NULL,'Nasal cleaning q8h','{\"task_name\":\"Wound Dressing\",\"times_per_day\":3}',2,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(7,2,'care_task',NULL,NULL,'Appetite check q12h','{\"task_name\":\"General Observation\",\"times_per_day\":2}',3,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(8,3,'medication',NULL,NULL,'Meloxicam','{\"medicine_name\":\"Meloxicam\",\"route\":\"PO\",\"dose_mg_per_kg\":0.1,\"frequency_hours\":24,\"duration_hours\":120}',1,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(9,3,'medication',NULL,NULL,'Cefazolin','{\"medicine_name\":\"Cefazolin\",\"route\":\"IV\",\"dose_mg_per_kg\":22,\"concentration_mg_per_ml\":100,\"frequency_hours\":8,\"duration_hours\":48}',2,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(10,3,'care_task',NULL,NULL,'Wound check q6h','{\"task_name\":\"Wound Dressing\",\"times_per_day\":4}',3,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(11,4,'fluid',NULL,NULL,'NaCl 0.9% maintenance','{\"fluid_type\":\"NaCl 0.9%\",\"rate_ml_per_hr\":50,\"bag_size_ml\":1000}',1,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(12,4,'medication',NULL,NULL,'Regular insulin CRI','{\"medicine_name\":\"Regular insulin\",\"route\":\"IV\",\"dose_mg_per_kg\":0.05,\"concentration_mg_per_ml\":100,\"frequency_hours\":1,\"duration_hours\":24}',2,'2026-05-29 00:03:52','2026-05-29 00:03:52'),(13,4,'care_task',NULL,NULL,'Glucose q2h','{\"task_name\":\"General Observation\",\"times_per_day\":12}',3,'2026-05-29 00:03:52','2026-05-29 00:03:52');
CREATE TABLE `va_protocols` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(120) NOT NULL,
  `species` varchar(40) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_protocols_business_id_index` (`business_id`),
  KEY `va_protocols_species_index` (`species`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_protocols` VALUES (1,NULL,'Canine Parvo','canine','Indication: Canine parvovirus enteritis (PCR / SNAP positive, or strongly suspicious history — unvaccinated puppy with severe vomiting / haemorrhagic diarrhoea / leukopenia).\n\nWhat this protocol does:\n• High-rate IV crystalloid (LRS) to correct dehydration and ongoing GI losses\n• Anti-emetic cover (maropitant q24h IV) for nausea + protection from oesophagitis\n• Broad-spectrum IV antibiotic (ampicillin q8h) to cover for bacterial translocation across damaged gut mucosa\n• Round-the-clock temperature monitoring (q4h) — the only one of the system protocols with full 24-hour vitals coverage\n\nMonitoring: temperature q4h, PCV/TS daily, glucose if collapsed.\nEscalate to ICU / extended care if: persistent vomiting after 24h of treatment, sustained hypoglycaemia, sepsis signs (hypothermia, hypotension), or sudden collapse.','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(2,NULL,'Feline URI','feline','Indication: Feline upper respiratory infection (calicivirus / herpesvirus / chlamydophila) presenting with sneezing, oculonasal discharge, anorexia, and mild-to-moderate dehydration in an otherwise stable cat.\n\nWhat this protocol does:\n• Doxycycline PO q24h × 10 days — primary cover for Chlamydophila felis and Mycoplasma\n• Nasal cleaning q8h — keeps the airway patent and improves appetite\n• Appetite check q12h — anorexia is the highest-risk complication of feline URI\n\nNotes: this is the lowest-intensity system protocol — there are no IV fluids and no IV medications. Use it for inpatients well enough to eat with encouragement and stay hydrated voluntarily.\nEscalate if: anorexia > 24 hours, dehydration > 5%, marked dyspnoea, or eye involvement worsens — switch to IV support + ophthalmic care.','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(3,NULL,'Post-op orthopedic',NULL,'Indication: Standard recovery for any orthopedic surgical patient (TPLO, fracture repair, joint surgery, etc.) staying overnight or longer for pain control and observation.\n\nWhat this protocol does:\n• Meloxicam PO q24h × 5 days — NSAID analgesia. Add an opioid (e.g. methadone, buprenorphine) separately for the first 24-48 h if pain is moderate-to-severe.\n• Cefazolin IV q8h × 48 h — perioperative antibiotic prophylaxis only. NOT a treatment of established infection.\n• Wound check q6h — early detection of incision dehiscence, swelling, or discharge\n\nActivity: strict crate rest. No discharge before the orthopedic surgeon clears the post-op films/exam.\nEscalate if: incision opens / bleeds / discharges, lameness sharply worse instead of improving, refusal to eat past 24 h, or vomiting on NSAIDs.','active','2026-05-29 00:03:52','2026-05-29 00:03:52'),(4,NULL,'Diabetic ketoacidosis (DKA)',NULL,'Indication: Diabetic ketoacidosis — hyperglycaemia + ketonuria/ketonaemia + metabolic acidosis. Typically presents with profound depression, dehydration, vomiting, and Kussmaul respiration.\n\nWhat this protocol does:\n• NaCl 0.9% maintenance fluid (NOT LRS — lactate complicates DKA management). Start with rehydration bolus separately; the protocol\'s 50 mL/h is the maintenance rate.\n• Regular insulin CRI 0.05 IU/kg/hr — the most frequent medication interval in any system protocol (q1h dosing rows seeded for 24 h). Adjust the rate (not the dose) based on hourly glucose readings.\n• Glucose monitoring q2h — protocol\'s highest-frequency monitoring task\n\nWatch points:\n• Drop in glucose > 75 mg/dL/hr is too fast — risk of cerebral oedema; halve the rate.\n• Once glucose < 250 mg/dL, switch the maintenance fluid to include dextrose (NaCl + 2.5–5% dextrose) so the CRI can keep resolving the ketoacidosis without inducing hypoglycaemia.\n• Hypokalaemia is the most common life-threatening electrolyte derangement during DKA treatment — supplement KCl in the fluids per the standard sliding scale once urine is being produced.\nEscalate if: refractory acidosis, persistent hypokalaemia, neurological signs, or no improvement in 12 h.','active','2026-05-29 00:03:52','2026-05-29 00:03:52');
CREATE TABLE `va_wards` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `location_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `code` varchar(30) DEFAULT NULL,
  `type` enum('cage','kennel','run','icu','ward','isolation') NOT NULL DEFAULT 'cage',
  `capacity` smallint(5) unsigned NOT NULL DEFAULT 1,
  `notes` text DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `va_wards_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `va_wards` VALUES (18,10,31,'Inpatient Ward A','WRD-A','ward',8,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(19,10,31,'Isolation Ward','ISO-1','isolation',4,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(20,10,31,'Boarding Kennels','BRD-1','kennel',12,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vai_queries` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `query_type` varchar(30) NOT NULL DEFAULT 'general',
  `stage` varchar(30) DEFAULT NULL,
  `prompt` text NOT NULL,
  `response` longtext DEFAULT NULL,
  `model` varchar(100) DEFAULT NULL,
  `tokens_input` int(10) unsigned DEFAULT NULL,
  `tokens_output` int(10) unsigned DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'success',
  `error` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vai_queries_business_id_created_at_index` (`business_id`,`created_at`),
  KEY `vai_queries_appointment_id_index` (`appointment_id`),
  KEY `vai_queries_stage_index` (`stage`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vai_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `provider` varchar(20) NOT NULL DEFAULT 'anthropic',
  `base_url` varchar(255) DEFAULT NULL,
  `api_key` text DEFAULT NULL,
  `model` varchar(100) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `temperature` decimal(3,2) NOT NULL DEFAULT 0.30,
  `max_tokens` int(10) unsigned NOT NULL DEFAULT 1024,
  `system_prompt` text DEFAULT NULL,
  `monthly_token_budget` int(10) unsigned DEFAULT NULL,
  `use_separate_transcription` tinyint(1) NOT NULL DEFAULT 0,
  `t_provider` varchar(30) DEFAULT NULL,
  `t_base_url` varchar(255) DEFAULT NULL,
  `t_api_key` text DEFAULT NULL,
  `t_model` varchar(100) DEFAULT NULL,
  `t_language_hint` varchar(10) NOT NULL DEFAULT 'auto',
  `t_silence_limit_sec` smallint(5) unsigned NOT NULL DEFAULT 30,
  `t_clean_non_medical` tinyint(1) NOT NULL DEFAULT 1,
  `auto_structure_soap` tinyint(1) NOT NULL DEFAULT 1,
  `consent_warning` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vai_settings_business_id_unique` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vai_settings` VALUES (2,5,'anthropic',NULL,NULL,NULL,0,0.30,1024,NULL,NULL,0,NULL,NULL,NULL,NULL,'auto',30,1,1,1,'2026-06-15 20:58:09','2026-06-15 20:58:09'),(3,10,'anthropic',NULL,NULL,NULL,0,0.30,1024,NULL,NULL,0,NULL,NULL,NULL,NULL,'auto',30,1,1,1,'2026-06-18 21:04:44','2026-06-18 21:04:44');
CREATE TABLE `variation_group_prices` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `variation_id` int(10) unsigned NOT NULL,
  `price_group_id` int(10) unsigned NOT NULL,
  `price_inc_tax` decimal(22,4) NOT NULL,
  `price_type` varchar(191) NOT NULL DEFAULT 'fixed',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `variation_group_prices_variation_id_foreign` (`variation_id`),
  KEY `variation_group_prices_price_group_id_foreign` (`price_group_id`),
  CONSTRAINT `variation_group_prices_price_group_id_foreign` FOREIGN KEY (`price_group_id`) REFERENCES `selling_price_groups` (`id`) ON DELETE CASCADE,
  CONSTRAINT `variation_group_prices_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `variation_location_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `product_variation_id` int(10) unsigned NOT NULL COMMENT 'id from product_variations table',
  `variation_id` int(10) unsigned NOT NULL,
  `location_id` int(10) unsigned NOT NULL,
  `qty_available` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `variation_location_details_location_id_foreign` (`location_id`),
  KEY `variation_location_details_product_id_index` (`product_id`),
  KEY `variation_location_details_product_variation_id_index` (`product_variation_id`),
  KEY `variation_location_details_variation_id_index` (`variation_id`),
  CONSTRAINT `variation_location_details_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`),
  CONSTRAINT `variation_location_details_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=77066 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `variation_location_details` VALUES (76676,15648,15624,15632,16,200.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76677,15648,15624,15632,17,200.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76678,15648,15624,15632,18,200.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76679,15649,15625,15633,16,150.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76680,15649,15625,15633,17,150.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76681,15649,15625,15633,18,150.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76682,15650,15626,15634,16,120.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76683,15650,15626,15634,17,120.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76684,15650,15626,15634,18,120.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76685,15651,15627,15635,16,400.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76686,15651,15627,15635,17,400.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76687,15651,15627,15635,18,400.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76688,15652,15628,15636,16,250.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76689,15652,15628,15636,17,250.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76690,15652,15628,15636,18,250.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76691,15653,15629,15637,16,300.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76692,15653,15629,15637,17,300.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76693,15653,15629,15637,18,300.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76694,15654,15630,15638,16,80.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76695,15654,15630,15638,17,80.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76696,15654,15630,15638,18,80.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76697,15655,15631,15639,16,90.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76698,15655,15631,15639,17,90.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76699,15655,15631,15639,18,90.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76700,15656,15632,15640,16,120.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76701,15656,15632,15640,17,120.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76702,15656,15632,15640,18,120.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76703,15657,15633,15641,16,500.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76704,15657,15633,15641,17,500.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76705,15657,15633,15641,18,500.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43'),(76706,15670,15646,15654,19,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76707,15670,15646,15654,20,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76708,15670,15646,15654,21,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76709,15671,15647,15655,19,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76710,15671,15647,15655,20,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76711,15671,15647,15655,21,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76712,15672,15648,15656,19,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76713,15672,15648,15656,20,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76714,15672,15648,15656,21,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76715,15673,15649,15657,19,100.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76716,15673,15649,15657,20,100.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76717,15673,15649,15657,21,100.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76718,15674,15650,15658,19,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76719,15674,15650,15658,20,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76720,15674,15650,15658,21,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76721,15675,15651,15659,19,400.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76722,15675,15651,15659,20,400.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76723,15675,15651,15659,21,400.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76724,15676,15652,15660,19,250.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76725,15676,15652,15660,20,250.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76726,15676,15652,15660,21,250.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76727,15677,15653,15661,19,300.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76728,15677,15653,15661,20,300.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76729,15677,15653,15661,21,300.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76730,15678,15654,15662,19,220.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76731,15678,15654,15662,20,220.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76732,15678,15654,15662,21,220.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76733,15679,15655,15663,19,180.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76734,15679,15655,15663,20,180.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76735,15679,15655,15663,21,180.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76736,15680,15656,15664,19,160.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76737,15680,15656,15664,20,160.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76738,15680,15656,15664,21,160.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76739,15681,15657,15665,19,80.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76740,15681,15657,15665,20,80.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76741,15681,15657,15665,21,80.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76742,15682,15658,15666,19,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76743,15682,15658,15666,20,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76744,15682,15658,15666,21,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76745,15683,15659,15667,19,70.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76746,15683,15659,15667,20,70.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76747,15683,15659,15667,21,70.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76748,15684,15660,15668,19,140.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76749,15684,15660,15668,20,140.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76750,15684,15660,15668,21,140.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76751,15685,15661,15669,19,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76752,15685,15661,15669,20,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76753,15685,15661,15669,21,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76754,15686,15662,15670,19,500.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76755,15686,15662,15670,20,500.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76756,15686,15662,15670,21,500.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76757,15687,15663,15671,19,160.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76758,15687,15663,15671,20,160.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76759,15687,15663,15671,21,160.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76760,15688,15664,15672,19,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76761,15688,15664,15672,20,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76762,15688,15664,15672,21,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76763,15689,15665,15673,19,80.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76764,15689,15665,15673,20,80.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76765,15689,15665,15673,21,80.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76766,15690,15666,15674,19,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76767,15690,15666,15674,20,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76768,15690,15666,15674,21,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76769,15691,15667,15675,19,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76770,15691,15667,15675,20,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76771,15691,15667,15675,21,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76772,15692,15668,15676,19,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76773,15692,15668,15676,20,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76774,15692,15668,15676,21,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76775,15693,15669,15677,19,60.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76776,15693,15669,15677,20,60.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76777,15693,15669,15677,21,60.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55'),(76778,15723,15699,15707,22,200.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76779,15723,15699,15707,23,200.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76780,15723,15699,15707,24,200.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76781,15724,15700,15708,22,150.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76782,15724,15700,15708,23,150.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76783,15724,15700,15708,24,150.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76784,15725,15701,15709,22,120.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76785,15725,15701,15709,23,120.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76786,15725,15701,15709,24,120.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44'),(76787,15726,15702,15710,22,100.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76788,15726,15702,15710,23,100.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76789,15726,15702,15710,24,100.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76790,15727,15703,15711,22,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76791,15727,15703,15711,23,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76792,15727,15703,15711,24,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76793,15728,15704,15712,22,400.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76794,15728,15704,15712,23,400.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76795,15728,15704,15712,24,400.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76796,15729,15705,15713,22,250.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76797,15729,15705,15713,23,250.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76798,15729,15705,15713,24,250.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76799,15730,15706,15714,22,300.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76800,15730,15706,15714,23,300.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76801,15730,15706,15714,24,300.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76802,15731,15707,15715,22,220.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76803,15731,15707,15715,23,220.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76804,15731,15707,15715,24,220.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76805,15732,15708,15716,22,180.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76806,15732,15708,15716,23,180.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76807,15732,15708,15716,24,180.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76808,15733,15709,15717,22,160.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76809,15733,15709,15717,23,160.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76810,15733,15709,15717,24,160.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76811,15734,15710,15718,22,80.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76812,15734,15710,15718,23,80.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76813,15734,15710,15718,24,80.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76814,15735,15711,15719,22,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76815,15735,15711,15719,23,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76816,15735,15711,15719,24,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76817,15736,15712,15720,22,70.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76818,15736,15712,15720,23,70.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76819,15736,15712,15720,24,70.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76820,15737,15713,15721,22,140.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76821,15737,15713,15721,23,140.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76822,15737,15713,15721,24,140.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76823,15738,15714,15722,22,120.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76824,15738,15714,15722,23,120.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76825,15738,15714,15722,24,120.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76826,15739,15715,15723,22,500.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76827,15739,15715,15723,23,500.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76828,15739,15715,15723,24,500.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76829,15740,15716,15724,22,160.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76830,15740,15716,15724,23,160.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76831,15740,15716,15724,24,160.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76832,15741,15717,15725,22,200.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76833,15741,15717,15725,23,200.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76834,15741,15717,15725,24,200.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76835,15742,15718,15726,22,80.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76836,15742,15718,15726,23,80.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76837,15742,15718,15726,24,80.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76838,15743,15719,15727,22,120.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76839,15743,15719,15727,23,120.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76840,15743,15719,15727,24,120.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76841,15744,15720,15728,22,150.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76842,15744,15720,15728,23,150.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76843,15744,15720,15728,24,150.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76844,15745,15721,15729,22,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76845,15745,15721,15729,23,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76846,15745,15721,15729,24,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76847,15746,15722,15730,22,60.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76848,15746,15722,15730,23,60.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76849,15746,15722,15730,24,60.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45'),(76850,15776,15752,15760,25,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76851,15776,15752,15760,26,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76852,15776,15752,15760,27,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76853,15777,15753,15761,25,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76854,15777,15753,15761,26,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76855,15777,15753,15761,27,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76856,15778,15754,15762,25,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76857,15778,15754,15762,26,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76858,15778,15754,15762,27,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76859,15779,15755,15763,25,100.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76860,15779,15755,15763,26,100.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76861,15779,15755,15763,27,100.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76862,15780,15756,15764,25,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76863,15780,15756,15764,26,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76864,15780,15756,15764,27,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76865,15781,15757,15765,25,400.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76866,15781,15757,15765,26,400.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76867,15781,15757,15765,27,400.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76868,15782,15758,15766,25,250.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76869,15782,15758,15766,26,250.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76870,15782,15758,15766,27,250.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76871,15783,15759,15767,25,300.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76872,15783,15759,15767,26,300.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76873,15783,15759,15767,27,300.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76874,15784,15760,15768,25,220.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76875,15784,15760,15768,26,220.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76876,15784,15760,15768,27,220.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76877,15785,15761,15769,25,180.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76878,15785,15761,15769,26,180.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76879,15785,15761,15769,27,180.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76880,15786,15762,15770,25,160.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76881,15786,15762,15770,26,160.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76882,15786,15762,15770,27,160.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76883,15787,15763,15771,25,80.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76884,15787,15763,15771,26,80.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76885,15787,15763,15771,27,80.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76886,15788,15764,15772,25,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76887,15788,15764,15772,26,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76888,15788,15764,15772,27,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76889,15789,15765,15773,25,70.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76890,15789,15765,15773,26,70.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76891,15789,15765,15773,27,70.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76892,15790,15766,15774,25,140.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76893,15790,15766,15774,26,140.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76894,15790,15766,15774,27,140.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76895,15791,15767,15775,25,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76896,15791,15767,15775,26,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76897,15791,15767,15775,27,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76898,15792,15768,15776,25,500.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76899,15792,15768,15776,26,500.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76900,15792,15768,15776,27,500.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76901,15793,15769,15777,25,160.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76902,15793,15769,15777,26,160.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76903,15793,15769,15777,27,160.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76904,15794,15770,15778,25,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76905,15794,15770,15778,26,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76906,15794,15770,15778,27,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76907,15795,15771,15779,25,80.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76908,15795,15771,15779,26,80.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76909,15795,15771,15779,27,80.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76910,15796,15772,15780,25,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76911,15796,15772,15780,26,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76912,15796,15772,15780,27,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76913,15797,15773,15781,25,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76914,15797,15773,15781,26,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76915,15797,15773,15781,27,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76916,15798,15774,15782,25,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76917,15798,15774,15782,26,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76918,15798,15774,15782,27,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76919,15799,15775,15783,25,60.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76920,15799,15775,15783,26,60.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76921,15799,15775,15783,27,60.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11'),(76922,15829,15805,15813,28,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76923,15829,15805,15813,29,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76924,15829,15805,15813,30,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76925,15830,15806,15814,28,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76926,15830,15806,15814,29,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76927,15830,15806,15814,30,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76928,15831,15807,15815,28,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76929,15831,15807,15815,29,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76930,15831,15807,15815,30,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76931,15832,15808,15816,28,100.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76932,15832,15808,15816,29,100.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76933,15832,15808,15816,30,100.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76934,15833,15809,15817,28,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76935,15833,15809,15817,29,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76936,15833,15809,15817,30,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76937,15834,15810,15818,28,400.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76938,15834,15810,15818,29,400.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76939,15834,15810,15818,30,400.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76940,15835,15811,15819,28,250.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76941,15835,15811,15819,29,250.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76942,15835,15811,15819,30,250.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76943,15836,15812,15820,28,300.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76944,15836,15812,15820,29,300.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76945,15836,15812,15820,30,300.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76946,15837,15813,15821,28,220.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76947,15837,15813,15821,29,220.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76948,15837,15813,15821,30,220.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76949,15838,15814,15822,28,180.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76950,15838,15814,15822,29,180.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76951,15838,15814,15822,30,180.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76952,15839,15815,15823,28,160.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76953,15839,15815,15823,29,160.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76954,15839,15815,15823,30,160.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76955,15840,15816,15824,28,80.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76956,15840,15816,15824,29,80.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76957,15840,15816,15824,30,80.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76958,15841,15817,15825,28,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76959,15841,15817,15825,29,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76960,15841,15817,15825,30,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76961,15842,15818,15826,28,70.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76962,15842,15818,15826,29,70.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76963,15842,15818,15826,30,70.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76964,15843,15819,15827,28,140.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76965,15843,15819,15827,29,140.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76966,15843,15819,15827,30,140.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76967,15844,15820,15828,28,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76968,15844,15820,15828,29,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76969,15844,15820,15828,30,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76970,15845,15821,15829,28,500.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76971,15845,15821,15829,29,500.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76972,15845,15821,15829,30,500.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76973,15846,15822,15830,28,160.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76974,15846,15822,15830,29,160.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76975,15846,15822,15830,30,160.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76976,15847,15823,15831,28,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76977,15847,15823,15831,29,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76978,15847,15823,15831,30,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76979,15848,15824,15832,28,80.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76980,15848,15824,15832,29,80.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76981,15848,15824,15832,30,80.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76982,15849,15825,15833,28,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76983,15849,15825,15833,29,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76984,15849,15825,15833,30,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76985,15850,15826,15834,28,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76986,15850,15826,15834,29,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76987,15850,15826,15834,30,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76988,15851,15827,15835,28,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76989,15851,15827,15835,29,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76990,15851,15827,15835,30,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76991,15852,15828,15836,28,60.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76992,15852,15828,15836,29,60.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76993,15852,15828,15836,30,60.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02'),(76994,15882,15858,15866,31,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(76995,15882,15858,15866,32,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(76996,15882,15858,15866,33,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(76997,15883,15859,15867,31,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(76998,15883,15859,15867,32,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(76999,15883,15859,15867,33,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77000,15884,15860,15868,31,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77001,15884,15860,15868,32,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77002,15884,15860,15868,33,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77003,15885,15861,15869,31,100.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77004,15885,15861,15869,32,100.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77005,15885,15861,15869,33,100.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77006,15886,15862,15870,31,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77007,15886,15862,15870,32,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77008,15886,15862,15870,33,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77009,15887,15863,15871,31,400.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77010,15887,15863,15871,32,400.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77011,15887,15863,15871,33,400.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77012,15888,15864,15872,31,250.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77013,15888,15864,15872,32,250.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77014,15888,15864,15872,33,250.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77015,15889,15865,15873,31,300.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77016,15889,15865,15873,32,300.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77017,15889,15865,15873,33,300.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77018,15890,15866,15874,31,220.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77019,15890,15866,15874,32,220.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77020,15890,15866,15874,33,220.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77021,15891,15867,15875,31,180.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77022,15891,15867,15875,32,180.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77023,15891,15867,15875,33,180.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77024,15892,15868,15876,31,160.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77025,15892,15868,15876,32,160.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77026,15892,15868,15876,33,160.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77027,15893,15869,15877,31,80.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77028,15893,15869,15877,32,80.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77029,15893,15869,15877,33,80.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77030,15894,15870,15878,31,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77031,15894,15870,15878,32,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77032,15894,15870,15878,33,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77033,15895,15871,15879,31,70.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77034,15895,15871,15879,32,70.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77035,15895,15871,15879,33,70.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77036,15896,15872,15880,31,140.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77037,15896,15872,15880,32,140.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77038,15896,15872,15880,33,140.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77039,15897,15873,15881,31,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77040,15897,15873,15881,32,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77041,15897,15873,15881,33,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77042,15898,15874,15882,31,500.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77043,15898,15874,15882,32,500.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77044,15898,15874,15882,33,500.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77045,15899,15875,15883,31,160.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77046,15899,15875,15883,32,160.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77047,15899,15875,15883,33,160.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77048,15900,15876,15884,31,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77049,15900,15876,15884,32,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77050,15900,15876,15884,33,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77051,15901,15877,15885,31,80.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77052,15901,15877,15885,32,80.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77053,15901,15877,15885,33,80.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77054,15902,15878,15886,31,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77055,15902,15878,15886,32,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77056,15902,15878,15886,33,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77057,15903,15879,15887,31,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77058,15903,15879,15887,32,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77059,15903,15879,15887,33,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77060,15904,15880,15888,31,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77061,15904,15880,15888,32,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77062,15904,15880,15888,33,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77063,15905,15881,15889,31,60.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77064,15905,15881,15889,32,60.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(77065,15905,15881,15889,33,60.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54');
CREATE TABLE `variation_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `business_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `variation_templates_business_id_foreign` (`business_id`),
  CONSTRAINT `variation_templates_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `variation_value_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `variation_template_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `variation_value_templates_name_index` (`name`),
  KEY `variation_value_templates_variation_template_id_index` (`variation_template_id`),
  CONSTRAINT `variation_value_templates_variation_template_id_foreign` FOREIGN KEY (`variation_template_id`) REFERENCES `variation_templates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `variations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `sub_sku` varchar(191) DEFAULT NULL,
  `product_variation_id` int(10) unsigned NOT NULL,
  `variation_value_id` int(11) DEFAULT NULL,
  `default_purchase_price` decimal(22,4) DEFAULT NULL,
  `dpp_inc_tax` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `profit_percent` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `default_sell_price` decimal(22,4) DEFAULT NULL,
  `sell_price_inc_tax` decimal(22,4) DEFAULT NULL COMMENT 'Sell price including tax',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `combo_variations` text DEFAULT NULL COMMENT 'Contains the combo variation details',
  PRIMARY KEY (`id`),
  KEY `variations_product_id_foreign` (`product_id`),
  KEY `variations_product_variation_id_foreign` (`product_variation_id`),
  KEY `variations_name_index` (`name`),
  KEY `variations_sub_sku_index` (`sub_sku`),
  KEY `variations_variation_value_id_index` (`variation_value_id`),
  CONSTRAINT `variations_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `variations_product_variation_id_foreign` FOREIGN KEY (`product_variation_id`) REFERENCES `product_variations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15919 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `variations` VALUES (15632,'DUMMY',15648,'VETF2224AC9',15624,NULL,120.0000,120.0000,0.0000,250.0000,250.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15633,'DUMMY',15649,'VET06DB9743',15625,NULL,180.0000,180.0000,0.0000,350.0000,350.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15634,'DUMMY',15650,'VET6BD0DC31',15626,NULL,200.0000,200.0000,0.0000,400.0000,400.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15635,'DUMMY',15651,'VET89EB0EDF',15627,NULL,35.0000,35.0000,0.0000,90.0000,90.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15636,'DUMMY',15652,'VETEC709068',15628,NULL,60.0000,60.0000,0.0000,140.0000,140.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15637,'DUMMY',15653,'VETB0E1F087',15629,NULL,90.0000,90.0000,0.0000,220.0000,220.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15638,'DUMMY',15654,'VET78C39866',15630,NULL,480.0000,480.0000,0.0000,850.0000,850.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15639,'DUMMY',15655,'VET14E05E43',15631,NULL,320.0000,320.0000,0.0000,600.0000,600.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15640,'DUMMY',15656,'VETFDC005FA',15632,NULL,110.0000,110.0000,0.0000,200.0000,200.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15641,'DUMMY',15657,'VET7708E6A7',15633,NULL,18.0000,18.0000,0.0000,45.0000,45.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15642,'DUMMY',15658,'VETBF742B4B',15634,NULL,25.0000,25.0000,0.0000,60.0000,60.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15643,'DUMMY',15659,'VET7BE37B12',15635,NULL,15.0000,15.0000,0.0000,40.0000,40.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15644,'DUMMY',15660,'VET89614E40',15636,NULL,20.0000,20.0000,0.0000,50.0000,50.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15645,'DUMMY',15661,'VETF1F60C15',15637,NULL,60.0000,60.0000,0.0000,180.0000,180.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[{\"variation_id\":15642,\"quantity\":2,\"unit_id\":5},{\"variation_id\":15643,\"quantity\":1,\"unit_id\":5},{\"variation_id\":15644,\"quantity\":1,\"unit_id\":5}]'),(15646,'DUMMY',15662,'VET19C59180',15638,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15647,'DUMMY',15663,'VET240A8DCD',15639,NULL,0.0000,0.0000,0.0000,150.0000,150.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15648,'DUMMY',15664,'VETCA0F54AA',15640,NULL,0.0000,0.0000,0.0000,2500.0000,2500.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15649,'DUMMY',15665,'VET1BD2D306',15641,NULL,0.0000,0.0000,0.0000,1200.0000,1200.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15650,'DUMMY',15666,'VETCBBE42A3',15642,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15651,'DUMMY',15667,'VET500ABBF2',15643,NULL,0.0000,0.0000,0.0000,600.0000,600.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15652,'DUMMY',15668,'VETF76C00E9',15644,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15653,'DUMMY',15669,'VET1B1098E1',15645,NULL,0.0000,0.0000,0.0000,700.0000,700.0000,'2026-06-15 17:18:43','2026-06-15 17:18:43',NULL,'[]'),(15654,'DUMMY',15670,'VETB44AEA4B',15646,NULL,120.0000,120.0000,0.0000,250.0000,250.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15655,'DUMMY',15671,'VET58BD3392',15647,NULL,180.0000,180.0000,0.0000,350.0000,350.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15656,'DUMMY',15672,'VET32B10823',15648,NULL,200.0000,200.0000,0.0000,400.0000,400.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15657,'DUMMY',15673,'VET33280A37',15649,NULL,160.0000,160.0000,0.0000,320.0000,320.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15658,'DUMMY',15674,'VET1575B0AA',15650,NULL,140.0000,140.0000,0.0000,280.0000,280.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15659,'DUMMY',15675,'VET597AF11E',15651,NULL,35.0000,35.0000,0.0000,90.0000,90.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15660,'DUMMY',15676,'VET2B756ABB',15652,NULL,60.0000,60.0000,0.0000,140.0000,140.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15661,'DUMMY',15677,'VET34F0DBD0',15653,NULL,90.0000,90.0000,0.0000,220.0000,220.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15662,'DUMMY',15678,'VETFD979C65',15654,NULL,40.0000,40.0000,0.0000,110.0000,110.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15663,'DUMMY',15679,'VET7C7997CF',15655,NULL,55.0000,55.0000,0.0000,130.0000,130.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15664,'DUMMY',15680,'VET67C1A687',15656,NULL,45.0000,45.0000,0.0000,120.0000,120.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15665,'DUMMY',15681,'VETF9EFC367',15657,NULL,480.0000,480.0000,0.0000,850.0000,850.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15666,'DUMMY',15682,'VETF9E6FB6C',15658,NULL,320.0000,320.0000,0.0000,600.0000,600.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15667,'DUMMY',15683,'VET54E4F183',15659,NULL,260.0000,260.0000,0.0000,480.0000,480.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15668,'DUMMY',15684,'VETE48204BE',15660,NULL,70.0000,70.0000,0.0000,150.0000,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15669,'DUMMY',15685,'VET892297C7',15661,NULL,110.0000,110.0000,0.0000,200.0000,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15670,'DUMMY',15686,'VET1AD6DEC9',15662,NULL,18.0000,18.0000,0.0000,45.0000,45.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15671,'DUMMY',15687,'VETB3B5ABA8',15663,NULL,65.0000,65.0000,0.0000,150.0000,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15672,'DUMMY',15688,'VETCB7005AF',15664,NULL,30.0000,30.0000,0.0000,80.0000,80.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15673,'DUMMY',15689,'VETE6887F3C',15665,NULL,180.0000,180.0000,0.0000,400.0000,400.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15674,'DUMMY',15690,'VETCA7F87D9',15666,NULL,60.0000,60.0000,0.0000,160.0000,160.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15675,'DUMMY',15691,'VETE2D9C6A4',15667,NULL,45.0000,45.0000,0.0000,130.0000,130.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15676,'DUMMY',15692,'VET31C4F9C0',15668,NULL,70.0000,70.0000,0.0000,190.0000,190.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15677,'DUMMY',15693,'VETBD8BF737',15669,NULL,220.0000,220.0000,0.0000,520.0000,520.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15678,'DUMMY',15694,'VETFE9D926C',15670,NULL,25.0000,25.0000,0.0000,60.0000,60.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15679,'DUMMY',15695,'VET9908960F',15671,NULL,15.0000,15.0000,0.0000,40.0000,40.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15680,'DUMMY',15696,'VET52447B29',15672,NULL,20.0000,20.0000,0.0000,50.0000,50.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15681,'DUMMY',15697,'VETB8AC9861',15673,NULL,60.0000,60.0000,0.0000,180.0000,180.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[{\"variation_id\":15678,\"quantity\":2,\"unit_id\":6},{\"variation_id\":15679,\"quantity\":1,\"unit_id\":6},{\"variation_id\":15680,\"quantity\":1,\"unit_id\":6}]'),(15682,'DUMMY',15698,'VET67A21B3D',15674,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15683,'DUMMY',15699,'VETFAAD29A6',15675,NULL,0.0000,0.0000,0.0000,150.0000,150.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15684,'DUMMY',15700,'VET2F52C34B',15676,NULL,0.0000,0.0000,0.0000,2500.0000,2500.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15685,'DUMMY',15701,'VET037200EA',15677,NULL,0.0000,0.0000,0.0000,1200.0000,1200.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15686,'DUMMY',15702,'VET3D80C8B2',15678,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15687,'DUMMY',15703,'VET480F8A25',15679,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15688,'DUMMY',15704,'VET33BDBFD6',15680,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15689,'DUMMY',15705,'VET32994225',15681,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15690,'DUMMY',15706,'VETEFD0BCB4',15682,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15691,'DUMMY',15707,'VET6E3DA368',15683,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 20:54:55','2026-06-17 20:54:55',NULL,'[]'),(15692,'DUMMY',15708,'VET8A8FF772',15684,NULL,0.0000,0.0000,0.0000,700.0000,700.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15693,'DUMMY',15709,'VETD0E3E92C',15685,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15694,'DUMMY',15710,'VET9676F827',15686,NULL,0.0000,0.0000,0.0000,1400.0000,1400.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15695,'DUMMY',15711,'VET474F62CA',15687,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15696,'DUMMY',15712,'VET5E951A8A',15688,NULL,0.0000,0.0000,0.0000,400.0000,400.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15697,'DUMMY',15713,'VET3F3F1DF5',15689,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15698,'DUMMY',15714,'VETE25E00E6',15690,NULL,0.0000,0.0000,0.0000,1800.0000,1800.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15699,'DUMMY',15715,'VET5E9C99D3',15691,NULL,0.0000,0.0000,0.0000,600.0000,600.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15700,'DUMMY',15716,'VET91FBF939',15692,NULL,0.0000,0.0000,0.0000,750.0000,750.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15701,'DUMMY',15717,'VETBB32F196',15693,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15702,'DUMMY',15718,'VET28216716',15694,NULL,0.0000,0.0000,0.0000,550.0000,550.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15703,'DUMMY',15719,'VETDD62933A',15695,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15704,'DUMMY',15720,'VETE4FD5DEB',15696,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15705,'DUMMY',15721,'VET9EB9DE14',15697,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15706,'DUMMY',15722,'VET14AB21C9',15698,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 20:54:56','2026-06-17 20:54:56',NULL,'[]'),(15707,'DUMMY',15723,'VET799FF509',15699,NULL,120.0000,120.0000,0.0000,250.0000,250.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44',NULL,'[]'),(15708,'DUMMY',15724,'VET00054F3E',15700,NULL,180.0000,180.0000,0.0000,350.0000,350.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44',NULL,'[]'),(15709,'DUMMY',15725,'VETD6CEB333',15701,NULL,200.0000,200.0000,0.0000,400.0000,400.0000,'2026-06-17 20:55:44','2026-06-17 20:55:44',NULL,'[]'),(15710,'DUMMY',15726,'VET27CFBB91',15702,NULL,160.0000,160.0000,0.0000,320.0000,320.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15711,'DUMMY',15727,'VET8B3B9AC1',15703,NULL,140.0000,140.0000,0.0000,280.0000,280.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15712,'DUMMY',15728,'VET6DF0B38E',15704,NULL,35.0000,35.0000,0.0000,90.0000,90.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15713,'DUMMY',15729,'VET90CD035A',15705,NULL,60.0000,60.0000,0.0000,140.0000,140.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15714,'DUMMY',15730,'VET151E7B3D',15706,NULL,90.0000,90.0000,0.0000,220.0000,220.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15715,'DUMMY',15731,'VET46DD43FB',15707,NULL,40.0000,40.0000,0.0000,110.0000,110.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15716,'DUMMY',15732,'VET4C9EC698',15708,NULL,55.0000,55.0000,0.0000,130.0000,130.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15717,'DUMMY',15733,'VETFE01ED8F',15709,NULL,45.0000,45.0000,0.0000,120.0000,120.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15718,'DUMMY',15734,'VETCE27A3CD',15710,NULL,480.0000,480.0000,0.0000,850.0000,850.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15719,'DUMMY',15735,'VET4ED73519',15711,NULL,320.0000,320.0000,0.0000,600.0000,600.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15720,'DUMMY',15736,'VET0425181E',15712,NULL,260.0000,260.0000,0.0000,480.0000,480.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15721,'DUMMY',15737,'VETDF327C40',15713,NULL,70.0000,70.0000,0.0000,150.0000,150.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15722,'DUMMY',15738,'VETBCE7A679',15714,NULL,110.0000,110.0000,0.0000,200.0000,200.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15723,'DUMMY',15739,'VET074C3E17',15715,NULL,18.0000,18.0000,0.0000,45.0000,45.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15724,'DUMMY',15740,'VET23B72072',15716,NULL,65.0000,65.0000,0.0000,150.0000,150.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15725,'DUMMY',15741,'VET3854ECF3',15717,NULL,30.0000,30.0000,0.0000,80.0000,80.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15726,'DUMMY',15742,'VET8C5BA104',15718,NULL,180.0000,180.0000,0.0000,400.0000,400.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15727,'DUMMY',15743,'VETC24357B9',15719,NULL,60.0000,60.0000,0.0000,160.0000,160.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15728,'DUMMY',15744,'VETD4730D83',15720,NULL,45.0000,45.0000,0.0000,130.0000,130.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15729,'DUMMY',15745,'VETE965FF86',15721,NULL,70.0000,70.0000,0.0000,190.0000,190.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15730,'DUMMY',15746,'VET3DF13EB5',15722,NULL,220.0000,220.0000,0.0000,520.0000,520.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15731,'DUMMY',15747,'VET99DCCEA5',15723,NULL,25.0000,25.0000,0.0000,60.0000,60.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15732,'DUMMY',15748,'VET2B7DD66F',15724,NULL,15.0000,15.0000,0.0000,40.0000,40.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15733,'DUMMY',15749,'VET145DD078',15725,NULL,20.0000,20.0000,0.0000,50.0000,50.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15734,'DUMMY',15750,'VET77D56577',15726,NULL,60.0000,60.0000,0.0000,180.0000,180.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[{\"variation_id\":15731,\"quantity\":2,\"unit_id\":7},{\"variation_id\":15732,\"quantity\":1,\"unit_id\":7},{\"variation_id\":15733,\"quantity\":1,\"unit_id\":7}]'),(15735,'DUMMY',15751,'VET9C744DBE',15727,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15736,'DUMMY',15752,'VETEC996918',15728,NULL,0.0000,0.0000,0.0000,150.0000,150.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15737,'DUMMY',15753,'VET3C58188D',15729,NULL,0.0000,0.0000,0.0000,2500.0000,2500.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15738,'DUMMY',15754,'VET47522B19',15730,NULL,0.0000,0.0000,0.0000,1200.0000,1200.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15739,'DUMMY',15755,'VET633E652B',15731,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15740,'DUMMY',15756,'VETA97A632C',15732,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15741,'DUMMY',15757,'VETD739355A',15733,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15742,'DUMMY',15758,'VET24B75228',15734,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15743,'DUMMY',15759,'VETC4FB9C7C',15735,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15744,'DUMMY',15760,'VET70C2C752',15736,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15745,'DUMMY',15761,'VET2BC62DF1',15737,NULL,0.0000,0.0000,0.0000,700.0000,700.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15746,'DUMMY',15762,'VETB4B0C0A3',15738,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15747,'DUMMY',15763,'VET33B1573C',15739,NULL,0.0000,0.0000,0.0000,1400.0000,1400.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15748,'DUMMY',15764,'VET9B864905',15740,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15749,'DUMMY',15765,'VET1E56ADFC',15741,NULL,0.0000,0.0000,0.0000,400.0000,400.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15750,'DUMMY',15766,'VETDCAC6187',15742,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15751,'DUMMY',15767,'VET8C6D371F',15743,NULL,0.0000,0.0000,0.0000,1800.0000,1800.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15752,'DUMMY',15768,'VET0E62B917',15744,NULL,0.0000,0.0000,0.0000,600.0000,600.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15753,'DUMMY',15769,'VET92AB873E',15745,NULL,0.0000,0.0000,0.0000,750.0000,750.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15754,'DUMMY',15770,'VET714CF357',15746,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15755,'DUMMY',15771,'VET69AAC640',15747,NULL,0.0000,0.0000,0.0000,550.0000,550.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15756,'DUMMY',15772,'VETEE73CDF7',15748,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15757,'DUMMY',15773,'VET0BB0EBA2',15749,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15758,'DUMMY',15774,'VETED4FD4C9',15750,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15759,'DUMMY',15775,'VETAF4CC5FD',15751,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 20:55:45','2026-06-17 20:55:45',NULL,'[]'),(15760,'DUMMY',15776,'VETA8E77114',15752,NULL,120.0000,120.0000,0.0000,250.0000,250.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15761,'DUMMY',15777,'VET20A9A1D6',15753,NULL,180.0000,180.0000,0.0000,350.0000,350.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15762,'DUMMY',15778,'VETDA9A6867',15754,NULL,200.0000,200.0000,0.0000,400.0000,400.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15763,'DUMMY',15779,'VET91883948',15755,NULL,160.0000,160.0000,0.0000,320.0000,320.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15764,'DUMMY',15780,'VET091C364C',15756,NULL,140.0000,140.0000,0.0000,280.0000,280.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15765,'DUMMY',15781,'VET420A0A83',15757,NULL,35.0000,35.0000,0.0000,90.0000,90.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15766,'DUMMY',15782,'VET287FA857',15758,NULL,60.0000,60.0000,0.0000,140.0000,140.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15767,'DUMMY',15783,'VET35525099',15759,NULL,90.0000,90.0000,0.0000,220.0000,220.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15768,'DUMMY',15784,'VET106B34C6',15760,NULL,40.0000,40.0000,0.0000,110.0000,110.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15769,'DUMMY',15785,'VETA0417E03',15761,NULL,55.0000,55.0000,0.0000,130.0000,130.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15770,'DUMMY',15786,'VET8C949046',15762,NULL,45.0000,45.0000,0.0000,120.0000,120.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15771,'DUMMY',15787,'VETC32E9B6A',15763,NULL,480.0000,480.0000,0.0000,850.0000,850.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15772,'DUMMY',15788,'VETC7FE0E20',15764,NULL,320.0000,320.0000,0.0000,600.0000,600.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15773,'DUMMY',15789,'VET0EF3C66A',15765,NULL,260.0000,260.0000,0.0000,480.0000,480.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15774,'DUMMY',15790,'VET6215F79E',15766,NULL,70.0000,70.0000,0.0000,150.0000,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15775,'DUMMY',15791,'VETCF674759',15767,NULL,110.0000,110.0000,0.0000,200.0000,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15776,'DUMMY',15792,'VET89BDB6B9',15768,NULL,18.0000,18.0000,0.0000,45.0000,45.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15777,'DUMMY',15793,'VET4F2B46FE',15769,NULL,65.0000,65.0000,0.0000,150.0000,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15778,'DUMMY',15794,'VET110CE71B',15770,NULL,30.0000,30.0000,0.0000,80.0000,80.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15779,'DUMMY',15795,'VET94206A12',15771,NULL,180.0000,180.0000,0.0000,400.0000,400.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15780,'DUMMY',15796,'VETE52A5D2D',15772,NULL,60.0000,60.0000,0.0000,160.0000,160.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15781,'DUMMY',15797,'VETF5CC28E2',15773,NULL,45.0000,45.0000,0.0000,130.0000,130.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15782,'DUMMY',15798,'VETCEEAD250',15774,NULL,70.0000,70.0000,0.0000,190.0000,190.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15783,'DUMMY',15799,'VET1A520D2D',15775,NULL,220.0000,220.0000,0.0000,520.0000,520.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15784,'DUMMY',15800,'VETF332C56A',15776,NULL,25.0000,25.0000,0.0000,60.0000,60.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15785,'DUMMY',15801,'VET4FE8DDAF',15777,NULL,15.0000,15.0000,0.0000,40.0000,40.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15786,'DUMMY',15802,'VET671097FA',15778,NULL,20.0000,20.0000,0.0000,50.0000,50.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15787,'DUMMY',15803,'VET65405095',15779,NULL,60.0000,60.0000,0.0000,180.0000,180.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[{\"variation_id\":15784,\"quantity\":2,\"unit_id\":8},{\"variation_id\":15785,\"quantity\":1,\"unit_id\":8},{\"variation_id\":15786,\"quantity\":1,\"unit_id\":8}]'),(15788,'DUMMY',15804,'VET0BD3DCF6',15780,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15789,'DUMMY',15805,'VETC21AB723',15781,NULL,0.0000,0.0000,0.0000,150.0000,150.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15790,'DUMMY',15806,'VET0AC9E022',15782,NULL,0.0000,0.0000,0.0000,2500.0000,2500.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15791,'DUMMY',15807,'VETB82A3503',15783,NULL,0.0000,0.0000,0.0000,1200.0000,1200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15792,'DUMMY',15808,'VET238DBF57',15784,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15793,'DUMMY',15809,'VETA60B5042',15785,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15794,'DUMMY',15810,'VET1C8008DF',15786,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15795,'DUMMY',15811,'VET0E483770',15787,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15796,'DUMMY',15812,'VET91685290',15788,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15797,'DUMMY',15813,'VETAA192DDB',15789,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15798,'DUMMY',15814,'VETB2DA2C0B',15790,NULL,0.0000,0.0000,0.0000,700.0000,700.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15799,'DUMMY',15815,'VETA9420096',15791,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15800,'DUMMY',15816,'VETC1F1792E',15792,NULL,0.0000,0.0000,0.0000,1400.0000,1400.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15801,'DUMMY',15817,'VETF839A300',15793,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15802,'DUMMY',15818,'VETADF0B16F',15794,NULL,0.0000,0.0000,0.0000,400.0000,400.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15803,'DUMMY',15819,'VET621399EA',15795,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15804,'DUMMY',15820,'VET55764787',15796,NULL,0.0000,0.0000,0.0000,1800.0000,1800.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15805,'DUMMY',15821,'VETC6A68E1C',15797,NULL,0.0000,0.0000,0.0000,600.0000,600.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15806,'DUMMY',15822,'VETBDBB2942',15798,NULL,0.0000,0.0000,0.0000,750.0000,750.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15807,'DUMMY',15823,'VET14C95EE3',15799,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15808,'DUMMY',15824,'VET0A35F4C7',15800,NULL,0.0000,0.0000,0.0000,550.0000,550.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15809,'DUMMY',15825,'VET061B23CD',15801,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15810,'DUMMY',15826,'VETA1C7E54B',15802,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15811,'DUMMY',15827,'VET351101B4',15803,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15812,'DUMMY',15828,'VETFEF3AF19',15804,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 20:58:11','2026-06-17 20:58:11',NULL,'[]'),(15813,'DUMMY',15829,'VET6EC7A828',15805,NULL,120.0000,120.0000,0.0000,250.0000,250.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15814,'DUMMY',15830,'VET781050F7',15806,NULL,180.0000,180.0000,0.0000,350.0000,350.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15815,'DUMMY',15831,'VET89FA9899',15807,NULL,200.0000,200.0000,0.0000,400.0000,400.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15816,'DUMMY',15832,'VETCB785FD7',15808,NULL,160.0000,160.0000,0.0000,320.0000,320.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15817,'DUMMY',15833,'VET5BA4002A',15809,NULL,140.0000,140.0000,0.0000,280.0000,280.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15818,'DUMMY',15834,'VET8EEB324A',15810,NULL,35.0000,35.0000,0.0000,90.0000,90.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15819,'DUMMY',15835,'VET3416D48E',15811,NULL,60.0000,60.0000,0.0000,140.0000,140.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15820,'DUMMY',15836,'VET93A30414',15812,NULL,90.0000,90.0000,0.0000,220.0000,220.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15821,'DUMMY',15837,'VETB4FA8429',15813,NULL,40.0000,40.0000,0.0000,110.0000,110.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15822,'DUMMY',15838,'VET8B91F56E',15814,NULL,55.0000,55.0000,0.0000,130.0000,130.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15823,'DUMMY',15839,'VET0DC44472',15815,NULL,45.0000,45.0000,0.0000,120.0000,120.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15824,'DUMMY',15840,'VET2CB16FD3',15816,NULL,480.0000,480.0000,0.0000,850.0000,850.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15825,'DUMMY',15841,'VET7285D017',15817,NULL,320.0000,320.0000,0.0000,600.0000,600.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15826,'DUMMY',15842,'VET06A7AFC3',15818,NULL,260.0000,260.0000,0.0000,480.0000,480.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15827,'DUMMY',15843,'VET307EF40E',15819,NULL,70.0000,70.0000,0.0000,150.0000,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15828,'DUMMY',15844,'VETAFA91AD6',15820,NULL,110.0000,110.0000,0.0000,200.0000,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15829,'DUMMY',15845,'VET10851280',15821,NULL,18.0000,18.0000,0.0000,45.0000,45.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15830,'DUMMY',15846,'VET91E76E6C',15822,NULL,65.0000,65.0000,0.0000,150.0000,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15831,'DUMMY',15847,'VETDE1DAEBE',15823,NULL,30.0000,30.0000,0.0000,80.0000,80.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15832,'DUMMY',15848,'VET7E338C54',15824,NULL,180.0000,180.0000,0.0000,400.0000,400.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15833,'DUMMY',15849,'VET86E9E427',15825,NULL,60.0000,60.0000,0.0000,160.0000,160.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15834,'DUMMY',15850,'VET9139E8C4',15826,NULL,45.0000,45.0000,0.0000,130.0000,130.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15835,'DUMMY',15851,'VETE157D6D1',15827,NULL,70.0000,70.0000,0.0000,190.0000,190.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15836,'DUMMY',15852,'VET391C64ED',15828,NULL,220.0000,220.0000,0.0000,520.0000,520.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15837,'DUMMY',15853,'VET3AB6945A',15829,NULL,25.0000,25.0000,0.0000,60.0000,60.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15838,'DUMMY',15854,'VET19EFE98D',15830,NULL,15.0000,15.0000,0.0000,40.0000,40.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15839,'DUMMY',15855,'VETE9CF3C38',15831,NULL,20.0000,20.0000,0.0000,50.0000,50.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15840,'DUMMY',15856,'VET8D160103',15832,NULL,60.0000,60.0000,0.0000,180.0000,180.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[{\"variation_id\":15837,\"quantity\":2,\"unit_id\":9},{\"variation_id\":15838,\"quantity\":1,\"unit_id\":9},{\"variation_id\":15839,\"quantity\":1,\"unit_id\":9}]'),(15841,'DUMMY',15857,'VET5523F59D',15833,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15842,'DUMMY',15858,'VETAD41CB38',15834,NULL,0.0000,0.0000,0.0000,150.0000,150.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15843,'DUMMY',15859,'VETE689F5ED',15835,NULL,0.0000,0.0000,0.0000,2500.0000,2500.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15844,'DUMMY',15860,'VETC9C06E95',15836,NULL,0.0000,0.0000,0.0000,1200.0000,1200.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15845,'DUMMY',15861,'VET56EA4A7A',15837,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15846,'DUMMY',15862,'VETF23A7EDD',15838,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15847,'DUMMY',15863,'VETD66F1FC5',15839,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15848,'DUMMY',15864,'VET301CDBD3',15840,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15849,'DUMMY',15865,'VET94628DA5',15841,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15850,'DUMMY',15866,'VETABC0712D',15842,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15851,'DUMMY',15867,'VET94CD010B',15843,NULL,0.0000,0.0000,0.0000,700.0000,700.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15852,'DUMMY',15868,'VET2D7B31E2',15844,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 21:00:02','2026-06-17 21:00:02',NULL,'[]'),(15853,'DUMMY',15869,'VET27EC203D',15845,NULL,0.0000,0.0000,0.0000,1400.0000,1400.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15854,'DUMMY',15870,'VETEC4A3FE0',15846,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15855,'DUMMY',15871,'VETCF4FBF8C',15847,NULL,0.0000,0.0000,0.0000,400.0000,400.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15856,'DUMMY',15872,'VETF8017E6A',15848,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15857,'DUMMY',15873,'VET0C714614',15849,NULL,0.0000,0.0000,0.0000,1800.0000,1800.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15858,'DUMMY',15874,'VET31453136',15850,NULL,0.0000,0.0000,0.0000,600.0000,600.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15859,'DUMMY',15875,'VET0AEE0074',15851,NULL,0.0000,0.0000,0.0000,750.0000,750.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15860,'DUMMY',15876,'VET2815C42B',15852,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15861,'DUMMY',15877,'VET553EAE38',15853,NULL,0.0000,0.0000,0.0000,550.0000,550.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15862,'DUMMY',15878,'VET9C3951F6',15854,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15863,'DUMMY',15879,'VETDFF829AD',15855,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15864,'DUMMY',15880,'VET2617F5EA',15856,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15865,'DUMMY',15881,'VET362CBE55',15857,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 21:00:03','2026-06-17 21:00:03',NULL,'[]'),(15866,'DUMMY',15882,'VETED341C56',15858,NULL,120.0000,120.0000,0.0000,250.0000,250.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15867,'DUMMY',15883,'VET36F01AD3',15859,NULL,180.0000,180.0000,0.0000,350.0000,350.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15868,'DUMMY',15884,'VETFC21A7E1',15860,NULL,200.0000,200.0000,0.0000,400.0000,400.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15869,'DUMMY',15885,'VET9B29857D',15861,NULL,160.0000,160.0000,0.0000,320.0000,320.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15870,'DUMMY',15886,'VET33526AC0',15862,NULL,140.0000,140.0000,0.0000,280.0000,280.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15871,'DUMMY',15887,'VET7C0808C3',15863,NULL,35.0000,35.0000,0.0000,90.0000,90.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15872,'DUMMY',15888,'VET52EF6CEA',15864,NULL,60.0000,60.0000,0.0000,140.0000,140.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15873,'DUMMY',15889,'VETDE76AC48',15865,NULL,90.0000,90.0000,0.0000,220.0000,220.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15874,'DUMMY',15890,'VETA779E80A',15866,NULL,40.0000,40.0000,0.0000,110.0000,110.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15875,'DUMMY',15891,'VET207E67AB',15867,NULL,55.0000,55.0000,0.0000,130.0000,130.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15876,'DUMMY',15892,'VETA234C67A',15868,NULL,45.0000,45.0000,0.0000,120.0000,120.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15877,'DUMMY',15893,'VET165AB18D',15869,NULL,480.0000,480.0000,0.0000,850.0000,850.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15878,'DUMMY',15894,'VET1C177096',15870,NULL,320.0000,320.0000,0.0000,600.0000,600.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15879,'DUMMY',15895,'VETF35AD6F1',15871,NULL,260.0000,260.0000,0.0000,480.0000,480.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15880,'DUMMY',15896,'VET9A858815',15872,NULL,70.0000,70.0000,0.0000,150.0000,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15881,'DUMMY',15897,'VET1752D138',15873,NULL,110.0000,110.0000,0.0000,200.0000,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15882,'DUMMY',15898,'VET0137FDEC',15874,NULL,18.0000,18.0000,0.0000,45.0000,45.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15883,'DUMMY',15899,'VETD2E2CA78',15875,NULL,65.0000,65.0000,0.0000,150.0000,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15884,'DUMMY',15900,'VETC21B60B3',15876,NULL,30.0000,30.0000,0.0000,80.0000,80.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15885,'DUMMY',15901,'VET308C94A7',15877,NULL,180.0000,180.0000,0.0000,400.0000,400.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15886,'DUMMY',15902,'VET694BE764',15878,NULL,60.0000,60.0000,0.0000,160.0000,160.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15887,'DUMMY',15903,'VETC7470A17',15879,NULL,45.0000,45.0000,0.0000,130.0000,130.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15888,'DUMMY',15904,'VET7EB9C1A7',15880,NULL,70.0000,70.0000,0.0000,190.0000,190.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15889,'DUMMY',15905,'VET12622885',15881,NULL,220.0000,220.0000,0.0000,520.0000,520.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15890,'DUMMY',15906,'VET41A3934C',15882,NULL,25.0000,25.0000,0.0000,60.0000,60.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15891,'DUMMY',15907,'VET87F8335E',15883,NULL,15.0000,15.0000,0.0000,40.0000,40.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15892,'DUMMY',15908,'VETC2252FF2',15884,NULL,20.0000,20.0000,0.0000,50.0000,50.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15893,'DUMMY',15909,'VET9BA8C00B',15885,NULL,60.0000,60.0000,0.0000,180.0000,180.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[{\"variation_id\":15890,\"quantity\":2,\"unit_id\":10},{\"variation_id\":15891,\"quantity\":1,\"unit_id\":10},{\"variation_id\":15892,\"quantity\":1,\"unit_id\":10}]'),(15894,'DUMMY',15910,'VETB39AED26',15886,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15895,'DUMMY',15911,'VET4E5EA464',15887,NULL,0.0000,0.0000,0.0000,150.0000,150.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15896,'DUMMY',15912,'VET8F5A3934',15888,NULL,0.0000,0.0000,0.0000,2500.0000,2500.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15897,'DUMMY',15913,'VET8B2ED3E0',15889,NULL,0.0000,0.0000,0.0000,1200.0000,1200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15898,'DUMMY',15914,'VETCF146481',15890,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15899,'DUMMY',15915,'VETB2FE6E82',15891,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15900,'DUMMY',15916,'VETF1AB440F',15892,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15901,'DUMMY',15917,'VET93EDD1C2',15893,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15902,'DUMMY',15918,'VETF3A806E6',15894,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15903,'DUMMY',15919,'VET9B4C1878',15895,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15904,'DUMMY',15920,'VET0DD0D571',15896,NULL,0.0000,0.0000,0.0000,700.0000,700.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15905,'DUMMY',15921,'VETF20577F1',15897,NULL,0.0000,0.0000,0.0000,900.0000,900.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15906,'DUMMY',15922,'VET617BF126',15898,NULL,0.0000,0.0000,0.0000,1400.0000,1400.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15907,'DUMMY',15923,'VET10B23077',15899,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15908,'DUMMY',15924,'VETA280F722',15900,NULL,0.0000,0.0000,0.0000,400.0000,400.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15909,'DUMMY',15925,'VET3520BC99',15901,NULL,0.0000,0.0000,0.0000,350.0000,350.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15910,'DUMMY',15926,'VET15E5ABFE',15902,NULL,0.0000,0.0000,0.0000,1800.0000,1800.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15911,'DUMMY',15927,'VETD10C587F',15903,NULL,0.0000,0.0000,0.0000,600.0000,600.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15912,'DUMMY',15928,'VET35AD2C05',15904,NULL,0.0000,0.0000,0.0000,750.0000,750.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15913,'DUMMY',15929,'VETB4DAB0DA',15905,NULL,0.0000,0.0000,0.0000,300.0000,300.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15914,'DUMMY',15930,'VETC7B45F2C',15906,NULL,0.0000,0.0000,0.0000,550.0000,550.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15915,'DUMMY',15931,'VETCEF63B6D',15907,NULL,0.0000,0.0000,0.0000,500.0000,500.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15916,'DUMMY',15932,'VET79950AF4',15908,NULL,0.0000,0.0000,0.0000,250.0000,250.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15917,'DUMMY',15933,'VET4BE3FA04',15909,NULL,0.0000,0.0000,0.0000,450.0000,450.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]'),(15918,'DUMMY',15934,'VET1CB6AB79',15910,NULL,0.0000,0.0000,0.0000,200.0000,200.0000,'2026-06-17 21:11:54','2026-06-17 21:11:54',NULL,'[]');
CREATE TABLE `vascular_surgery_patient_profiles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `clc_patient_id` int(10) unsigned NOT NULL,
  `abi_right` decimal(8,2) DEFAULT NULL,
  `abi_left` decimal(8,2) DEFAULT NULL,
  `affected_vessel` varchar(120) DEFAULT NULL,
  `planned_procedure` varchar(120) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vascular_surgery_patient_profiles_clc_patient_id_unique` (`clc_patient_id`),
  CONSTRAINT `vascular_surgery_patient_profiles_clc_patient_id_foreign` FOREIGN KEY (`clc_patient_id`) REFERENCES `clc_patients` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_appointment_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `document_name` varchar(191) NOT NULL,
  `document_type` enum('lab_report','xray','prescription','consent_form','discharge_summary','other') NOT NULL DEFAULT 'other',
  `description` text DEFAULT NULL,
  `file_name` varchar(191) NOT NULL,
  `file_path` varchar(500) NOT NULL,
  `file_size` bigint(20) unsigned DEFAULT NULL,
  `mime_type` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_appointment_edit_requests` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned NOT NULL,
  `requested_by` int(10) unsigned NOT NULL,
  `reason` text NOT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `reviewed_by` int(10) unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `review_notes` text DEFAULT NULL,
  `consumed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_appointment_edit_requests_business_id_index` (`business_id`),
  KEY `vc_appointment_edit_requests_appointment_id_index` (`appointment_id`),
  KEY `vc_appointment_edit_requests_requested_by_index` (`requested_by`),
  KEY `vc_appointment_edit_requests_status_index` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_appointment_exam_findings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned NOT NULL,
  `template_id` int(10) unsigned NOT NULL,
  `template_item_id` int(10) unsigned NOT NULL,
  `region_snapshot` varchar(80) DEFAULT NULL,
  `item_label_snapshot` varchar(200) NOT NULL,
  `side` varchar(8) DEFAULT NULL,
  `value` text DEFAULT NULL,
  `numeric_value` decimal(10,3) DEFAULT NULL,
  `values_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`values_json`)),
  `free_text` text DEFAULT NULL,
  `severity` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `is_critical` tinyint(1) NOT NULL DEFAULT 0,
  `recorded_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_exam_finding_unique` (`appointment_id`,`template_item_id`,`side`),
  KEY `vc_exam_finding_critical` (`appointment_id`,`is_critical`),
  KEY `vc_appointment_exam_findings_business_id_index` (`business_id`),
  KEY `vc_appointment_exam_findings_appointment_id_index` (`appointment_id`),
  KEY `vc_appointment_exam_findings_template_id_index` (`template_id`),
  KEY `vc_appointment_exam_findings_template_item_id_index` (`template_item_id`),
  KEY `vc_appointment_exam_findings_severity_index` (`severity`),
  KEY `vc_appointment_exam_findings_is_critical_index` (`is_critical`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_appointment_notes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `appointment_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `title` varchar(150) DEFAULT NULL,
  `notes` text NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_appointment_notes_appointment_id_index` (`appointment_id`),
  CONSTRAINT `vc_appointment_notes_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `vc_appointments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_appointment_reasons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_appointment_reasons_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_appointment_reasons` VALUES (1,NULL,'Routine Check-up','active',1,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(2,NULL,'Vaccination Due','active',2,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(3,NULL,'Sick Visit','active',3,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(4,NULL,'Follow-Up Visit','active',4,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(5,NULL,'Pre-Surgery Consultation','active',5,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(6,NULL,'Post-Surgery Follow-Up','active',6,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(7,NULL,'Parasite Prevention','active',7,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(8,NULL,'Dental Cleaning','active',8,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(9,NULL,'Wound / Injury','active',9,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(10,NULL,'Nutrition Consultation','active',10,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(11,NULL,'Behavioral Concern','active',11,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(12,NULL,'Eye / Ear Problem','active',12,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(13,NULL,'Skin / Coat Problem','active',13,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(14,NULL,'Vomiting / Diarrhea','active',14,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(15,NULL,'Lethargy / Not Eating','active',15,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(16,NULL,'Pregnancy / Reproductive','active',16,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(17,NULL,'Spay / Neuter Consultation','active',17,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(18,NULL,'Microchip Registration','active',18,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(19,NULL,'Certificate / Documentation','active',19,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(20,NULL,'Emergency','active',20,'2026-04-25 23:14:00','2026-04-25 23:14:00');
CREATE TABLE `vc_appointment_status_logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned NOT NULL,
  `from_status` varchar(30) DEFAULT NULL,
  `to_status` varchar(30) NOT NULL,
  `changed_by` int(10) unsigned DEFAULT NULL,
  `changed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_appointment_status_logs_business_id_index` (`business_id`),
  KEY `vc_appointment_status_logs_appointment_id_index` (`appointment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_appointment_status_logs` VALUES (17,5,50,'pending','waiting',164,'2026-06-16 16:33:06','2026-06-16 16:33:06','2026-06-16 16:33:06'),(18,5,50,'','in_progress',164,'2026-06-16 16:33:28','2026-06-16 16:33:28','2026-06-16 16:33:28'),(19,10,97,'pending','in_progress',195,'2026-06-23 23:04:15','2026-06-23 23:04:15','2026-06-23 23:04:15'),(20,10,91,'pending','in_progress',201,'2026-06-24 22:31:55','2026-06-24 22:31:55','2026-06-24 22:31:55');
CREATE TABLE `vc_appointment_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `color` varchar(20) NOT NULL DEFAULT '#2980b9',
  `icon` varchar(50) NOT NULL DEFAULT 'fa-calendar-check',
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_appointment_types_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_appointment_types` VALUES (2,NULL,'General Consultation','#2980b9','fa-stethoscope','active',1,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(3,NULL,'Vaccination','#27ae60','fa-syringe','active',2,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(4,NULL,'Surgery','#c0392b','fa-scalpel','active',3,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(5,NULL,'Grooming','#8e44ad','fa-cut','active',4,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(6,NULL,'Dental','#16a085','fa-tooth','active',5,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(7,NULL,'Dermatology','#d35400','fa-band-aid','active',6,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(8,NULL,'X-Ray / Imaging','#2c3e50','fa-x-ray','active',7,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(9,NULL,'Lab / Blood Work','#922b21','fa-vial','active',8,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(10,NULL,'Follow-Up','#3498db','fa-redo','active',9,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(11,NULL,'Emergency','#e67e22','fa-ambulance','active',10,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(12,NULL,'Wellness / Checkup','#1abc9c','fa-heart','active',11,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(13,NULL,'Ophthalmology','#6c3483','fa-eye','active',12,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(14,NULL,'Orthopedics','#7f8c8d','fa-bone','active',13,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(15,NULL,'Microchipping','#2980b9','fa-microchip','active',14,'2026-04-25 23:14:00','2026-04-25 23:14:00'),(16,NULL,'Spay / Neuter','#e74c3c','fa-cut','active',15,'2026-04-25 23:14:00','2026-04-25 23:14:00');
CREATE TABLE `vc_appointments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `location_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `doctor_id` int(10) unsigned DEFAULT NULL,
  `department_id` int(10) unsigned DEFAULT NULL,
  `schedule_id` int(10) unsigned DEFAULT NULL,
  `ref_no` varchar(30) NOT NULL,
  `appointment_date` date NOT NULL,
  `appointment_time` time NOT NULL,
  `duration_minutes` smallint(5) unsigned NOT NULL DEFAULT 30,
  `weight_kg` decimal(8,2) DEFAULT NULL,
  `temperature` decimal(4,1) DEFAULT NULL,
  `heart_rate` smallint(5) unsigned DEFAULT NULL,
  `respiratory_rate` smallint(5) unsigned DEFAULT NULL,
  `soap_subjective` text DEFAULT NULL,
  `soap_objective` text DEFAULT NULL,
  `soap_assessment` text DEFAULT NULL,
  `soap_investigations` text DEFAULT NULL,
  `soap_lab_investigations` text DEFAULT NULL,
  `soap_exam_investigations` text DEFAULT NULL,
  `exam_results` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`exam_results`)),
  `next_visit_date` date DEFAULT NULL,
  `next_visit_time` time DEFAULT NULL,
  `next_visit_doctor_id` int(10) unsigned DEFAULT NULL,
  `next_visit_department_id` int(10) unsigned DEFAULT NULL,
  `next_visit_reason` varchar(255) DEFAULT NULL,
  `next_visit_type_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`next_visit_type_ids`)),
  `next_visit_reason_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`next_visit_reason_ids`)),
  `next_visit_notes` text DEFAULT NULL,
  `next_appointment_id` int(10) unsigned DEFAULT NULL,
  `soap_plan` text DEFAULT NULL,
  `soap_plan_meds_json` text DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `reason_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`reason_ids`)),
  `type` enum('checkup','vaccination','surgery','grooming','emergency','other') NOT NULL DEFAULT 'checkup',
  `type_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`type_ids`)),
  `status` enum('pending','confirmed','in_progress','completed','cancelled','no_show') NOT NULL DEFAULT 'pending',
  `arrived_at` timestamp NULL DEFAULT NULL,
  `consultation_started_at` timestamp NULL DEFAULT NULL,
  `consultation_ended_at` timestamp NULL DEFAULT NULL,
  `waiting_minutes` int(10) unsigned DEFAULT NULL,
  `consultation_minutes` int(10) unsigned DEFAULT NULL,
  `has_overlap` tinyint(1) NOT NULL DEFAULT 0,
  `notes` text DEFAULT NULL,
  `doctor_notes` text DEFAULT NULL,
  `erp_sell_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `vitals_critical_count` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `vitals_abnormal_count` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `vitals_critical_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`vitals_critical_json`)),
  `findings_critical_count` smallint(5) unsigned NOT NULL DEFAULT 0,
  `last_critical_check_at` timestamp NULL DEFAULT NULL,
  `ai_subjective_hash` varchar(40) DEFAULT NULL,
  `ai_exam_suggestions_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`ai_exam_suggestions_json`)),
  `ai_symptoms_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`ai_symptoms_json`)),
  `ai_advice_updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_appointments_ref_no_unique` (`ref_no`),
  KEY `vc_appointments_contact_id_foreign` (`contact_id`),
  KEY `vc_appointments_pet_id_foreign` (`pet_id`),
  KEY `vc_appointments_doctor_id_foreign` (`doctor_id`),
  KEY `vc_appointments_department_id_foreign` (`department_id`),
  KEY `vc_appointments_business_id_appointment_date_index` (`business_id`,`appointment_date`),
  KEY `vc_appointments_business_id_status_index` (`business_id`,`status`),
  KEY `vc_appointments_location_id_foreign` (`location_id`),
  KEY `vc_appointments_schedule_id_foreign` (`schedule_id`),
  KEY `vc_appointments_next_visit_doctor_id_index` (`next_visit_doctor_id`),
  KEY `vc_appointments_next_visit_department_id_index` (`next_visit_department_id`),
  KEY `vc_appointments_next_appointment_id_index` (`next_appointment_id`),
  KEY `vc_appointments_vitals_critical_count_index` (`vitals_critical_count`),
  KEY `vc_appointments_findings_critical_count_index` (`findings_critical_count`),
  KEY `vc_appointments_ai_subjective_hash_index` (`ai_subjective_hash`),
  CONSTRAINT `vc_appointments_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_appointments_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_appointments_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `vc_departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_appointments_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `vc_doctors` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_appointments_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `vc_clinic_locations` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_appointments_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `vc_pets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_appointments_schedule_id_foreign` FOREIGN KEY (`schedule_id`) REFERENCES `vc_doctor_schedules` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_appointments` VALUES (83,10,31,6092,70,19,NULL,NULL,'APT-0001','2026-05-24','09:00:00',30,12.50,38.6,90,NULL,'Owner reports reduced appetite and mild lethargy over 3 days.','BAR, mild dehydration, temp 38.6°C, HR 90 bpm.','Suspected mild gastroenteritis.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Supportive care + bland diet; recheck in 1 week.',NULL,'General Consultation','[1]','','[2]','completed',NULL,'2026-05-24 06:05:00','2026-05-24 06:35:00',NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(84,10,31,6093,71,20,NULL,NULL,'APT-0002','2026-05-31','10:00:00',30,12.50,38.6,90,NULL,'Owner reports reduced appetite and mild lethargy over 3 days.','BAR, mild dehydration, temp 38.6°C, HR 90 bpm.','Suspected mild gastroenteritis.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Supportive care + bland diet; recheck in 1 week.',NULL,'Vaccination','[2]','vaccination','[3]','completed',NULL,'2026-05-31 06:05:00','2026-05-31 06:35:00',NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(85,10,31,6094,72,21,NULL,NULL,'APT-0003','2026-06-06','11:00:00',30,12.50,38.6,90,NULL,'Owner reports reduced appetite and mild lethargy over 3 days.','BAR, mild dehydration, temp 38.6°C, HR 90 bpm.','Suspected mild gastroenteritis.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Supportive care + bland diet; recheck in 1 week.',NULL,'Dental','[3]','','[6]','completed',NULL,'2026-06-06 06:05:00','2026-06-06 06:35:00',NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(86,10,31,6095,73,19,NULL,NULL,'APT-0004','2026-06-12','12:00:00',30,12.50,38.6,90,NULL,'Owner reports reduced appetite and mild lethargy over 3 days.','BAR, mild dehydration, temp 38.6°C, HR 90 bpm.','Suspected mild gastroenteritis.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Supportive care + bland diet; recheck in 1 week.',NULL,'Lab / Blood Work','[4]','','[9]','completed',NULL,'2026-06-12 06:05:00','2026-06-12 06:35:00',NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(87,10,31,6096,74,20,NULL,NULL,'APT-0005','2026-06-14','13:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Follow-Up','[5]','','[10]','no_show',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(88,10,31,6097,75,21,NULL,NULL,'APT-0006','2026-06-16','14:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Grooming','[6]','grooming','[5]','cancelled',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(89,10,31,6098,76,19,NULL,NULL,'APT-0007','2026-06-20','15:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Wellness / Checkup','[7]','','[12]','in_progress','2026-06-18 23:06:45','2026-06-18 23:06:45',NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-18 23:06:45',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(90,10,31,6099,77,20,NULL,NULL,'APT-0008','2026-06-22','09:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Surgery','[8]','surgery','[4]','confirmed',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(91,10,31,6100,78,21,NULL,NULL,'APT-0009','2026-06-25','10:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Vaccination','[9]','vaccination','[3]','in_progress',NULL,'2026-06-24 22:31:55',NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-24 22:32:19',0,0,NULL,0,NULL,'642409b609908d21f0b6784365a2ae27f53a29a6','{\"suggested\":[],\"reason\":\"\"}','{\"findings\":[],\"overall_concern\":\"low\"}','2026-06-24 22:32:19'),(92,10,31,6101,79,19,NULL,NULL,'APT-0010','2026-06-28','11:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'X-Ray / Imaging','[10]','','[8]','pending',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(94,10,13,6094,72,21,25,76,'APT-6A346285E05DC','2026-06-21','09:30:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[\"1\"]','other','[\"2\"]','pending',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-18 21:26:29','2026-06-18 21:26:29',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(95,10,12,6094,72,19,22,66,'APT-6A3463FDD0EE3','2026-06-21','09:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\"[5]\"','','\"[6]\"','pending',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-18 21:32:45','2026-06-18 21:32:45',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(96,10,13,6098,76,21,25,80,'APT-6A347A307C96B','2026-06-18','09:00:00',60,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Routine Check-up','\"[1,8]\"','','\"[2,10]\"','pending',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-18 23:07:28','2026-06-18 23:07:28',0,0,NULL,0,NULL,NULL,NULL,NULL,NULL),(97,10,13,6094,72,21,25,79,'APT-6A3B10E1ED0E9','2026-06-24','09:00:00',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[\"3\"]','other','[\"4\"]','in_progress',NULL,'2026-06-23 23:04:15',NULL,NULL,NULL,0,NULL,NULL,NULL,'2026-06-23 23:04:01','2026-06-23 23:04:34',0,0,NULL,0,NULL,'7c77c43698590ac50cf122d44cbf606589d95afa','{\"suggested\":[],\"reason\":\"\"}','{\"findings\":[],\"overall_concern\":\"low\"}','2026-06-23 23:04:34');
CREATE TABLE `vc_authorized_vets` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `doctor_id` int(10) unsigned NOT NULL,
  `schedules` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`schedules`)),
  `permit_no` varchar(80) DEFAULT NULL,
  `valid_until` date DEFAULT NULL,
  `document_path` varchar(191) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_authorized_vets_business_id_doctor_id_unique` (`business_id`,`doctor_id`),
  KEY `vc_authorized_vets_business_id_index` (`business_id`),
  KEY `vc_authorized_vets_doctor_id_index` (`doctor_id`),
  KEY `vc_authorized_vets_valid_until_index` (`valid_until`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_birth_death_records` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `record_type` enum('birth','death') NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `doctor_id` int(10) unsigned DEFAULT NULL,
  `event_date` date NOT NULL,
  `event_time` time DEFAULT NULL,
  `weight_kg` decimal(8,2) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_birth_death_records_pet_id_foreign` (`pet_id`),
  KEY `vc_birth_death_records_business_id_record_type_index` (`business_id`,`record_type`),
  CONSTRAINT `vc_birth_death_records_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_birth_death_records_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `vc_pets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_block_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `enable_auto_block` tinyint(1) NOT NULL DEFAULT 0,
  `block_rating_threshold` tinyint(3) unsigned NOT NULL DEFAULT 25,
  `min_ratings_to_evaluate` tinyint(3) unsigned NOT NULL DEFAULT 3,
  `block_zero_credit_limit` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_block_settings_business_id_unique` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_block_settings` VALUES (2,10,0,25,3,1,'2026-06-20 15:00:05','2026-06-20 15:00:05');
CREATE TABLE `vc_clinic_locations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `business_location_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `address` varchar(255) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `email` varchar(150) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_clinic_locations_business_id_status_index` (`business_id`,`status`),
  KEY `vc_clinic_locations_business_location_id_foreign` (`business_location_id`),
  CONSTRAINT `vc_clinic_locations_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_clinic_locations_business_location_id_foreign` FOREIGN KEY (`business_location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_clinic_locations` VALUES (12,10,NULL,'VET One — New Cairo','90th Street, New Cairo','+201092288093','clinic@vetone.test',NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(13,10,NULL,'VET One — Maadi','Road 9, Maadi','+201092288093','clinic@vetone.test',NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_confidential_notes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `subject_type` varchar(20) NOT NULL,
  `subject_id` bigint(20) unsigned NOT NULL,
  `visibility` enum('normal','confidential') NOT NULL DEFAULT 'normal',
  `title` varchar(191) DEFAULT NULL,
  `body` text NOT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `updated_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_confidential_notes_subject_type_subject_id_index` (`subject_type`,`subject_id`),
  KEY `vc_confidential_notes_business_id_index` (`business_id`),
  KEY `vc_confidential_notes_visibility_index` (`visibility`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_confidential_notes` VALUES (3,5,'pet',14,'normal','gdsgdsfgfdsgsdg','sgdfgdfg',164,164,'2026-06-16 16:15:20','2026-06-16 16:15:20');
CREATE TABLE `vc_consent_signatures` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `consent_id` int(10) unsigned NOT NULL,
  `method` varchar(20) NOT NULL DEFAULT 'canvas',
  `signed_by_name` varchar(191) NOT NULL,
  `signed_by_relation` varchar(60) DEFAULT NULL,
  `png_path` varchar(255) NOT NULL,
  `file_mime` varchar(100) DEFAULT NULL,
  `file_size` int(10) unsigned DEFAULT NULL,
  `original_filename` varchar(191) DEFAULT NULL,
  `png_hash_sha256` char(64) NOT NULL,
  `ip` varchar(45) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `signed_at` timestamp NULL DEFAULT NULL,
  `superseded_at` timestamp NULL DEFAULT NULL,
  `captured_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_consent_signatures_png_hash_sha256_index` (`png_hash_sha256`),
  KEY `vc_consent_signatures_consent_id_superseded_at_index` (`consent_id`,`superseded_at`),
  KEY `vc_consent_signatures_consent_id_index` (`consent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_consent_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `code` varchar(60) NOT NULL,
  `category` varchar(40) NOT NULL DEFAULT 'general',
  `name_en` varchar(191) NOT NULL,
  `name_ar` varchar(191) DEFAULT NULL,
  `body_en` longtext DEFAULT NULL,
  `body_ar` longtext DEFAULT NULL,
  `requires_witness` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_consent_templates_business_id_index` (`business_id`),
  KEY `vc_consent_templates_code_index` (`code`),
  KEY `vc_consent_templates_category_index` (`category`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_consents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `consent_template_id` int(10) unsigned DEFAULT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `code` varchar(60) DEFAULT NULL,
  `category` varchar(40) DEFAULT NULL,
  `title` varchar(191) NOT NULL,
  `language` enum('en','ar','both') NOT NULL DEFAULT 'both',
  `body_en` longtext DEFAULT NULL,
  `body_ar` longtext DEFAULT NULL,
  `signatory_name` varchar(191) DEFAULT NULL,
  `signatory_relationship` varchar(60) DEFAULT NULL,
  `witness_name` varchar(191) DEFAULT NULL,
  `issued_by` int(10) unsigned DEFAULT NULL,
  `issued_at` timestamp NULL DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `signed_file_path` varchar(191) DEFAULT NULL,
  `signed_file_name` varchar(191) DEFAULT NULL,
  `signed_file_size` int(10) unsigned DEFAULT NULL,
  `signed_mime_type` varchar(100) DEFAULT NULL,
  `signed_uploaded_at` timestamp NULL DEFAULT NULL,
  `signed_uploaded_by` int(10) unsigned DEFAULT NULL,
  `archived_at` timestamp NULL DEFAULT NULL,
  `archived_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_consents_business_id_index` (`business_id`),
  KEY `vc_consents_consent_template_id_index` (`consent_template_id`),
  KEY `vc_consents_appointment_id_index` (`appointment_id`),
  KEY `vc_consents_pet_id_index` (`pet_id`),
  KEY `vc_consents_contact_id_index` (`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_controlled_daily_seals` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `seal_date` date NOT NULL,
  `movement_count` int(10) unsigned NOT NULL DEFAULT 0,
  `first_movement_id` int(10) unsigned DEFAULT NULL,
  `last_movement_id` int(10) unsigned DEFAULT NULL,
  `prev_hash` varchar(64) DEFAULT NULL,
  `hash` varchar(64) NOT NULL,
  `sealed_at` timestamp NULL DEFAULT NULL,
  `sealed_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_controlled_daily_seals_business_id_seal_date_unique` (`business_id`,`seal_date`),
  KEY `vc_controlled_daily_seals_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_controlled_reconciliations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `reference` varchar(30) NOT NULL,
  `medicine_id` int(10) unsigned NOT NULL,
  `batch_no` varchar(60) DEFAULT NULL,
  `expected_qty` decimal(14,3) NOT NULL,
  `counted_qty` decimal(14,3) NOT NULL,
  `variance` decimal(14,3) NOT NULL,
  `unit` varchar(30) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `stocktake_at` datetime NOT NULL,
  `witnessed_by` int(10) unsigned DEFAULT NULL,
  `movement_id` int(10) unsigned DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_controlled_reconciliations_reference_unique` (`reference`),
  KEY `vc_controlled_reconciliations_business_id_medicine_id_index` (`business_id`,`medicine_id`),
  KEY `vc_controlled_reconciliations_business_id_index` (`business_id`),
  KEY `vc_controlled_reconciliations_medicine_id_index` (`medicine_id`),
  KEY `vc_controlled_reconciliations_batch_no_index` (`batch_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_controlled_stock_movements` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `serial_no` varchar(30) NOT NULL,
  `medicine_id` int(10) unsigned NOT NULL,
  `direction` enum('in','out','adjust') NOT NULL,
  `qty` decimal(12,3) NOT NULL,
  `unit` varchar(30) DEFAULT NULL,
  `batch_no` varchar(60) DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `balance_after` decimal(14,3) NOT NULL DEFAULT 0.000,
  `reason_code` varchar(30) NOT NULL,
  `source_type` varchar(40) DEFAULT NULL,
  `source_id` bigint(20) unsigned DEFAULT NULL,
  `source_line_id` bigint(20) unsigned DEFAULT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `prescription_id` int(10) unsigned DEFAULT NULL,
  `stocktake_id` int(10) unsigned DEFAULT NULL,
  `doctor_id` int(10) unsigned DEFAULT NULL,
  `witness_user_id` int(10) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_controlled_stock_movements_serial_no_unique` (`serial_no`),
  UNIQUE KEY `vc_cm_source_unique` (`business_id`,`source_type`,`source_id`,`source_line_id`),
  KEY `vc_controlled_stock_movements_business_id_index` (`business_id`),
  KEY `vc_controlled_stock_movements_medicine_id_index` (`medicine_id`),
  KEY `vc_controlled_stock_movements_batch_no_index` (`batch_no`),
  KEY `vc_controlled_stock_movements_reason_code_index` (`reason_code`),
  KEY `vc_controlled_stock_movements_pet_id_index` (`pet_id`),
  KEY `vc_controlled_stock_movements_contact_id_index` (`contact_id`),
  KEY `vc_controlled_stock_movements_appointment_id_index` (`appointment_id`),
  KEY `vc_controlled_stock_movements_prescription_id_index` (`prescription_id`),
  KEY `vc_controlled_stock_movements_source_type_index` (`source_type`),
  KEY `vc_controlled_stock_movements_stocktake_id_index` (`stocktake_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_controlled_stock_movements` VALUES (23,10,'CR-10-0000001',544,'in',200.000,'ml','KET-2406','2028-06-18',200.000,'receive',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Opening stock received into controlled register.',195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(24,10,'CR-10-0000002',555,'in',120.000,'ml','DZP-2405','2028-06-18',120.000,'receive',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Opening stock received into controlled register.',195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(25,10,'CR-10-0000003',507,'in',300.000,'mg','TRM-2404','2028-06-18',300.000,'receive',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Opening stock received into controlled register.',195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(26,10,'CR-10-0000004',556,'in',150.000,'mg','PHB-2403','2028-06-18',150.000,'receive',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Opening stock received into controlled register.',195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(27,10,'CR-10-0000005',557,'in',60.000,'ml','BUP-2406','2028-06-18',60.000,'receive',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Opening stock received into controlled register.',195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(28,10,'CR-10-0000006',558,'in',90.000,'mg','MOR-2402','2028-06-18',90.000,'receive',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Opening stock received into controlled register.',195,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_departments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `location_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_departments_business_id_index` (`business_id`),
  KEY `vc_departments_location_id_foreign` (`location_id`),
  CONSTRAINT `vc_departments_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_departments_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `vc_clinic_locations` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_departments` VALUES (22,10,12,'General Practice',NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(23,10,12,'Surgery',NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(24,10,12,'Dentistry',NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(25,10,13,'Diagnostics & Lab',NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_doctor_change_requests` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `requested_by` int(10) unsigned NOT NULL,
  `current_doctor_id` int(10) unsigned DEFAULT NULL,
  `requested_doctor_id` int(10) unsigned NOT NULL,
  `scope` enum('this_appointment','set_preferred') NOT NULL DEFAULT 'this_appointment',
  `reason` text NOT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `reviewed_by` int(10) unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `review_notes` text DEFAULT NULL,
  `consumed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_doctor_change_requests_business_id_index` (`business_id`),
  KEY `vc_doctor_change_requests_appointment_id_index` (`appointment_id`),
  KEY `vc_doctor_change_requests_requested_by_index` (`requested_by`),
  KEY `vc_doctor_change_requests_status_index` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_doctor_departments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `doctor_id` int(10) unsigned NOT NULL,
  `department_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_doctor_departments_doctor_id_department_id_unique` (`doctor_id`,`department_id`),
  KEY `vc_doctor_departments_department_id_foreign` (`department_id`),
  CONSTRAINT `vc_doctor_departments_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `vc_departments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_doctor_departments_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `vc_doctors` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_doctor_departments` VALUES (24,19,22,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(25,20,23,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(26,21,25,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_doctor_schedules` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `doctor_id` int(10) unsigned NOT NULL,
  `department_id` int(10) unsigned DEFAULT NULL,
  `location_id` bigint(20) unsigned DEFAULT NULL,
  `day_of_week` tinyint(3) unsigned NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `slot_duration_minutes` smallint(5) unsigned NOT NULL DEFAULT 30,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_doctor_schedules_doctor_id_department_id_day_of_week_index` (`doctor_id`,`department_id`,`day_of_week`),
  KEY `vc_doctor_schedules_department_id_foreign` (`department_id`),
  KEY `vc_doctor_schedules_location_id_index` (`location_id`),
  CONSTRAINT `vc_doctor_schedules_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `vc_departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_doctor_schedules_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `vc_doctors` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_doctor_schedules` VALUES (66,19,22,NULL,0,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(67,19,22,NULL,1,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(68,19,22,NULL,2,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(69,19,22,NULL,3,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(70,19,22,NULL,4,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(71,20,23,NULL,0,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(72,20,23,NULL,1,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(73,20,23,NULL,2,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(74,20,23,NULL,3,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(75,20,23,NULL,4,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(76,21,25,NULL,0,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(77,21,25,NULL,1,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(78,21,25,NULL,2,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(79,21,25,NULL,3,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(80,21,25,NULL,4,'09:00:00','17:00:00',30,'active','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_doctors` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `department_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `email` varchar(150) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `specialization` varchar(150) DEFAULT NULL,
  `about` text DEFAULT NULL,
  `consultation_fee` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `product_id` int(10) unsigned DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `color` varchar(9) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_doctors_user_id_foreign` (`user_id`),
  KEY `vc_doctors_department_id_foreign` (`department_id`),
  KEY `vc_doctors_business_id_status_index` (`business_id`,`status`),
  KEY `vc_doctors_product_id_index` (`product_id`),
  CONSTRAINT `vc_doctors_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_doctors_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `vc_departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_doctors_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_doctors` VALUES (19,10,196,22,'Dr. Yasmin Fahmy',NULL,'+201092288093','Internal Medicine',NULL,200.0000,15910,'active','#27ae60','2026-06-17 21:11:55','2026-06-17 21:11:55'),(20,10,197,23,'Dr. Omar Sherif',NULL,'+201092288093','Soft-Tissue Surgery',NULL,350.0000,15910,'active','#c0392b','2026-06-17 21:11:55','2026-06-17 21:11:55'),(21,10,195,25,'Dr. Hossam Makram',NULL,'+201092288093','Diagnostic Imaging',NULL,250.0000,15910,'active','#2980b9','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_evaluation_questions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `category` enum('pet_owner','clinic') NOT NULL,
  `question_text` text NOT NULL,
  `response_type` enum('rating','text','yes_no') NOT NULL DEFAULT 'rating',
  `is_required` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_evaluation_questions_business_id_index` (`business_id`),
  KEY `vc_evaluation_questions_category_index` (`category`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_evaluation_questions` VALUES (1,NULL,'pet_owner','How cooperative was the pet owner during the visit?','rating',1,10,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(2,NULL,'pet_owner','How well did the owner follow previous instructions?','rating',1,20,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(3,NULL,'pet_owner','How attentive was the owner to the pet\'s condition?','rating',1,30,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(4,NULL,'pet_owner','Did the owner provide a complete medical history?','yes_no',1,40,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(5,NULL,'pet_owner','Owner\'s overall responsibility level','rating',1,50,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(6,NULL,'pet_owner','Additional notes about the owner','text',0,60,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(7,NULL,'clinic','How would you rate the doctor\'s communication?','rating',1,10,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(8,NULL,'clinic','How would you rate the quality of medical care?','rating',1,20,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(9,NULL,'clinic','How would you rate the cleanliness of the clinic?','rating',1,30,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(10,NULL,'clinic','How would you rate the reception / staff service?','rating',1,40,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(11,NULL,'clinic','How would you rate the wait time?','rating',1,50,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(12,NULL,'clinic','Overall satisfaction with the visit','rating',1,60,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(13,NULL,'clinic','Would you recommend our clinic to others?','yes_no',1,70,'active','2026-05-20 02:25:13','2026-05-20 02:25:13'),(14,NULL,'clinic','Any suggestions or comments','text',0,80,'active','2026-05-20 02:25:13','2026-05-20 02:25:13');
CREATE TABLE `vc_evaluation_responses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `evaluation_id` int(10) unsigned NOT NULL,
  `question_id` int(10) unsigned DEFAULT NULL,
  `question_text_snapshot` text NOT NULL,
  `response_type` enum('rating','text','yes_no') NOT NULL,
  `rating` tinyint(3) unsigned DEFAULT NULL,
  `text_answer` text DEFAULT NULL,
  `yes_no_answer` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_evaluation_responses_evaluation_id_index` (`evaluation_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_evaluations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned NOT NULL,
  `category` enum('pet_owner','clinic') NOT NULL,
  `evaluator_user_id` int(10) unsigned DEFAULT NULL,
  `doctor_id` int(10) unsigned DEFAULT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `avg_rating` decimal(3,2) DEFAULT NULL,
  `flagged_for_review` tinyint(1) NOT NULL DEFAULT 0,
  `reviewed_by` int(10) unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `review_notes` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_eval_apt_cat_unique` (`appointment_id`,`category`),
  KEY `vc_evaluations_business_id_index` (`business_id`),
  KEY `vc_evaluations_appointment_id_index` (`appointment_id`),
  KEY `vc_evaluations_category_index` (`category`),
  KEY `vc_evaluations_evaluator_user_id_index` (`evaluator_user_id`),
  KEY `vc_evaluations_doctor_id_index` (`doctor_id`),
  KEY `vc_evaluations_pet_id_index` (`pet_id`),
  KEY `vc_evaluations_contact_id_index` (`contact_id`),
  KEY `vc_evaluations_flagged_for_review_index` (`flagged_for_review`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_exam_not_done_reasons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_exam_not_done_reasons_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_exam_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `active_general_template_id` int(10) unsigned DEFAULT NULL,
  `visible_specialist_template_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`visible_specialist_template_ids`)),
  `enable_ai_suggest` tinyint(1) NOT NULL DEFAULT 0,
  `enable_comparison_with_previous` tinyint(1) NOT NULL DEFAULT 1,
  `enable_voice_fill` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_exam_settings_business_id_unique` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_exam_settings` VALUES (2,10,NULL,NULL,0,1,1,'2026-06-18 00:24:52','2026-06-18 00:24:52');
CREATE TABLE `vc_exam_template_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `template_id` int(10) unsigned NOT NULL,
  `region` varchar(80) NOT NULL,
  `item_label` varchar(200) NOT NULL,
  `response_type` enum('select','multi_select','grade','measurement','text','yes_no','body_map') NOT NULL DEFAULT 'select',
  `options_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`options_json`)),
  `unit` varchar(20) DEFAULT NULL,
  `normal_low` decimal(10,3) DEFAULT NULL,
  `normal_high` decimal(10,3) DEFAULT NULL,
  `critical_low` decimal(10,3) DEFAULT NULL,
  `critical_high` decimal(10,3) DEFAULT NULL,
  `lateralisation` varchar(12) NOT NULL DEFAULT 'none',
  `is_required` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `help_text` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_exam_tpl_item_order` (`template_id`,`region`,`sort_order`),
  KEY `vc_exam_template_items_template_id_index` (`template_id`),
  KEY `vc_exam_template_items_region_index` (`region`)
) ENGINE=InnoDB AUTO_INCREMENT=94 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_exam_template_items` VALUES (1,1,'General','Body condition score (1-9)','grade','[{\"value\":\"1\",\"label\":\"1 - Emaciated\",\"severity\":3,\"is_critical\":true},{\"value\":\"2\",\"label\":\"2 - Very thin\",\"severity\":3,\"is_critical\":true},{\"value\":\"3\",\"label\":\"3 - Thin\",\"severity\":2,\"is_critical\":false},{\"value\":\"4\",\"label\":\"4 - Underweight\",\"severity\":1,\"is_critical\":false},{\"value\":\"5\",\"label\":\"5 - Ideal\",\"severity\":0,\"is_critical\":false},{\"value\":\"6\",\"label\":\"6 - Slightly overweight\",\"severity\":1,\"is_critical\":false},{\"value\":\"7\",\"label\":\"7 - Overweight\",\"severity\":2,\"is_critical\":false},{\"value\":\"8\",\"label\":\"8 - Obese\",\"severity\":3,\"is_critical\":false},{\"value\":\"9\",\"label\":\"9 - Severely obese\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,0,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(2,1,'General','Demeanour','select','[{\"value\":\"bar\",\"label\":\"BAR - Bright, alert, responsive\",\"severity\":0,\"is_critical\":false},{\"value\":\"qar\",\"label\":\"QAR - Quiet, alert, responsive\",\"severity\":1,\"is_critical\":false},{\"value\":\"dull\",\"label\":\"Dull \\/ lethargic\",\"severity\":2,\"is_critical\":false},{\"value\":\"depressed\",\"label\":\"Depressed\",\"severity\":3,\"is_critical\":true},{\"value\":\"collapsed\",\"label\":\"Collapsed \\/ unresponsive\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,1,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(3,1,'General','Hydration status','select','[{\"value\":\"hydrated\",\"label\":\"Hydrated (<5%)\",\"severity\":0,\"is_critical\":false},{\"value\":\"mild\",\"label\":\"Mild dehydration 5-7%\",\"severity\":2,\"is_critical\":false},{\"value\":\"moderate\",\"label\":\"Moderate 8-10%\",\"severity\":3,\"is_critical\":true},{\"value\":\"severe\",\"label\":\"Severe 10-12%\",\"severity\":3,\"is_critical\":true},{\"value\":\"shock\",\"label\":\"Shock >12%\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,2,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(4,1,'Mucous Membranes','Colour','select','[{\"value\":\"pink\",\"label\":\"Pink\",\"severity\":0,\"is_critical\":false},{\"value\":\"pale\",\"label\":\"Pale\",\"severity\":3,\"is_critical\":true},{\"value\":\"cyanotic\",\"label\":\"Cyanotic\",\"severity\":3,\"is_critical\":true},{\"value\":\"icteric\",\"label\":\"Icteric (yellow)\",\"severity\":3,\"is_critical\":true},{\"value\":\"injected\",\"label\":\"Injected \\/ hyperemic\",\"severity\":2,\"is_critical\":false},{\"value\":\"muddy\",\"label\":\"Muddy \\/ grey\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,3,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(5,1,'Mucous Membranes','Capillary refill time','select','[{\"value\":\"lt2\",\"label\":\"< 2 seconds (normal)\",\"severity\":0,\"is_critical\":false},{\"value\":\"2-3\",\"label\":\"2-3 seconds (borderline)\",\"severity\":2,\"is_critical\":false},{\"value\":\"gt3\",\"label\":\"> 3 seconds\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,4,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(6,1,'Lymph Nodes','Mandibular','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,5,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(7,1,'Lymph Nodes','Prescapular','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,6,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(8,1,'Lymph Nodes','Popliteal','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,7,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(9,1,'Lymph Nodes','Inguinal','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,8,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(10,1,'Lymph Nodes','Enlarged node details','text',NULL,NULL,NULL,NULL,NULL,NULL,'none',0,9,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(11,1,'Eyes','Conjunctiva','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'od_os',0,10,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(12,1,'Eyes','Discharge','select','[{\"value\":\"none\",\"label\":\"None\",\"severity\":0,\"is_critical\":false},{\"value\":\"serous\",\"label\":\"Serous\",\"severity\":1,\"is_critical\":false},{\"value\":\"mucoid\",\"label\":\"Mucoid\",\"severity\":2,\"is_critical\":false},{\"value\":\"purulent\",\"label\":\"Purulent\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'od_os',0,11,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(13,1,'Eyes','Cornea','select','[{\"value\":\"clear\",\"label\":\"Clear\",\"severity\":0,\"is_critical\":false},{\"value\":\"opacity\",\"label\":\"Opacity\",\"severity\":2,\"is_critical\":false},{\"value\":\"ulcer\",\"label\":\"Ulcer\",\"severity\":3,\"is_critical\":true},{\"value\":\"edema\",\"label\":\"Edema\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'od_os',0,12,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(14,1,'Eyes','Pupil response','select','[{\"value\":\"plr_normal\",\"label\":\"PLR normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"miosis\",\"label\":\"Miosis\",\"severity\":2,\"is_critical\":false},{\"value\":\"mydriasis\",\"label\":\"Mydriasis\",\"severity\":2,\"is_critical\":false},{\"value\":\"anisocoria\",\"label\":\"Anisocoria\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'od_os',0,13,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(15,1,'Ears','Pinna / canal','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'ad_as',0,14,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(16,1,'Ears','Exudate','select','[{\"value\":\"none\",\"label\":\"None\",\"severity\":0,\"is_critical\":false},{\"value\":\"ceruminous\",\"label\":\"Ceruminous (waxy)\",\"severity\":1,\"is_critical\":false},{\"value\":\"purulent\",\"label\":\"Purulent\",\"severity\":3,\"is_critical\":false},{\"value\":\"hemorrhagic\",\"label\":\"Hemorrhagic\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'ad_as',0,15,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(17,1,'Ears','Pain on palpation','yes_no','[{\"value\":\"no\",\"label\":\"No pain\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'ad_as',0,16,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(18,1,'Oral Cavity','Dental grade (0-4)','grade','[{\"value\":\"0\",\"label\":\"0 - No tartar \\/ gingivitis\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild tartar, marginal gingivitis\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Moderate tartar, gingivitis\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Heavy tartar, periodontitis\",\"severity\":3,\"is_critical\":false},{\"value\":\"4\",\"label\":\"4 - Severe \\/ loose teeth, abscess\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,17,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(19,1,'Oral Cavity','Mucosa','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,18,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(20,1,'Oral Cavity','Halitosis','yes_no','[{\"value\":\"no\",\"label\":\"None \\/ mild\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Significant\",\"severity\":1,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,19,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(21,1,'Oral Cavity','Mass / ulcer noted','text',NULL,NULL,NULL,NULL,NULL,NULL,'none',0,20,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(22,1,'Cardiovascular','Heart rate (bpm)','measurement',NULL,'bpm',60.000,140.000,30.000,300.000,'none',0,21,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(23,1,'Cardiovascular','Rhythm','select','[{\"value\":\"sinus\",\"label\":\"Sinus rhythm\",\"severity\":0,\"is_critical\":false},{\"value\":\"sinus_arrhyth\",\"label\":\"Sinus arrhythmia (normal)\",\"severity\":0,\"is_critical\":false},{\"value\":\"arrhythmia\",\"label\":\"Arrhythmia\",\"severity\":3,\"is_critical\":true},{\"value\":\"gallop\",\"label\":\"Gallop rhythm\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,22,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(24,1,'Cardiovascular','Murmur grade (I-VI)','grade','[{\"value\":\"none\",\"label\":\"None\",\"severity\":0,\"is_critical\":false},{\"value\":\"I\",\"label\":\"I - Faint, barely audible\",\"severity\":1,\"is_critical\":false},{\"value\":\"II\",\"label\":\"II - Soft but easily heard\",\"severity\":2,\"is_critical\":false},{\"value\":\"III\",\"label\":\"III - Moderate intensity\",\"severity\":2,\"is_critical\":false},{\"value\":\"IV\",\"label\":\"IV - Loud, no thrill\",\"severity\":3,\"is_critical\":true},{\"value\":\"V\",\"label\":\"V - Loud with palpable thrill\",\"severity\":3,\"is_critical\":true},{\"value\":\"VI\",\"label\":\"VI - Audible with stethoscope off chest\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,23,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(25,1,'Cardiovascular','Pulse character','select','[{\"value\":\"strong_synch\",\"label\":\"Strong, synchronous\",\"severity\":0,\"is_critical\":false},{\"value\":\"weak\",\"label\":\"Weak \\/ thready\",\"severity\":3,\"is_critical\":true},{\"value\":\"bounding\",\"label\":\"Bounding \\/ water-hammer\",\"severity\":2,\"is_critical\":false},{\"value\":\"asynch\",\"label\":\"Asynchronous \\/ pulse deficit\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,24,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(26,1,'Respiratory','Respiratory rate (/min)','measurement',NULL,'/min',10.000,30.000,5.000,80.000,'none',0,25,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(27,1,'Respiratory','Respiratory effort','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"increased\",\"label\":\"Increased effort\",\"severity\":2,\"is_critical\":false},{\"value\":\"dyspnea\",\"label\":\"Dyspnea\",\"severity\":3,\"is_critical\":true},{\"value\":\"orthopnea\",\"label\":\"Orthopnea\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,26,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(28,1,'Respiratory','Lung sounds','select','[{\"value\":\"clear\",\"label\":\"Clear\",\"severity\":0,\"is_critical\":false},{\"value\":\"harsh\",\"label\":\"Harsh\",\"severity\":1,\"is_critical\":false},{\"value\":\"crackles\",\"label\":\"Crackles\",\"severity\":3,\"is_critical\":true},{\"value\":\"wheezes\",\"label\":\"Wheezes\",\"severity\":3,\"is_critical\":false},{\"value\":\"absent\",\"label\":\"Absent \\/ muffled\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,27,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(29,1,'Abdomen','Palpation','select','[{\"value\":\"soft\",\"label\":\"Soft, non-painful\",\"severity\":0,\"is_critical\":false},{\"value\":\"tense\",\"label\":\"Tense\",\"severity\":2,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":3,\"is_critical\":true},{\"value\":\"mass\",\"label\":\"Mass palpated\",\"severity\":3,\"is_critical\":true},{\"value\":\"fluid\",\"label\":\"Fluid wave\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,28,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(30,1,'Abdomen','Organomegaly','select','[{\"value\":\"none\",\"label\":\"None\",\"severity\":0,\"is_critical\":false},{\"value\":\"hepatomegaly\",\"label\":\"Hepatomegaly\",\"severity\":2,\"is_critical\":false},{\"value\":\"splenomegaly\",\"label\":\"Splenomegaly\",\"severity\":2,\"is_critical\":false},{\"value\":\"renal\",\"label\":\"Renomegaly\",\"severity\":2,\"is_critical\":false},{\"value\":\"bladder\",\"label\":\"Bladder distention \\/ pain\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,29,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(31,1,'Abdomen','Findings note','text',NULL,NULL,NULL,NULL,NULL,NULL,'none',0,30,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(32,1,'Musculoskeletal','Gait','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"stiff\",\"label\":\"Stiff\",\"severity\":1,\"is_critical\":false},{\"value\":\"lame\",\"label\":\"Lame\",\"severity\":2,\"is_critical\":false},{\"value\":\"nwb\",\"label\":\"Non-weight-bearing\",\"severity\":3,\"is_critical\":true},{\"value\":\"ataxic\",\"label\":\"Ataxic\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,31,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(33,1,'Musculoskeletal','Lameness grade (0-4)','grade','[{\"value\":\"0\",\"label\":\"0 - Sound\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild, intermittent\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Mild, consistent\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Obvious lameness\",\"severity\":3,\"is_critical\":false},{\"value\":\"4\",\"label\":\"4 - Non-weight-bearing\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,32,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(34,1,'Musculoskeletal','Affected limb','multi_select','[{\"value\":\"lf\",\"label\":\"Left fore\",\"severity\":2,\"is_critical\":false},{\"value\":\"rf\",\"label\":\"Right fore\",\"severity\":2,\"is_critical\":false},{\"value\":\"lh\",\"label\":\"Left hind\",\"severity\":2,\"is_critical\":false},{\"value\":\"rh\",\"label\":\"Right hind\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,33,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(35,1,'Musculoskeletal','Muscle mass','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,34,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(36,1,'Neurological','Mentation','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"dull\",\"label\":\"Dull\",\"severity\":2,\"is_critical\":false},{\"value\":\"obtunded\",\"label\":\"Obtunded\",\"severity\":3,\"is_critical\":true},{\"value\":\"stupor\",\"label\":\"Stupor\",\"severity\":3,\"is_critical\":true},{\"value\":\"coma\",\"label\":\"Coma\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,35,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(37,1,'Neurological','Postural reactions','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,36,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(38,1,'Neurological','Spinal palpation pain','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,37,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(39,1,'Skin / Coat','Coat condition','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"dry\",\"label\":\"Dry \\/ dull\",\"severity\":1,\"is_critical\":false},{\"value\":\"alopecia\",\"label\":\"Alopecia\",\"severity\":2,\"is_critical\":false},{\"value\":\"greasy\",\"label\":\"Greasy \\/ oily\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,38,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(40,1,'Skin / Coat','Pruritus 0-10','grade','[{\"value\":\"0\",\"label\":\"0 - None\",\"severity\":0,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Mild\",\"severity\":1,\"is_critical\":false},{\"value\":\"5\",\"label\":\"5 - Moderate\",\"severity\":2,\"is_critical\":false},{\"value\":\"8\",\"label\":\"8 - Severe\",\"severity\":3,\"is_critical\":false},{\"value\":\"10\",\"label\":\"10 - Self-mutilating\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,39,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(41,1,'Skin / Coat','Parasites','multi_select','[{\"value\":\"none\",\"label\":\"None seen\",\"severity\":0,\"is_critical\":false},{\"value\":\"fleas\",\"label\":\"Fleas\",\"severity\":2,\"is_critical\":false},{\"value\":\"ticks\",\"label\":\"Ticks\",\"severity\":2,\"is_critical\":false},{\"value\":\"mites\",\"label\":\"Mites\",\"severity\":2,\"is_critical\":false},{\"value\":\"lice\",\"label\":\"Lice\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,40,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(42,1,'Skin / Coat','Lesion description','text',NULL,NULL,NULL,NULL,NULL,NULL,'none',0,41,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(43,1,'Urogenital','External exam','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,42,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(44,1,'Urogenital','Discharge','select','[{\"value\":\"none\",\"label\":\"None\",\"severity\":0,\"is_critical\":false},{\"value\":\"serous\",\"label\":\"Serous\",\"severity\":1,\"is_critical\":false},{\"value\":\"mucoid\",\"label\":\"Mucoid\",\"severity\":2,\"is_critical\":false},{\"value\":\"purulent\",\"label\":\"Purulent\",\"severity\":3,\"is_critical\":true},{\"value\":\"bloody\",\"label\":\"Sanguineous\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,43,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(45,1,'Urogenital','Mammary chain (F)','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,44,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(46,1,'Urogenital','Prostate (M, on rectal)','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'none',0,45,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(47,2,'Gait & Posture','Stance','select','[{\"value\":\"square\",\"label\":\"Square \\/ symmetric\",\"severity\":0,\"is_critical\":false},{\"value\":\"shifted_weight\",\"label\":\"Shifted weight off limb\",\"severity\":2,\"is_critical\":false},{\"value\":\"non_weight\",\"label\":\"Non-weight-bearing on limb\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,0,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(48,2,'Gait & Posture','Gait at walk','select','[{\"value\":\"sound\",\"label\":\"Sound\",\"severity\":0,\"is_critical\":false},{\"value\":\"stiff\",\"label\":\"Stiff \\/ shortened stride\",\"severity\":1,\"is_critical\":false},{\"value\":\"mild\",\"label\":\"Mild lameness\",\"severity\":2,\"is_critical\":false},{\"value\":\"marked\",\"label\":\"Marked lameness\",\"severity\":3,\"is_critical\":false},{\"value\":\"nwb\",\"label\":\"Non-weight-bearing\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,1,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(49,2,'Gait & Posture','Lameness grade (0-5)','grade','[{\"value\":\"0\",\"label\":\"0 - Sound\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Visible only at trot\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Visible at walk, intermittent\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Visible at walk, consistent\",\"severity\":2,\"is_critical\":false},{\"value\":\"4\",\"label\":\"4 - Severe, partial weight bearing\",\"severity\":3,\"is_critical\":false},{\"value\":\"5\",\"label\":\"5 - Non-weight-bearing\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,2,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(50,2,'Shoulder','Flexion','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,3,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(51,2,'Shoulder','Extension','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,4,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(52,2,'Shoulder','Pain on manipulation','select','[{\"value\":\"0\",\"label\":\"0 - None\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Moderate\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Severe\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,5,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(53,2,'Shoulder','Instability','select','[{\"value\":\"stable\",\"label\":\"Stable\",\"severity\":0,\"is_critical\":false},{\"value\":\"mild_laxity\",\"label\":\"Mild laxity\",\"severity\":1,\"is_critical\":false},{\"value\":\"moderate_laxity\",\"label\":\"Moderate laxity\",\"severity\":2,\"is_critical\":false},{\"value\":\"gross_laxity\",\"label\":\"Gross \\/ pathological laxity\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,6,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(54,2,'Shoulder','Crepitus','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,7,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(55,2,'Shoulder','Effusion','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,8,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(56,2,'Elbow','Flexion','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,9,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(57,2,'Elbow','Extension','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,10,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(58,2,'Elbow','Pain on manipulation','select','[{\"value\":\"0\",\"label\":\"0 - None\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Moderate\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Severe\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,11,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(59,2,'Elbow','Instability','select','[{\"value\":\"stable\",\"label\":\"Stable\",\"severity\":0,\"is_critical\":false},{\"value\":\"mild_laxity\",\"label\":\"Mild laxity\",\"severity\":1,\"is_critical\":false},{\"value\":\"moderate_laxity\",\"label\":\"Moderate laxity\",\"severity\":2,\"is_critical\":false},{\"value\":\"gross_laxity\",\"label\":\"Gross \\/ pathological laxity\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,12,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(60,2,'Elbow','Crepitus','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,13,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(61,2,'Elbow','Effusion','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,14,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(62,2,'Carpus','Flexion','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,15,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(63,2,'Carpus','Extension','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,16,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(64,2,'Carpus','Pain on manipulation','select','[{\"value\":\"0\",\"label\":\"0 - None\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Moderate\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Severe\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,17,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(65,2,'Carpus','Instability','select','[{\"value\":\"stable\",\"label\":\"Stable\",\"severity\":0,\"is_critical\":false},{\"value\":\"mild_laxity\",\"label\":\"Mild laxity\",\"severity\":1,\"is_critical\":false},{\"value\":\"moderate_laxity\",\"label\":\"Moderate laxity\",\"severity\":2,\"is_critical\":false},{\"value\":\"gross_laxity\",\"label\":\"Gross \\/ pathological laxity\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,18,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(66,2,'Carpus','Crepitus','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,19,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(67,2,'Carpus','Effusion','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,20,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(68,2,'Hip','Flexion','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,21,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(69,2,'Hip','Extension','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,22,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(70,2,'Hip','Pain on manipulation','select','[{\"value\":\"0\",\"label\":\"0 - None\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Moderate\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Severe\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,23,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(71,2,'Hip','Instability','select','[{\"value\":\"stable\",\"label\":\"Stable\",\"severity\":0,\"is_critical\":false},{\"value\":\"mild_laxity\",\"label\":\"Mild laxity\",\"severity\":1,\"is_critical\":false},{\"value\":\"moderate_laxity\",\"label\":\"Moderate laxity\",\"severity\":2,\"is_critical\":false},{\"value\":\"gross_laxity\",\"label\":\"Gross \\/ pathological laxity\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,24,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(72,2,'Hip','Crepitus','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,25,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(73,2,'Hip','Effusion','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,26,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(74,2,'Stifle','Flexion','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,27,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(75,2,'Stifle','Extension','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,28,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(76,2,'Stifle','Pain on manipulation','select','[{\"value\":\"0\",\"label\":\"0 - None\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Moderate\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Severe\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,29,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(77,2,'Stifle','Instability','select','[{\"value\":\"stable\",\"label\":\"Stable\",\"severity\":0,\"is_critical\":false},{\"value\":\"mild_laxity\",\"label\":\"Mild laxity\",\"severity\":1,\"is_critical\":false},{\"value\":\"moderate_laxity\",\"label\":\"Moderate laxity\",\"severity\":2,\"is_critical\":false},{\"value\":\"gross_laxity\",\"label\":\"Gross \\/ pathological laxity\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,30,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(78,2,'Stifle','Crepitus','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,31,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(79,2,'Stifle','Effusion','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,32,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(80,2,'Hock','Flexion','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,33,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(81,2,'Hock','Extension','select','[{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"reduced\",\"label\":\"Reduced\",\"severity\":1,\"is_critical\":false},{\"value\":\"painful\",\"label\":\"Painful\",\"severity\":2,\"is_critical\":false},{\"value\":\"severe\",\"label\":\"Severely abnormal\",\"severity\":3,\"is_critical\":true},{\"value\":\"ne\",\"label\":\"Not examined\",\"severity\":0,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,34,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(82,2,'Hock','Pain on manipulation','select','[{\"value\":\"0\",\"label\":\"0 - None\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Mild\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Moderate\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Severe\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,35,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(83,2,'Hock','Instability','select','[{\"value\":\"stable\",\"label\":\"Stable\",\"severity\":0,\"is_critical\":false},{\"value\":\"mild_laxity\",\"label\":\"Mild laxity\",\"severity\":1,\"is_critical\":false},{\"value\":\"moderate_laxity\",\"label\":\"Moderate laxity\",\"severity\":2,\"is_critical\":false},{\"value\":\"gross_laxity\",\"label\":\"Gross \\/ pathological laxity\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,36,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(84,2,'Hock','Crepitus','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,37,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(85,2,'Hock','Effusion','yes_no','[{\"value\":\"no\",\"label\":\"No\",\"severity\":0,\"is_critical\":false},{\"value\":\"yes\",\"label\":\"Yes\",\"severity\":2,\"is_critical\":false}]',NULL,NULL,NULL,NULL,NULL,'lr',0,38,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(86,2,'Special Tests','Cranial drawer (stifle)','select','[{\"value\":\"negative\",\"label\":\"Negative\",\"severity\":0,\"is_critical\":false},{\"value\":\"partial\",\"label\":\"Partial (mild)\",\"severity\":2,\"is_critical\":false},{\"value\":\"positive\",\"label\":\"Positive\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,39,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(87,2,'Special Tests','Tibial thrust (stifle)','select','[{\"value\":\"negative\",\"label\":\"Negative\",\"severity\":0,\"is_critical\":false},{\"value\":\"positive\",\"label\":\"Positive\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,40,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(88,2,'Special Tests','Ortolani sign (hip)','select','[{\"value\":\"negative\",\"label\":\"Negative\",\"severity\":0,\"is_critical\":false},{\"value\":\"positive\",\"label\":\"Positive (subluxation)\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,41,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(89,2,'Special Tests','Patellar luxation grade','grade','[{\"value\":\"0\",\"label\":\"0 - Stable\",\"severity\":0,\"is_critical\":false},{\"value\":\"1\",\"label\":\"1 - Manual luxation, spontaneous reduction\",\"severity\":1,\"is_critical\":false},{\"value\":\"2\",\"label\":\"2 - Spontaneous luxation, manual reduction\",\"severity\":2,\"is_critical\":false},{\"value\":\"3\",\"label\":\"3 - Permanently luxated, manually reducible\",\"severity\":3,\"is_critical\":false},{\"value\":\"4\",\"label\":\"4 - Permanently luxated, not reducible\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'lr',0,42,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(90,2,'Measurements','Thigh circumference (cm)','measurement',NULL,'cm',NULL,NULL,NULL,NULL,'lr',0,43,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(91,2,'Measurements','Range of motion (degrees)','measurement',NULL,'deg',NULL,NULL,NULL,NULL,'lr',0,44,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(92,2,'Notes','Radiographs reviewed','select','[{\"value\":\"not_done\",\"label\":\"Not done\",\"severity\":0,\"is_critical\":false},{\"value\":\"normal\",\"label\":\"Normal\",\"severity\":0,\"is_critical\":false},{\"value\":\"abnormal\",\"label\":\"Abnormal\",\"severity\":2,\"is_critical\":false},{\"value\":\"fracture\",\"label\":\"Fracture\",\"severity\":3,\"is_critical\":true}]',NULL,NULL,NULL,NULL,NULL,'none',0,45,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(93,2,'Notes','Findings summary','text',NULL,NULL,NULL,NULL,NULL,NULL,'none',0,46,NULL,'2026-05-31 00:35:09','2026-05-31 00:35:09');
CREATE TABLE `vc_exam_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(120) NOT NULL,
  `kind` enum('general','specialist','breed') NOT NULL,
  `species_scope` varchar(30) NOT NULL DEFAULT 'all',
  `display_label` varchar(140) DEFAULT NULL,
  `icon` varchar(60) DEFAULT NULL,
  `colour` varchar(12) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_exam_tpl_lookup` (`business_id`,`kind`,`is_active`),
  KEY `vc_exam_templates_business_id_index` (`business_id`),
  KEY `vc_exam_templates_kind_index` (`kind`),
  KEY `vc_exam_templates_species_scope_index` (`species_scope`),
  KEY `vc_exam_templates_is_active_index` (`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_exam_templates` VALUES (1,NULL,'Standard General Exam','general','all','General Exam','fa-stethoscope','2980b9','Always-on head-to-tail physical exam template.',1,0,'2026-05-31 00:35:09','2026-05-31 00:35:09'),(2,NULL,'Orthopedic Exam','specialist','all','Orthopedic Exam','fa-bone','c0392b','Joint-by-joint orthopedic assessment with special tests.',1,10,'2026-05-31 00:35:09','2026-05-31 00:35:09');
CREATE TABLE `vc_imaging_modalities` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `code` varchar(10) NOT NULL,
  `name` varchar(80) NOT NULL,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_imaging_modalities_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_imaging_modalities` VALUES (1,NULL,'XR','X-Ray',1,'active','2026-05-28 23:57:42','2026-05-28 23:57:42'),(2,NULL,'US','Ultrasound',2,'active','2026-05-28 23:57:42','2026-05-28 23:57:42'),(3,NULL,'CT','CT scan',3,'active','2026-05-28 23:57:42','2026-05-28 23:57:42'),(4,NULL,'MR','MRI',4,'active','2026-05-28 23:57:42','2026-05-28 23:57:42'),(5,NULL,'ENDO','Endoscopy',5,'active','2026-05-28 23:57:42','2026-05-28 23:57:42');
CREATE TABLE `vc_imaging_requests` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `ref_no` varchar(30) NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `modality_id` int(10) unsigned NOT NULL,
  `body_region` varchar(120) DEFAULT NULL,
  `indication` text DEFAULT NULL,
  `priority` enum('routine','urgent','stat') NOT NULL DEFAULT 'routine',
  `status` enum('requested','in_progress','reported','cancelled') NOT NULL DEFAULT 'requested',
  `report` text DEFAULT NULL,
  `requested_by` int(10) unsigned DEFAULT NULL,
  `reported_by` int(10) unsigned DEFAULT NULL,
  `requested_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `reported_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_imaging_requests_ref_no_unique` (`ref_no`),
  KEY `vc_imaging_requests_business_id_index` (`business_id`),
  KEY `vc_imaging_requests_pet_id_index` (`pet_id`),
  KEY `vc_imaging_requests_appointment_id_index` (`appointment_id`),
  KEY `vc_imaging_requests_status_index` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_imaging_studies` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `imaging_request_id` int(10) unsigned NOT NULL,
  `study_uid` varchar(80) DEFAULT NULL,
  `file_path` varchar(255) NOT NULL,
  `original_name` varchar(191) DEFAULT NULL,
  `file_mime` varchar(100) DEFAULT NULL,
  `file_size` int(10) unsigned DEFAULT NULL,
  `thumb_path` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `uploaded_by` int(10) unsigned DEFAULT NULL,
  `uploaded_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_imaging_studies_imaging_request_id_index` (`imaging_request_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_medical_conditions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `category` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `icd_code` varchar(20) DEFAULT NULL,
  `is_chronic` tinyint(1) NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_medical_conditions_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_medical_conditions` VALUES (1,NULL,'Parvovirus','Infectious',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(2,NULL,'Distemper','Infectious',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(3,NULL,'Rabies','Infectious',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(4,NULL,'Kennel Cough','Respiratory',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(5,NULL,'Feline Leukemia','Infectious',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(6,NULL,'Diabetes Mellitus','Metabolic',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(7,NULL,'Obesity','Metabolic',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(8,NULL,'Arthritis','Musculoskeletal',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(9,NULL,'Hip Dysplasia','Musculoskeletal',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(10,NULL,'Dermatitis','Dermatology',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(11,NULL,'Mange','Dermatology',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(12,NULL,'Conjunctivitis','Ophthalmology',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(13,NULL,'Cataracts','Ophthalmology',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(14,NULL,'Urinary Tract Infection','Urinary',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(15,NULL,'Kidney Disease','Urinary',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(16,NULL,'Ear Infection','ENT',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(17,NULL,'Dental Disease','Dental',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(18,NULL,'Heartworm','Parasitic',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(19,NULL,'Ringworm','Parasitic',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(20,NULL,'Hypothyroidism','Endocrine',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(21,NULL,'Hyperthyroidism','Endocrine',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(22,NULL,'Epilepsy','Neurological',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(23,NULL,'Anemia','Hematological',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(24,NULL,'Liver Disease','Gastrointestinal',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(25,NULL,'Pancreatitis','Gastrointestinal',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(26,NULL,'Gastroenteritis','Gastrointestinal',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(27,NULL,'Allergies','Immunological',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(28,NULL,'Heart Disease','Cardiovascular',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(29,NULL,'Respiratory Infection','Respiratory',NULL,NULL,0,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(30,NULL,'Cancer / Tumor','Oncology',NULL,NULL,1,'active','2026-04-21 00:20:15','2026-04-21 00:20:15');
CREATE TABLE `vc_medical_reports` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `doctor_id` int(10) unsigned DEFAULT NULL,
  `report_type` enum('lab','xray','ultrasound','ecg','other') NOT NULL DEFAULT 'lab',
  `source` varchar(30) NOT NULL DEFAULT 'manual',
  `exam_key` varchar(100) DEFAULT NULL,
  `report_title` varchar(200) NOT NULL,
  `findings` text DEFAULT NULL,
  `attachments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attachments`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_medical_reports_pet_id_foreign` (`pet_id`),
  KEY `vc_medical_reports_business_id_pet_id_index` (`business_id`,`pet_id`),
  KEY `vc_medrep_apt_examkey_idx` (`appointment_id`,`exam_key`),
  CONSTRAINT `vc_medical_reports_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_medical_reports_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `vc_pets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_medical_reports` VALUES (17,10,NULL,70,6092,19,'','consultation',NULL,'Rex — Health Summary','Overall good body condition. Vaccinations up to date. Recommend annual wellness checkup.',NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(18,10,NULL,71,6093,20,'','consultation',NULL,'Luna — Health Summary','Overall good body condition. Vaccinations up to date. Recommend annual wellness checkup.',NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(19,10,NULL,72,6094,21,'','consultation',NULL,'Bella — Health Summary','Overall good body condition. Vaccinations up to date. Recommend annual wellness checkup.',NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_medicine_categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_medicine_categories_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_medicine_categories` VALUES (1,NULL,'Antibiotics',NULL,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(2,NULL,'Antiparasitic',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(3,NULL,'Vaccines',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(4,NULL,'Analgesics',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(5,NULL,'Anti-inflammatory',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(6,NULL,'Vitamins & Supplements',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(7,NULL,'Dermatology',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(8,NULL,'Ophthalmology',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(9,NULL,'Dental',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(10,NULL,'Cardiac',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(11,NULL,'Hormonal',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(12,NULL,'Gastrointestinal',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(13,NULL,'Respiratory',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(14,NULL,'Anesthetics',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(15,NULL,'Antifungal',NULL,'active','2026-04-21 00:20:16','2026-04-21 00:20:16'),(16,NULL,'Dewormers','Intestinal parasites','active','2026-05-02 11:55:39','2026-05-02 11:55:39'),(17,NULL,'NSAIDs & Analgesics','Pain relief and anti-inflammation','active','2026-05-02 11:55:39','2026-05-02 11:55:39'),(18,NULL,'Corticosteroids','Immune suppression and allergy','active','2026-05-02 11:55:39','2026-05-02 11:55:39'),(19,NULL,'Cardiac & Diuretics','Heart and fluid management','active','2026-05-02 11:55:39','2026-05-02 11:55:39'),(20,NULL,'Anaesthesia & Sedation','Surgical and procedural sedation','active','2026-05-02 11:55:39','2026-05-02 11:55:39');
CREATE TABLE `vc_medicines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `category_id` int(10) unsigned DEFAULT NULL,
  `product_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `generic_name` varchar(150) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `unit` varchar(50) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `controlled_schedule` varchar(30) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_medicines_category_id_foreign` (`category_id`),
  KEY `vc_medicines_business_id_status_index` (`business_id`,`status`),
  KEY `vc_medicines_controlled_schedule_index` (`controlled_schedule`),
  CONSTRAINT `vc_medicines_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_medicines_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `vc_medicine_categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=719 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_medicines` VALUES (479,10,1,15887,'Amoxicillin','Amoxicillin Trihydrate','Norbrook / Vétoquinol','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-20 20:54:04'),(480,10,1,NULL,'Amoxicillin + Clavulanate','Amoxicillin-Clavulanate','GSK / Zoetis','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(481,10,1,NULL,'Enrofloxacin','Enrofloxacin','Bayer (Baytril)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(482,10,1,NULL,'Metronidazole','Metronidazole','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(483,10,1,NULL,'Doxycycline','Doxycycline Hyclate','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(484,10,1,NULL,'Tylosin','Tylosin Tartrate','Elanco','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(485,10,1,NULL,'Oxytetracycline','Oxytetracycline HCl','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(486,10,1,NULL,'Ampicillin','Ampicillin Trihydrate','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(487,10,1,NULL,'Gentamicin','Gentamicin Sulfate','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(488,10,1,NULL,'Clindamycin','Clindamycin HCl','Pharmacia (Antirobe)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(489,10,1,NULL,'Trimethoprim-Sulfamethoxazole','TMP-SMX','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(490,10,1,NULL,'Chloramphenicol','Chloramphenicol','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(491,10,2,NULL,'Ivermectin','Ivermectin','MSD (Ivomec)','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(492,10,2,NULL,'Doramectin','Doramectin','Zoetis (Dectomax)','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(493,10,2,NULL,'Selamectin','Selamectin','Zoetis (Revolution)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(494,10,2,NULL,'Moxidectin','Moxidectin','Bayer (Advantage Multi)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(495,10,2,NULL,'Imidacloprid','Imidacloprid','Bayer (Advantage)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(496,10,2,NULL,'Fipronil','Fipronil','Merial (Frontline)','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(497,10,2,NULL,'Milbemycin Oxime','Milbemycin Oxime','Elanco (Sentinel)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(498,10,16,NULL,'Praziquantel','Praziquantel','Bayer (Droncit / Caniquantel)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(499,10,16,NULL,'Fenbendazole','Fenbendazole','MSD (Panacur)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(500,10,16,NULL,'Albendazole','Albendazole','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(501,10,16,NULL,'Pyrantel Pamoate','Pyrantel Pamoate','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(502,10,16,NULL,'Toltrazuril','Toltrazuril','Bayer (Baycox)','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(503,10,17,NULL,'Meloxicam','Meloxicam','Boehringer (Metacam)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(504,10,17,NULL,'Carprofen','Carprofen','Zoetis (Rimadyl)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(505,10,17,NULL,'Ketoprofen','Ketoprofen','Merial (Ketofen)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(506,10,17,NULL,'Flunixin Meglumine','Flunixin Meglumine','MSD (Finadyne)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(507,10,17,NULL,'Tramadol','Tramadol HCl','Generic','mg',NULL,'active','Schedule IV','2026-06-17 21:11:54','2026-06-17 21:11:55'),(508,10,17,NULL,'Butorphanol','Butorphanol Tartrate','Zoetis (Torbugesic)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(509,10,18,NULL,'Dexamethasone','Dexamethasone Sodium Phosphate','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(510,10,18,NULL,'Prednisolone','Prednisolone','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(511,10,18,NULL,'Methylprednisolone','Methylprednisolone','Pfizer (Depo-Medrol)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(512,10,18,NULL,'Betamethasone','Betamethasone','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(513,10,6,NULL,'Vitamin B Complex','Vitamin B1/B6/B12','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(514,10,6,NULL,'Vitamin C','Ascorbic Acid','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(515,10,6,NULL,'Vitamin D3','Cholecalciferol','Generic','IU',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(516,10,6,NULL,'Calcium Gluconate','Calcium Gluconate','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(517,10,6,NULL,'Iron Dextran','Iron Dextran','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(518,10,6,NULL,'Multivitamin Supplement','Multi-mineral + vitamins','Various','tab',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(519,10,12,NULL,'Metoclopramide','Metoclopramide HCl','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(520,10,12,NULL,'Maropitant','Maropitant Citrate','Zoetis (Cerenia)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(521,10,12,NULL,'Famotidine','Famotidine','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(522,10,12,NULL,'Omeprazole','Omeprazole','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(523,10,12,NULL,'Atropine Sulfate','Atropine Sulfate','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(524,10,12,NULL,'Kaolin-Pectin','Kaolin + Pectin','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(525,10,12,NULL,'Sucralfate','Sucralfate','Generic','tab',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(526,10,19,NULL,'Furosemide','Furosemide','Sanofi (Lasix)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(527,10,19,NULL,'Atenolol','Atenolol','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(528,10,19,NULL,'Digoxin','Digoxin','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(529,10,19,NULL,'Spironolactone','Spironolactone','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(530,10,19,NULL,'Pimobendan','Pimobendan','Boehringer (Vetmedin)','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(531,10,19,NULL,'Enalapril','Enalapril Maleate','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(532,10,7,NULL,'Chlorhexidine Solution','Chlorhexidine Gluconate 4%','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(533,10,7,NULL,'Miconazole Cream','Miconazole Nitrate 2%','Generic','g',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(534,10,7,NULL,'Betadine Solution','Povidone-Iodine 10%','Mundipharma','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(535,10,7,NULL,'Zinc Oxide Ointment','Zinc Oxide','Generic','g',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(536,10,15,NULL,'Ketoconazole','Ketoconazole','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(537,10,15,NULL,'Itraconazole','Itraconazole','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(538,10,15,NULL,'Fluconazole','Fluconazole','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(539,10,8,NULL,'Tobramycin Eye Drops','Tobramycin 0.3%','Alcon','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(540,10,8,NULL,'Chloramphenicol Eye Drops','Chloramphenicol 0.5%','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(541,10,8,NULL,'Atropine Eye Drops','Atropine Sulfate 1%','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(542,10,8,NULL,'Dexamethasone Eye Drops','Dexamethasone 0.1%','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(543,10,8,NULL,'Sodium Hyaluronate Drops','Sodium Hyaluronate 0.18%','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(544,10,20,NULL,'Ketamine','Ketamine HCl','Generic','ml',NULL,'active','Schedule III','2026-06-17 21:11:54','2026-06-17 21:11:55'),(545,10,20,NULL,'Xylazine','Xylazine HCl','Bayer (Rompun)','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(546,10,20,NULL,'Propofol','Propofol','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(547,10,20,NULL,'Lidocaine 2%','Lidocaine HCl','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(548,10,20,NULL,'Medetomidine','Medetomidine HCl','Orion (Domitor)','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(549,10,20,NULL,'Midazolam','Midazolam HCl','Generic','ml',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(550,10,11,NULL,'Oxytocin','Oxytocin','Generic','IU',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(551,10,11,NULL,'Progesterone','Progesterone','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(552,10,11,NULL,'Insulin (Bovine)','Bovine Insulin','Generic','IU',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(553,10,11,NULL,'Levothyroxine','Levothyroxine Sodium','Generic','mcg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(554,10,11,NULL,'Methimazole','Methimazole','Generic','mg',NULL,'active',NULL,'2026-06-17 21:11:54','2026-06-17 21:11:54'),(555,10,20,NULL,'Diazepam','Diazepam','Controlled / Restricted','ml','Controlled substance — register-tracked; store in locked cabinet.','active','Schedule IV','2026-06-17 21:11:55','2026-06-17 21:11:55'),(556,10,20,NULL,'Phenobarbital','Phenobarbital','Controlled / Restricted','mg','Controlled substance — register-tracked; store in locked cabinet.','active','Schedule IV','2026-06-17 21:11:55','2026-06-17 21:11:55'),(557,10,20,NULL,'Buprenorphine','Buprenorphine','Controlled / Restricted','ml','Controlled substance — register-tracked; store in locked cabinet.','active','Schedule III','2026-06-17 21:11:55','2026-06-17 21:11:55'),(558,10,20,NULL,'Morphine','Morphine Sulfate','Controlled / Restricted','mg','Controlled substance — register-tracked; store in locked cabinet.','active','Schedule II','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_module_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `key` varchar(100) NOT NULL,
  `value` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_module_settings_business_id_key_unique` (`business_id`,`key`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_pet_conditions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned NOT NULL,
  `condition_id` int(10) unsigned NOT NULL,
  `diagnosed_date` date DEFAULT NULL,
  `diagnosed_by` int(10) unsigned DEFAULT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `severity` enum('mild','moderate','severe') DEFAULT NULL,
  `status` enum('active','resolved','chronic') NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_pet_conditions_condition_id_foreign` (`condition_id`),
  KEY `vc_pet_conditions_pet_id_index` (`pet_id`),
  CONSTRAINT `vc_pet_conditions_condition_id_foreign` FOREIGN KEY (`condition_id`) REFERENCES `vc_medical_conditions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_pet_conditions_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `vc_pets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_pet_conditions` VALUES (8,14,30,'2026-06-16',NULL,NULL,'severe','chronic',NULL,'2026-06-16 15:56:04','2026-06-16 15:56:04');
CREATE TABLE `vc_pet_owner_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `emergency_contact_name` varchar(100) DEFAULT NULL,
  `emergency_contact_phone` varchar(30) DEFAULT NULL,
  `emergency_contact_relation` varchar(50) DEFAULT NULL,
  `occupation` varchar(100) DEFAULT NULL,
  `referred_by` varchar(100) DEFAULT NULL,
  `preferred_doctor_id` int(10) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `email_confirmed` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `email_confirm_token` varchar(100) DEFAULT NULL,
  `email_confirm_sent_at` timestamp NULL DEFAULT NULL,
  `is_blocked` tinyint(1) NOT NULL DEFAULT 0,
  `blocked_at` timestamp NULL DEFAULT NULL,
  `blocked_reason` text DEFAULT NULL,
  `blocked_by` int(10) unsigned DEFAULT NULL,
  `credit_limit_backup` decimal(14,2) DEFAULT NULL,
  `block_avg_rating` decimal(3,2) DEFAULT NULL,
  `block_rating_count` smallint(5) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_pet_owner_details_contact_id_unique` (`contact_id`),
  KEY `vc_pet_owner_details_business_id_index` (`business_id`),
  KEY `vc_pet_owner_details_preferred_doctor_id_index` (`preferred_doctor_id`),
  KEY `vc_pet_owner_details_is_blocked_index` (`is_blocked`),
  CONSTRAINT `vc_pet_owner_details_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_pet_owner_details_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_pet_owner_details` VALUES (53,10,6092,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(54,10,6093,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(55,10,6094,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(56,10,6095,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(57,10,6096,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(58,10,6097,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(59,10,6098,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(60,10,6099,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(61,10,6100,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(62,10,6101,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(63,10,6102,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(64,10,6103,'Family Contact','+201092288093','Relative',NULL,'Walk-in',NULL,NULL,0,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL);
CREATE TABLE `vc_pet_symptoms` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `pet_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `recorded_at` datetime NOT NULL,
  `body` text NOT NULL,
  `severity` enum('low','moderate','high','urgent') NOT NULL DEFAULT 'low',
  `photo_paths` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`photo_paths`)),
  `reply_by` bigint(20) unsigned DEFAULT NULL,
  `reply_body` text DEFAULT NULL,
  `replied_at` datetime DEFAULT NULL,
  `status` enum('open','answered','closed') NOT NULL DEFAULT 'open',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_pet_symptoms_business_id_pet_id_recorded_at_index` (`business_id`,`pet_id`,`recorded_at`),
  KEY `vc_pet_symptoms_business_id_status_index` (`business_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_pet_weights` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `pet_id` bigint(20) unsigned NOT NULL,
  `weight_kg` decimal(6,2) NOT NULL,
  `recorded_at` datetime NOT NULL,
  `source` enum('owner','clinic') NOT NULL DEFAULT 'owner',
  `recorded_by` bigint(20) unsigned DEFAULT NULL,
  `notes` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_pet_weights_business_id_pet_id_recorded_at_index` (`business_id`,`pet_id`,`recorded_at`)
) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_pet_weights` VALUES (114,10,70,29.58,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(115,10,70,31.53,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(116,10,71,3.82,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(117,10,71,4.07,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(118,10,72,25.48,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(119,10,72,27.16,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(120,10,73,6.19,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(121,10,73,6.60,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(122,10,74,10.92,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(123,10,74,11.64,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(124,10,75,0.41,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(125,10,75,0.44,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(126,10,76,40.95,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(127,10,76,43.65,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(128,10,77,3.55,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(129,10,77,3.78,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(130,10,78,27.30,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(131,10,78,29.10,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(132,10,79,1.64,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(133,10,79,1.75,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(134,10,80,5.01,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(135,10,80,5.34,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(136,10,81,28.21,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(137,10,81,30.07,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(138,10,82,0.08,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(139,10,82,0.09,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(140,10,83,6.55,'2026-03-20 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(141,10,83,6.98,'2026-05-19 00:11:55','owner',NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_pets` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `petname` varchar(100) NOT NULL,
  `species` varchar(50) DEFAULT NULL,
  `breed` varchar(100) DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `gender` enum('male','female','unknown') NOT NULL DEFAULT 'unknown',
  `dob` date DEFAULT NULL,
  `weight_kg` decimal(8,2) DEFAULT NULL,
  `bloodgroup` varchar(20) DEFAULT NULL,
  `microchip_no` varchar(50) DEFAULT NULL,
  `serial_no` varchar(50) DEFAULT NULL,
  `preferred_doctor_id` int(10) unsigned DEFAULT NULL,
  `neutered` tinyint(1) NOT NULL DEFAULT 0,
  `deceased` tinyint(1) NOT NULL DEFAULT 0,
  `deceased_date` date DEFAULT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `cert_verify_token` varchar(64) DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_pets_cert_verify_token_unique` (`cert_verify_token`),
  KEY `vc_pets_contact_id_foreign` (`contact_id`),
  KEY `vc_pets_business_id_contact_id_index` (`business_id`,`contact_id`),
  KEY `vc_pets_business_id_status_index` (`business_id`,`status`),
  KEY `vc_pets_preferred_doctor_id_index` (`preferred_doctor_id`),
  CONSTRAINT `vc_pets_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_pets_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_pets` VALUES (70,10,6092,'Rex','Dog','German Shepherd',NULL,'male','2025-06-18',32.50,NULL,'CHIP001000',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(71,10,6093,'Luna','Cat','Persian',NULL,'female','2024-05-18',4.20,NULL,'CHIP001001',NULL,NULL,1,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(72,10,6094,'Bella','Dog','Labrador',NULL,'female','2023-04-18',28.00,NULL,'CHIP001002',NULL,NULL,1,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(73,10,6095,'Simba','Cat','Maine Coon',NULL,'male','2022-03-18',6.80,NULL,'CHIP001003',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(74,10,6096,'Max','Dog','Beagle',NULL,'male','2021-02-18',12.00,NULL,'CHIP001004',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(75,10,6097,'Coco','Bird','African Grey Parrot',NULL,'female','2020-01-18',0.45,NULL,'CHIP001005',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(76,10,6098,'Rocky','Dog','Rottweiler',NULL,'male','2018-12-18',45.00,NULL,'CHIP001006',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(77,10,6099,'Misty','Cat','Siamese',NULL,'female','2017-11-18',3.90,NULL,'CHIP001007',NULL,NULL,1,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(78,10,6100,'Charlie','Dog','Golden Retriever',NULL,'male','2024-10-18',30.00,NULL,'CHIP001008',NULL,NULL,1,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(79,10,6101,'Daisy','Rabbit','Holland Lop',NULL,'female','2023-09-18',1.80,NULL,'CHIP001009',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(80,10,6102,'Shadow','Cat','British Shorthair',NULL,'male','2022-08-18',5.50,NULL,'CHIP001010',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(81,10,6103,'Bruno','Dog','Boxer',NULL,'male','2022-06-18',31.00,NULL,'CHIP001011',NULL,NULL,0,1,'2026-04-18',NULL,NULL,'inactive','2026-06-17 21:11:55','2026-06-17 21:11:55'),(82,10,6092,'Kiwi','Bird','Cockatiel',NULL,'male','2021-05-18',0.09,NULL,'CHIP001012',NULL,NULL,0,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(83,10,6093,'Nala','Dog','Poodle',NULL,'female','2020-04-18',7.20,NULL,'CHIP001013',NULL,NULL,1,0,NULL,NULL,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_preferred_doctor_history` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `old_doctor_id` int(10) unsigned DEFAULT NULL,
  `new_doctor_id` int(10) unsigned DEFAULT NULL,
  `changed_by` int(10) unsigned DEFAULT NULL,
  `source` enum('manual','doctor_change_request') NOT NULL DEFAULT 'manual',
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `reason` varchar(500) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_preferred_doctor_history_business_id_index` (`business_id`),
  KEY `vc_preferred_doctor_history_contact_id_index` (`contact_id`),
  KEY `vc_preferred_doctor_history_pet_id_index` (`pet_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_prescription_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `prescription_id` int(10) unsigned NOT NULL,
  `medicine_id` int(10) unsigned DEFAULT NULL,
  `medicine_name` varchar(150) NOT NULL,
  `dosage` varchar(100) DEFAULT NULL,
  `frequency` varchar(100) DEFAULT NULL,
  `duration_days` smallint(5) unsigned DEFAULT NULL,
  `instructions` text DEFAULT NULL,
  `quantity` smallint(5) unsigned NOT NULL DEFAULT 1,
  `purchase_line_id` int(10) unsigned DEFAULT NULL,
  `dispensed_qty` decimal(22,4) DEFAULT NULL,
  `dispensed_at` timestamp NULL DEFAULT NULL,
  `dispensed_by` int(10) unsigned DEFAULT NULL,
  `location_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_prescription_items_prescription_id_index` (`prescription_id`),
  CONSTRAINT `vc_prescription_items_prescription_id_foreign` FOREIGN KEY (`prescription_id`) REFERENCES `vc_prescriptions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_prescription_items` VALUES (47,24,479,'Amoxicillin','1 tablet','BID',7,'After meals',14,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(48,24,480,'Amoxicillin + Clavulanate','0.5 ml/kg','SID',7,'After meals',14,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(49,25,479,'Amoxicillin','1 tablet','BID',7,'After meals',14,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(50,25,480,'Amoxicillin + Clavulanate','0.5 ml/kg','SID',7,'After meals',14,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(51,26,479,'Amoxicillin','1 tablet','BID',7,'After meals',14,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(52,26,480,'Amoxicillin + Clavulanate','0.5 ml/kg','SID',7,'After meals',14,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_prescriptions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `ref_no` varchar(30) NOT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `doctor_id` int(10) unsigned DEFAULT NULL,
  `prescribed_date` date NOT NULL,
  `valid_until` date DEFAULT NULL,
  `diagnosis` text DEFAULT NULL,
  `status` enum('active','completed','cancelled') NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_prescriptions_ref_no_unique` (`ref_no`),
  KEY `vc_prescriptions_appointment_id_foreign` (`appointment_id`),
  KEY `vc_prescriptions_contact_id_foreign` (`contact_id`),
  KEY `vc_prescriptions_pet_id_foreign` (`pet_id`),
  KEY `vc_prescriptions_doctor_id_foreign` (`doctor_id`),
  KEY `vc_prescriptions_business_id_pet_id_index` (`business_id`,`pet_id`),
  CONSTRAINT `vc_prescriptions_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `vc_appointments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_prescriptions_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_prescriptions_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_prescriptions_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `vc_doctors` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_prescriptions_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `vc_pets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_prescriptions` VALUES (24,10,'RX-0001',83,6092,70,19,'2026-05-24','2026-06-23','Gastroenteritis (mild)','active','Give with food. Complete the full course.','2026-06-17 21:11:55','2026-06-17 21:11:55'),(25,10,'RX-0003',85,6094,72,21,'2026-06-06','2026-07-06','Gastroenteritis (mild)','active','Give with food. Complete the full course.','2026-06-17 21:11:55','2026-06-17 21:11:55'),(26,10,'RX-0004',86,6095,73,19,'2026-06-12','2026-07-12','Gastroenteritis (mild)','active','Give with food. Complete the full course.','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_quotation_meta` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `transaction_id` int(10) unsigned NOT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `approval_token` varchar(64) DEFAULT NULL,
  `status` enum('draft','sent','viewed','approved','rejected','expired') NOT NULL DEFAULT 'draft',
  `sent_at` timestamp NULL DEFAULT NULL,
  `viewed_at` timestamp NULL DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `approved_by_name` varchar(191) DEFAULT NULL,
  `approval_ip` varchar(45) DEFAULT NULL,
  `approval_signature_path` varchar(255) DEFAULT NULL,
  `rejected_at` timestamp NULL DEFAULT NULL,
  `rejection_reason` text DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `converted_sell_id` int(10) unsigned DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_quotation_meta_transaction_id_unique` (`transaction_id`),
  UNIQUE KEY `vc_quotation_meta_approval_token_unique` (`approval_token`),
  KEY `vc_quotation_meta_business_id_index` (`business_id`),
  KEY `vc_quotation_meta_appointment_id_index` (`appointment_id`),
  KEY `vc_quotation_meta_pet_id_index` (`pet_id`),
  KEY `vc_quotation_meta_status_index` (`status`),
  KEY `vc_quotation_meta_converted_sell_id_index` (`converted_sell_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_reminder_logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `vaccination_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `channel` enum('email','wa') NOT NULL DEFAULT 'email',
  `template_type` enum('email_due','email_overdue','wa_due','wa_overdue') NOT NULL,
  `sent_to` varchar(255) DEFAULT NULL COMMENT 'Email or phone number used',
  `status` enum('sent','failed') NOT NULL DEFAULT 'sent',
  `error_message` text DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_reminder_logs_vaccination_id_channel_template_type_index` (`vaccination_id`,`channel`,`template_type`),
  KEY `vc_reminder_logs_business_id_sent_at_index` (`business_id`,`sent_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_reminder_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `is_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `days_before_due` tinyint(3) unsigned NOT NULL DEFAULT 7 COMMENT 'Send reminder X days before the scheduled vaccine date',
  `send_overdue` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Also send reminders for overdue vaccinations',
  `overdue_reminder_interval` tinyint(3) unsigned NOT NULL DEFAULT 7 COMMENT 'Re-send overdue reminder every X days (0 = only once)',
  `max_reminders_per_vaccine` tinyint(3) unsigned NOT NULL DEFAULT 3 COMMENT 'Maximum reminder emails per vaccination record',
  `email_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `sms_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `wa_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `schedule_time` varchar(5) NOT NULL DEFAULT '08:00' COMMENT 'Preferred time to run daily reminders (HH:MM, display only)',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_reminder_settings_business_id_unique` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_reminder_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL COMMENT 'NULL = system default, set to business_id for customised copy',
  `type` enum('email_due','email_overdue','wa_due','wa_overdue','sms_due','sms_overdue') NOT NULL,
  `name` varchar(100) NOT NULL,
  `subject` varchar(255) DEFAULT NULL COMMENT 'Email subject (null for WA)',
  `body` text NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_system_default` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_reminder_templates` VALUES (1,NULL,'email_due','Default — Vaccination Due Soon','Vaccination Reminder for {{pet_name}} — {{vaccine_name}}','Dear {{owner_name}},\n\nThis is a friendly reminder that your pet {{pet_name}} ({{pet_species}}) is due for the {{vaccine_name}} vaccination on {{due_date}}.\n\nThat\'s in {{days_until_due}} — please contact us to schedule an appointment at your earliest convenience.\n\nClinic: {{clinic_name}}\nPhone: {{clinic_phone}}\nEmail: {{clinic_email}}\n\nThank you for keeping {{pet_name}} healthy!\n\nBest regards,\n{{clinic_name}}',1,1,'2026-05-02 01:27:50','2026-05-02 01:27:50'),(2,NULL,'email_overdue','Default — Vaccination Overdue','OVERDUE: {{pet_name}} missed their {{vaccine_name}} vaccination','Dear {{owner_name}},\n\nWe noticed that {{pet_name}} ({{pet_species}}) missed their {{vaccine_name}} vaccination that was due on {{due_date}} ({{days_until_due}}).\n\nDelayed vaccinations can put your pet at risk. Please contact us as soon as possible to reschedule.\n\nClinic: {{clinic_name}}\nPhone: {{clinic_phone}}\nEmail: {{clinic_email}}\n\nBest regards,\n{{clinic_name}}',1,1,'2026-05-02 01:27:50','2026-05-02 01:27:50'),(3,NULL,'wa_due','Default WhatsApp — Vaccination Due Soon',NULL,'Hello {{owner_name}} 👋\n\nThis is a reminder from {{clinic_name}} that your pet *{{pet_name}}* is due for the *{{vaccine_name}}* vaccination on *{{due_date}}* (in {{days_until_due}}).\n\nPlease call us on {{clinic_phone}} to book an appointment.\n\nThank you! 🐾',1,1,'2026-05-02 01:27:50','2026-05-02 01:27:50'),(4,NULL,'wa_overdue','Default WhatsApp — Vaccination Overdue',NULL,'Hello {{owner_name}} 👋\n\n⚠️ *Important:* Your pet *{{pet_name}}* missed their *{{vaccine_name}}* vaccination (was due {{due_date}} — {{days_until_due}}).\n\nPlease contact {{clinic_name}} urgently to reschedule.\n📞 {{clinic_phone}}\n\nThank you for keeping {{pet_name}} safe! 🐾',1,1,'2026-05-02 01:27:50','2026-05-02 01:27:50'),(5,NULL,'sms_due','SMS — Vaccine due',NULL,'Hi {{owner_name}}, this is a reminder that {{pet_name}}\'s {{vaccine_name}} is due on {{due_date}}. Please book at {{clinic_name}} on {{clinic_phone}}.',1,1,'2026-05-28 23:57:42','2026-05-28 23:57:42'),(6,NULL,'sms_overdue','SMS — Vaccine overdue',NULL,'Hi {{owner_name}}, {{pet_name}}\'s {{vaccine_name}} is now {{days_until_due}}. Please call {{clinic_name}} on {{clinic_phone}} to schedule.',1,1,'2026-05-28 23:57:42','2026-05-28 23:57:42');
CREATE TABLE `vc_role_landing_pages` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `role_id` bigint(20) unsigned NOT NULL,
  `landing_url` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_role_landing_pages_business_id_role_id_unique` (`business_id`,`role_id`),
  KEY `vc_role_landing_pages_business_id_index` (`business_id`),
  KEY `vc_role_landing_pages_role_id_index` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_role_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `role_id` bigint(20) unsigned NOT NULL,
  `key` varchar(60) NOT NULL,
  `value` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_role_settings_business_id_role_id_key_unique` (`business_id`,`role_id`,`key`),
  KEY `vc_role_settings_business_id_index` (`business_id`),
  KEY `vc_role_settings_role_id_index` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_soap_options` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `section` enum('complaint','lab_test','exam_test','frequency','body_system') NOT NULL,
  `species` varchar(20) NOT NULL DEFAULT 'all',
  `group_name` varchar(60) DEFAULT NULL,
  `label` varchar(120) NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_soap_options_business_id_index` (`business_id`),
  KEY `vc_soap_options_product_id_index` (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=154 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_soap_options` VALUES (1,NULL,'complaint','all',NULL,'Vomiting',NULL,0,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(2,NULL,'complaint','all',NULL,'Diarrhea',NULL,1,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(3,NULL,'complaint','all',NULL,'Not eating',NULL,2,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(4,NULL,'complaint','all',NULL,'Lethargy',NULL,3,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(5,NULL,'complaint','all',NULL,'Weight loss',NULL,4,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(6,NULL,'complaint','all',NULL,'Limping',NULL,5,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(7,NULL,'complaint','all',NULL,'Itching',NULL,6,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(8,NULL,'complaint','all',NULL,'Coughing',NULL,7,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(9,NULL,'complaint','all',NULL,'Sneezing',NULL,8,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(10,NULL,'complaint','all',NULL,'Eye discharge',NULL,9,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(11,NULL,'complaint','all',NULL,'Nasal discharge',NULL,10,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(12,NULL,'complaint','all',NULL,'Breathing difficulty',NULL,11,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(13,NULL,'complaint','all',NULL,'Seizure',NULL,12,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(14,NULL,'complaint','all',NULL,'Bloody stool',NULL,13,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(15,NULL,'complaint','all',NULL,'Excessive thirst',NULL,14,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(16,NULL,'complaint','dog',NULL,'Excessive barking',NULL,15,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(17,NULL,'complaint','dog',NULL,'Pawing at ears',NULL,16,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(18,NULL,'complaint','dog',NULL,'Dragging hindquarters',NULL,17,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(19,NULL,'complaint','dog',NULL,'Licking paws',NULL,18,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(20,NULL,'complaint','dog',NULL,'Collar rubbing',NULL,19,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(21,NULL,'complaint','dog',NULL,'Anal scooting',NULL,20,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(22,NULL,'complaint','cat',NULL,'Hiding',NULL,21,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(23,NULL,'complaint','cat',NULL,'Over-grooming',NULL,22,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(24,NULL,'complaint','cat',NULL,'Straining to urinate',NULL,23,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(25,NULL,'complaint','cat',NULL,'Hairballs',NULL,24,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(26,NULL,'complaint','cat',NULL,'Chin acne',NULL,25,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(27,NULL,'complaint','cat',NULL,'Drooling',NULL,26,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(28,NULL,'complaint','rabbit',NULL,'GI stasis',NULL,27,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(29,NULL,'complaint','rabbit',NULL,'Head tilt',NULL,28,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(30,NULL,'complaint','rabbit',NULL,'Dental issues',NULL,29,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(31,NULL,'complaint','rabbit',NULL,'Hair loss',NULL,30,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(32,NULL,'complaint','rabbit',NULL,'Myiasis',NULL,31,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(33,NULL,'complaint','rabbit',NULL,'Anorexia',NULL,32,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(34,NULL,'complaint','bird',NULL,'Feather plucking',NULL,33,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(35,NULL,'complaint','bird',NULL,'Fluffed feathers',NULL,34,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(36,NULL,'complaint','bird',NULL,'Regurgitation',NULL,35,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(37,NULL,'complaint','bird',NULL,'Tail bobbing',NULL,36,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(38,NULL,'complaint','bird',NULL,'Voice change',NULL,37,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(39,NULL,'complaint','bird',NULL,'Beak malformation',NULL,38,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(40,NULL,'lab_test','all',NULL,'CBC (Complete Blood Count)',NULL,0,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(41,NULL,'lab_test','all',NULL,'Blood Glucose',NULL,1,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(42,NULL,'lab_test','all',NULL,'Urinalysis',NULL,2,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(43,NULL,'lab_test','all',NULL,'Liver Panel (ALT/AST/ALP)',NULL,3,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(44,NULL,'lab_test','all',NULL,'Kidney Panel (BUN/Creatinine)',NULL,4,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(45,NULL,'lab_test','all',NULL,'Thyroid (T4)',NULL,5,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(46,NULL,'lab_test','all',NULL,'Culture & Sensitivity',NULL,6,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(47,NULL,'lab_test','all',NULL,'Fecal Float',NULL,7,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(48,NULL,'lab_test','all',NULL,'Direct Smear',NULL,8,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(49,NULL,'lab_test','all',NULL,'Stool Exam',NULL,9,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(50,NULL,'lab_test','all',NULL,'Electrolytes',NULL,10,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(51,NULL,'lab_test','all',NULL,'Serum Protein',NULL,11,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(52,NULL,'lab_test','all',NULL,'Coagulation Panel',NULL,12,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(53,NULL,'lab_test','all',NULL,'Blood Pressure',NULL,13,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(54,NULL,'lab_test','dog',NULL,'Heartworm Antigen Test',NULL,14,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(55,NULL,'lab_test','dog',NULL,'Brucellosis Test',NULL,15,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(56,NULL,'lab_test','dog',NULL,'Parvovirus PCR',NULL,16,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(57,NULL,'lab_test','dog',NULL,'Distemper Titer',NULL,17,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(58,NULL,'lab_test','dog',NULL,'Lyme SNAP Test',NULL,18,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(59,NULL,'lab_test','dog',NULL,'Ehrlichia/Anaplasma Panel',NULL,19,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(60,NULL,'lab_test','cat',NULL,'FeLV/FIV Combo Test',NULL,20,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(61,NULL,'lab_test','cat',NULL,'Feline Panleukopenia PCR',NULL,21,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(62,NULL,'lab_test','cat',NULL,'Corona Virus Titer',NULL,22,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(63,NULL,'lab_test','cat',NULL,'Bile Acids',NULL,23,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(64,NULL,'lab_test','cat',NULL,'Toxoplasmosis Titer',NULL,24,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(65,NULL,'lab_test','rabbit',NULL,'E. cuniculi Titer',NULL,25,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(66,NULL,'lab_test','rabbit',NULL,'Rabbit Calicivirus Titer',NULL,26,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(67,NULL,'lab_test','rabbit',NULL,'Myxomatosis Titer',NULL,27,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(68,NULL,'lab_test','bird',NULL,'Chlamydophila PCR',NULL,28,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(69,NULL,'lab_test','bird',NULL,'Gram Stain',NULL,29,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(70,NULL,'lab_test','bird',NULL,'Newcastle Disease Titer',NULL,30,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(71,NULL,'lab_test','bird',NULL,'Polyomavirus PCR',NULL,31,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(72,NULL,'lab_test','bird',NULL,'PBFD PCR',NULL,32,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(73,NULL,'exam_test','all',NULL,'X-Ray (Radiograph)',NULL,0,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(74,NULL,'exam_test','all',NULL,'Ultrasound',NULL,1,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(75,NULL,'exam_test','all',NULL,'Otoscopy',NULL,2,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(76,NULL,'exam_test','all',NULL,'Ophthalmoscopy',NULL,3,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(77,NULL,'exam_test','all',NULL,'ECG',NULL,4,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(78,NULL,'exam_test','all',NULL,'Biopsy',NULL,5,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(79,NULL,'exam_test','all',NULL,'Fine Needle Aspirate',NULL,6,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(80,NULL,'exam_test','all',NULL,'Blood Pressure Measurement',NULL,7,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(81,NULL,'exam_test','dog',NULL,'Skin Scraping',NULL,8,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(82,NULL,'exam_test','dog',NULL,'Vaginal Cytology',NULL,9,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(83,NULL,'exam_test','dog',NULL,'Rectal Exam',NULL,10,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(84,NULL,'exam_test','dog',NULL,'Hip Evaluation (PennHIP)',NULL,11,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(85,NULL,'exam_test','dog',NULL,'Joint Fluid Analysis',NULL,12,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(86,NULL,'exam_test','cat',NULL,'Tonometry (Eye Pressure)',NULL,13,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(87,NULL,'exam_test','cat',NULL,'Rectal Exam',NULL,14,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(88,NULL,'exam_test','cat',NULL,'Thoracocentesis',NULL,15,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(89,NULL,'exam_test','rabbit',NULL,'Dental X-Ray',NULL,16,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(90,NULL,'exam_test','rabbit',NULL,'Skull X-Ray',NULL,17,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(91,NULL,'exam_test','rabbit',NULL,'Slit Lamp Exam',NULL,18,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(92,NULL,'exam_test','bird',NULL,'Endoscopy',NULL,19,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(93,NULL,'exam_test','bird',NULL,'Laparoscopy',NULL,20,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(94,NULL,'exam_test','bird',NULL,'Crop Flush',NULL,21,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(95,NULL,'frequency','all',NULL,'Once daily',NULL,0,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(96,NULL,'frequency','all',NULL,'Twice daily (BID)',NULL,1,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(97,NULL,'frequency','all',NULL,'3× daily (TID)',NULL,2,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(98,NULL,'frequency','all',NULL,'4× daily (QID)',NULL,3,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(99,NULL,'frequency','all',NULL,'Every 8 hours',NULL,4,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(100,NULL,'frequency','all',NULL,'Every 12 hours',NULL,5,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(101,NULL,'frequency','all',NULL,'Every 48 hours',NULL,6,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(102,NULL,'frequency','all',NULL,'As needed (PRN)',NULL,7,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(103,NULL,'frequency','all',NULL,'Single dose',NULL,8,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(104,NULL,'frequency','all',NULL,'Weekly',NULL,9,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(105,NULL,'frequency','all',NULL,'Bi-weekly',NULL,10,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(106,NULL,'frequency','all',NULL,'Monthly',NULL,11,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(107,NULL,'frequency','all',NULL,'With food',NULL,12,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(108,NULL,'frequency','all',NULL,'Without food',NULL,13,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(109,NULL,'frequency','all',NULL,'Before meals',NULL,14,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(110,NULL,'frequency','all',NULL,'After meals',NULL,15,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(111,NULL,'body_system','all','Cardio-Respiratory','Cardiovascular',NULL,0,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(112,NULL,'body_system','all','Cardio-Respiratory','Respiratory',NULL,1,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(113,NULL,'body_system','all','Digestive & Metabolic','Gastrointestinal',NULL,2,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(114,NULL,'body_system','all','Musculo-Neurological','Musculoskeletal',NULL,5,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(115,NULL,'body_system','all','Musculo-Neurological','Neurological',NULL,6,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(116,NULL,'body_system','all','Integumentary & Sensory','Dermatological',NULL,7,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(117,NULL,'body_system','all','Integumentary & Sensory','Ophthalmological',NULL,8,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(118,NULL,'body_system','all','Integumentary & Sensory','Ears / ENT',NULL,9,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(119,NULL,'body_system','all','Urogenital & Lymphatic','Urogenital',NULL,10,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(120,NULL,'body_system','all','Urogenital & Lymphatic','Lymphatic',NULL,11,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(121,NULL,'body_system','all','Digestive & Metabolic','Endocrine',NULL,3,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(122,NULL,'body_system','all','Digestive & Metabolic','Dental / Oral',NULL,4,'active','2026-04-29 02:24:10','2026-04-29 02:24:10'),(130,NULL,'complaint','all',NULL,'Hypothermia (low temp)',NULL,39,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(131,NULL,'complaint','all',NULL,'Fever / hyperthermia',NULL,40,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(132,NULL,'complaint','all',NULL,'Collapse / syncope',NULL,41,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(133,NULL,'complaint','all',NULL,'Pale gums',NULL,42,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(134,NULL,'complaint','all',NULL,'Cyanosis (blue gums)',NULL,43,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(135,NULL,'complaint','all',NULL,'Icterus (jaundice)',NULL,44,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(136,NULL,'complaint','all',NULL,'Anuria / not urinating',NULL,45,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(137,NULL,'complaint','all',NULL,'Polyuria (increased urine)',NULL,46,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(138,NULL,'complaint','all',NULL,'Polydipsia (increased thirst)',NULL,47,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(139,NULL,'complaint','all',NULL,'Haematuria (blood in urine)',NULL,48,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(140,NULL,'complaint','all',NULL,'Urinary incontinence',NULL,49,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(141,NULL,'complaint','all',NULL,'Anorexia (won\'t eat)',NULL,50,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(142,NULL,'complaint','all',NULL,'Hyporexia (eating less)',NULL,51,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(143,NULL,'complaint','all',NULL,'Regurgitation',NULL,52,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(144,NULL,'complaint','all',NULL,'Constipation',NULL,53,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(145,NULL,'complaint','all',NULL,'Tenesmus (straining to defecate)',NULL,54,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(146,NULL,'complaint','all',NULL,'Hypersalivation / drooling',NULL,55,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(147,NULL,'complaint','all',NULL,'Dehydration',NULL,56,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(148,NULL,'complaint','all',NULL,'Hiding / withdrawn',NULL,57,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(149,NULL,'complaint','all',NULL,'Vocalising in pain',NULL,58,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(150,NULL,'complaint','all',NULL,'Disorientation / confusion',NULL,59,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(151,NULL,'complaint','all',NULL,'Head pressing',NULL,60,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(152,NULL,'complaint','all',NULL,'Open-mouth breathing',NULL,61,'active','2026-06-01 12:20:58','2026-06-01 12:20:58'),(153,NULL,'complaint','all',NULL,'Skin mass / lump',NULL,62,'active','2026-06-01 12:20:58','2026-06-01 12:20:58');
CREATE TABLE `vc_system_findings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `system_key` varchar(40) NOT NULL,
  `value` varchar(60) NOT NULL,
  `label` varchar(160) NOT NULL,
  `supports_severity` tinyint(1) NOT NULL DEFAULT 0,
  `supports_lr` tinyint(1) NOT NULL DEFAULT 0,
  `is_critical` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vc_sysf_uniq` (`business_id`,`system_key`,`value`),
  KEY `vc_system_findings_business_id_index` (`business_id`),
  KEY `vc_system_findings_system_key_index` (`system_key`),
  KEY `vc_system_findings_is_critical_index` (`is_critical`),
  KEY `vc_system_findings_status_index` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_vaccinations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `vaccine_type_id` int(10) unsigned NOT NULL,
  `dose` varchar(100) DEFAULT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `medicine_id` int(10) unsigned DEFAULT NULL,
  `batch_no` varchar(50) DEFAULT NULL,
  `administered_date` date NOT NULL,
  `next_due_date` date DEFAULT NULL,
  `administered_by` int(10) unsigned DEFAULT NULL,
  `weight_at_time` decimal(8,2) DEFAULT NULL,
  `temperature_at_time` decimal(5,2) DEFAULT NULL,
  `status` enum('scheduled','administered','overdue','cancelled') NOT NULL DEFAULT 'administered',
  `taken_status` enum('taken_in','taken_out','not_taken') DEFAULT NULL COMMENT 'taken_in=at clinic, taken_out=external, not_taken=scheduled/not yet given',
  `reminder_sent` tinyint(1) NOT NULL DEFAULT 0,
  `waived_at` timestamp NULL DEFAULT NULL,
  `waived_reason` varchar(191) DEFAULT NULL,
  `waived_note` varchar(191) DEFAULT NULL,
  `waived_by` bigint(20) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `billed_sell_line_id` bigint(20) unsigned DEFAULT NULL,
  `billed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_vaccinations_pet_id_foreign` (`pet_id`),
  KEY `vc_vaccinations_contact_id_foreign` (`contact_id`),
  KEY `vc_vaccinations_vaccine_type_id_foreign` (`vaccine_type_id`),
  KEY `vc_vaccinations_appointment_id_foreign` (`appointment_id`),
  KEY `vc_vaccinations_business_id_pet_id_index` (`business_id`,`pet_id`),
  KEY `vc_vaccinations_business_id_next_due_date_index` (`business_id`,`next_due_date`),
  KEY `vc_vaccinations_billed_sell_line_id_index` (`billed_sell_line_id`),
  CONSTRAINT `vc_vaccinations_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `vc_appointments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `vc_vaccinations_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_vaccinations_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_vaccinations_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `vc_pets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vc_vaccinations_vaccine_type_id_foreign` FOREIGN KEY (`vaccine_type_id`) REFERENCES `vc_vaccine_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_vaccinations` VALUES (63,10,70,6092,1,'1 ml',NULL,NULL,NULL,'2025-07-18','2026-07-18',196,NULL,NULL,'administered','',0,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(64,10,72,6094,1,'1 ml',NULL,NULL,NULL,'2025-07-24','2026-07-24',196,NULL,NULL,'administered','',0,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(65,10,74,6096,1,'1 ml',NULL,NULL,NULL,'2025-07-30','2026-07-30',196,NULL,NULL,'administered','',0,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(66,10,76,6098,1,'1 ml',NULL,NULL,NULL,'2025-08-05','2026-08-05',196,NULL,NULL,'administered','',0,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(67,10,78,6100,1,'1 ml',NULL,NULL,NULL,'2025-08-11','2026-08-11',196,NULL,NULL,'administered','',0,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(68,10,80,6102,1,'1 ml',NULL,NULL,NULL,'2025-08-17','2026-08-17',196,NULL,NULL,'administered','',0,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL),(69,10,82,6092,1,'1 ml',NULL,NULL,NULL,'2025-08-23','2026-08-23',196,NULL,NULL,'administered','',0,NULL,NULL,NULL,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55',NULL,NULL);
CREATE TABLE `vc_vaccine_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `manufacturer` varchar(100) DEFAULT NULL,
  `category` enum('core_vaccine','non_core_vaccine','spot_on','deworming','oral','nasal','topical','preventive','other') NOT NULL DEFAULT 'core_vaccine',
  `species_target` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`species_target`)),
  `description` text DEFAULT NULL,
  `valid_for_months` smallint(5) unsigned NOT NULL DEFAULT 12,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_vaccine_types_business_id_status_index` (`business_id`,`status`),
  KEY `vc_vaccine_types_product_id_index` (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_vaccine_types` VALUES (1,NULL,'Rabies (Dog)',NULL,NULL,'core_vaccine','[\"dog\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(2,NULL,'Rabies (Cat)',NULL,NULL,'core_vaccine','[\"cat\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(3,NULL,'DHPP (Distemper/Hepatitis/Parvo/Parainfluenza)',NULL,NULL,'core_vaccine','[\"dog\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(4,NULL,'Bordetella (Kennel Cough)',NULL,NULL,'core_vaccine','[\"dog\"]',NULL,6,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(5,NULL,'Leptospirosis',NULL,NULL,'core_vaccine','[\"dog\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(6,NULL,'Lyme Disease',NULL,NULL,'core_vaccine','[\"dog\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(7,NULL,'Canine Influenza',NULL,NULL,'core_vaccine','[\"dog\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(8,NULL,'Parvovirus',NULL,NULL,'core_vaccine','[\"dog\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(9,NULL,'Feline FVRCP (Distemper)',NULL,NULL,'core_vaccine','[\"cat\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(10,NULL,'Feline Leukemia (FeLV)',NULL,NULL,'core_vaccine','[\"cat\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(11,NULL,'Feline Chlamydophila',NULL,NULL,'core_vaccine','[\"cat\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(12,NULL,'Myxomatosis (Rabbit)',NULL,NULL,'core_vaccine','[\"rabbit\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(13,NULL,'Rabbit Haemorrhagic Disease (RHD)',NULL,NULL,'core_vaccine','[\"rabbit\"]',NULL,12,'active','2026-04-21 00:20:15','2026-04-21 00:20:15'),(15,NULL,'Myxomatosis',NULL,NULL,'core_vaccine','[\"rabbit\"]',NULL,12,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(16,NULL,'Frontline Spot-on (Dog)',NULL,NULL,'spot_on','[\"dog\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(17,NULL,'Frontline Spot-on (Cat)',NULL,NULL,'spot_on','[\"cat\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(18,NULL,'Advocate (Dog)',NULL,NULL,'spot_on','[\"dog\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(19,NULL,'Advocate (Cat)',NULL,NULL,'spot_on','[\"cat\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(20,NULL,'Revolution / Stronghold',NULL,NULL,'spot_on','[\"dog\",\"cat\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(21,NULL,'Bravecto Spot-on',NULL,NULL,'spot_on','[\"dog\",\"cat\"]',NULL,3,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(22,NULL,'Milbemax (Dog)',NULL,NULL,'deworming','[\"dog\"]',NULL,3,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(23,NULL,'Milbemax (Cat)',NULL,NULL,'deworming','[\"cat\"]',NULL,3,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(24,NULL,'Drontal (Dog)',NULL,NULL,'deworming','[\"dog\"]',NULL,3,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(25,NULL,'Drontal (Cat)',NULL,NULL,'deworming','[\"cat\"]',NULL,3,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(26,NULL,'Panacur / Fenbendazole',NULL,NULL,'deworming','[\"dog\",\"cat\",\"rabbit\"]',NULL,3,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(27,NULL,'Interceptor (Heartworm + Intestinal)',NULL,NULL,'deworming','[\"dog\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(28,NULL,'Bravecto Oral (Flea & Tick)',NULL,NULL,'oral','[\"dog\"]',NULL,3,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(29,NULL,'Nexgard (Flea & Tick)',NULL,NULL,'oral','[\"dog\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(30,NULL,'Simparica',NULL,NULL,'oral','[\"dog\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(31,NULL,'Credelio (Flea & Tick)',NULL,NULL,'oral','[\"dog\",\"cat\"]',NULL,1,'active','2026-04-21 15:44:55','2026-04-21 15:44:55'),(32,NULL,'Bordetella Intranasal',NULL,NULL,'nasal','[\"dog\"]',NULL,12,'active','2026-04-21 15:44:55','2026-04-21 15:44:55');
CREATE TABLE `vc_vital_ranges` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned DEFAULT NULL,
  `species` varchar(40) NOT NULL,
  `life_stage` enum('pediatric','adult','senior','all') NOT NULL DEFAULT 'all',
  `temperature_low` decimal(5,2) DEFAULT NULL,
  `temperature_high` decimal(5,2) DEFAULT NULL,
  `heart_rate_low` smallint(5) unsigned DEFAULT NULL,
  `heart_rate_high` smallint(5) unsigned DEFAULT NULL,
  `respiratory_rate_low` smallint(5) unsigned DEFAULT NULL,
  `respiratory_rate_high` smallint(5) unsigned DEFAULT NULL,
  `weight_low_kg` decimal(6,2) DEFAULT NULL,
  `weight_high_kg` decimal(6,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_vital_ranges_business_id_index` (`business_id`),
  KEY `vc_vital_ranges_species_index` (`species`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_vital_ranges` VALUES (1,NULL,'canine','all',38.30,39.20,60,140,10,30,NULL,NULL,'2026-05-28 23:57:42','2026-05-28 23:57:42'),(2,NULL,'canine','pediatric',38.50,39.50,80,220,15,35,NULL,NULL,'2026-05-28 23:57:42','2026-05-28 23:57:42'),(3,NULL,'feline','all',38.00,39.20,140,220,16,40,NULL,NULL,'2026-05-28 23:57:42','2026-05-28 23:57:42'),(4,NULL,'feline','pediatric',38.00,39.50,200,260,20,45,NULL,NULL,'2026-05-28 23:57:42','2026-05-28 23:57:42'),(5,NULL,'canine','adult',38.30,39.20,60,140,10,30,NULL,NULL,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(6,NULL,'canine','senior',37.80,39.00,50,130,8,28,NULL,NULL,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(7,NULL,'canine_toy','adult',38.30,39.20,90,160,15,35,0.50,5.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(8,NULL,'canine_small','adult',38.30,39.20,80,140,15,35,5.00,10.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(9,NULL,'canine_med','adult',38.30,39.20,70,120,10,30,10.00,25.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(10,NULL,'canine_large','adult',38.30,39.20,60,100,10,30,25.00,45.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(11,NULL,'canine_giant','adult',38.30,39.20,50,90,10,30,45.00,90.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(12,NULL,'feline','adult',38.00,39.20,140,220,16,40,2.50,6.50,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(13,NULL,'feline','senior',37.50,39.00,130,220,16,40,2.50,6.50,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(14,NULL,'lagomorph','all',38.50,40.00,180,250,30,60,1.00,6.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(15,NULL,'lagomorph','pediatric',38.50,40.50,200,280,35,65,NULL,NULL,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(16,NULL,'mustelid','all',37.80,40.00,200,400,33,36,0.60,2.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(17,NULL,'avian','all',39.50,42.50,150,600,25,70,0.02,1.50,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(18,NULL,'rodent','all',37.50,39.50,230,450,60,200,0.03,1.50,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(19,NULL,'reptile','all',NULL,NULL,30,100,10,40,0.05,30.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(20,NULL,'equine','adult',37.50,38.50,28,44,8,16,300.00,600.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(21,NULL,'equine','pediatric',37.50,39.00,60,90,14,30,NULL,NULL,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(22,NULL,'bovine','adult',38.00,39.30,48,84,10,30,400.00,800.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(23,NULL,'ovine','adult',38.50,40.00,60,120,12,30,30.00,100.00,'2026-06-01 10:03:06','2026-06-01 10:03:06'),(24,NULL,'caprine','adult',38.50,40.50,60,120,15,35,25.00,90.00,'2026-06-01 10:03:06','2026-06-01 10:03:06');
CREATE TABLE `vc_wellness_benefit_usage` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subscription_id` int(10) unsigned NOT NULL,
  `benefit_id` int(10) unsigned NOT NULL,
  `used_at` datetime NOT NULL,
  `qty` decimal(8,2) NOT NULL DEFAULT 1.00,
  `discounted_amount` decimal(22,4) DEFAULT NULL,
  `source_type` varchar(30) DEFAULT NULL,
  `source_id` int(10) unsigned DEFAULT NULL,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_wellness_benefit_usage_subscription_id_index` (`subscription_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vc_wellness_plan_benefits` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `plan_id` int(10) unsigned NOT NULL,
  `kind` enum('visits','vaccines','products','discount_pct') NOT NULL,
  `label` varchar(120) NOT NULL,
  `quantity_per_year` decimal(8,2) DEFAULT NULL,
  `value` decimal(22,4) DEFAULT NULL,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_wellness_plan_benefits_plan_id_index` (`plan_id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_wellness_plan_benefits` VALUES (25,9,'visits','Wellness checkups',4.00,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(26,9,'vaccines','Core vaccinations',3.00,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(27,9,'discount_pct','Pharmacy discount',NULL,10.0000,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(28,10,'visits','Wellness checkups',4.00,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(29,10,'vaccines','Core vaccinations',3.00,NULL,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(30,10,'discount_pct','Pharmacy discount',NULL,10.0000,NULL,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_wellness_plans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `name` varchar(120) NOT NULL,
  `description` text DEFAULT NULL,
  `price_monthly` decimal(22,4) DEFAULT NULL,
  `price_annual` decimal(22,4) DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_wellness_plans_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_wellness_plans` VALUES (9,10,'Puppy & Kitten Wellness','First-year package: core vaccines, deworming, 4 checkups.',250.0000,2500.0000,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55'),(10,10,'Adult Annual Wellness','Annual membership: 2 checkups, 1 dental, vaccine boosters, 10% pharmacy discount.',350.0000,3600.0000,NULL,'active','2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vc_wellness_subscriptions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned NOT NULL,
  `plan_id` int(10) unsigned NOT NULL,
  `status` enum('active','paused','cancelled','expired') NOT NULL DEFAULT 'active',
  `billing_cycle` enum('monthly','annual') NOT NULL DEFAULT 'monthly',
  `started_at` date NOT NULL,
  `renews_at` date DEFAULT NULL,
  `ended_at` date DEFAULT NULL,
  `erp_recurring_transaction_id` int(10) unsigned DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vc_wellness_subscriptions_business_id_pet_id_index` (`business_id`,`pet_id`),
  KEY `vc_wellness_subscriptions_business_id_index` (`business_id`),
  KEY `vc_wellness_subscriptions_status_index` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vc_wellness_subscriptions` VALUES (17,10,6092,70,9,'active','annual','2026-04-18','2027-04-18',NULL,NULL,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(18,10,6093,71,10,'active','monthly','2026-04-18','2027-04-18',NULL,NULL,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(19,10,6094,72,9,'active','annual','2026-04-18','2027-04-18',NULL,NULL,195,'2026-06-17 21:11:55','2026-06-17 21:11:55'),(20,10,6095,73,10,'active','monthly','2026-04-18','2027-04-18',NULL,NULL,195,'2026-06-17 21:11:55','2026-06-17 21:11:55');
CREATE TABLE `vet_staff_push_subscriptions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `business_id` int(10) unsigned DEFAULT NULL,
  `endpoint` varchar(500) NOT NULL,
  `p256dh_key` varchar(191) NOT NULL,
  `auth_key` varchar(64) NOT NULL,
  `user_agent` varchar(191) DEFAULT NULL,
  `categories` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`categories`)),
  `last_used_at` timestamp NULL DEFAULT NULL,
  `last_failed_at` timestamp NULL DEFAULT NULL,
  `consecutive_failures` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_staff_push_subscriptions_business_id_user_id_index` (`business_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vet_staff_tokens` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `business_id` int(10) unsigned DEFAULT NULL,
  `token_hash` varchar(64) NOT NULL,
  `user_agent` varchar(191) DEFAULT NULL,
  `ip` varchar(45) DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vet_staff_tokens_token_hash_unique` (`token_hash`),
  KEY `vet_staff_tokens_user_id_index` (`user_id`),
  KEY `vet_staff_tokens_expires_at_index` (`expires_at`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vet_staff_tokens` VALUES (5,164,5,'1836679c59d8b713ac82b6a4acf5799c6e59eaa3deab0b1c63e662a762e65e86','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0','::1','2026-06-17 20:24:14','2026-07-17 13:53:17','2026-06-17 13:53:17','2026-06-17 20:24:14'),(6,195,10,'6a2fd190aac60850ee08ddc962cf2e66e77838c7b09e4746d5ee243f3654a3cf','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36','::1','2026-06-18 00:26:10','2026-07-18 00:20:06','2026-06-18 00:20:06','2026-06-18 00:26:10'),(7,195,10,'d3a8b8fc4fa67bd135d0816b33df62d173ab52f2e98410aca81af24f2377fa01','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36','::1','2026-06-18 18:07:51','2026-07-18 18:06:16','2026-06-18 18:06:16','2026-06-18 18:07:51'),(8,195,10,'af1c1c7903c01d3ea111ef0cb8d184d408604b505ab8dfdd6677dd7ad28856a0','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0','::1','2026-06-20 14:45:20','2026-07-18 20:57:52','2026-06-18 20:57:52','2026-06-20 14:45:20');
CREATE TABLE `vp_portal_accounts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `name` varchar(150) NOT NULL,
  `email` varchar(150) NOT NULL,
  `password` varchar(255) NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `last_login_at` datetime DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vp_portal_accounts_email_unique` (`email`),
  KEY `vp_portal_accounts_business_id_index` (`business_id`),
  KEY `vp_portal_accounts_contact_id_index` (`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vp_portal_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `clinic_name` varchar(150) DEFAULT NULL,
  `logo_path` varchar(255) DEFAULT NULL,
  `primary_color` varchar(20) NOT NULL DEFAULT '#2563eb',
  `welcome_text` text DEFAULT NULL,
  `whatsapp_number` varchar(30) DEFAULT NULL,
  `portal_slug` varchar(80) DEFAULT NULL,
  `custom_domain` varchar(150) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vp_portal_settings_business_id_unique` (`business_id`),
  UNIQUE KEY `vp_portal_settings_portal_slug_unique` (`portal_slug`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vp_portal_settings` VALUES (2,5,0,NULL,NULL,'#2563eb',NULL,NULL,NULL,NULL,'2026-06-16 03:46:28','2026-06-16 03:46:28'),(3,10,0,NULL,NULL,'#2563eb',NULL,NULL,NULL,NULL,'2026-06-18 23:03:05','2026-06-18 23:03:05');
CREATE TABLE `vs_media` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `path` varchar(255) NOT NULL,
  `original_name` varchar(200) DEFAULT NULL,
  `mime` varchar(80) DEFAULT NULL,
  `size` int(10) unsigned DEFAULT NULL,
  `alt` varchar(200) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vs_media_business_id_index` (`business_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vs_messages` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `site_id` int(10) unsigned NOT NULL,
  `name` varchar(150) NOT NULL,
  `email` varchar(180) DEFAULT NULL,
  `phone` varchar(40) DEFAULT NULL,
  `subject` varchar(200) DEFAULT NULL,
  `message` text DEFAULT NULL,
  `source` varchar(60) NOT NULL DEFAULT 'contact_form',
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `ip` varchar(60) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vs_messages_business_id_index` (`business_id`),
  KEY `vs_messages_site_id_index` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vs_pages` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `site_id` int(10) unsigned NOT NULL,
  `business_id` int(10) unsigned NOT NULL,
  `title` varchar(180) NOT NULL,
  `slug` varchar(180) NOT NULL,
  `is_home` tinyint(1) NOT NULL DEFAULT 0,
  `status` varchar(20) NOT NULL DEFAULT 'published',
  `sort` int(10) unsigned NOT NULL DEFAULT 0,
  `show_in_nav` tinyint(1) NOT NULL DEFAULT 1,
  `blocks` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`blocks`)),
  `seo_title` varchar(180) DEFAULT NULL,
  `seo_description` varchar(300) DEFAULT NULL,
  `og_image_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vs_pages_site_id_slug_unique` (`site_id`,`slug`),
  KEY `vs_pages_site_id_index` (`site_id`),
  KEY `vs_pages_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vs_pages` VALUES (3,2,10,'Home','home',1,'published',0,1,'[{\"id\":\"6kqMmwGT\",\"type\":\"hero\",\"data\":{\"eyebrow\":\"Trusted veterinary care\",\"heading\":\"Compassionate care for the pets you love\",\"subheading\":\"Modern medicine, a gentle touch, and a team that treats your companion like family.\",\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1576201836106-db1758fd1c97?auto=format&fit=crop&w=1400&q=80\",\"primary_label\":\"Book an appointment\",\"primary_url\":\"#contact\",\"secondary_label\":\"Our services\",\"secondary_url\":\"#services\"}},{\"id\":\"XFBHxS7k\",\"type\":\"services\",\"data\":{\"heading\":\"Complete care, under one roof\",\"items\":[{\"icon\":\"fas fa-stethoscope\",\"title\":\"Wellness Exams\",\"text\":\"Routine check-ups and preventive care to keep tails wagging.\"},{\"icon\":\"fas fa-syringe\",\"title\":\"Vaccinations\",\"text\":\"Tailored vaccination plans for lifelong protection.\"},{\"icon\":\"fas fa-tooth\",\"title\":\"Dental Care\",\"text\":\"Cleanings and oral surgery for a healthy smile.\"},{\"icon\":\"fas fa-x-ray\",\"title\":\"Diagnostics\",\"text\":\"On-site lab, digital X-ray and ultrasound.\"},{\"icon\":\"fas fa-heartbeat\",\"title\":\"Surgery\",\"text\":\"Safe, modern surgical suites with full monitoring.\"},{\"icon\":\"fas fa-ambulance\",\"title\":\"Emergency\",\"text\":\"Urgent care when your pet needs it most.\"}]}},{\"id\":\"FE02KR2Y\",\"type\":\"about\",\"data\":{\"heading\":\"Where your pet is family\",\"body\":\"<p>Our experienced veterinarians combine advanced diagnostics with genuine compassion to keep your companions healthy and happy at every stage of life.<\\/p><p>From wagging-tail wellness visits to complex surgery, we treat every animal as if they were our own.<\\/p>\",\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1601758228041-f3b2795255f1?auto=format&fit=crop&w=1000&q=80\"}},{\"id\":\"1bTSYVtu\",\"type\":\"stats\",\"data\":{\"items\":[{\"value\":\"15k+\",\"label\":\"Happy patients\"},{\"value\":\"20+\",\"label\":\"Years of care\"},{\"value\":\"24\\/7\",\"label\":\"Emergency support\"},{\"value\":\"4.9\",\"label\":\"Average rating\"}]}},{\"id\":\"v9tLkZAO\",\"type\":\"products\",\"data\":{\"heading\":\"Best sellers\",\"subheading\":\"Quality food, toys and accessories for your best friend.\",\"items\":[{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1589924691995-400dc9ecc119?auto=format&fit=crop&w=500&q=80\",\"name\":\"Premium Dog Food 5kg\",\"price\":\"$39\",\"old_price\":\"$49\",\"badge\":\"Sale\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1583511655826-05700d52f4d9?auto=format&fit=crop&w=500&q=80\",\"name\":\"Chew Toy Bundle\",\"price\":\"$18\",\"old_price\":\"\",\"badge\":\"New\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1601758228041-f3b2795255f1?auto=format&fit=crop&w=500&q=80\",\"name\":\"Cozy Pet Bed\",\"price\":\"$54\",\"old_price\":\"\",\"badge\":\"\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1576201836106-db1758fd1c97?auto=format&fit=crop&w=500&q=80\",\"name\":\"Grooming Kit\",\"price\":\"$29\",\"old_price\":\"$35\",\"badge\":\"Sale\"}]}},{\"id\":\"WrAlgHnI\",\"type\":\"pricing\",\"data\":{\"heading\":\"Our packages\",\"subheading\":\"Transparent pricing with no surprises.\",\"items\":[{\"name\":\"Basic Wash\",\"price\":\"$29\",\"period\":\"\\/ visit\",\"features\":\"Bath & blow dry\\nNail trim\\nEar cleaning\",\"featured\":\"0\"},{\"name\":\"Full Groom\",\"price\":\"$59\",\"period\":\"\\/ visit\",\"features\":\"Everything in Basic\\nHaircut & styling\\nTeeth brushing\\nPerfume finish\",\"featured\":\"1\"},{\"name\":\"Spa Deluxe\",\"price\":\"$89\",\"period\":\"\\/ visit\",\"features\":\"Everything in Full Groom\\nDe-shedding treatment\\nPaw & nose balm\\nMassage\",\"featured\":\"0\"}]}},{\"id\":\"jeasv4FW\",\"type\":\"team\",\"data\":{\"heading\":\"Meet our veterinary team\",\"subheading\":\"Caring, certified professionals dedicated to your pet\\u2019s wellbeing.\",\"items\":[{\"name\":\"Dr. Sarah Hill\",\"role\":\"Chief Veterinarian\",\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1594824476967-48c8b964273f?auto=format&fit=crop&w=500&q=80\"},{\"name\":\"Dr. James Park\",\"role\":\"Surgeon\",\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1612349317150-e413f6a5b16d?auto=format&fit=crop&w=500&q=80\"},{\"name\":\"Dr. Lena Ortiz\",\"role\":\"Internal Medicine\",\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1559839734-2b71ea197ec2?auto=format&fit=crop&w=500&q=80\"},{\"name\":\"Dr. Omar Aziz\",\"role\":\"Dentistry & Surgery\",\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1622253692010-333f2da6031d?auto=format&fit=crop&w=500&q=80\"}]}},{\"id\":\"M8Nehmi6\",\"type\":\"pets\",\"data\":{\"heading\":\"Meet our adoptable friends\",\"subheading\":\"Every one of them is looking for a loving forever home.\",\"items\":[{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1543466835-00a7907e9de1?auto=format&fit=crop&w=500&q=80\",\"name\":\"Buddy\",\"breed\":\"Golden Retriever\",\"age\":\"2 years\",\"gender\":\"Male\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1574158622682-e40e69881006?auto=format&fit=crop&w=500&q=80\",\"name\":\"Mia\",\"breed\":\"Tabby Cat\",\"age\":\"1 year\",\"gender\":\"Female\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1518717758536-85ae29035b6d?auto=format&fit=crop&w=500&q=80\",\"name\":\"Rocky\",\"breed\":\"Labrador Mix\",\"age\":\"3 years\",\"gender\":\"Male\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1592194996308-7b43878e84a6?auto=format&fit=crop&w=500&q=80\",\"name\":\"Luna\",\"breed\":\"Siberian Husky\",\"age\":\"8 months\",\"gender\":\"Female\"}]}},{\"id\":\"VF3LHJlb\",\"type\":\"testimonials\",\"data\":{\"heading\":\"Loved by pet parents\",\"items\":[{\"quote\":\"They treated my dog like their own. Caring, professional and always available.\",\"name\":\"Emily R.\",\"meta\":\"Max\\u2019s mum\"},{\"quote\":\"Modern facilities and the friendliest staff. Highly recommend!\",\"name\":\"David K.\",\"meta\":\"Luna\\u2019s dad\"}]}},{\"id\":\"gDLdvK1X\",\"type\":\"gallery\",\"data\":{\"heading\":\"Inside our clinic\",\"items\":[{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1518717758536-85ae29035b6d?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Friendly faces\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1450778869180-41d0601e046e?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Gentle handling\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1583337130417-3346a1be7dee?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Modern facilities\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1444212477490-ca407925329e?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Happy patients\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1535930891776-0c2dfb7fda1a?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Expert care\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1425082661705-1834bfd09dca?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Feline friends\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1606425271394-c3ca9ac8d4fb?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Comfortable wards\"},{\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1597633425046-08f5110420b5?auto=format&fit=crop&w=700&q=80\",\"caption\":\"Surgical suite\"}]}},{\"id\":\"S3pQ8Mpz\",\"type\":\"faq\",\"data\":{\"heading\":\"Frequently asked questions\",\"items\":[{\"q\":\"Do you accept walk-ins?\",\"a\":\"Yes \\u2014 though we recommend booking ahead so we can prepare for your visit.\"},{\"q\":\"Do you offer emergency care?\",\"a\":\"We provide urgent care during clinic hours and can refer for overnight emergencies.\"}]}},{\"id\":\"JQ3zywDL\",\"type\":\"hours\",\"data\":{\"heading\":\"Opening hours\",\"items\":[{\"day\":\"Mon \\u2013 Fri\",\"time\":\"8:00 AM \\u2013 7:00 PM\"},{\"day\":\"Saturday\",\"time\":\"9:00 AM \\u2013 5:00 PM\"},{\"day\":\"Sunday\",\"time\":\"10:00 AM \\u2013 2:00 PM\"}]}},{\"id\":\"e3U267A6\",\"type\":\"cta\",\"data\":{\"heading\":\"Ready to give your pet the best care?\",\"text\":\"Book an appointment today \\u2014 our team can\\u2019t wait to meet you.\",\"button_label\":\"Book now\",\"button_url\":\"#contact\"}},{\"id\":\"sFqpSyUL\",\"type\":\"contact\",\"data\":{\"heading\":\"Get in touch\",\"subheading\":\"Questions, bookings or emergencies \\u2014 we\\u2019re here to help.\",\"show_form\":\"1\"}}]',NULL,NULL,NULL,'2026-06-18 20:33:36','2026-06-20 13:15:00'),(4,2,10,'About us','about',0,'published',1,1,'[{\"id\":\"shP09XT0\",\"type\":\"about\",\"data\":{\"heading\":\"Where your pet is family\",\"body\":\"<p>Our experienced veterinarians combine advanced diagnostics with genuine compassion to keep your companions healthy and happy at every stage of life.<\\/p><p>From wagging-tail wellness visits to complex surgery, we treat every animal as if they were our own.<\\/p>\",\"image\":\"https:\\/\\/images.unsplash.com\\/photo-1601758228041-f3b2795255f1?auto=format&fit=crop&w=1000&q=80\"}}]',NULL,NULL,NULL,'2026-06-18 20:33:36','2026-06-18 20:33:36'),(5,2,10,'Services','services',0,'published',2,1,'[{\"id\":\"mpNJuJUG\",\"type\":\"services\",\"data\":{\"heading\":\"Complete care, under one roof\",\"items\":[{\"icon\":\"fas fa-stethoscope\",\"title\":\"Wellness Exams\",\"text\":\"Routine check-ups and preventive care to keep tails wagging.\"},{\"icon\":\"fas fa-syringe\",\"title\":\"Vaccinations\",\"text\":\"Tailored vaccination plans for lifelong protection.\"},{\"icon\":\"fas fa-tooth\",\"title\":\"Dental Care\",\"text\":\"Cleanings and oral surgery for a healthy smile.\"},{\"icon\":\"fas fa-x-ray\",\"title\":\"Diagnostics\",\"text\":\"On-site lab, digital X-ray and ultrasound.\"},{\"icon\":\"fas fa-heartbeat\",\"title\":\"Surgery\",\"text\":\"Safe, modern surgical suites with full monitoring.\"},{\"icon\":\"fas fa-ambulance\",\"title\":\"Emergency\",\"text\":\"Urgent care when your pet needs it most.\"}]}}]',NULL,NULL,NULL,'2026-06-18 20:33:36','2026-06-18 20:33:36'),(6,2,10,'Contact','contact',0,'published',3,1,'[{\"id\":\"na7iNxJg\",\"type\":\"contact\",\"data\":{\"heading\":\"Get in touch\",\"subheading\":\"Questions, bookings or emergencies \\u2014 we\\u2019re here to help.\",\"show_form\":\"1\"}}]',NULL,NULL,NULL,'2026-06-18 20:33:36','2026-06-18 20:33:36');
CREATE TABLE `vs_sites` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `status` varchar(20) NOT NULL DEFAULT 'draft',
  `name` varchar(150) DEFAULT NULL,
  `tagline` varchar(200) DEFAULT NULL,
  `theme` varchar(40) NOT NULL DEFAULT 'aurora',
  `logo_path` varchar(255) DEFAULT NULL,
  `favicon_path` varchar(255) DEFAULT NULL,
  `og_image_path` varchar(255) DEFAULT NULL,
  `primary_color` varchar(20) DEFAULT NULL,
  `secondary_color` varchar(20) DEFAULT NULL,
  `accent_color` varchar(20) DEFAULT NULL,
  `font_heading` varchar(80) DEFAULT NULL,
  `font_body` varchar(80) DEFAULT NULL,
  `subdomain_slug` varchar(80) DEFAULT NULL,
  `custom_domain` varchar(150) DEFAULT NULL,
  `custom_domain_verified` tinyint(1) NOT NULL DEFAULT 0,
  `seo_title` varchar(180) DEFAULT NULL,
  `seo_description` varchar(300) DEFAULT NULL,
  `analytics_id` varchar(60) DEFAULT NULL,
  `contact` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`contact`)),
  `social` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`social`)),
  `hours` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`hours`)),
  `nav` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`nav`)),
  `options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`options`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vs_sites_business_id_unique` (`business_id`),
  UNIQUE KEY `vs_sites_subdomain_slug_unique` (`subdomain_slug`),
  UNIQUE KEY `vs_sites_custom_domain_unique` (`custom_domain`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vs_sites` VALUES (2,10,1,'published','VET One','Compassionate, modern care for the pets you love.','aurora',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'happy-paws',NULL,0,NULL,NULL,NULL,'{\"phone\":\"+20 100 123 4567\",\"whatsapp\":\"+20 100 123 4567\",\"email\":\"hello@happypaws.vet\",\"address\":\"24 Garden St, Cairo\"}','{\"facebook\":\"#\",\"instagram\":\"#\",\"youtube\":\"#\"}','[{\"day\":\"Mon \\u2013 Fri\",\"time\":\"8:00 AM \\u2013 7:00 PM\"},{\"day\":\"Saturday\",\"time\":\"9:00 AM \\u2013 5:00 PM\"},{\"day\":\"Sunday\",\"time\":\"10:00 AM \\u2013 2:00 PM\"}]',NULL,NULL,'2026-06-18 18:38:53','2026-06-18 20:33:36');
CREATE TABLE `wa_auto_replies` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `name` varchar(120) NOT NULL,
  `trigger` enum('welcome','keyword','fallback') NOT NULL DEFAULT 'keyword',
  `keyword` varchar(191) DEFAULT NULL COMMENT 'Comma-separated keywords for trigger=keyword',
  `match` enum('contains','exact','starts') NOT NULL DEFAULT 'contains',
  `template_id` int(10) unsigned DEFAULT NULL,
  `body` text DEFAULT NULL COMMENT 'Used when no template is set',
  `stop_after` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Stop the pipeline (skip AI) when this rule fires',
  `priority` int(10) unsigned NOT NULL DEFAULT 10,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `wa_auto_replies_business_id_active_priority_index` (`business_id`,`active`,`priority`),
  KEY `wa_auto_replies_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `wa_channels` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `location_id` int(10) unsigned DEFAULT NULL COMMENT 'business_locations.id — lets every location use its own number',
  `label` varchar(120) NOT NULL,
  `driver` enum('meta','web') NOT NULL DEFAULT 'meta',
  `display_number` varchar(30) DEFAULT NULL COMMENT 'E.164 number shown to staff',
  `status` enum('connecting','scanning','active','disconnected','disabled') NOT NULL DEFAULT 'connecting',
  `is_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Default channel for automated messages when none specified',
  `meta_phone_number_id` varchar(60) DEFAULT NULL,
  `meta_waba_id` varchar(60) DEFAULT NULL,
  `meta_access_token` text DEFAULT NULL,
  `meta_verify_token` varchar(80) DEFAULT NULL,
  `api_token` varchar(80) DEFAULT NULL COMMENT 'Bearer token the Node bridge authenticates with',
  `qr_code` text DEFAULT NULL COMMENT 'Latest QR payload awaiting scan (transient)',
  `connected_as` varchar(40) DEFAULT NULL COMMENT 'Linked phone wa_id once paired',
  `session_meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`session_meta`)),
  `bridge_version` varchar(20) DEFAULT NULL,
  `last_heartbeat_at` timestamp NULL DEFAULT NULL,
  `last_connected_at` timestamp NULL DEFAULT NULL,
  `disconnected_at` timestamp NULL DEFAULT NULL,
  `last_ip` varchar(45) DEFAULT NULL,
  `rescan_alert_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Guards against repeat disconnect alerts',
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wa_channels_api_token_unique` (`api_token`),
  KEY `wa_channels_business_id_status_index` (`business_id`,`status`),
  KEY `wa_channels_business_id_location_id_index` (`business_id`,`location_id`),
  KEY `wa_channels_business_id_index` (`business_id`),
  KEY `wa_channels_location_id_index` (`location_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `wa_contacts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `wa_id` varchar(30) NOT NULL COMMENT 'E.164 digits, no +',
  `address_jid` varchar(60) DEFAULT NULL,
  `name` varchar(160) DEFAULT NULL,
  `has_whatsapp` tinyint(1) DEFAULT NULL,
  `wa_checked_at` timestamp NULL DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL COMMENT 'contacts.id in the core ERP, when matched',
  `opted_out` tinyint(1) NOT NULL DEFAULT 0,
  `last_inbound_at` timestamp NULL DEFAULT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wa_contacts_business_id_wa_id_unique` (`business_id`,`wa_id`),
  KEY `wa_contacts_business_id_index` (`business_id`),
  KEY `wa_contacts_contact_id_index` (`contact_id`),
  KEY `wa_contacts_has_whatsapp_index` (`has_whatsapp`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `wa_contacts` VALUES (59,5,'201092288093',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(60,8,'201092288093',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(61,10,'201092288093',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(63,10,'201082630698',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,'2026-06-26 22:19:50','2026-06-26 22:19:50'),(64,10,'201090631049',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,'2026-06-26 23:52:37','2026-06-26 23:52:37');
CREATE TABLE `wa_conversations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `channel_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `wa_id` varchar(30) NOT NULL,
  `status` enum('open','closed','snoozed') NOT NULL DEFAULT 'open',
  `labels` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`labels`)),
  `assigned_user_id` int(10) unsigned DEFAULT NULL COMMENT 'Human agent who has taken the conversation (handoff)',
  `ai_enabled` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Per-thread AI auto-reply override',
  `unread_count` int(10) unsigned NOT NULL DEFAULT 0,
  `last_direction` enum('in','out') DEFAULT NULL,
  `last_message_excerpt` varchar(200) DEFAULT NULL,
  `last_message_at` timestamp NULL DEFAULT NULL,
  `window_expires_at` timestamp NULL DEFAULT NULL COMMENT 'Meta 24h customer-service window',
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wa_conversations_business_id_channel_id_wa_id_unique` (`business_id`,`channel_id`,`wa_id`),
  KEY `wa_conversations_business_id_status_last_message_at_index` (`business_id`,`status`,`last_message_at`),
  KEY `wa_conversations_business_id_index` (`business_id`),
  KEY `wa_conversations_channel_id_index` (`channel_id`),
  KEY `wa_conversations_wa_id_index` (`wa_id`),
  KEY `wa_conversations_assigned_user_id_index` (`assigned_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `wa_conversations` VALUES (54,5,NULL,59,'201092288093','open',NULL,NULL,1,0,'out','📅 *Appointment confirmed* — VET One\n\nHi Ahmed Saleh, the appointment for *Rex* is booked:\n\n🗓 *Date:* Sat, 20 Jun 2026\n⏰ *Time:* 11:30\n👨‍⚕️ *Doctor:* Dr. Hossam Makram\n📍 \nRef: A...','2026-06-16 13:48:59',NULL,NULL,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(55,8,NULL,60,'201092288093','open',NULL,NULL,1,0,'out','🧾 *VET One*\n\nHi Karim Adel, thank you for your purchase! 🙏\n\n*Invoice:* ADM-ADM-0003\n*Total:*  600\n*Paid:*  0\n*Balance due:*  600\n\n📄 View or download your invoice:\nhttps://localh...','2026-06-17 20:59:49',NULL,NULL,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(56,10,NULL,61,'201092288093','open',NULL,NULL,1,0,'out','📅 *Appointment confirmed* — VET One — Maadi\n\nHi Karim Adel, the appointment for *Bella* is booked:\n\n🗓 *Date:* Wed, 24 Jun 2026\n⏰ *Time:* 09:00\n👨‍⚕️ *Doctor:* Dr. Hossam Makram...','2026-06-23 23:04:02',NULL,NULL,'2026-06-18 00:22:28','2026-06-23 23:04:02'),(57,10,NULL,62,'201096395880','open',NULL,NULL,1,0,'out','📅 *Appointment confirmed* — VET One\n\nHi Guest Tester, the appointment for *TestyPet* is booked:\n\n🗓 *Date:* Sat, 27 Jun 2026\n⏰ *Time:* 11:30\n👨‍⚕️ *Doctor:* \n📍 \nRef: APT-9460C4...','2026-06-26 15:06:49',NULL,NULL,'2026-06-26 15:06:48','2026-06-26 15:06:49'),(58,10,NULL,63,'201082630698','open',NULL,NULL,1,0,'out','📅 *Appointment confirmed* — VET One\n\nHi OTP2, the appointment for *P2* is booked:\n\n🗓 *Date:* Sun, 28 Jun 2026\n⏰ *Time:* 09:30\n👨‍⚕️ *Doctor:* \n📍 \nRef: APT-72CB92\n\nPlease arrive...','2026-06-26 22:19:51',NULL,NULL,'2026-06-26 22:19:51','2026-06-26 22:19:51'),(59,10,NULL,64,'201090631049','open',NULL,NULL,1,0,'out','📅 *Appointment confirmed* — VET One\n\nHi Drv Owner, the appointment for *DrvSubj* is booked:\n\n🗓 *Date:* Sun, 28 Jun 2026\n⏰ *Time:* 09:30\n👨‍⚕️ *Doctor:* \n📍 \nRef: APT-57CF9B\n\nPlea...','2026-06-26 23:52:37',NULL,NULL,'2026-06-26 23:52:37','2026-06-26 23:52:37');
CREATE TABLE `wa_messages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `channel_id` int(10) unsigned DEFAULT NULL,
  `conversation_id` bigint(20) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `wa_id` varchar(30) NOT NULL COMMENT 'Other party E.164 (recipient for out, sender for in)',
  `direction` enum('out','in') NOT NULL DEFAULT 'out',
  `type` enum('text','template','image','document','audio','video','location','interactive') NOT NULL DEFAULT 'text',
  `template_id` int(10) unsigned DEFAULT NULL,
  `body` text DEFAULT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Media url/path, template vars, buttons, raw provider payload' CHECK (json_valid(`payload`)),
  `status` enum('pending','queued','sent','delivered','read','failed','received') NOT NULL DEFAULT 'pending',
  `provider_message_id` varchar(128) DEFAULT NULL,
  `error` text DEFAULT NULL,
  `attempts` int(10) unsigned NOT NULL DEFAULT 0,
  `source` varchar(40) DEFAULT NULL COMMENT 'invoice|reminder|manual|ai|...',
  `dedupe_key` varchar(191) DEFAULT NULL COMMENT 'Idempotency key for automated sends',
  `available_at` timestamp NULL DEFAULT NULL COMMENT 'Throttle gate: not before this time',
  `queued_at` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `delivered_at` timestamp NULL DEFAULT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wa_messages_business_id_dedupe_key_unique` (`business_id`,`dedupe_key`),
  KEY `wa_messages_business_id_status_index` (`business_id`,`status`),
  KEY `wa_messages_channel_id_direction_status_index` (`channel_id`,`direction`,`status`),
  KEY `wa_messages_business_id_index` (`business_id`),
  KEY `wa_messages_channel_id_index` (`channel_id`),
  KEY `wa_messages_wa_id_index` (`wa_id`),
  KEY `wa_messages_provider_message_id_index` (`provider_message_id`),
  KEY `wa_messages_conversation_id_index` (`conversation_id`)
) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `wa_messages` VALUES (161,5,NULL,54,59,'201092288093','out','text',NULL,'📅 *Appointment confirmed* — VET One\n\nHi Ahmed Saleh, the appointment for *Rex* is booked:\n\n🗓 *Date:* Sat, 20 Jun 2026\n⏰ *Time:* 11:30\n👨‍⚕️ *Doctor:* Dr. Hossam Makram\n📍 \nRef: APT-6A31544AF3FBE\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'appointment_booked','appt_booked:52','2026-06-16 13:48:59',NULL,NULL,NULL,NULL,NULL,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(162,8,NULL,55,60,'201092288093','out','text',NULL,'🧾 *VET One*\n\nHi Karim Adel, thank you for your purchase! 🙏\n\n*Invoice:* ADM-ADM-0003\n*Total:*  600\n*Paid:*  0\n*Balance due:*  600\n\n📄 View or download your invoice:\nhttps://localhost/vet-one/public/invoice/75f291f9a29e1d9064b3942a12a8e20c\n\nWe appreciate your business — just reply to this message if you have any questions.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'invoice','invoice:295348','2026-06-17 20:59:49',NULL,NULL,NULL,NULL,NULL,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(163,10,NULL,56,61,'201092288093','out','text',NULL,'📅 *Appointment confirmed* — VET One — New Cairo\n\nHi Ahmed Saleh, the appointment for *Rex* is booked:\n\n🗓 *Date:* Thu, 18 Jun 2026\n⏰ *Time:* 11:00\n👨‍⚕️ *Doctor:* Dr. Yasmin Fahmy\n📍 VET One — New Cairo\nRef: APT-6A333A44503E7\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'appointment_booked','appt_booked:93','2026-06-18 00:22:28',NULL,NULL,NULL,NULL,NULL,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(164,10,NULL,56,61,'201092288093','out','text',NULL,'📅 *Appointment confirmed* — VET One — Maadi\n\nHi Karim Adel, the appointment for *Bella* is booked:\n\n🗓 *Date:* Sun, 21 Jun 2026\n⏰ *Time:* 09:30\n👨‍⚕️ *Doctor:* Dr. Hossam Makram\n📍 VET One — Maadi\nRef: APT-6A346285E05DC\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'appointment_booked','appt_booked:94','2026-06-18 21:26:30',NULL,NULL,NULL,NULL,NULL,'2026-06-18 21:26:30','2026-06-18 21:26:30'),(165,10,NULL,56,61,'201092288093','out','text',NULL,'📅 *Appointment confirmed* — VET One — New Cairo\n\nHi Karim Adel, the appointment for *Bella* is booked:\n\n🗓 *Date:* Sun, 21 Jun 2026\n⏰ *Time:* 09:00\n👨‍⚕️ *Doctor:* Dr. Yasmin Fahmy\n📍 VET One — New Cairo\nRef: APT-6A3463FDD0EE3\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'appointment_booked','appt_booked:95','2026-06-18 21:32:46',NULL,NULL,NULL,NULL,NULL,'2026-06-18 21:32:46','2026-06-18 21:32:46'),(166,10,NULL,56,61,'201092288093','out','text',NULL,'🧾 *VET One*\n\nHi Karim Adel, thank you for your purchase! 🙏\n\n*Invoice:* ADM-ADM-0003\n*Total:*  900\n*Paid:*  0\n*Balance due:*  900\n\n📄 View or download your invoice:\nhttps://localhost/vet-one/public/invoice/ab40378a5ab69822dfda9cf23cd7a402\n\nWe appreciate your business — just reply to this message if you have any questions.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'invoice','invoice:295361','2026-06-18 21:44:29',NULL,NULL,NULL,NULL,NULL,'2026-06-18 21:44:29','2026-06-18 21:44:29'),(167,10,NULL,56,61,'201092288093','out','text',NULL,'📅 *Appointment confirmed* — VET One — Maadi\n\nHi Youssef Nabil, the appointment for *Rocky* is booked:\n\n🗓 *Date:* Thu, 18 Jun 2026\n⏰ *Time:* 09:00\n👨‍⚕️ *Doctor:* Dr. Hossam Makram\n📍 VET One — Maadi\nRef: APT-6A347A307C96B\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'appointment_booked','appt_booked:96','2026-06-18 23:07:28',NULL,NULL,NULL,NULL,NULL,'2026-06-18 23:07:28','2026-06-18 23:07:28'),(168,10,NULL,56,61,'201092288093','out','text',NULL,'📅 *Appointment confirmed* — VET One — Maadi\n\nHi Karim Adel, the appointment for *Bella* is booked:\n\n🗓 *Date:* Wed, 24 Jun 2026\n⏰ *Time:* 09:00\n👨‍⚕️ *Doctor:* Dr. Hossam Makram\n📍 VET One — Maadi\nRef: APT-6A3B10E1ED0E9\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.\n\n_Powered by TPS_','{\"preview_url\":false}','pending',NULL,NULL,0,'appointment_booked','appt_booked:97','2026-06-23 23:04:02',NULL,NULL,NULL,NULL,NULL,'2026-06-23 23:04:02','2026-06-23 23:04:02');
CREATE TABLE `wa_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `key` varchar(60) NOT NULL,
  `value` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wa_settings_business_id_key_unique` (`business_id`,`key`),
  KEY `wa_settings_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `wa_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` int(10) unsigned NOT NULL,
  `name` varchar(120) NOT NULL COMMENT 'Internal key, e.g. invoice_created',
  `language` varchar(12) NOT NULL DEFAULT 'en',
  `category` varchar(40) NOT NULL DEFAULT 'utility' COMMENT 'utility|marketing|authentication',
  `meta_template_name` varchar(160) DEFAULT NULL,
  `meta_status` enum('none','pending','approved','rejected') NOT NULL DEFAULT 'none',
  `header` text DEFAULT NULL,
  `body` text NOT NULL COMMENT 'Supports {{var}} placeholders',
  `footer` text DEFAULT NULL,
  `buttons` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`buttons`)),
  `variables` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Ordered variable names for {{1}}.. mapping' CHECK (json_valid(`variables`)),
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wa_templates_business_id_name_unique` (`business_id`,`name`),
  KEY `wa_templates_business_id_index` (`business_id`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `wa_templates` VALUES (19,5,'invoice_created','en','utility',NULL,'none',NULL,'🧾 *{business_name}*\n\nHi {contact_name}, thank you for your purchase! 🙏\n\n*Invoice:* {invoice_number}\n*Total:* {total_amount}\n*Paid:* {paid_amount}\n*Balance due:* {due_amount}\n\n📄 View or download your invoice:\n{invoice_url}\n\nWe appreciate your business — just reply to this message if you have any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"total_amount\",\"paid_amount\",\"due_amount\",\"invoice_url\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(20,5,'payment_received','en','utility',NULL,'none',NULL,'✅ *Payment received* — {business_name}\n\nHi {contact_name}, we\'ve received your payment of *{received_amount}* for invoice {invoice_number}.\n\n*Remaining balance:* {due_amount}\n\nThank you! Reply here if you need anything.',NULL,NULL,'[\"business_name\",\"contact_name\",\"received_amount\",\"invoice_number\",\"due_amount\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(21,5,'sale_return','en','utility',NULL,'none',NULL,'↩️ *Return processed* — {business_name}\n\nHi {contact_name}, your return for invoice {invoice_number} has been processed.\n\n*Updated balance:* {due_amount}\n\nThank you for giving us the chance to help. Reply with any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"due_amount\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(22,5,'appointment_booked','en','utility',NULL,'none',NULL,'📅 *Appointment confirmed* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* is booked:\n\n🗓 *Date:* {appointment_date}\n⏰ *Time:* {appointment_time}\n👨‍⚕️ *Doctor:* {doctor_name}\n📍 {location_name}\nRef: {ref_no}\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\",\"ref_no\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(23,5,'appointment_reminder','en','utility',NULL,'none',NULL,'⏰ *Appointment reminder* — {clinic_name}\n\nHi {owner_name}, a friendly reminder of *{pet_name}*\'s appointment:\n\n🗓 {appointment_date} at ⏰ {appointment_time}\n👨‍⚕️ {doctor_name}\n📍 {location_name}\n\nSee you soon! Reply to reschedule or cancel.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(24,5,'appointment_cancelled','en','utility',NULL,'none',NULL,'❌ *Appointment cancelled* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* on {appointment_date} at {appointment_time} has been cancelled.\n\nReply here to book a new time — we\'d be happy to help.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(25,5,'appointment_rescheduled','en','utility',NULL,'none',NULL,'🔄 *Appointment rescheduled* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* has been moved to:\n\n🗓 *{appointment_date}* at ⏰ *{appointment_time}*\n👨‍⚕️ {doctor_name}\n📍 {location_name}\n\nReply if this time doesn\'t work for you.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(26,5,'appointment_followup','en','utility',NULL,'none',NULL,'💚 *Thank you for visiting* — {clinic_name}\n\nHi {owner_name}, we hope *{pet_name}* is doing well after the visit with {doctor_name}.\n\nIf you have any questions or concerns, just reply to this message — we\'re here to help. 🐾',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"doctor_name\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(27,5,'quotation_sent','en','utility',NULL,'none',NULL,'📝 *Your quotation* — {business_name}\n\nHi {contact_name}, here is the quotation you requested.\n\n*Total:* {total_amount}\n\n📄 View the full quotation:\n{quote_url}\n\nReply to confirm or if you\'d like any changes.',NULL,NULL,'[\"business_name\",\"contact_name\",\"total_amount\",\"quote_url\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(28,5,'payment_due_reminder','en','utility',NULL,'none',NULL,'🔔 *Payment reminder* — {business_name}\n\nHi {contact_name}, a friendly reminder that invoice {invoice_number} has an outstanding balance.\n\n*Amount due:* {due_amount}\n*Due date:* {due_date}\n\n📄 View invoice: {invoice_url}\n\nPlease reply if you\'ve already paid or need assistance. Thank you!',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"due_amount\",\"due_date\",\"invoice_url\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(29,5,'shipment_status','en','utility',NULL,'none',NULL,'🚚 *Delivery update* — {business_name}\n\nHi {contact_name}, the status of your order {invoice_number} is now: *{shipping_status}*.\n\nReply to this message if you have any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"shipping_status\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(30,5,'po_sent','en','utility',NULL,'none',NULL,'📦 *Purchase Order* — {business_name}\n\nHi {contact_name}, we\'ve issued purchase order {order_ref_number}.\n\n*Total:* {total_amount}\n\nPlease confirm receipt and expected delivery. Thank you for partnering with us.',NULL,NULL,'[\"business_name\",\"contact_name\",\"order_ref_number\",\"total_amount\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(31,5,'lab_results_ready','en','utility',NULL,'none',NULL,'🔬 *Lab results ready* — {clinic_name}\n\nHi {owner_name}, the lab results for *{pet_name}* (sample {sample_no}) are ready.\n\nPlease contact the clinic or reply here to discuss the results with your veterinarian.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"sample_no\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(32,5,'vaccination_due','en','utility',NULL,'none',NULL,'💉 *Vaccination reminder* — {clinic_name}\n\nHi {owner_name}, *{pet_name}*\'s *{vaccine_name}* vaccination is due on *{due_date}*.\n\nReply to book an appointment — keeping {pet_name} protected and healthy. 🐾',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"vaccine_name\",\"due_date\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(33,5,'contact_welcome','en','marketing',NULL,'none',NULL,'👋 *Welcome to {business_name}!*\n\nHi {contact_name}, thank you for joining us. We\'re glad to have you!\n\nYou can reach us anytime by replying to this message. We\'re here to help. 🙌',NULL,NULL,'[\"business_name\",\"contact_name\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(34,5,'pet_owner_welcome','en','marketing',NULL,'none',NULL,'🐾 *Welcome to {clinic_name}!*\n\nHi {owner_name}, thank you for trusting us with your pet\'s care. 💚\n\nWe\'ll keep you updated about appointments, vaccinations and reminders right here on WhatsApp.\nReply anytime — we\'re happy to help.',NULL,NULL,'[\"clinic_name\",\"owner_name\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(35,5,'pet_welcome','en','marketing',NULL,'none',NULL,'🎉🐾 *Welcome, {pet_name}!*\n\nHi {owner_name}, *{pet_name}* has been added to your profile at {clinic_name}.\n\nWe\'ll help you keep {pet_name} healthy with timely checkups, vaccinations and reminders.\nReply anytime to book a visit. 💚',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(36,5,'pet_birthday','en','marketing',NULL,'none',NULL,'🎉🐾 *Happy Birthday {pet_name}!* 🎂\n\nHi {owner_name}, all of us at {clinic_name} are wishing *{pet_name}* a wonderful birthday!\n\nThank you for trusting us with {pet_name}\'s care. Reply for a birthday check-up. 💚',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\"]',1,'2026-06-16 13:48:59','2026-06-16 13:48:59'),(37,8,'invoice_created','en','utility',NULL,'none',NULL,'🧾 *{business_name}*\n\nHi {contact_name}, thank you for your purchase! 🙏\n\n*Invoice:* {invoice_number}\n*Total:* {total_amount}\n*Paid:* {paid_amount}\n*Balance due:* {due_amount}\n\n📄 View or download your invoice:\n{invoice_url}\n\nWe appreciate your business — just reply to this message if you have any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"total_amount\",\"paid_amount\",\"due_amount\",\"invoice_url\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(38,8,'payment_received','en','utility',NULL,'none',NULL,'✅ *Payment received* — {business_name}\n\nHi {contact_name}, we\'ve received your payment of *{received_amount}* for invoice {invoice_number}.\n\n*Remaining balance:* {due_amount}\n\nThank you! Reply here if you need anything.',NULL,NULL,'[\"business_name\",\"contact_name\",\"received_amount\",\"invoice_number\",\"due_amount\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(39,8,'sale_return','en','utility',NULL,'none',NULL,'↩️ *Return processed* — {business_name}\n\nHi {contact_name}, your return for invoice {invoice_number} has been processed.\n\n*Updated balance:* {due_amount}\n\nThank you for giving us the chance to help. Reply with any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"due_amount\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(40,8,'appointment_booked','en','utility',NULL,'none',NULL,'📅 *Appointment confirmed* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* is booked:\n\n🗓 *Date:* {appointment_date}\n⏰ *Time:* {appointment_time}\n👨‍⚕️ *Doctor:* {doctor_name}\n📍 {location_name}\nRef: {ref_no}\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\",\"ref_no\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(41,8,'appointment_reminder','en','utility',NULL,'none',NULL,'⏰ *Appointment reminder* — {clinic_name}\n\nHi {owner_name}, a friendly reminder of *{pet_name}*\'s appointment:\n\n🗓 {appointment_date} at ⏰ {appointment_time}\n👨‍⚕️ {doctor_name}\n📍 {location_name}\n\nSee you soon! Reply to reschedule or cancel.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(42,8,'appointment_cancelled','en','utility',NULL,'none',NULL,'❌ *Appointment cancelled* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* on {appointment_date} at {appointment_time} has been cancelled.\n\nReply here to book a new time — we\'d be happy to help.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(43,8,'appointment_rescheduled','en','utility',NULL,'none',NULL,'🔄 *Appointment rescheduled* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* has been moved to:\n\n🗓 *{appointment_date}* at ⏰ *{appointment_time}*\n👨‍⚕️ {doctor_name}\n📍 {location_name}\n\nReply if this time doesn\'t work for you.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(44,8,'appointment_followup','en','utility',NULL,'none',NULL,'💚 *Thank you for visiting* — {clinic_name}\n\nHi {owner_name}, we hope *{pet_name}* is doing well after the visit with {doctor_name}.\n\nIf you have any questions or concerns, just reply to this message — we\'re here to help. 🐾',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"doctor_name\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(45,8,'quotation_sent','en','utility',NULL,'none',NULL,'📝 *Your quotation* — {business_name}\n\nHi {contact_name}, here is the quotation you requested.\n\n*Total:* {total_amount}\n\n📄 View the full quotation:\n{quote_url}\n\nReply to confirm or if you\'d like any changes.',NULL,NULL,'[\"business_name\",\"contact_name\",\"total_amount\",\"quote_url\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(46,8,'payment_due_reminder','en','utility',NULL,'none',NULL,'🔔 *Payment reminder* — {business_name}\n\nHi {contact_name}, a friendly reminder that invoice {invoice_number} has an outstanding balance.\n\n*Amount due:* {due_amount}\n*Due date:* {due_date}\n\n📄 View invoice: {invoice_url}\n\nPlease reply if you\'ve already paid or need assistance. Thank you!',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"due_amount\",\"due_date\",\"invoice_url\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(47,8,'shipment_status','en','utility',NULL,'none',NULL,'🚚 *Delivery update* — {business_name}\n\nHi {contact_name}, the status of your order {invoice_number} is now: *{shipping_status}*.\n\nReply to this message if you have any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"shipping_status\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(48,8,'po_sent','en','utility',NULL,'none',NULL,'📦 *Purchase Order* — {business_name}\n\nHi {contact_name}, we\'ve issued purchase order {order_ref_number}.\n\n*Total:* {total_amount}\n\nPlease confirm receipt and expected delivery. Thank you for partnering with us.',NULL,NULL,'[\"business_name\",\"contact_name\",\"order_ref_number\",\"total_amount\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(49,8,'lab_results_ready','en','utility',NULL,'none',NULL,'🔬 *Lab results ready* — {clinic_name}\n\nHi {owner_name}, the lab results for *{pet_name}* (sample {sample_no}) are ready.\n\nPlease contact the clinic or reply here to discuss the results with your veterinarian.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"sample_no\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(50,8,'vaccination_due','en','utility',NULL,'none',NULL,'💉 *Vaccination reminder* — {clinic_name}\n\nHi {owner_name}, *{pet_name}*\'s *{vaccine_name}* vaccination is due on *{due_date}*.\n\nReply to book an appointment — keeping {pet_name} protected and healthy. 🐾',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"vaccine_name\",\"due_date\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(51,8,'contact_welcome','en','marketing',NULL,'none',NULL,'👋 *Welcome to {business_name}!*\n\nHi {contact_name}, thank you for joining us. We\'re glad to have you!\n\nYou can reach us anytime by replying to this message. We\'re here to help. 🙌',NULL,NULL,'[\"business_name\",\"contact_name\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(52,8,'pet_owner_welcome','en','marketing',NULL,'none',NULL,'🐾 *Welcome to {clinic_name}!*\n\nHi {owner_name}, thank you for trusting us with your pet\'s care. 💚\n\nWe\'ll keep you updated about appointments, vaccinations and reminders right here on WhatsApp.\nReply anytime — we\'re happy to help.',NULL,NULL,'[\"clinic_name\",\"owner_name\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(53,8,'pet_welcome','en','marketing',NULL,'none',NULL,'🎉🐾 *Welcome, {pet_name}!*\n\nHi {owner_name}, *{pet_name}* has been added to your profile at {clinic_name}.\n\nWe\'ll help you keep {pet_name} healthy with timely checkups, vaccinations and reminders.\nReply anytime to book a visit. 💚',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(54,8,'pet_birthday','en','marketing',NULL,'none',NULL,'🎉🐾 *Happy Birthday {pet_name}!* 🎂\n\nHi {owner_name}, all of us at {clinic_name} are wishing *{pet_name}* a wonderful birthday!\n\nThank you for trusting us with {pet_name}\'s care. Reply for a birthday check-up. 💚',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\"]',1,'2026-06-17 20:59:49','2026-06-17 20:59:49'),(55,10,'invoice_created','en','utility',NULL,'none',NULL,'🧾 *{business_name}*\n\nHi {contact_name}, thank you for your purchase! 🙏\n\n*Invoice:* {invoice_number}\n*Total:* {total_amount}\n*Paid:* {paid_amount}\n*Balance due:* {due_amount}\n\n📄 View or download your invoice:\n{invoice_url}\n\nWe appreciate your business — just reply to this message if you have any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"total_amount\",\"paid_amount\",\"due_amount\",\"invoice_url\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(56,10,'payment_received','en','utility',NULL,'none',NULL,'✅ *Payment received* — {business_name}\n\nHi {contact_name}, we\'ve received your payment of *{received_amount}* for invoice {invoice_number}.\n\n*Remaining balance:* {due_amount}\n\nThank you! Reply here if you need anything.',NULL,NULL,'[\"business_name\",\"contact_name\",\"received_amount\",\"invoice_number\",\"due_amount\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(57,10,'sale_return','en','utility',NULL,'none',NULL,'↩️ *Return processed* — {business_name}\n\nHi {contact_name}, your return for invoice {invoice_number} has been processed.\n\n*Updated balance:* {due_amount}\n\nThank you for giving us the chance to help. Reply with any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"due_amount\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(58,10,'appointment_booked','en','utility',NULL,'none',NULL,'📅 *Appointment confirmed* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* is booked:\n\n🗓 *Date:* {appointment_date}\n⏰ *Time:* {appointment_time}\n👨‍⚕️ *Doctor:* {doctor_name}\n📍 {location_name}\nRef: {ref_no}\n\nPlease arrive 10 minutes early. Reply to reschedule or cancel.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\",\"ref_no\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(59,10,'appointment_reminder','en','utility',NULL,'none',NULL,'⏰ *Appointment reminder* — {clinic_name}\n\nHi {owner_name}, a friendly reminder of *{pet_name}*\'s appointment:\n\n🗓 {appointment_date} at ⏰ {appointment_time}\n👨‍⚕️ {doctor_name}\n📍 {location_name}\n\nSee you soon! Reply to reschedule or cancel.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(60,10,'appointment_cancelled','en','utility',NULL,'none',NULL,'❌ *Appointment cancelled* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* on {appointment_date} at {appointment_time} has been cancelled.\n\nReply here to book a new time — we\'d be happy to help.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(61,10,'appointment_rescheduled','en','utility',NULL,'none',NULL,'🔄 *Appointment rescheduled* — {clinic_name}\n\nHi {owner_name}, the appointment for *{pet_name}* has been moved to:\n\n🗓 *{appointment_date}* at ⏰ *{appointment_time}*\n👨‍⚕️ {doctor_name}\n📍 {location_name}\n\nReply if this time doesn\'t work for you.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"appointment_date\",\"appointment_time\",\"doctor_name\",\"location_name\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(62,10,'appointment_followup','en','utility',NULL,'none',NULL,'💚 *Thank you for visiting* — {clinic_name}\n\nHi {owner_name}, we hope *{pet_name}* is doing well after the visit with {doctor_name}.\n\nIf you have any questions or concerns, just reply to this message — we\'re here to help. 🐾',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"doctor_name\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(63,10,'quotation_sent','en','utility',NULL,'none',NULL,'📝 *Your quotation* — {business_name}\n\nHi {contact_name}, here is the quotation you requested.\n\n*Total:* {total_amount}\n\n📄 View the full quotation:\n{quote_url}\n\nReply to confirm or if you\'d like any changes.',NULL,NULL,'[\"business_name\",\"contact_name\",\"total_amount\",\"quote_url\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(64,10,'payment_due_reminder','en','utility',NULL,'none',NULL,'🔔 *Payment reminder* — {business_name}\n\nHi {contact_name}, a friendly reminder that invoice {invoice_number} has an outstanding balance.\n\n*Amount due:* {due_amount}\n*Due date:* {due_date}\n\n📄 View invoice: {invoice_url}\n\nPlease reply if you\'ve already paid or need assistance. Thank you!',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"due_amount\",\"due_date\",\"invoice_url\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(65,10,'shipment_status','en','utility',NULL,'none',NULL,'🚚 *Delivery update* — {business_name}\n\nHi {contact_name}, the status of your order {invoice_number} is now: *{shipping_status}*.\n\nReply to this message if you have any questions.',NULL,NULL,'[\"business_name\",\"contact_name\",\"invoice_number\",\"shipping_status\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(66,10,'po_sent','en','utility',NULL,'none',NULL,'📦 *Purchase Order* — {business_name}\n\nHi {contact_name}, we\'ve issued purchase order {order_ref_number}.\n\n*Total:* {total_amount}\n\nPlease confirm receipt and expected delivery. Thank you for partnering with us.',NULL,NULL,'[\"business_name\",\"contact_name\",\"order_ref_number\",\"total_amount\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(67,10,'lab_results_ready','en','utility',NULL,'none',NULL,'🔬 *Lab results ready* — {clinic_name}\n\nHi {owner_name}, the lab results for *{pet_name}* (sample {sample_no}) are ready.\n\nPlease contact the clinic or reply here to discuss the results with your veterinarian.',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"sample_no\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(68,10,'vaccination_due','en','utility',NULL,'none',NULL,'💉 *Vaccination reminder* — {clinic_name}\n\nHi {owner_name}, *{pet_name}*\'s *{vaccine_name}* vaccination is due on *{due_date}*.\n\nReply to book an appointment — keeping {pet_name} protected and healthy. 🐾',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\",\"vaccine_name\",\"due_date\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(69,10,'contact_welcome','en','marketing',NULL,'none',NULL,'👋 *Welcome to {business_name}!*\n\nHi {contact_name}, thank you for joining us. We\'re glad to have you!\n\nYou can reach us anytime by replying to this message. We\'re here to help. 🙌',NULL,NULL,'[\"business_name\",\"contact_name\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(70,10,'pet_owner_welcome','en','marketing',NULL,'none',NULL,'🐾 *Welcome to {clinic_name}!*\n\nHi {owner_name}, thank you for trusting us with your pet\'s care. 💚\n\nWe\'ll keep you updated about appointments, vaccinations and reminders right here on WhatsApp.\nReply anytime — we\'re happy to help.',NULL,NULL,'[\"clinic_name\",\"owner_name\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(71,10,'pet_welcome','en','marketing',NULL,'none',NULL,'🎉🐾 *Welcome, {pet_name}!*\n\nHi {owner_name}, *{pet_name}* has been added to your profile at {clinic_name}.\n\nWe\'ll help you keep {pet_name} healthy with timely checkups, vaccinations and reminders.\nReply anytime to book a visit. 💚',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28'),(72,10,'pet_birthday','en','marketing',NULL,'none',NULL,'🎉🐾 *Happy Birthday {pet_name}!* 🎂\n\nHi {owner_name}, all of us at {clinic_name} are wishing *{pet_name}* a wonderful birthday!\n\nThank you for trusting us with {pet_name}\'s care. Reply for a birthday check-up. 💚',NULL,NULL,'[\"clinic_name\",\"owner_name\",\"pet_name\"]',1,'2026-06-18 00:22:28','2026-06-18 00:22:28');
CREATE TABLE `warranties` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `duration` int(11) NOT NULL,
  `duration_type` enum('days','months','years') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `warranties_business_id_index` (`business_id`),
  KEY `warranties_duration_type_index` (`duration_type`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



