Repository: mendesmariosatech/mmtech
Pull request #86: Backend projects
Author: login: mendes-develop
Created: 2025-04-13T18:16:35Z | Merged: 2025-04-13T19:51:22Z



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Novas Funcionalidades**
	- Adição de rotas que permitem a criação e consulta de planos mestres, facilitando o gerenciamento de planos e tarefas associadas.
	- Suporte para operações de criação e recuperação de tarefas mestres.
- **Melhorias de Dados**
	- Atualizações na estrutura dos dados para garantir maior consistência e integridade das informações exibidas, aprimorando a confiabilidade do sistema.

Essas atualizações visam melhorar a experiência do usuário, proporcionando um controle mais efetivo dos planos e das tarefas associadas dentro da aplicação.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/.husky/pre-commit b/.husky/pre-commit
index ab02cc66..eb5d2f6a 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,8 +1,4 @@
 #!/usr/bin/env sh
-. "$(dirname -- "$0")/_/husky.sh"
-
-# yarn format && git add -A .
-
 # .husky/pre-commit
 # Only format TypeScript files
 yarn biome format $(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(ts|tsx)$' | sed 's| |\\ |g') --write
diff --git a/packages/server/migrations/0000_brave_sway.sql b/packages/server/migrations/0000_aberrant_zuras.sql
similarity index 96%
rename from packages/server/migrations/0000_brave_sway.sql
rename to packages/server/migrations/0000_aberrant_zuras.sql
index aa725228..4dde6d5e 100644
--- a/packages/server/migrations/0000_brave_sway.sql
+++ b/packages/server/migrations/0000_aberrant_zuras.sql
@@ -66,9 +66,9 @@ CREATE TABLE `component_page` (
 CREATE TABLE `landing_page.components` (
 	`id` integer PRIMARY KEY NOT NULL,
 	`type` text NOT NULL,
-	`content` text,
+	`content` text NOT NULL,
 	`css` text NOT NULL,
-	`created_at` integer DEFAULT '"2025-01-30T00:27:33.779Z"'
+	`created_at` integer DEFAULT '"2025-04-06T17:50:59.659Z"' NOT NULL
 );
 --> statement-breakpoint
 CREATE TABLE `customer` (
@@ -134,5 +134,4 @@ CREATE TABLE `videos` (
 );
 --> statement-breakpoint
 CREATE UNIQUE INDEX `auth_email_unique` ON `auth` (`email`);--> statement-breakpoint
-CREATE INDEX `page_component_idx` ON `component_page` (`page_id`,`component_id`);--> statement-breakpoint
-CREATE INDEX `type_idx` ON `landing_page.components` (`type`);
\ No newline at end of file
+CREATE INDEX `page_component_idx` ON `component_page` (`page_id`,`component_id`);
\ No newline at end of file
diff --git a/packages/server/migrations/0000_lush_venom.sql b/packages/server/migrations/0000_lush_venom.sql
deleted file mode 100644
index 41f513d3..00000000
--- a/packages/server/migrations/0000_lush_venom.sql
+++ /dev/null
@@ -1,90 +0,0 @@
-CREATE TABLE `address` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`street_address` text NOT NULL,
-	`complement` text,
-	`state_or_province` text NOT NULL,
-	`city` text NOT NULL,
-	`postal_code` text NOT NULL,
-	`country` text NOT NULL,
-	`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer
-);
---> statement-breakpoint
-CREATE TABLE `auth` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`name` text NOT NULL,
-	`password` text NOT NULL,
-	`email` text NOT NULL,
-	`phone` text,
-	`email_confirmed_at` integer,
-	`deleted_at` integer,
-	`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer
-);
---> statement-breakpoint
-CREATE TABLE `business_customers` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`business_id` text NOT NULL,
-	`customer_id` text NOT NULL,
-	`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer,
-	FOREIGN KEY (`business_id`) REFERENCES `business`(`id`) ON UPDATE no action ON DELETE cascade,
-	FOREIGN KEY (`customer_id`) REFERENCES `customer`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `business` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`client_id` text NOT NULL,
-	`name` text NOT NULL,
-	`address_id` text,
-	`description` text,
-	`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer,
-	FOREIGN KEY (`client_id`) REFERENCES `client`(`id`) ON UPDATE no action ON DELETE cascade,
-	FOREIGN KEY (`address_id`) REFERENCES `address`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `client` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`auth_id` text NOT NULL,
-	`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer,
-	FOREIGN KEY (`auth_id`) REFERENCES `auth`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `customer` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`auth_id` text,
-	`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer,
-	FOREIGN KEY (`auth_id`) REFERENCES `auth`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `customer_attendee` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`customer_id` text NOT NULL,
-	`event_id` text NOT NULL,
-	`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer,
-	FOREIGN KEY (`customer_id`) REFERENCES `customer`(`id`) ON UPDATE no action ON DELETE cascade,
-	FOREIGN KEY (`event_id`) REFERENCES `event`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `event` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`client_id` text NOT NULL,
-	`business_id` text NOT NULL,
-	`address_id` text,
-	`title` text NOT NULL,
-	`description` text,
-	`date` integer NOT NULL,
-	`time` integer,
-	`location` text,
-	`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
-	`updated_at` integer,
-	FOREIGN KEY (`client_id`) REFERENCES `client`(`id`) ON UPDATE no action ON DELETE cascade,
-	FOREIGN KEY (`business_id`) REFERENCES `business`(`id`) ON UPDATE no action ON DELETE cascade,
-	FOREIGN KEY (`address_id`) REFERENCES `address`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE UNIQUE INDEX `auth_email_unique` ON `auth` (`email`);
\ No newline at end of file
diff --git a/packages/server/migrations/0001_heavy_kulan_gath.sql b/packages/server/migrations/0001_heavy_kulan_gath.sql
deleted file mode 100644
index b00db87b..00000000
--- a/packages/server/migrations/0001_heavy_kulan_gath.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-CREATE TABLE `videos` (
-	`id` text(128) PRIMARY KEY NOT NULL,
-	`business_id` text NOT NULL,
-	`title` text NOT NULL,
-	`url` text NOT NULL,
-	`description` text,
-	`created_at` integer NOT NULL,
-	`updated_at` integer,
-	FOREIGN KEY (`business_id`) REFERENCES `business`(`id`) ON UPDATE no action ON DELETE cascade
-);
diff --git a/packages/server/migrations/0001_red_jazinda.sql b/packages/server/migrations/0001_red_jazinda.sql
new file mode 100644
index 00000000..be869b15
--- /dev/null
+++ b/packages/server/migrations/0001_red_jazinda.sql
@@ -0,0 +1,17 @@
+CREATE TABLE `plan_master` (
+	`planMasterId` text(128) PRIMARY KEY NOT NULL,
+	`name` text NOT NULL,
+	`description` text,
+	`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
+	`updated_at` integer
+);
+--> statement-breakpoint
+CREATE TABLE `plan_master_tasks` (
+	`planMasterTasksId` text(128) PRIMARY KEY NOT NULL,
+	`plan_master_id` text NOT NULL,
+	`name` text NOT NULL,
+	`description` text,
+	`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
+	`updated_at` integer,
+	FOREIGN KEY (`plan_master_id`) REFERENCES `plan_master`(`planMasterId`) ON UPDATE no action ON DELETE cascade
+);
diff --git a/packages/server/migrations/meta/0000_snapshot.json b/packages/server/migrations/meta/0000_snapshot.json
index 9cd1aa1a..0bb9fbcb 100644
--- a/packages/server/migrations/meta/0000_snapshot.json
+++ b/packages/server/migrations/meta/0000_snapshot.json
@@ -1,7 +1,7 @@
 {
   "version": "6",
   "dialect": "sqlite",
-  "id": "b6c7ede6-57fe-4b38-a378-37af73816db3",
+  "id": "5d083391-d8bb-48a4-8a2a-4f3c6153af36",
   "prevId": "00000000-0000-0000-0000-000000000000",
   "tables": {
     "address": {
@@ -476,7 +476,7 @@
           "name": "content",
           "type": "text",
           "primaryKey": false,
-          "notNull": false,
+          "notNull": true,
           "autoincrement": false
         },
         "css": {
@@ -490,20 +490,12 @@
           "name": "created_at",
           "type": "integer",
           "primaryKey": false,
-          "notNull": false,
+          "notNull": true,
           "autoincrement": false,
-          "default": "'\"2025-01-30T00:27:33.779Z\"'"
-        }
-      },
-      "indexes": {
-        "type_idx": {
-          "name": "type_idx",
-          "columns": [
-            "type"
-          ],
-          "isUnique": false
+          "default": "'\"2025-04-06T17:50:59.659Z\"'"
         }
       },
+      "indexes": {},
       "foreignKeys": {},
       "compositePrimaryKeys": {},
       "uniqueConstraints": {}
diff --git a/packages/server/migrations/meta/0001_snapshot.json b/packages/server/migrations/meta/0001_snapshot.json
index af8358d8..29b64c46 100644
--- a/packages/server/migrations/meta/0001_snapshot.json
+++ b/packages/server/migrations/meta/0001_snapshot.json
@@ -1,8 +1,8 @@
 {
   "version": "6",
   "dialect": "sqlite",
-  "id": "4ed09724-792d-4c82-b6d3-d787465906ef",
-  "prevId": "56e5c989-ab73-42b6-a5b1-2f141612557f",
+  "id": "d86baa5d-ad2a-492d-a7d2-0a55aab6dbd2",
+  "prevId": "5d083391-d8bb-48a4-8a2a-4f3c6153af36",
   "tables": {
     "address": {
       "name": "address",
@@ -368,6 +368,138 @@
       "compositePrimaryKeys": {},
       "uniqueConstraints": {}
     },
+    "component_page": {
+      "name": "component_page",
+      "columns": {
+        "id": {
+          "name": "id",
+          "type": "integer",
+          "primaryKey": true,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "component_id": {
+          "name": "component_id",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        },
+        "page_id": {
+          "name": "page_id",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        },
+        "order": {
+          "name": "order",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "css_override": {
+          "name": "css_override",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        },
+        "content_override": {
+          "name": "content_override",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        }
+      },
+      "indexes": {
+        "page_component_idx": {
+          "name": "page_component_idx",
+          "columns": [
+            "page_id",
+            "component_id"
+          ],
+          "isUnique": false
+        }
+      },
+      "foreignKeys": {
+        "component_page_component_id_landing_page.components_id_fk": {
+          "name": "component_page_component_id_landing_page.components_id_fk",
+          "tableFrom": "component_page",
+          "tableTo": "landing_page.components",
+          "columnsFrom": [
+            "component_id"
+          ],
+          "columnsTo": [
+            "id"
+          ],
+          "onDelete": "no action",
+          "onUpdate": "no action"
+        },
+        "component_page_page_id_landing_page.page_id_fk": {
+          "name": "component_page_page_id_landing_page.page_id_fk",
+          "tableFrom": "component_page",
+          "tableTo": "landing_page.page",
+          "columnsFrom": [
+            "page_id"
+          ],
+          "columnsTo": [
+            "id"
+          ],
+          "onDelete": "no action",
+          "onUpdate": "no action"
+        }
+      },
+      "compositePrimaryKeys": {},
+      "uniqueConstraints": {}
+    },
+    "landing_page.components": {
+      "name": "landing_page.components",
+      "columns": {
+        "id": {
+          "name": "id",
+          "type": "integer",
+          "primaryKey": true,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "type": {
+          "name": "type",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "content": {
+          "name": "content",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "css": {
+          "name": "css",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "created_at": {
+          "name": "created_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false,
+          "default": "'\"2025-04-06T18:02:00.803Z\"'"
+        }
+      },
+      "indexes": {},
+      "foreignKeys": {},
+      "compositePrimaryKeys": {},
+      "uniqueConstraints": {}
+    },
     "customer": {
       "name": "customer",
       "columns": {
@@ -619,6 +751,212 @@
       "compositePrimaryKeys": {},
       "uniqueConstraints": {}
     },
+    "landing_page.page": {
+      "name": "landing_page.page",
+      "columns": {
+        "id": {
+          "name": "id",
+          "type": "text(128)",
+          "primaryKey": true,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "name": {
+          "name": "name",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "template_id": {
+          "name": "template_id",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "created_at": {
+          "name": "created_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "updated_at": {
+          "name": "updated_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        }
+      },
+      "indexes": {},
+      "foreignKeys": {
+        "landing_page.page_template_id_landing_page.template_id_fk": {
+          "name": "landing_page.page_template_id_landing_page.template_id_fk",
+          "tableFrom": "landing_page.page",
+          "tableTo": "landing_page.template",
+          "columnsFrom": [
+            "template_id"
+          ],
+          "columnsTo": [
+            "id"
+          ],
+          "onDelete": "cascade",
+          "onUpdate": "no action"
+        }
+      },
+      "compositePrimaryKeys": {},
+      "uniqueConstraints": {}
+    },
+    "plan_master": {
+      "name": "plan_master",
+      "columns": {
+        "planMasterId": {
+          "name": "planMasterId",
+          "type": "text(128)",
+          "primaryKey": true,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "name": {
+          "name": "name",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "description": {
+          "name": "description",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        },
+        "created_at": {
+          "name": "created_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false,
+          "default": "(CURRENT_TIMESTAMP)"
+        },
+        "updated_at": {
+          "name": "updated_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        }
+      },
+      "indexes": {},
+      "foreignKeys": {},
+      "compositePrimaryKeys": {},
+      "uniqueConstraints": {}
+    },
+    "plan_master_tasks": {
+      "name": "plan_master_tasks",
+      "columns": {
+        "planMasterTasksId": {
+          "name": "planMasterTasksId",
+          "type": "text(128)",
+          "primaryKey": true,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "plan_master_id": {
+          "name": "plan_master_id",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "name": {
+          "name": "name",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "description": {
+          "name": "description",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        },
+        "created_at": {
+          "name": "created_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false,
+          "default": "(CURRENT_TIMESTAMP)"
+        },
+        "updated_at": {
+          "name": "updated_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        }
+      },
+      "indexes": {},
+      "foreignKeys": {
+        "plan_master_tasks_plan_master_id_plan_master_planMasterId_fk": {
+          "name": "plan_master_tasks_plan_master_id_plan_master_planMasterId_fk",
+          "tableFrom": "plan_master_tasks",
+          "tableTo": "plan_master",
+          "columnsFrom": [
+            "plan_master_id"
+          ],
+          "columnsTo": [
+            "planMasterId"
+          ],
+          "onDelete": "cascade",
+          "onUpdate": "no action"
+        }
+      },
+      "compositePrimaryKeys": {},
+      "uniqueConstraints": {}
+    },
+    "landing_page.template": {
+      "name": "landing_page.template",
+      "columns": {
+        "id": {
+          "name": "id",
+          "type": "text(128)",
+          "primaryKey": true,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "name": {
+          "name": "name",
+          "type": "text",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "created_at": {
+          "name": "created_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": true,
+          "autoincrement": false
+        },
+        "updated_at": {
+          "name": "updated_at",
+          "type": "integer",
+          "primaryKey": false,
+          "notNull": false,
+          "autoincrement": false
+        }
+      },
+      "indexes": {},
+      "foreignKeys": {},
+      "compositePrimaryKeys": {},
+      "uniqueConstraints": {}
+    },
     "videos": {
       "name": "videos",
       "columns": {
diff --git a/packages/server/migrations/meta/_journal.json b/packages/server/migrations/meta/_journal.json
index 781ca308..d1a23c85 100644
--- a/packages/server/migrations/meta/_journal.json
+++ b/packages/server/migrations/meta/_journal.json
@@ -5,8 +5,15 @@
     {
       "idx": 0,
       "version": "6",
-      "when": 1738196853786,
-      "tag": "0000_brave_sway",
+      "when": 1743961859674,
+      "tag": "0000_aberrant_zuras",
+      "breakpoints": true
+    },
+    {
+      "idx": 1,
+      "version": "6",
+      "when": 1743962520825,
+      "tag": "0001_red_jazinda",
       "breakpoints": true
     }
   ]
diff --git a/packages/server/package.json b/packages/server/package.json
index e42e9f0e..8f2d5df0 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -3,7 +3,6 @@
   "version": "0.0.1",
   "scripts": {
     "dev": "tsx watch app.ts",
-    "deploy": "wrangler deploy --minify src/index.ts",
     "db:generate": "npx drizzle-kit generate",
     "db:migrate": "npx drizzle-kit migrate",
     "test": "jest --env-file=.env",
diff --git a/packages/server/src/base/type.ts b/packages/server/src/base/type.ts
index 43aff1c0..d3132f1c 100644
--- a/packages/server/src/base/type.ts
+++ b/packages/server/src/base/type.ts
@@ -2,6 +2,7 @@ import type { OpenAPIHono, RouteConfig, RouteHandler } from "@hono/zod-openapi";
 import { ENV_TYPES } from "@repo/zod-types";
 import { DBConnection, DBConnectionFunc } from "../drizzle/drizzle-client";
 import { VideoDTO } from "../drizzle/videos/videos.dto";
+import { TasksDTO } from "../drizzle/tasks/tasks.dto";
 
 type Variables = {
 	authId: string;
@@ -10,6 +11,7 @@ type Variables = {
 	db: DBConnectionFunc;
 	dto: {
 		Videos: VideoDTO;
+		Tasks: TasksDTO;
 	};
 };
 export type AppOpenAPI = {
diff --git a/packages/server/src/drizzle/schema.ts b/packages/server/src/drizzle/schema.ts
index 6f0c7ad7..53ee4627 100644
--- a/packages/server/src/drizzle/schema.ts
+++ b/packages/server/src/drizzle/schema.ts
@@ -18,6 +18,11 @@ export {
 } from "./landing-page/page/page";
 export { componentTable } from "./landing-page/component/component";
 
+export {
+	planMaster,
+	planMasterTasks,
+} from "./tasks/master-plan";
+
 export const authTable = sqliteTable("auth", {
 	id: text("id", { length: 128 })
 		.$defaultFn(() => genEntityId("AU"))
diff --git a/packages/server/src/drizzle/tasks/master-plan.ts b/packages/server/src/drizzle/tasks/master-plan.ts
new file mode 100644
index 00000000..8f758f79
--- /dev/null
+++ b/packages/server/src/drizzle/tasks/master-plan.ts
@@ -0,0 +1,62 @@
+import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
+import { genEntityId } from "../utils";
+import { clientTable } from "../schema";
+import { sql } from "drizzle-orm";
+import { createInsertSchema, createSelectSchema } from "drizzle-zod";
+import { z } from "zod";
+
+const PlanMasterId = z.string().brand("PlanMasterId");
+const PlanMasterTasksId = z.string().brand("PlanMasterTasksId");
+
+export const planMaster = sqliteTable("plan_master", {
+	planMasterId: text("planMasterId", { length: 128 })
+		.$defaultFn(() => genEntityId("PM"))
+		.primaryKey()
+		.notNull(),
+	name: text("name").notNull(),
+	description: text("description"),
+	createdAt: integer("created_at").default(sql`(CURRENT_TIMESTAMP)`).notNull(),
+	updatedAt: integer("updated_at", { mode: "timestamp" }).$onUpdate(
+		() => new Date(),
+	),
+});
+
+export const GetSchemaPlanMaster = createSelectSchema(planMaster);
+
+export const PlanMaster = createInsertSchema(planMaster).pick({
+	name: true,
+	description: true,
+});
+
+export type PlanMaster = z.infer<typeof PlanMaster>;
+
+export const planMasterTasks = sqliteTable("plan_master_tasks", {
+	planMasterTasksId: text("planMasterTasksId", { length: 128 })
+		.$defaultFn(() => genEntityId("PMT"))
+		.primaryKey()
+		.notNull(),
+	planMasterId: text("plan_master_id")
+		.references(() => planMaster.planMasterId, { onDelete: "cascade" })
+		.notNull(),
+	name: text("name").notNull(),
+	description: text("description"),
+	createdAt: integer("created_at").default(sql`(CURRENT_TIMESTAMP)`).notNull(),
+	updatedAt: integer("updated_at", { mode: "timestamp" }).$onUpdate(
+		() => new Date(),
+	),
+});
+
+const PlanMasterTasks = createInsertSchema(planMasterTasks)
+	.pick({
+		name: true,
+		description: true,
+		planMasterId: true,
+	})
+	.transform((value) => {
+		return {
+			...value,
+			planMasterId: PlanMasterTasksId.parse(value.planMasterId),
+		};
+	});
+
+type PlanMasterTasks = z.infer<typeof PlanMasterTasks>;
diff --git a/packages/server/src/drizzle/tasks/tasks.dto.ts b/packages/server/src/drizzle/tasks/tasks.dto.ts
new file mode 100644
index 00000000..ba2a1c6b
--- /dev/null
+++ b/packages/server/src/drizzle/tasks/tasks.dto.ts
@@ -0,0 +1,17 @@
+import type { DBConnectionFunc } from "../drizzle-client";
+import { planMaster, type PlanMaster } from "./master-plan";
+
+export const TasksDTO = (db: DBConnectionFunc) => ({
+	async createMasterTasks(args: PlanMaster) {
+		const [masterTasks] = await db.insert(planMaster).values(args).returning();
+
+		return masterTasks;
+	},
+
+	async getAllMasterPlans() {
+		const masterPlans = await db.select().from(planMaster);
+		return masterPlans;
+	},
+});
+
+export type TasksDTO = ReturnType<typeof TasksDTO>;
diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts
index e6651ae2..95ae84c6 100644
--- a/packages/server/src/index.ts
+++ b/packages/server/src/index.ts
@@ -6,6 +6,7 @@ import { calendarRouter } from "./routes/calendar";
 import { businessRouter } from "./routes/business";
 import { videosRouter } from "./routes/videos";
 import { templateRouter } from "./routes/landing-page";
+import { plansRouter } from "./routes/plans";
 
 const route = app
 	.basePath(base_api_path) // in order to work with Next.js API routes
@@ -15,6 +16,7 @@ const route = app
 	.route("/", calendarRouter)
 	.route("/", personalRouter)
 	.route("/", videosRouter)
+	.route("/", plansRouter)
 	.route("/", templateRouter);
 
 withOpenApi(app);
diff --git a/packages/server/src/routes/middleware/dbContext.ts b/packages/server/src/routes/middleware/dbContext.ts
index 70c29940..7f5cdc06 100644
--- a/packages/server/src/routes/middleware/dbContext.ts
+++ b/packages/server/src/routes/middleware/dbContext.ts
@@ -3,6 +3,7 @@ import { createMiddleware } from "hono/factory";
 import { dbConnection, DBConnection } from "../../drizzle/drizzle-client";
 import { AppOpenAPI } from "../../base/type";
 import { VideoDTO } from "../../drizzle/videos/videos.dto";
+import { TasksDTO } from "../../drizzle/tasks/tasks.dto";
 
 export const dbContext = createMiddleware<any, string, {}, AppOpenAPI>(
 	async (c, next) => {
@@ -12,8 +13,13 @@ export const dbContext = createMiddleware<any, string, {}, AppOpenAPI>(
 		// and will return all of the DTOs that are needed for the app
 		const db = dbConnection(TURSO_CONNECTION_URL, TURSO_AUTH_TOKEN);
 
+		console.log("DB", db);
+
 		c.set("db", db);
-		c.set("dto", { Videos: VideoDTO(db) });
+		c.set("dto", {
+			Videos: VideoDTO(db),
+			Tasks: TasksDTO(db),
+		});
 
 		await next();
 	},
diff --git a/packages/server/src/routes/plans/create-master-plan.ts b/packages/server/src/routes/plans/create-master-plan.ts
new file mode 100644
index 00000000..5b04b587
--- /dev/null
+++ b/packages/server/src/routes/plans/create-master-plan.ts
@@ -0,0 +1,73 @@
+import { z } from "zod";
+import { createRoute } from "@hono/zod-openapi";
+import { AppRouteHandler } from "../../base/type";
+import { authMiddleware } from "../middleware/authentication";
+import {
+	GetSchemaPlanMaster,
+	PlanMaster,
+} from "../../drizzle/tasks/master-plan";
+import { dbContext } from "../middleware/dbContext";
+
+export const createMasterPlanSpec = createRoute({
+	method: "post",
+	path: "/master-plan",
+	tags: ["plans"],
+	middleware: [dbContext],
+	// header: { authorization: z.string(), },
+	request: {
+		body: {
+			content: {
+				"application/json": {
+					schema: PlanMaster,
+				},
+			},
+		},
+	},
+	responses: {
+		200: {
+			description: "Get personal data",
+			content: {
+				"application/json": {
+					schema: z.object({
+						data: GetSchemaPlanMaster,
+					}),
+				},
+			},
+		},
+		500: {
+			description: "Unauthorized",
+			content: {
+				"application/json": {
+					schema: z.object({
+						error: z.object({
+							message: z.string(),
+						}),
+					}),
+				},
+			},
+		},
+	},
+});
+
+type PersonalRoute = typeof createMasterPlanSpec;
+
+export const createMasterPlanHandler: AppRouteHandler<PersonalRoute> = async (
+	c,
+) => {
+	const input = c.req.valid("json");
+	const Tasks = c.get("dto").Tasks;
+	const masterTasks = await Tasks.createMasterTasks(input);
+
+	if (!masterTasks) {
+		return c.json(
+			{
+				error: {
+					message: "Failed to create master tasks",
+				},
+			},
+			500,
+		);
+	}
+
+	return c.json({ data: masterTasks }, 200);
+};
diff --git a/packages/server/src/routes/plans/get-master-plans.ts b/packages/server/src/routes/plans/get-master-plans.ts
new file mode 100644
index 00000000..01a8cc27
--- /dev/null
+++ b/packages/server/src/routes/plans/get-master-plans.ts
@@ -0,0 +1,59 @@
+import { z } from "zod";
+import { createRoute } from "@hono/zod-openapi";
+import type { AppRouteHandler } from "../../base/type";
+import { GetSchemaPlanMaster } from "../../drizzle/tasks/master-plan";
+import { dbContext } from "../middleware/dbContext";
+
+export const getMasterPlansSpec = createRoute({
+	method: "get",
+	path: "/master-plans",
+	tags: ["plans"],
+	middleware: [dbContext],
+	responses: {
+		200: {
+			description: "Lista de planos mestre recuperados com sucesso",
+			content: {
+				"application/json": {
+					schema: z.object({
+						data: z.array(GetSchemaPlanMaster),
+					}),
+				},
+			},
+		},
+		500: {
+			description: "Server Error",
+			content: {
+				"application/json": {
+					schema: z.object({
+						error: z.object({
+							message: z.string(),
+						}),
+					}),
+				},
+			},
+		},
+	},
+});
+
+type GetMasterPlansRoute = typeof getMasterPlansSpec;
+
+export const getMasterPlansHandler: AppRouteHandler<
+	GetMasterPlansRoute
+> = async (c) => {
+	const Tasks = c.get("dto").Tasks;
+
+	try {
+		const masterPlans = await Tasks.getAllMasterPlans();
+		return c.json({ data: masterPlans }, 200);
+	} catch (error) {
+		console.error("Error getting master plans:", error);
+		return c.json(
+			{
+				error: {
+					message: "Failed to retrieve master plans",
+				},
+			},
+			500,
+		);
+	}
+};
diff --git a/packages/server/src/routes/plans/index.ts b/packages/server/src/routes/plans/index.ts
new file mode 100644
index 00000000..c725ffe4
--- /dev/null
+++ b/packages/server/src/routes/plans/index.ts
@@ -0,0 +1,12 @@
+import { app } from "../../base/base-app";
+import {
+	createMasterPlanHandler,
+	createMasterPlanSpec,
+} from "./create-master-plan";
+import { getMasterPlansHandler, getMasterPlansSpec } from "./get-master-plans";
+
+const plansRouter = app
+	.openapi(createMasterPlanSpec, createMasterPlanHandler)
+	.openapi(getMasterPlansSpec, getMasterPlansHandler);
+
+export { plansRouter };


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 6**

<details>
<summary>🔭 Outside diff range comments (2)</summary><blockquote>

<details>
<summary>packages/server/src/routes/plans/create-master-plan copy.ts (1)</summary><blockquote>

`1-74`: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**Nome do arquivo sugere que é uma cópia.**

O nome do arquivo "create-master-plan copy.ts" sugere que este é um arquivo duplicado. Recomendo renomear para um nome mais apropriado, como "create-master-plan.ts".

---

🏁 Script executed:

```shell
#!/bin/bash
# Verificar se existe outro arquivo "create-master-plan.ts" no mesmo diretório
find packages/server/src/routes/plans -name "create-master-plan.ts" -type f
```

Length of output: 130

---



</details>

**Ação necessária: Renomear ou remover arquivo duplicado**

Verificamos que existe um arquivo `create-master-plan.ts` no mesmo diretório, o que indica que o arquivo `create-master-plan copy.ts` é provavelmente uma duplicata desnecessária. Para evitar confusões e manter a consistência do código, recomendo que:

- Caso o conteúdo dos arquivos seja idêntico, remova `create-master-plan copy.ts`.
- Se a duplicata for necessária por algum motivo específico, renomeie-a para um nome que reflita melhor sua finalidade, evitando o uso do sufixo "copy".

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Biome (1.9.4)</summary>

[error] 3-3: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

</blockquote></details>
<details>
<summary>packages/server/src/drizzle/tasks/master-plan.ts (1)</summary><blockquote>

`49-63`: _⚠️ Potential issue_

**Inconsistência na transformação de ID e falta de exportação**

Há uma possível inconsistência na transformação do `planMasterId`. Na linha 58, o tipo usado é `PlanMasterTasksId`, mas o campo refere-se a um `planMasterId` que deveria usar o tipo `PlanMasterId` definido na linha 8.

Além disso, ao contrário do esquema `PlanMaster`, o esquema `PlanMasterTasks` e seu tipo não são exportados, o que pode limitar sua usabilidade em outros módulos.


```diff
 const PlanMasterTasks = createInsertSchema(planMasterTasks)
   .pick({
     name: true,
     description: true,
     planMasterId: true,
   })
   .transform((value) => {
     return {
       ...value,
-      planMasterId: PlanMasterTasksId.parse(value.planMasterId),
+      planMasterId: PlanMasterId.parse(value.planMasterId),
     };
   });

-type PlanMasterTasks = z.infer<typeof PlanMasterTasks>;
+export const PlanMasterTasks = PlanMasterTasks;
+export type PlanMasterTasks = z.infer<typeof PlanMasterTasks>;
```

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (13)</summary><blockquote>

<details>
<summary>packages/server/src/routes/middleware/dbContext.ts (1)</summary><blockquote>

`16-17`: **Considere remover console.log antes de mover para produção.**

O console.log pode ser útil durante o desenvolvimento, mas não é recomendado em código de produção.


```diff
-console.log("DB", db);
```

</blockquote></details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectTile.tsx (1)</summary><blockquote>

`8-26`: **Considere aprimorar a apresentação do link.**

O componente apresenta algumas oportunidades de melhoria:

1. O texto "Project: {props.link}" mostra o link bruto, o que pode não ser visualmente agradável
2. A descrição do projeto contém uma referência estática ao link, tornando todas as descrições idênticas exceto pelo link inserido no meio do texto


Sugiro refatorar para usar dados mais significativos:

```diff
-			<h2 className="text-xl font-semibold text-gray-700 mb-4">
-				Project: {props.link}
-			</h2>
-			<p className="text-gray-600 mb-4">
-				A full-stack {props.link} with user authentication, product catalog,
-				shopping cart, and checkout functionality.
-			</p>
+			<h2 className="text-xl font-semibold text-gray-700 mb-4">
+				{props.link.split('/').pop()}
+			</h2>
+			<p className="text-gray-600 mb-4">
+				Um projeto full-stack com autenticação de usuário e funcionalidades avançadas.
+			</p>
```

Ou, idealmente, passar dados completos para o componente:

```typescript
type Props = {
	title: string;
	description: string;
	link: string;
};
```

</blockquote></details>
<details>
<summary>packages/server/src/base/type.ts (1)</summary><blockquote>

`5-5`: **Use import type para importações que são usadas apenas como tipos.**

A importação de TasksDTO é usada apenas como um tipo na definição de Variables.


```diff
-import { TasksDTO } from "../drizzle/tasks/tasks.dto";
+import type { TasksDTO } from "../drizzle/tasks/tasks.dto";
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Biome (1.9.4)</summary>

[error] 5-5: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

</blockquote></details>
<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (1)</summary><blockquote>

`1-1`: **Utilize import type para importações que são usadas apenas como tipos.**

A importação de DBConnectionFunc é utilizada apenas como tipo. Recomendamos usar import type para garantir que o código seja otimizado durante a compilação.

```diff
-import { DBConnectionFunc } from "../drizzle-client";
+import type { DBConnectionFunc } from "../drizzle-client";
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Biome (1.9.4)</summary>

[error] 1-1: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

</blockquote></details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectList.tsx (1)</summary><blockquote>

`8-21`: **Simplifique a lógica de filtragem de rotas.**

O switch case atual pode ser simplificado usando um array com as rotas desejadas e o método includes.

```diff
-const filteredRoutes = typedKeys(Routes.client).filter((route) => {
-	switch (route) {
-		case "/videos":
-			return true;
-		case "/tasks":
-			return true;
-		case "/page-builder":
-			return true;
-		case "/page-builderV2":
-			return true;
-		default:
-			return false;
-	}
-});
+const allowedRoutes = ["/videos", "/tasks", "/page-builder", "/page-builderV2"];
+const filteredRoutes = typedKeys(Routes.client).filter(route => 
+   allowedRoutes.includes(route as string)
+);
```

</blockquote></details>
<details>
<summary>packages/server/migrations/0001_red_jazinda.sql (1)</summary><blockquote>

`9-17`: **Inconsistência na nomenclatura dos campos entre as tabelas.**

Existe uma inconsistência no estilo de nomenclatura: a tabela `plan_master` usa `planMasterId` (camelCase) enquanto `plan_master_tasks` usa `plan_master_id` (snake_case). Recomendo padronizar o estilo em todas as tabelas para manter consistência na base de dados.


```diff
-	`planMasterId` text(128) PRIMARY KEY NOT NULL,
+	`plan_master_id` text(128) PRIMARY KEY NOT NULL,
```

Ou alternativamente:

```diff
-	`plan_master_id` text NOT NULL,
+	`planMasterId` text NOT NULL,
-	FOREIGN KEY (`plan_master_id`) REFERENCES `plan_master`(`planMasterId`) ON UPDATE no action ON DELETE cascade
+	FOREIGN KEY (`planMasterId`) REFERENCES `plan_master`(`planMasterId`) ON UPDATE no action ON DELETE cascade
```

</blockquote></details>
<details>
<summary>packages/server/src/routes/plans/create-master-plan copy.ts (1)</summary><blockquote>

`52-53`: **Nome do tipo está inconsistente com a funcionalidade.**

O tipo `PersonalRoute` parece ter sido copiado de outro arquivo e não reflete adequadamente a funcionalidade desta rota.


```diff
-type PersonalRoute = typeof createMasterPlanSpec;
+type MasterPlanRoute = typeof createMasterPlanSpec;
```

</blockquote></details>
<details>
<summary>packages/data-testing/Routes.ts (1)</summary><blockquote>

`17-32`: **Estrutura de rotas aninhadas bem organizada**

A organização das rotas aninhadas para vídeos, tarefas e builders de página está bem estruturada, facilitando a manutenção e escalabilidade do sistema.

Porém, notei uma possível inconsistência na linha 25: `/page-builder` aponta para `/page-builderV1`, enquanto `/page-builderV2` aponta para `/page-builderV2`. Isso pode gerar confusão para novos desenvolvedores. Considere padronizar o nome das rotas.

</blockquote></details>
<details>
<summary>packages/server/src/routes/plans/create-master-plan.ts (3)</summary><blockquote>

`1-9`: **Imports bem organizados, mas podem ser otimizados**

Os imports estão bem organizados, mas há uma sugestão da análise estática para usar `import type` na linha 3, já que estas importações são usadas apenas como tipos.


```diff
-import { AppRouteHandler } from "../../base/type";
+import type { AppRouteHandler } from "../../base/type";
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Biome (1.9.4)</summary>

[error] 3-3: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

---

`52-53`: **Nome de tipo pode ser mais descritivo**

O nome `PersonalRoute` poderia ser mais descritivo para refletir melhor o propósito da rota, como `MasterPlanRoute` ou `CreateMasterPlanRoute`.


```diff
-type PersonalRoute = typeof createMasterPlanSpec;
+type CreateMasterPlanRoute = typeof createMasterPlanSpec;
```

---

`54-73`: **Handler bem implementado, mas poderia ter logs para depuração**

O handler está bem implementado com validação de entrada e tratamento de erros adequado. Considere adicionar logs de erro para facilitar a depuração em caso de falha.
 

```diff
 if (!masterTasks) {
+    console.error("Failed to create master tasks");
     return c.json(
       {
         error: {
           message: "Failed to create master tasks",
         },
       },
       500,
     );
   }
```

</blockquote></details>
<details>
<summary>packages/server/migrations/meta/0001_snapshot.json (2)</summary><blockquote>

`371-457`: **Nova Tabela "component_page" Adicionada**  
A tabela `"component_page"` foi introduzida com as colunas:  
- `"id"` (integer, chave primária),  
- `"component_id"` (integer, permitindo nulo),  
- `"page_id"` (integer, permitindo nulo),  
- `"order"` (integer, obrigatório),  
- `"css_override"` e `"content_override"` (do tipo text, opcionais).  

Além disso, foi criado o índice `"page_component_idx"` e definidas chaves estrangeiras para as tabelas `"landing_page.components"` e `"landing_page.page"`. Verifique se os tipos de dados e as restrições (especialmente a possibilidade de nulos em `"component_id"` e `"page_id"`) estão de acordo com os requisitos do modelo e se as ações de `onDelete` e `onUpdate` se alinham com a lógica de negócio esperada.

---

`458-502`: **Nova Tabela "landing_page.components" Adicionada**  
A tabela `"landing_page.components"` foi adicionada com as seguintes colunas:  
- `"id"` (integer, chave primária),  
- `"type"`, `"content"`, `"css"` (texto, obrigatórios),  
- `"created_at"` (integer) com um valor padrão definido como `'"2025-04-06T18:02:00.803Z"'`.  

**Observação:** O valor padrão para `"created_at"` está sendo definido com uma data fixa e com aspas internas, o que difere do padrão `(CURRENT_TIMESTAMP)` utilizado em outras tabelas. Certifique-se de que isso é intencional e atende aos requisitos do sistema.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: .coderabbit.yaml**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b1ee41737f9e562060a37415af68308856e4192d and 5913b3f114d8e6780ab712272ae59770c92c4829.

</details>

<details>
<summary>📒 Files selected for processing (26)</summary>

* `.husky/pre-commit` (0 hunks)
* `apps/docs/app/projects/page.tsx` (1 hunks)
* `packages/data-testing/Routes.ts` (1 hunks)
* `packages/hook-services/hono_client.ts` (1 hunks)
* `packages/server/migrations/0000_aberrant_zuras.sql` (2 hunks)
* `packages/server/migrations/0000_lush_venom.sql` (0 hunks)
* `packages/server/migrations/0001_heavy_kulan_gath.sql` (0 hunks)
* `packages/server/migrations/0001_red_jazinda.sql` (1 hunks)
* `packages/server/migrations/meta/0000_snapshot.json` (3 hunks)
* `packages/server/migrations/meta/0001_snapshot.json` (3 hunks)
* `packages/server/migrations/meta/_journal.json` (1 hunks)
* `packages/server/package.json` (0 hunks)
* `packages/server/src/base/type.ts` (2 hunks)
* `packages/server/src/drizzle/schema.ts` (1 hunks)
* `packages/server/src/drizzle/tasks/master-plan.ts` (1 hunks)
* `packages/server/src/drizzle/tasks/tasks.dto.ts` (1 hunks)
* `packages/server/src/index.ts` (2 hunks)
* `packages/server/src/routes/middleware/dbContext.ts` (2 hunks)
* `packages/server/src/routes/plans/create-master-plan copy.ts` (1 hunks)
* `packages/server/src/routes/plans/create-master-plan.ts` (1 hunks)
* `packages/server/src/routes/plans/index.ts` (1 hunks)
* `packages/ui/src/domains/Auth/Login/LoginPage.tsx` (0 hunks)
* `packages/ui/src/domains/Marketing/LandingPage/Hero.tsx` (1 hunks)
* `packages/ui/src/domains/ProjectsList/ProjectList.stories.tsx` (1 hunks)
* `packages/ui/src/domains/ProjectsList/ProjectList.tsx` (1 hunks)
* `packages/ui/src/domains/ProjectsList/ProjectTile.tsx` (1 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (5)</summary>

* .husky/pre-commit
* packages/server/package.json
* packages/ui/src/domains/Auth/Login/LoginPage.tsx
* packages/server/migrations/0001_heavy_kulan_gath.sql
* packages/server/migrations/0000_lush_venom.sql

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (9)</summary>

<details>
<summary>apps/docs/app/projects/page.tsx (1)</summary><blockquote>

<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectList.tsx (1)</summary>

* `ProjectList` (23-38)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/index.ts (1)</summary><blockquote>

<details>
<summary>packages/server/src/routes/plans/index.ts (1)</summary>

* `plansRouter` (9-9)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/routes/plans/index.ts (2)</summary><blockquote>

<details>
<summary>packages/server/src/base/base-app.tsx (1)</summary>

* `app` (15-17)

</details>
<details>
<summary>packages/server/src/routes/plans/create-master-plan.ts (2)</summary>

* `createMasterPlanSpec` (11-50)
* `createMasterPlanHandler` (54-73)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (2)</summary><blockquote>

<details>
<summary>packages/server/src/drizzle/drizzle-client.ts (1)</summary>

* `DBConnectionFunc` (24-24)

</details>
<details>
<summary>packages/server/src/drizzle/tasks/master-plan.ts (3)</summary>

* `PlanMaster` (26-29)
* `PlanMaster` (31-31)
* `planMaster` (11-22)

</details>

</blockquote></details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectList.stories.tsx (1)</summary><blockquote>

<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectList.tsx (1)</summary>

* `ProjectList` (23-38)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/routes/middleware/dbContext.ts (2)</summary><blockquote>

<details>
<summary>packages/server/src/drizzle/videos/videos.dto.ts (2)</summary>

* `VideoDTO` (6-28)
* `VideoDTO` (30-30)

</details>
<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (2)</summary>

* `TasksDTO` (4-10)
* `TasksDTO` (12-12)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/base/type.ts (1)</summary><blockquote>

<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (2)</summary>

* `TasksDTO` (4-10)
* `TasksDTO` (12-12)

</details>

</blockquote></details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectList.tsx (2)</summary><blockquote>

<details>
<summary>packages/data-testing/Routes.ts (1)</summary>

* `Routes` (1-34)

</details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectTile.tsx (1)</summary>

* `ProjectTile` (8-26)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/routes/plans/create-master-plan.ts (3)</summary><blockquote>

<details>
<summary>packages/server/src/routes/middleware/dbContext.ts (1)</summary>

* `dbContext` (8-26)

</details>
<details>
<summary>packages/server/src/drizzle/tasks/master-plan.ts (3)</summary>

* `PlanMaster` (26-29)
* `PlanMaster` (31-31)
* `GetSchemaPlanMaster` (24-24)

</details>
<details>
<summary>packages/server/src/base/type.ts (1)</summary>

* `AppRouteHandler` (22-25)

</details>

</blockquote></details>

</details><details>
<summary>🪛 Biome (1.9.4)</summary>

<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts</summary>

[error] 1-1: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>
<details>
<summary>packages/server/src/routes/plans/create-master-plan copy.ts</summary>

[error] 3-3: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>
<details>
<summary>packages/server/src/base/type.ts</summary>

[error] 5-5: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>
<details>
<summary>packages/server/src/routes/plans/create-master-plan.ts</summary>

[error] 3-3: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (34)</summary><blockquote>

<details>
<summary>apps/docs/app/projects/page.tsx (1)</summary>

`1-3`: **Componente corretamente importado e exportado.**

O código importa o componente `ProjectList` do módulo `@repo/ui/domains/ProjectsList/ProjectList` e o exporta como padrão, seguindo boas práticas para páginas Next.js.

</details>
<details>
<summary>packages/hook-services/hono_client.ts (1)</summary>

`11-11`: <details>
<summary>❓ Verification inconclusive</summary>

**Alteração na URL de fallback do cliente Hono.**

A URL de fallback foi alterada de "http://localhost:3001" para "http://localhost:3000". Certifique-se de que esta alteração está alinhada com a configuração atual do servidor de desenvolvimento.

---

🏁 Script executed:

```shell
#!/bin/bash
# Verificar se há outras referências à porta 3001 que possam precisar ser atualizadas
rg -i "localhost:3001" --type-not=binary
```

Length of output: 71

---



</details>

**Alteração na URL de fallback do Hono Client – Verifique a consistência da mudança**

A URL de fallback foi alterada de `http://localhost:3001` para `http://localhost:3000`. Esta modificação deve estar alinhada com a configuração atual do servidor de desenvolvimento. Além disso, confirme se não existem outras referências à porta `3001` que possam ter sido esquecidas. Se necessário, execute a verificação manual ou utilize o script abaixo para pesquisar essas referências especificamente em arquivos TypeScript e JSON:

```shell
#!/bin/bash
echo "Verificando em arquivos .ts:"
rg -i "localhost:3001" -g "*.ts"
echo "Verificando em arquivos .json:"
rg -i "localhost:3001" -g "*.json"
```

Por favor, valide que essa alteração está correta em todo o projeto.

</details>
<details>
<summary>packages/server/src/drizzle/schema.ts (1)</summary>

`21-24`: **Novas entidades de tarefas exportadas corretamente.**

As entidades `planMaster` e `planMasterTasks` do módulo "./tasks/master-plan" foram adicionadas às exportações do schema. Esta alteração é consistente com o padrão de exportação de outras entidades no arquivo.


Verifique se os relacionamentos entre estas novas tabelas e as tabelas existentes estão devidamente configurados para manter a integridade referencial.

</details>
<details>
<summary>packages/server/src/index.ts (2)</summary>

`9-9`: **Importação do novo router de planos.**

O `plansRouter` foi corretamente importado do módulo "./routes/plans".

---

`19-19`: **Adição do router de planos à cadeia de rotas.**

O `plansRouter` foi adicionado à cadeia de rotas seguindo o mesmo padrão utilizado para os outros routers da aplicação. Esta alteração permite que a aplicação processe requisições relacionadas a planos.

</details>
<details>
<summary>packages/server/src/routes/plans/index.ts (1)</summary>

`1-9`: **Boa implementação do router para planos.**

A estrutura está bem organizada, importando corretamente o aplicativo base e os handlers necessários. O uso do padrão de design para rotas OpenAPI está consistente com o restante da aplicação.

</details>
<details>
<summary>packages/server/src/routes/middleware/dbContext.ts (2)</summary>

`6-6`: **Importação adicionada corretamente.**

A importação do TasksDTO foi corretamente adicionada, mantendo a consistência com os outros DTOs do sistema.

---

`19-22`: **Integração bem-sucedida do TasksDTO no contexto da aplicação.**

A atualização do objeto dto para incluir o TasksDTO está correta e segue o padrão estabelecido com outros DTOs.

</details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectTile.tsx (1)</summary>

`4-6`: **Definição de tipo adequada.**

A tipagem com Props está correta, fornecendo uma interface clara para o componente.

</details>
<details>
<summary>packages/server/src/base/type.ts (1)</summary>

`14-14`: **Atualização correta do tipo Variables.**

A adição do TasksDTO ao objeto dto no tipo Variables está correta e mantém a consistência dos tipos no sistema.

</details>
<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (2)</summary>

`4-10`: **Boa implementação do padrão DTO!**

A implementação do TasksDTO está bem estruturada, seguindo boas práticas para operações de banco de dados com o retorno apropriado dos dados inseridos.

---

`12-12`: **Exportação de tipo adequada.**

A exportação do tipo derivado do ReturnType é uma boa prática para garantir consistência entre a implementação e o tipo exportado.

</details>
<details>
<summary>packages/ui/src/domains/Marketing/LandingPage/Hero.tsx (1)</summary>

`57-64`: **Simplificação da navegação implementada corretamente.**

A redução de múltiplos botões para um único botão "PROJECTS" simplifica a interface e melhora a experiência do usuário. A implementação usando o componente Link do Next.js garante uma navegação eficiente.

</details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectList.stories.tsx (1)</summary>

`1-14`: **Configuração adequada do Storybook para o componente ProjectList.**

A implementação segue as boas práticas do Storybook, com a definição correta de metadados e exportação adequada da história base. Não há problemas aparentes.

</details>
<details>
<summary>packages/ui/src/domains/ProjectsList/ProjectList.tsx (2)</summary>

`5-6`: **Função typedKeys bem implementada.**

A função genérica para extrair chaves tipadas de um objeto é uma boa abordagem para garantir segurança de tipos ao trabalhar com objetos.

---

`23-38`: **Boa implementação do componente ProjectList.**

O componente apresenta uma boa estrutura responsiva com grid adequado para diferentes tamanhos de tela. A iteração sobre as rotas filtradas para renderizar os componentes ProjectTile está implementada corretamente.

</details>
<details>
<summary>packages/server/migrations/meta/_journal.json (1)</summary>

`8-17`: **Arquivo de journal de migração atualizado corretamente.**

O journal foi atualizado adequadamente com a nova entrada de migração (index 1) e a atualização da entrada existente (index 0). Ambas as entradas possuem "breakpoints" configurados como true, o que é consistente com a estrutura das migrações SQL correspondentes.

</details>
<details>
<summary>packages/server/migrations/0001_red_jazinda.sql (1)</summary>

`1-7`: **Estrutura da tabela plan_master parece adequada.**

A estrutura da tabela inclui campos essenciais como ID, nome, descrição e timestamps de criação/atualização. A definição do campo PRIMARY KEY e constraints NOT NULL estão implementadas corretamente.

</details>
<details>
<summary>packages/server/migrations/0000_aberrant_zuras.sql (2)</summary>

`69-69`: **Adição correta da restrição NOT NULL.**

A adição da restrição NOT NULL ao campo `content` é apropriada para garantir a integridade dos dados na tabela `landing_page.components`.

---

`137-137`: **Índice adicionado corretamente para melhorar performance.**

A adição do índice `page_component_idx` nas colunas `page_id` e `component_id` da tabela `component_page` é uma boa prática para otimizar consultas que filtram por essas colunas.

</details>
<details>
<summary>packages/data-testing/Routes.ts (2)</summary>

`4-4`: **Ótima adição de rota para projetos!**

A adição da rota `/projects` está bem implementada, seguindo o padrão do restante do código.

---

`36-37`: **Comentários úteis para documentação**

Bons comentários explicativos sobre as principais rotas da aplicação.

</details>
<details>
<summary>packages/server/migrations/meta/0000_snapshot.json (3)</summary>

`4-4`: **Atualização do ID de migração**

A atualização do ID de migração é esperada em alterações de esquema.

---

`479-495`: **Melhoria na integridade dos dados**

Boa modificação ao tornar os campos `content` e `created_at` obrigatórios (`notNull: true`). Isso garante maior integridade dos dados e evita inconsistências no banco de dados.

A atualização do valor padrão para `created_at` também está correta.

---

`498-498`: <details>
<summary>❓ Verification inconclusive</summary>

**Remoção de índices**

A remoção de índices para a tabela `landing_page.components` pode afetar o desempenho de consultas que anteriormente usavam esses índices. Certifique-se de que essa remoção foi intencional e que o impacto no desempenho foi avaliado.

---

🏁 Script executed:

```shell
#!/bin/bash
# Verifica se existem consultas que poderiam se beneficiar de índices na tabela landing_page.components
rg -A 3 -B 3 "landing_page.components" --glob "*.{ts,js}"
```

Length of output: 790

---



</details>

**Verificação de remoção de índices na tabela landing_page.components**

Observamos que no snapshot da migração (packages/server/migrations/meta/0000_snapshot.json, linha 498) a propriedade `"indexes"` está vazia, indicando que os índices foram removidos. A busca no código (em particular, em packages/server/src/drizzle/landing-page/component/component.ts) mostra que a tabela `landing_page.components` está em uso, principalmente em sua definição via `sqliteTable`, considerando que a chave primária (`id`) continua presente.

- Certifique-se de que a remoção dos índices extras (além da chave primária) foi intencional.
- Revise as consultas que podem se beneficiar desses índices e confirme, por meio de testes de desempenho ou benchmarking, que a alteração não degrada a performance das operações que dependem desses índices.

</details>
<details>
<summary>packages/server/src/drizzle/tasks/master-plan.ts (4)</summary>

`1-7`: **Imports apropriados para Drizzle e Zod**

Os imports estão corretos e seguem as boas práticas para a utilização do Drizzle ORM com Zod para validação de esquemas.

---

`8-10`: **Bom uso de tipos branded para IDs**

O uso de tipos branded com Zod para os IDs é uma excelente prática para garantir type safety e evitar confusão entre diferentes tipos de IDs.

---

`11-32`: **Definição clara da tabela planMaster**

A tabela `planMaster` está bem definida com todos os campos necessários, tipos apropriados e geração automática de ID. A exportação do esquema Zod para seleção e inserção também está correta.

---

`33-47`: **Boa implementação de relacionamento entre tabelas**

A tabela `planMasterTasks` está bem implementada com uma referência adequada para a tabela `planMaster` usando `onDelete: "cascade"`, o que garante integridade referencial.

</details>
<details>
<summary>packages/server/migrations/meta/0001_snapshot.json (5)</summary>

`4-5`: **IDs de Snapshot Atualizados**  
Os valores de `"id"` e `"prevId"` foram atualizados para novos UUIDs. Certifique-se de que essas alterações estão em conformidade com o histórico de migrações do projeto e que não geram inconsistências com outras referências no banco de dados.

---

`754-811`: **Nova Tabela "landing_page.page" Adicionada**  
A tabela `"landing_page.page"` foi inserida com as colunas:  
- `"id"` (tipo `text(128)`, chave primária),  
- `"name"` (texto obrigatório),  
- `"template_id"` (texto obrigatório),  
- `"created_at"` e `"updated_at"` (inteiros).  

A chave estrangeira definida em `"template_id"`, que referencia a tabela `"landing_page.template"`, parece estar corretamente configurada. Verifique se o uso do tipo `text(128)` para as colunas de identificação é consistente com o restante do esquema do banco.

---

`812-856`: **Nova Tabela "plan_master" Adicionada**  
A tabela `"plan_master"` foi adicionada com as seguintes colunas:  
- `"planMasterId"` (tipo `text(128)`, chave primária),  
- `"name"` (texto obrigatório),  
- `"description"` (texto opcional),  
- `"created_at"` (com valor padrão `(CURRENT_TIMESTAMP)`) e  
- `"updated_at"` (inteiro, opcional).  

A definição está consistente com as demais tabelas do esquema. Certifique-se de que a nomenclatura `"planMasterId"` está alinhada com os padrões do projeto.

---

`857-922`: **Nova Tabela "plan_master_tasks" Adicionada**  
A tabela `"plan_master_tasks"` foi introduzida com as colunas:  
- `"planMasterTasksId"` (tipo `text(128)`, chave primária),  
- `"plan_master_id"` (texto obrigatório),  
- `"name"` (texto obrigatório),  
- `"description"` (texto opcional),  
- `"created_at"` (com padrão `(CURRENT_TIMESTAMP)`) e  
- `"updated_at"` (inteiro, opcional).  

A chave estrangeira `"plan_master_tasks_plan_master_id_plan_master_planMasterId_fk"` vincula corretamente a coluna `"plan_master_id"` à coluna `"planMasterId"` da tabela `"plan_master"`. Verifique se os tipos e relacionamentos estão de acordo com o modelo de dados esperado.

---

`923-959`: **Nova Tabela "landing_page.template" Adicionada**  
A tabela `"landing_page.template"` foi criada com as colunas:  
- `"id"` (tipo `text(128)`, chave primária),  
- `"name"` (texto obrigatório),  
- `"created_at"` e `"updated_at"` (inteiros).  

A estrutura segue os padrões de nomenclatura e tipos de dados utilizados no esquema. Certifique-se de que todas as relações e referências futuras a esta tabela serão tratadas adequadamente.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-13T18:22:14Z
user: login: mendesmariosatech
state: COMMENTED
author_association: OWNER
submitted_at: 2025-04-13T19:40:45Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (1)</summary><blockquote>

`1-3`: **Considere usar `import type` para importações usadas apenas como tipos**

Seguindo a recomendação da análise estática, a importação do `DBConnectionFunc` deveria usar `import type` para melhorar a otimização do código durante a compilação.


```diff
-import { DBConnectionFunc } from "../drizzle-client";
+import type { DBConnectionFunc } from "../drizzle-client";
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Biome (1.9.4)</summary>

[error] 1-1: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

</blockquote></details>
<details>
<summary>packages/server/src/routes/plans/get-master-plans.ts (2)</summary><blockquote>

`1-5`: **Considere usar `import type` para importações usadas apenas como tipos**

A importação de `AppRouteHandler` deveria usar `import type` já que é usada apenas como tipo.


```diff
-import { AppRouteHandler } from "../../base/type";
+import type { AppRouteHandler } from "../../base/type";
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Biome (1.9.4)</summary>

[error] 3-3: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

---

`7-36`: **Boa definição da especificação da rota**

A especificação da rota está bem estruturada, com métodos, caminhos e respostas claramente definidos.

Sugestão de melhoria: A descrição da resposta 200 poderia ser mais informativa do que "Get all master plans".



```diff
-			description: "Get all master plans",
+			description: "Lista de planos mestre recuperados com sucesso",
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: .coderabbit.yaml**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 6e27eee17139dbb4765eb690166538651c81de86 and c1c36f24d403b89502bcdbdb3aaf5951e58447e2.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `packages/server/src/drizzle/tasks/tasks.dto.ts` (1 hunks)
* `packages/server/src/routes/plans/get-master-plans.ts` (1 hunks)
* `packages/server/src/routes/plans/index.ts` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (3)</summary>

<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (2)</summary><blockquote>

<details>
<summary>packages/server/src/drizzle/drizzle-client.ts (1)</summary>

* `DBConnectionFunc` (24-24)

</details>
<details>
<summary>packages/server/src/drizzle/tasks/master-plan.ts (3)</summary>

* `PlanMaster` (26-29)
* `PlanMaster` (31-31)
* `planMaster` (11-22)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/routes/plans/index.ts (3)</summary><blockquote>

<details>
<summary>packages/server/src/base/base-app.tsx (1)</summary>

* `app` (15-17)

</details>
<details>
<summary>packages/server/src/routes/plans/create-master-plan.ts (2)</summary>

* `createMasterPlanSpec` (11-50)
* `createMasterPlanHandler` (54-73)

</details>
<details>
<summary>packages/server/src/routes/plans/get-master-plans.ts (2)</summary>

* `getMasterPlansSpec` (7-36)
* `getMasterPlansHandler` (40-59)

</details>

</blockquote></details>
<details>
<summary>packages/server/src/routes/plans/get-master-plans.ts (3)</summary><blockquote>

<details>
<summary>packages/server/src/routes/middleware/dbContext.ts (1)</summary>

* `dbContext` (8-26)

</details>
<details>
<summary>packages/server/src/drizzle/tasks/master-plan.ts (1)</summary>

* `GetSchemaPlanMaster` (24-24)

</details>
<details>
<summary>packages/server/src/base/type.ts (1)</summary>

* `AppRouteHandler` (22-25)

</details>

</blockquote></details>

</details><details>
<summary>🪛 Biome (1.9.4)</summary>

<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts</summary>

[error] 1-1: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>
<details>
<summary>packages/server/src/routes/plans/get-master-plans.ts</summary>

[error] 3-3: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>packages/server/src/routes/plans/index.ts (1)</summary>

`1-13`: **Boa implementação do router para planos!**

A estrutura do arquivo está bem organizada, importando os handlers e specs necessários e configurando as rotas de forma clara.

</details>
<details>
<summary>packages/server/src/drizzle/tasks/tasks.dto.ts (2)</summary>

`4-15`: **Implementação clara e objetiva dos métodos do DTO**

Os métodos `createMasterTasks` e `getAllMasterPlans` estão bem implementados, seguindo um padrão consistente de acesso ao banco de dados.

---

`17-17`: **Exportação de tipo bem definida**

A exportação do tipo `TasksDTO` derivado do retorno da função é uma boa prática para garantir consistência de tipos.

</details>
<details>
<summary>packages/server/src/routes/plans/get-master-plans.ts (2)</summary>

`38-38`: **Tipo bem definido para a rota**

A definição do tipo da rota baseada na especificação garante consistência de tipos.

---

`40-59`: <details>
<summary>✅ Verification successful</summary>

**Handler bem implementado com tratamento de erros adequado**

O handler inclui tratamento apropriado de erros, registrando-os no console e retornando uma resposta de erro com status 500.

Consideração: À medida que o número de planos mestre cresce, considere implementar paginação para evitar problemas de desempenho.


---

🏁 Script executed:

```shell
#!/bin/bash
# Verificar a quantidade atual de planos mestre para avaliar a necessidade de paginação

echo "Verificando se há tabelas criadas..."
sqlite3 .sqlite-data/db.sqlite "SELECT name FROM sqlite_master WHERE type='table' AND name='plan_master';"

echo "Verificando a quantidade atual de registros na tabela plan_master (se existir)..."
sqlite3 .sqlite-data/db.sqlite "SELECT COUNT(*) FROM plan_master;" 2>/dev/null || echo "Tabela ainda não existe ou está vazia"
```

Length of output: 628

---



</details>

**Assunto: Handler de planos mestre – Aprovação do tratamento de erros e consideração quanto à paginação**

O handler está bem implementado, registrando os erros e retornando respostas apropriadas em caso de falha. No entanto, conforme mencionado, caso o volume de registros aumente significativamente, é recomendável avaliar a implementação de paginação para mitigar possíveis problemas de desempenho. Observe que na verificação atual a tabela "plan_master" não foi encontrada ou está vazia, o que reforça que este é um cenário a ser monitorado para ambientes de produção futuros.

- **Local:** `packages/server/src/routes/plans/get-master-plans.ts` (linhas 40-59)

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-13T19:46:14Z
user: login: mendesmariosatech
state: APPROVED
author_association: OWNER
submitted_at: 2025-04-13T19:49:49Z

Review comments:
diff_hunk: @@ -0,0 +1,38 @@
+import React from "react";
+import { ProjectTile } from "./ProjectTile";
+import { Routes } from "@repo/data-testing/Routes";
+
+export const typedKeys = <T extends Record<string, unknown>>(obj?: T) =>
+	Object.keys(obj ?? {}) as (keyof T)[];
+
+const filteredRoutes = typedKeys(Routes.client).filter((route) => {
+	switch (route) {
+		case "/videos":
+			return true;
+		case "/tasks":
+			return true;
+		case "/page-builder":
+			return true;
+		case "/page-builderV2":
+			return true;
+		default:
+			return false;
+	}
+});
+
+export const ProjectList = () => {
+	return (
+		<body className="bg-gray-100 p-6">
path: packages/ui/src/domains/ProjectsList/ProjectList.tsx
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Evite usar a tag body dentro de componentes React.**

A tag `<body>` é parte da estrutura do documento HTML e não deve ser aninhada dentro de componentes React. Considere usar uma `<div>` ou outro elemento semântico adequado.

```diff
-<body className="bg-gray-100 p-6">
+<div className="bg-gray-100 p-6">
```

E lembre-se de fechar corretamente na linha 36:

```diff
-</body>
+</div>
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
		<div className="bg-gray-100 p-6">
		  {/* Component content goes here */}
		</div>
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commits 6f2bb21 to 6e27eee
created_at: 2025-04-13T18:22:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -66,9 +66,9 @@ CREATE TABLE `component_page` (
 CREATE TABLE `landing_page.components` (
 	`id` integer PRIMARY KEY NOT NULL,
 	`type` text NOT NULL,
-	`content` text,
+	`content` text NOT NULL,
 	`css` text NOT NULL,
-	`created_at` integer DEFAULT '"2025-01-30T00:27:33.779Z"'
+	`created_at` integer DEFAULT '"2025-04-06T17:50:59.659Z"' NOT NULL
path: packages/server/migrations/0000_aberrant_zuras.sql
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Data padrão hardcoded pode causar problemas futuros.**

O valor default do campo `created_at` está configurado como uma string de data fixa ("2025-04-06T17:50:59.659Z") em vez de usar CURRENT_TIMESTAMP como é feito em outras tabelas. Isso pode causar problemas em registros futuros que terão sempre essa data estática.


```diff
-	`created_at` integer DEFAULT '"2025-04-06T17:50:59.659Z"' NOT NULL
+	`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
	`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-13T18:22:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+import { z } from "zod";
+import { createRoute } from "@hono/zod-openapi";
+import { AppRouteHandler } from "../../base/type";
+import { authMiddleware } from "../middleware/authentication";
+import {
+	GetSchemaPlanMaster,
+	PlanMaster,
+} from "../../drizzle/tasks/master-plan";
+import { dbContext } from "../middleware/dbContext";
+
path: packages/server/src/routes/plans/create-master-plan copy.ts
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Importações podem ser otimizadas.**

A importação de `AppRouteHandler` pode ser convertida para uma importação de tipo para melhorar a eficiência na compilação.


```diff
-import { AppRouteHandler } from "../../base/type";
+import type { AppRouteHandler } from "../../base/type";
```

Além disso, `authMiddleware` está sendo importado mas não está sendo utilizado na rota.



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
import { z } from "zod";
import { createRoute } from "@hono/zod-openapi";
import type { AppRouteHandler } from "../../base/type";
import { authMiddleware } from "../middleware/authentication";
import {
	GetSchemaPlanMaster,
	PlanMaster,
} from "../../drizzle/tasks/master-plan";
import { dbContext } from "../middleware/dbContext";
`````

</details>

<!-- suggestion_end -->

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Biome (1.9.4)</summary>

[error] 3-3: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.


(lint/style/useImportType)

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-13T18:22:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+import { z } from "zod";
+import { createRoute } from "@hono/zod-openapi";
+import { AppRouteHandler } from "../../base/type";
+import { authMiddleware } from "../middleware/authentication";
+import {
+	GetSchemaPlanMaster,
+	PlanMaster,
+} from "../../drizzle/tasks/master-plan";
+import { dbContext } from "../middleware/dbContext";
+
+export const createMasterPlanSpec = createRoute({
+	method: "post",
+	path: "/master-plan",
+	tags: ["plans"],
+	middleware: [dbContext],
+	// header: { authorization: z.string(), },
+	request: {
+		body: {
+			content: {
+				"application/json": {
+					schema: PlanMaster,
+				},
+			},
+		},
+	},
+	responses: {
+		200: {
+			description: "Get personal data",
+			content: {
+				"application/json": {
+					schema: z.object({
+						data: GetSchemaPlanMaster,
+					}),
+				},
+			},
+		},
+		500: {
+			description: "Unauthorized",
+			content: {
+				"application/json": {
+					schema: z.object({
+						error: z.object({
+							message: z.string(),
+						}),
+					}),
+				},
+			},
+		},
+	},
+});
path: packages/server/src/routes/plans/create-master-plan copy.ts
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Especificação da rota precisa de revisões.**

Observei três problemas na especificação da rota:

1. Há um comentário na linha 16 indicando que autenticação pode ser necessária, mas não está implementada.
2. A descrição na linha 28 menciona "Get personal data" quando na verdade é uma rota de criação.
3. A resposta de erro 500 está com descrição "Unauthorized", que deveria ser "Internal Server Error" ou algo similar.


```diff
-	// header: { authorization: z.string(), },
+	header: { authorization: z.string() },
+	security: [{ BearerAuth: [] }],
```

```diff
-			description: "Get personal data",
+			description: "Master plan created successfully",
```

```diff
-			description: "Unauthorized",
+			description: "Internal Server Error",
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
export const createMasterPlanSpec = createRoute({
	method: "post",
	path: "/master-plan",
	tags: ["plans"],
	middleware: [dbContext],
	header: { authorization: z.string() },
	security: [{ BearerAuth: [] }],
	request: {
		body: {
			content: {
				"application/json": {
					schema: PlanMaster,
				},
			},
		},
	},
	responses: {
		200: {
			description: "Master plan created successfully",
			content: {
				"application/json": {
					schema: z.object({
						data: GetSchemaPlanMaster,
					}),
				},
			},
		},
		500: {
			description: "Internal Server Error",
			content: {
				"application/json": {
					schema: z.object({
						error: z.object({
							message: z.string(),
						}),
					}),
				},
			},
		},
	},
});
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-13T18:22:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+import { z } from "zod";
+import { createRoute } from "@hono/zod-openapi";
+import { AppRouteHandler } from "../../base/type";
+import { authMiddleware } from "../middleware/authentication";
+import {
+	GetSchemaPlanMaster,
+	PlanMaster,
+} from "../../drizzle/tasks/master-plan";
+import { dbContext } from "../middleware/dbContext";
+
+export const createMasterPlanSpec = createRoute({
+	method: "post",
+	path: "/master-plan",
+	tags: ["plans"],
+	middleware: [dbContext],
+	// header: { authorization: z.string(), },
+	request: {
+		body: {
+			content: {
+				"application/json": {
+					schema: PlanMaster,
+				},
+			},
+		},
+	},
+	responses: {
+		200: {
+			description: "Get personal data",
+			content: {
+				"application/json": {
+					schema: z.object({
+						data: GetSchemaPlanMaster,
+					}),
+				},
+			},
+		},
+		500: {
+			description: "Unauthorized",
+			content: {
+				"application/json": {
+					schema: z.object({
+						error: z.object({
+							message: z.string(),
+						}),
+					}),
+				},
+			},
+		},
+	},
+});
+
+type PersonalRoute = typeof createMasterPlanSpec;
+
+export const createMasterPlanHandler: AppRouteHandler<PersonalRoute> = async (
+	c,
+) => {
+	const input = c.req.valid("json");
+	const Tasks = c.get("dto").Tasks;
+	const masterTasks = await Tasks.createMasterTasks(input);
+
+	if (!masterTasks) {
+		return c.json(
+			{
+				error: {
+					message: "Failed to create master tasks",
+				},
+			},
+			500,
+		);
+	}
+
+	return c.json({ data: masterTasks }, 200);
+};
path: packages/server/src/routes/plans/create-master-plan copy.ts
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Implementação do handler precisa de middleware de autenticação.**

O handler não está utilizando o middleware de autenticação importado (`authMiddleware`), o que pode ser um problema de segurança se esta rota deve ser protegida.


```diff
export const createMasterPlanSpec = createRoute({
	method: "post",
	path: "/master-plan",
	tags: ["plans"],
-	middleware: [dbContext],
+	middleware: [authMiddleware, dbContext],
```

Além disso, é necessário corrigir o tipo usado na assinatura do handler:

```diff
-export const createMasterPlanHandler: AppRouteHandler<PersonalRoute> = async (
+export const createMasterPlanHandler: AppRouteHandler<MasterPlanRoute> = async (
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
// Route specification with updated middleware
export const createMasterPlanSpec = createRoute({
	method: "post",
	path: "/master-plan",
	tags: ["plans"],
	middleware: [authMiddleware, dbContext],
});

// Handler with corrected type
export const createMasterPlanHandler: AppRouteHandler<MasterPlanRoute> = async (
	c,
) => {
	const input = c.req.valid("json");
	const Tasks = c.get("dto").Tasks;
	const masterTasks = await Tasks.createMasterTasks(input);

	if (!masterTasks) {
		return c.json(
			{
				error: {
					message: "Failed to create master tasks",
				},
			},
			500,
		);
	}

	return c.json({ data: masterTasks }, 200);
};
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-13T18:22:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+import { z } from "zod";
+import { createRoute } from "@hono/zod-openapi";
+import { AppRouteHandler } from "../../base/type";
+import { authMiddleware } from "../middleware/authentication";
+import {
+	GetSchemaPlanMaster,
+	PlanMaster,
+} from "../../drizzle/tasks/master-plan";
+import { dbContext } from "../middleware/dbContext";
+
+export const createMasterPlanSpec = createRoute({
+	method: "post",
+	path: "/master-plan",
+	tags: ["plans"],
+	middleware: [dbContext],
+	// header: { authorization: z.string(), },
+	request: {
+		body: {
+			content: {
+				"application/json": {
+					schema: PlanMaster,
+				},
+			},
+		},
+	},
+	responses: {
+		200: {
+			description: "Get personal data",
+			content: {
+				"application/json": {
+					schema: z.object({
+						data: GetSchemaPlanMaster,
+					}),
+				},
+			},
+		},
+		500: {
+			description: "Unauthorized",
+			content: {
+				"application/json": {
+					schema: z.object({
+						error: z.object({
+							message: z.string(),
+						}),
+					}),
+				},
+			},
+		},
+	},
+});
path: packages/server/src/routes/plans/create-master-plan.ts
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Especificação de rota bem estruturada, mas com pequena inconsistência**

A especificação da rota está bem implementada, seguindo as boas práticas com Zod e OpenAPI. No entanto, há uma inconsistência na descrição do erro 500 na linha 38. A descrição indica "Unauthorized", mas o código de status 500 representa um erro interno do servidor, não uma falha de autorização (que seria 401).

Também notei que a linha 16 tem um comentário sobre autenticação. É intencional que esta rota não requeira autenticação?


```diff
-      description: "Unauthorized",
+      description: "Internal Server Error",
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
export const createMasterPlanSpec = createRoute({
	method: "post",
	path: "/master-plan",
	tags: ["plans"],
	middleware: [dbContext],
	// header: { authorization: z.string(), },
	request: {
		body: {
			content: {
				"application/json": {
					schema: PlanMaster,
				},
			},
		},
	},
	responses: {
		200: {
			description: "Get personal data",
			content: {
				"application/json": {
					schema: z.object({
						data: GetSchemaPlanMaster,
					}),
				},
			},
		},
		500: {
			description: "Internal Server Error",
			content: {
				"application/json": {
					schema: z.object({
						error: z.object({
							message: z.string(),
						}),
					}),
				},
			},
		},
	},
});
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-13T18:22:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,62 @@
+import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
+import { genEntityId } from "../utils";
+import { clientTable } from "../schema";
+import { sql } from "drizzle-orm";
+import { createInsertSchema, createSelectSchema } from "drizzle-zod";
+import { z } from "zod";
+
+const PlanMasterId = z.string().brand("PlanMasterId");
+const PlanMasterTasksId = z.string().brand("PlanMasterTasksId");
+
+export const planMaster = sqliteTable("plan_master", {
+	planMasterId: text("planMasterId", { length: 128 })
+		.$defaultFn(() => genEntityId("PM"))
+		.primaryKey()
+		.notNull(),
+	name: text("name").notNull(),
+	description: text("description"),
+	createdAt: integer("created_at").default(sql`(CURRENT_TIMESTAMP)`).notNull(),
+	updatedAt: integer("updated_at", { mode: "timestamp" }).$onUpdate(
+		() => new Date(),
+	),
+});
+
+export const GetSchemaPlanMaster = createSelectSchema(planMaster);
+
+export const PlanMaster = createInsertSchema(planMaster).pick({
+	name: true,
+	description: true,
+});
+
+export type PlanMaster = z.infer<typeof PlanMaster>;
+
+export const planMasterTasks = sqliteTable("plan_master_tasks", {
+	planMasterTasksId: text("planMasterTasksId", { length: 128 })
+		.$defaultFn(() => genEntityId("PMT"))
+		.primaryKey()
+		.notNull(),
+	planMasterId: text("plan_master_id")
+		.references(() => planMaster.planMasterId, { onDelete: "cascade" })
+		.notNull(),
+	name: text("name").notNull(),
+	description: text("description"),
+	createdAt: integer("created_at").default(sql`(CURRENT_TIMESTAMP)`).notNull(),
path: packages/server/src/drizzle/tasks/master-plan.ts
user: login: mendesmariosatech
body: let's update the default to be  a sql NOW

created_at: 2025-04-13T19:40:45Z
author_association: OWNER

PR comments:
user: login: vercel[bot]
created_at: 2025-04-13T18:16:40Z
body: [vc]: #N8DLt0jSx+HcShn+kD9iWBu5nS9sIInBdnN6kQwneLU=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJtbXRlY2gtZG9jcyIsInJvb3REaXJlY3RvcnkiOiJhcHBzL2RvY3MiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoibW10ZWNoLWRvY3MtZ2l0LWJhY2tlbmQtcHJvamVjdHMtbWVuZGVzbWFyaW9zYXRlY2hzLXByb2plY3RzLnZlcmNlbC5hcHAifSwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL21lbmRlc21hcmlvc2F0ZWNocy1wcm9qZWN0cy9tbXRlY2gtZG9jcy8zVkt0QUdMTm5OSnRHQ0FzdGd4TTJNQktKeW5tIiwicHJldmlld1VybCI6Im1tdGVjaC1kb2NzLWdpdC1iYWNrZW5kLXByb2plY3RzLW1lbmRlc21hcmlvc2F0ZWNocy1wcm9qZWN0cy52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIn0seyJuYW1lIjoibW10ZWNoLXdlYiIsInJvb3REaXJlY3RvcnkiOiJhcHBzL3dlYiIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJtbXRlY2gtd2ViLWdpdC1iYWNrZW5kLXByb2plY3RzLW1lbmRlc21hcmlvc2F0ZWNocy1wcm9qZWN0cy52ZXJjZWwuYXBwIn0sImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9tZW5kZXNtYXJpb3NhdGVjaHMtcHJvamVjdHMvbW10ZWNoLXdlYi85NjZMVVhIc2tjZUFMR0t2YkFldEZ0aDNKTU5RIiwicHJldmlld1VybCI6Im1tdGVjaC13ZWItZ2l0LWJhY2tlbmQtcHJvamVjdHMtbWVuZGVzbWFyaW9zYXRlY2hzLXByb2plY3RzLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQifV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **mmtech-docs** | ✅ Ready ([Inspect](https://vercel.com/mendesmariosatechs-projects/mmtech-docs/3VKtAGLNnNJtGCAstgxM2MBKJynm)) | [Visit Preview](https://mmtech-docs-git-backend-projects-mendesmariosatechs-projects.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/mmtech-docs-git-backend-projects-mendesmariosatechs-projects.vercel.app?via=pr-comment-feedback-link) | Apr 13, 2025 7:51pm |
| **mmtech-web** | ✅ Ready ([Inspect](https://vercel.com/mendesmariosatechs-projects/mmtech-web/966LUXHskceALGKvbAetFth3JMNQ)) | [Visit Preview](https://mmtech-web-git-backend-projects-mendesmariosatechs-projects.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/mmtech-web-git-backend-projects-mendesmariosatechs-projects.vercel.app?via=pr-comment-feedback-link) | Apr 13, 2025 7:51pm |



author_association: NONE
user: login: coderabbitai[bot]
created_at: 2025-04-13T18:16:42Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: failure by coderabbit.ai -->

> [!CAUTION]
> ## Review failed
> 
> The pull request is closed.

<!-- end of auto-generated comment: failure by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough
As mudanças abrangem diversas áreas do projeto. No arquivo de hook do Husky, o pre-commit foi simplificado para executar apenas comandos de formatação e atualização do índice Git. Nos scripts de migração SQL e arquivos de metadados, há atualizações de constraints, valores padrão, índices e remoção de tabelas antigas, além da adição de novas tabelas para planos (`plan_master` e `plan_master_tasks`). O código do servidor foi estendido com novos tipos, DTOs e endpoints para criar e recuperar master plans, e o script de deploy foi removido do `package.json`.

## Changes

| Arquivo(s) | Resumo das Alterações |
| --- | --- |
| `.husky/pre-commit` | Remoção de linhas redundantes, mantendo apenas comandos para formatar arquivos TypeScript e atualizar o índice do Git. |
| `packages/server/migrations/0000_aberrant_zuras.sql`<br>`packages/server/migrations/0001_red_jazinda.sql`<br>`packages/server/migrations/0000_lush_venom.sql`<br>`packages/server/migrations/0001_heavy_kulan_gath.sql` | Atualizações nos scripts de migração SQL: <br>- Ajuste de constraints e valores padrão na tabela `landing_page.components`;<br>- Ativação de índice em `component_page` e remoção do índice `type_idx`;<br>- Remoção dos scripts de criação das tabelas antigas (`lush_venom` e `videos`);<br>- Adição das tabelas `plan_master` e `plan_master_tasks`. |
| `packages/server/migrations/meta/*.json`<br>(0000_snapshot.json, 0001_snapshot.json, _journal.json) | Atualizações de metadados e estrutura: <br>- Alteração de UUIDs e valores padrão;<br>- Mudança de propriedades `notNull` para campos específicos;<br>- Redefinição e remoção de índices;<br>- Atualização e adição de entradas no journal. |
| `packages/server/package.json` | Remoção do script `"deploy": "wrangler deploy --minify src/index.ts"` do campo `scripts`. |
| `packages/server/src/**/*`<br>(type.ts, schema.ts, drizzle/tasks/*, index.ts, routes/middleware/dbContext.ts, routes/plans/*) | Adição e modificação de código TypeScript: <br>- Inclusão do DTO `TasksDTO` e atualização dos tipos (adição de `Tasks` no objeto `dto`);<br>- Exportação de novas schemas (`planMaster` e `planMasterTasks`);<br>- Criação de novos arquivos para definir os endpoints de criação e listagem de master plans;<br>- Inclusão do `plansRouter` nas rotas principais. |

## Sequence Diagram(s)
```mermaid
sequenceDiagram
    participant C as Cliente
    participant R as plansRouter
    participant M as Middleware (dbContext)
    participant T as TasksDTO
    participant DB as Banco de Dados
    C->>R: POST /master-plan (dados do plano)
    R->>M: Processa contexto
    M->>T: Inicializa TasksDTO(db)
    T->>DB: createMasterTasks(args)
    DB-->>T: Retorna dados criados
    T-->>M: Envia resposta
    M-->>R: Repassa resposta
    R-->>C: Resposta 200 (master plan criado)
```

```mermaid
sequenceDiagram
    participant C as Cliente
    participant R as plansRouter
    participant M as Middleware (dbContext)
    participant T as TasksDTO
    participant DB as Banco de Dados
    C->>R: GET /master-plans
    R->>M: Processa contexto
    M->>T: Inicializa TasksDTO(db)
    T->>DB: getAllMasterPlans()
    DB-->>T: Retorna lista de planos
    T-->>M: Envia resposta
    M-->>R: Repassa resposta
    R-->>C: Resposta 200 (lista de master plans)
```

## Poem
> Eu sou um coelho saltitante,  
> Navegando entre bits e linhas brilhantes,  
> Planos e dados pulam com energia,  
> Cada rota é uma doce sinfonia,  
> Em saltos de código, celebro a mudança,  
> Com alegria e bytes, danço na aliança!  🐰

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AhNAwDWZer3wixiAwDlszAZS4ADgA2AwBVRADINgwlRDAlKQt8biN9Y3AoZ34AMxwCYjJlGnomVnYuXn5hUXEpGXkmJSpVdS0ddJMoOFRUTHzCUnIqEoVyjE5IKgB3SERfZjQKeTkFZpU1TW1dMEMM0wMNWGxEB1kAel4SMDLmdQ4DACJngwBiV8gAQQBJQuHqOhzBZLeT4PIMWCYUieAxwEiMSEYaEoLC4WDwgAGRxOZ0uFG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GrCBZSwhHCjzIJACRbCwKYJAHWMo6ljVUBAasIWCbBIDxUpYnMYICbFyomwOYgLDmEoBCDWORHDAYJ1NRyDfNaAasNHgIHRZ6xcWDAaqvHT5Y5BDYLMDmMi0CBqwPHJABmNY5scQBRH22CR3HC/QbjA8qYfQEAA== -->

<!-- internal state end -->
<!-- announcements_start -->

> [!TIP]
> <details>
> <summary>⚡💬 Agentic Chat (Pro Plan, General Availability)</summary>
> 
> - We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
> 
> </details>

<!-- announcements_end -->

---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: .coderabbit.yaml**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between c1c36f24d403b89502bcdbdb3aaf5951e58447e2 and b4c7bcc7f5d519acaba6d5666d82e3a583ce1125.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `packages/server/src/drizzle/tasks/tasks.dto.ts` (1 hunks)
* `packages/server/src/routes/plans/get-master-plans.ts` (1 hunks)

</details>

</details>
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=mendesmariosatech/mmtech&utm_content=86):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai plan` to trigger planning for file edits and PR creation.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR