
CREATE TABLE `_prisma_migrations` (
  `id` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `checksum` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `finished_at` datetime(3) DEFAULT NULL,
  `migration_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `logs` text COLLATE utf8mb4_unicode_ci,
  `rolled_back_at` datetime(3) DEFAULT NULL,
  `started_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `applied_steps_count` int unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `_prisma_migrations` VALUES ('707098d3-8534-4ccf-83b2-f5e090ab9f68','c6609e75d1c7ae42966e0e029e5d8375bc4ccf84b6c5f7ef6fded80ee2bb72be','2026-02-13 01:19:46.807','20260213011946_add_onboarding_engine',NULL,NULL,'2026-02-13 01:19:46.466',1);
INSERT INTO `_prisma_migrations` VALUES ('8330eb2d-c5e4-41b5-89e7-9766dc8a4560','cca9e4d99a4dd7ed5f5c645803473a31aab9fc8cb43c0f64690535c2ff0f2347','2026-02-11 10:22:14.493','20260211102211_init',NULL,NULL,'2026-02-11 10:22:11.381',1);
INSERT INTO `_prisma_migrations` VALUES ('95b50432-0eca-479c-9ebc-27e8002b5f88','2ae9b05ce01500f7e3e9e7751a2eccf0406b6a4872d723f05b77dc51e4236bc4','2026-02-11 17:00:16.640','20260211170016_add_onboarding_video_and_documents',NULL,NULL,'2026-02-11 17:00:16.287',1);
CREATE TABLE `activitylog` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `userId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entityType` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entityId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `ipAddress` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `userAgent` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`),
  KEY `ActivityLog_userId_idx` (`userId`),
  KEY `ActivityLog_action_idx` (`action`),
  KEY `ActivityLog_createdAt_idx` (`createdAt`),
  CONSTRAINT `ActivityLog_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `activitylog` VALUES ('cmlla72d00002fp60mqjhe6co','cmlla71cy0000fp60xl2uo04p','INVITE_SENT','User','cmlla71cy0000fp60xl2uo04p','{\"role\": \"APPLICANT\", \"email\": \"beocodes@gmail.com\", \"expiresInDays\": 7}',NULL,NULL,'2026-02-13 19:29:14.677');
INSERT INTO `activitylog` VALUES ('cmllbl52m0006fp60side2w47','cmlla71cy0000fp60xl2uo04p','REGISTER','User','cmlla71cy0000fp60xl2uo04p','{\"email\": \"beocodes@gmail.com\"}',NULL,NULL,'2026-02-13 20:08:10.990');
INSERT INTO `activitylog` VALUES ('cmllbyghn000cfp604a1o9yft','cmlla71cy0000fp60xl2uo04p','DOCUMENT_UPLOAD','ApplicantDocument','cmllbyggn000afp604mhmc8t8','{\"fileName\": \"file-sample_150kB.pdf\", \"documentName\": \"Document 1\"}',NULL,NULL,'2026-02-13 20:18:32.314');
INSERT INTO `activitylog` VALUES ('cmllbyshy000gfp60n52ragm5','cmlla71cy0000fp60xl2uo04p','DOCUMENT_UPLOAD','ApplicantDocument','cmllbysh5000efp60gctfgo7u','{\"fileName\": \"file-sample_150kB.pdf\", \"documentName\": \"Document 2\"}',NULL,NULL,'2026-02-13 20:18:47.878');
CREATE TABLE `announcement` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `targetRoles` json NOT NULL,
  `priority` enum('LOW','NORMAL','HIGH','URGENT') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NORMAL',
  `isActive` tinyint(1) NOT NULL DEFAULT '1',
  `publishedAt` datetime(3) DEFAULT NULL,
  `expiresAt` datetime(3) DEFAULT NULL,
  `createdById` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `Announcement_isActive_idx` (`isActive`),
  KEY `Announcement_publishedAt_idx` (`publishedAt`),
  KEY `Announcement_createdById_fkey` (`createdById`),
  CONSTRAINT `Announcement_createdById_fkey` FOREIGN KEY (`createdById`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `applicantdocument` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `userId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileName` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileUrl` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  `status` enum('PENDING','APPROVED','REJECTED','EXPIRED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
  `reviewedAt` datetime(3) DEFAULT NULL,
  `reviewedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reviewNotes` text COLLATE utf8mb4_unicode_ci,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `documentType` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `licenseeId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mimeType` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uploadedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`),
  KEY `ApplicantDocument_userId_idx` (`userId`),
  KEY `ApplicantDocument_status_idx` (`status`),
  KEY `ApplicantDocument_licenseeId_idx` (`licenseeId`),
  CONSTRAINT `ApplicantDocument_licenseeId_fkey` FOREIGN KEY (`licenseeId`) REFERENCES `licensee` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ApplicantDocument_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `applicantdocument` VALUES ('cmllbyggn000afp604mhmc8t8','cmlla71cy0000fp60xl2uo04p','file-sample_150kB.pdf','https://res.cloudinary.com/dfzz1nnkx/image/upload/v1771013911/applicant-documents/cmlla71cy0000fp60xl2uo04p/pdshosvje8hlsnguwymt.pdf',376814,'PENDING',NULL,NULL,NULL,'2026-02-13 20:18:32.277','2026-02-13 20:18:32.277',NULL,NULL,'general','applicant-documents/cmlla71cy0000fp60xl2uo04p/pdshosvje8hlsnguwymt',NULL,'application/pdf','Document 1','2026-02-13 20:18:32.277');
INSERT INTO `applicantdocument` VALUES ('cmllbysh5000efp60gctfgo7u','cmlla71cy0000fp60xl2uo04p','file-sample_150kB.pdf','https://res.cloudinary.com/dfzz1nnkx/image/upload/v1771013927/applicant-documents/cmlla71cy0000fp60xl2uo04p/wz0se1y2oszi6ksltxhd.pdf',376814,'PENDING',NULL,NULL,NULL,'2026-02-13 20:18:47.847','2026-02-13 20:18:47.847',NULL,NULL,'general','applicant-documents/cmlla71cy0000fp60xl2uo04p/wz0se1y2oszi6ksltxhd',NULL,'application/pdf','Document 2','2026-02-13 20:18:47.847');
CREATE TABLE `compliancedocument` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `licenseeId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `documentType` enum('INSURANCE','WAIVER','CONTRACT','BUSINESS_LICENSE','CERTIFICATE','OTHER') COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileName` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileUrl` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  `uploadedDate` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `expiryDate` datetime(3) DEFAULT NULL,
  `status` enum('PENDING','APPROVED','REJECTED','EXPIRED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updatedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ComplianceDocument_licenseeId_idx` (`licenseeId`),
  KEY `ComplianceDocument_documentType_idx` (`documentType`),
  KEY `ComplianceDocument_expiryDate_idx` (`expiryDate`),
  CONSTRAINT `ComplianceDocument_licenseeId_fkey` FOREIGN KEY (`licenseeId`) REFERENCES `licensee` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `contentitem` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `section` enum('START_HERE','OPERATIONS','MARKETING_VAULT','TRAINING') COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `contentType` enum('VIDEO','PDF','IMAGE','CHECKLIST','TEMPLATE','LINK') COLLATE utf8mb4_unicode_ci NOT NULL,
  `fileUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fileName` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fileSize` int DEFAULT NULL,
  `thumbnailUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `videoDuration` int DEFAULT NULL,
  `sortOrder` int NOT NULL DEFAULT '0',
  `isActive` tinyint(1) NOT NULL DEFAULT '1',
  `requiredRole` enum('APPLICANT','ACTIVE_LICENSEE','PAST_DUE_LICENSEE','SALES','ADMIN') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE_LICENSEE',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updatedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ContentItem_section_idx` (`section`),
  KEY `ContentItem_contentType_idx` (`contentType`),
  KEY `ContentItem_sortOrder_idx` (`sortOrder`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `licensee` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `licenseeNumber` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `businessName` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zipCode` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('PENDING','APPROVED','ACTIVE','RENEWAL_DUE','PAST_DUE','EXPIRED','SUSPENDED','REJECTED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
  `contractSignedDate` datetime(3) DEFAULT NULL,
  `activationDate` datetime(3) DEFAULT NULL,
  `renewalDate` datetime(3) DEFAULT NULL,
  `expirationDate` datetime(3) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updatedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  `currentOnboardingPhase` enum('PHASE_1_APPLICATION','PHASE_2_DOCUMENTATION','PHASE_3_TRAINING','PHASE_4_SETUP','PHASE_5_LAUNCH_PREP','COMPLETED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PHASE_1_APPLICATION',
  `licenseModel` enum('CLASSES_ONLY','MOBILE_GYM','PHYSICAL_LOCATION') COLLATE utf8mb4_unicode_ci NOT NULL,
  `onboardingProgress` double NOT NULL DEFAULT '0',
  `approvedAt` datetime(3) DEFAULT NULL,
  `approvedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `businessEmail` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `businessPhone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rejectedAt` datetime(3) DEFAULT NULL,
  `rejectedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rejectionReason` text COLLATE utf8mb4_unicode_ci,
  `submittedAt` datetime(3) DEFAULT NULL,
  `submittedForApproval` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `Licensee_licenseeNumber_key` (`licenseeNumber`),
  KEY `Licensee_status_idx` (`status`),
  KEY `Licensee_licenseeNumber_idx` (`licenseeNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `licensee` VALUES ('cmllccdg1000hfp60zo30jgqc',NULL,'Emmanuel Tester\'s Business',NULL,NULL,NULL,NULL,'PENDING',NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.552','2026-02-13 21:00:31.354',NULL,NULL,NULL,'PHASE_2_DOCUMENTATION','CLASSES_ONLY',21.42857142857143,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);
CREATE TABLE `onboardingchecklistitem` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `licenseeId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `licenseModel` enum('CLASSES_ONLY','MOBILE_GYM','PHYSICAL_LOCATION') COLLATE utf8mb4_unicode_ci NOT NULL,
  `phase` enum('PHASE_1_APPLICATION','PHASE_2_DOCUMENTATION','PHASE_3_TRAINING','PHASE_4_SETUP','PHASE_5_LAUNCH_PREP','COMPLETED') COLLATE utf8mb4_unicode_ci NOT NULL,
  `sortOrder` int NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `requiresDocument` tinyint(1) NOT NULL DEFAULT '0',
  `requiresAdminApproval` tinyint(1) NOT NULL DEFAULT '0',
  `documentType` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instructionsUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('LOCKED','AVAILABLE','IN_PROGRESS','PENDING_REVIEW','APPROVED','REJECTED','COMPLETED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'LOCKED',
  `startedAt` datetime(3) DEFAULT NULL,
  `completedAt` datetime(3) DEFAULT NULL,
  `uploadedFileUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uploadedFileName` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uploadedAt` datetime(3) DEFAULT NULL,
  `approvedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approvedAt` datetime(3) DEFAULT NULL,
  `rejectionReason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `OnboardingChecklistItem_licenseeId_sortOrder_key` (`licenseeId`,`sortOrder`),
  KEY `OnboardingChecklistItem_licenseeId_idx` (`licenseeId`),
  KEY `OnboardingChecklistItem_phase_idx` (`phase`),
  KEY `OnboardingChecklistItem_status_idx` (`status`),
  CONSTRAINT `OnboardingChecklistItem_licenseeId_fkey` FOREIGN KEY (`licenseeId`) REFERENCES `licensee` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000ifp60mrjki4tj','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_1_APPLICATION',1,'Watch Welcome Video',NULL,0,0,NULL,NULL,'COMPLETED',NULL,'2026-02-13 20:53:08.115',NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:53:08.123');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000jfp60ul1472fh','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_1_APPLICATION',2,'Provide Business Information',NULL,0,0,NULL,NULL,'COMPLETED',NULL,'2026-02-13 21:00:28.482',NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 21:00:28.489');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000kfp60hwps7vek','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_1_APPLICATION',3,'Emergency Contact Info',NULL,0,0,NULL,NULL,'COMPLETED',NULL,'2026-02-13 21:00:31.164',NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 21:00:31.172');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000lfp60miu78x3o','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_2_DOCUMENTATION',4,'Upload Liability Insurance',NULL,1,1,'insurance',NULL,'AVAILABLE',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 21:00:31.292');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000mfp6048kz3v7o','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_2_DOCUMENTATION',5,'Upload Government ID',NULL,1,1,'identification',NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000nfp60lfvdonb2','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_2_DOCUMENTATION',6,'Sign Instructor Agreement',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000ofp607ahs7d4y','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_3_TRAINING',7,'Complete Child Safety Training',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000pfp60hqbcdo6c','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_3_TRAINING',8,'Complete Curriculum Training',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgl000qfp60tyfgfq5w','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_3_TRAINING',9,'Pass Training Assessment',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgm000rfp60a2ftzssu','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_4_SETUP',10,'Submit Instructor Bio',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgm000sfp60rxvi492s','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_4_SETUP',11,'Upload Professional Photo',NULL,1,1,'headshot',NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgm000tfp60j68wnmm7','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_4_SETUP',12,'Set Service Areas',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgm000ufp60d7f154qj','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_5_LAUNCH_PREP',13,'Review All Information',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
INSERT INTO `onboardingchecklistitem` VALUES ('cmllccdgm000vfp60ehhn8mfy','cmllccdg1000hfp60zo30jgqc','CLASSES_ONLY','PHASE_5_LAUNCH_PREP',14,'Submit for Admin Approval',NULL,0,0,NULL,NULL,'LOCKED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-02-13 20:29:21.573','2026-02-13 20:29:21.573');
CREATE TABLE `onboardingchecklisttemplate` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `licenseModel` enum('CLASSES_ONLY','MOBILE_GYM','PHYSICAL_LOCATION') COLLATE utf8mb4_unicode_ci NOT NULL,
  `phase` enum('PHASE_1_APPLICATION','PHASE_2_DOCUMENTATION','PHASE_3_TRAINING','PHASE_4_SETUP','PHASE_5_LAUNCH_PREP','COMPLETED') COLLATE utf8mb4_unicode_ci NOT NULL,
  `sortOrder` int NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `requiresDocument` tinyint(1) NOT NULL DEFAULT '0',
  `requiresAdminApproval` tinyint(1) NOT NULL DEFAULT '0',
  `documentType` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instructionsUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT '1',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `OnboardingChecklistTemplate_licenseModel_sortOrder_key` (`licenseModel`,`sortOrder`),
  KEY `OnboardingChecklistTemplate_licenseModel_idx` (`licenseModel`),
  KEY `OnboardingChecklistTemplate_phase_idx` (`phase`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `onboardingvideo` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `videoUrl` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `thumbnailUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `duration` int DEFAULT NULL,
  `fileSize` int DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT '1',
  `sortOrder` int NOT NULL DEFAULT '0',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updatedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `OnboardingVideo_isActive_idx` (`isActive`),
  KEY `OnboardingVideo_sortOrder_idx` (`sortOrder`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `onboardingvideo` VALUES ('cmllb7ocj0003fp60sps3yykk','Welcome to superkid fitness','Brief description of the video','/uploads/onboarding-videos/onboarding-1771012662646.mp4',NULL,NULL,5376552,0,0,'2026-02-13 19:57:42.787','2026-02-13 20:05:46.043','cmlkx8aez000012b3v1n7vhy4',NULL,NULL);
INSERT INTO `onboardingvideo` VALUES ('cmllbi18u0004fp6043fmgxdv','Welcome to superkid fitness','Brief description of the video','https://res.cloudinary.com/dfzz1nnkx/video/upload/v1771013139/onboarding-videos/x0qugrwengf00y0jhatn.mp4',NULL,NULL,5376552,1,0,'2026-02-13 20:05:46.062','2026-02-13 20:05:46.062','cmlkx8aez000012b3v1n7vhy4',NULL,NULL);
CREATE TABLE `saleslead` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `companyName` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contactName` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('NEW','CONTACTED','QUALIFIED','PROPOSAL','NEGOTIATION','WON','LOST') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NEW',
  `source` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estimatedValue` decimal(10,2) DEFAULT NULL,
  `salesRepId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `wonDate` datetime(3) DEFAULT NULL,
  `lostDate` datetime(3) DEFAULT NULL,
  `lostReason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `licenseeId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updatedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `SalesLead_licenseeId_key` (`licenseeId`),
  KEY `SalesLead_status_idx` (`status`),
  KEY `SalesLead_salesRepId_idx` (`salesRepId`),
  CONSTRAINT `SalesLead_licenseeId_fkey` FOREIGN KEY (`licenseeId`) REFERENCES `licensee` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `SalesLead_salesRepId_fkey` FOREIGN KEY (`salesRepId`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `salesnote` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `leadId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `noteType` enum('GENERAL','CALL','EMAIL','MEETING','FOLLOW_UP') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'GENERAL',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `SalesNote_leadId_idx` (`leadId`),
  CONSTRAINT `SalesNote_leadId_fkey` FOREIGN KEY (`leadId`) REFERENCES `saleslead` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `supportticket` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ticketNumber` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` enum('TECHNICAL','BILLING','COMPLIANCE','TRAINING','GENERAL') COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` enum('LOW','NORMAL','HIGH','URGENT') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NORMAL',
  `status` enum('OPEN','IN_PROGRESS','WAITING_RESPONSE','RESOLVED','CLOSED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'OPEN',
  `submittedById` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `assignedToId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resolvedAt` datetime(3) DEFAULT NULL,
  `resolution` text COLLATE utf8mb4_unicode_ci,
  `attachments` json DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `SupportTicket_ticketNumber_key` (`ticketNumber`),
  KEY `SupportTicket_status_idx` (`status`),
  KEY `SupportTicket_submittedById_idx` (`submittedById`),
  CONSTRAINT `SupportTicket_submittedById_fkey` FOREIGN KEY (`submittedById`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `task` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `priority` enum('LOW','MEDIUM','HIGH','URGENT') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'MEDIUM',
  `status` enum('OPEN','IN_PROGRESS','COMPLETED','CANCELLED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'OPEN',
  `licenseeId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assignedToId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdById` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `relatedSection` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deepLink` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dueDate` datetime(3) DEFAULT NULL,
  `completedAt` datetime(3) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `Task_licenseeId_idx` (`licenseeId`),
  KEY `Task_assignedToId_idx` (`assignedToId`),
  KEY `Task_status_idx` (`status`),
  KEY `Task_dueDate_idx` (`dueDate`),
  KEY `Task_createdById_fkey` (`createdById`),
  CONSTRAINT `Task_assignedToId_fkey` FOREIGN KEY (`assignedToId`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `Task_createdById_fkey` FOREIGN KEY (`createdById`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `Task_licenseeId_fkey` FOREIGN KEY (`licenseeId`) REFERENCES `licensee` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `trainingmodule` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `videoUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `videoDuration` int DEFAULT NULL,
  `thumbnailUrl` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `materials` json DEFAULT NULL,
  `sortOrder` int NOT NULL DEFAULT '0',
  `isRequired` tinyint(1) NOT NULL DEFAULT '0',
  `isActive` tinyint(1) NOT NULL DEFAULT '1',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updatedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `TrainingModule_sortOrder_idx` (`sortOrder`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `trainingprogress` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `userId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `moduleId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('NOT_STARTED','IN_PROGRESS','COMPLETED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NOT_STARTED',
  `progressPercent` int NOT NULL DEFAULT '0',
  `startedAt` datetime(3) DEFAULT NULL,
  `completedAt` datetime(3) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `TrainingProgress_userId_moduleId_key` (`userId`,`moduleId`),
  KEY `TrainingProgress_userId_idx` (`userId`),
  KEY `TrainingProgress_moduleId_idx` (`moduleId`),
  CONSTRAINT `TrainingProgress_moduleId_fkey` FOREIGN KEY (`moduleId`) REFERENCES `trainingmodule` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `TrainingProgress_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `user` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `firstName` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lastName` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` enum('APPLICANT','ACTIVE_LICENSEE','PAST_DUE_LICENSEE','SALES','ADMIN') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'APPLICANT',
  `status` enum('PENDING','ACTIVE','SUSPENDED','EXPIRED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
  `emailVerified` datetime(3) DEFAULT NULL,
  `inviteCode` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inviteCodeUsed` tinyint(1) NOT NULL DEFAULT '0',
  `inviteExpiresAt` datetime(3) DEFAULT NULL,
  `licenseeId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  `createdBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updatedBy` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  `watchedWelcomeVideo` tinyint(1) NOT NULL DEFAULT '0',
  `welcomeVideoWatchedAt` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `User_email_key` (`email`),
  UNIQUE KEY `User_inviteCode_key` (`inviteCode`),
  UNIQUE KEY `User_licenseeId_key` (`licenseeId`),
  KEY `User_email_idx` (`email`),
  KEY `User_role_idx` (`role`),
  KEY `User_licenseeId_idx` (`licenseeId`),
  CONSTRAINT `User_licenseeId_fkey` FOREIGN KEY (`licenseeId`) REFERENCES `licensee` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `user` VALUES ('cmlkx8aez000012b3v1n7vhy4','admin@superkidfitness.com','$2a$10$9rDsHxOqM7Mx1o1s6bUgWefFCnUWWQSQpzGEFayyKRo6a.HWXj8Tm','Super Kid','Admin','+1234567890','ADMIN','ACTIVE','2026-02-13 13:26:16.759',NULL,0,NULL,NULL,'2026-02-13 13:26:16.762','2026-02-13 13:26:16.762',NULL,NULL,NULL,0,NULL);
INSERT INTO `user` VALUES ('cmlla71cy0000fp60xl2uo04p','beocodes@gmail.com','$2a$10$lUCCYRi5b8eDj.kFNoKQYOxIfNNIUMnc5Dw53PDTX99vWpaJoESqK','Emmanuel','Tester','','APPLICANT','PENDING',NULL,'INV-QCFC6R1UQE',1,'2026-02-20 19:29:13.169','cmllccdg1000hfp60zo30jgqc','2026-02-13 19:29:13.367','2026-02-13 20:29:21.589',NULL,NULL,NULL,1,'2026-02-13 20:18:15.221');


