From 26833e18185944235825ba678aa5288558caf13d Mon Sep 17 00:00:00 2001 From: behnam Date: Sat, 2 Nov 2024 12:50:33 +0300 Subject: [PATCH] Fix location of db to boundaries --- package.json | 2 +- src/bootstrap/{ => boundaries}/db/db.ts | 2 +- src/bootstrap/{ => boundaries}/db/placeholder-data.js | 0 src/bootstrap/{ => boundaries}/db/seed.js | 0 src/bootstrap/helpers/lib/actions.ts | 2 +- .../core/customer-invoice/data/repo/customer-invoice-db-repo.ts | 2 +- src/feature/core/customer/data/repo/customer-db-repo.ts | 2 +- src/feature/core/invoice/data/repo/invoice-db-repo.ts | 2 +- src/feature/core/revenue/data/repo/revenue-db-repo.ts | 2 +- tsconfig.json | 2 +- 10 files changed, 8 insertions(+), 8 deletions(-) rename src/bootstrap/{ => boundaries}/db/db.ts (86%) rename src/bootstrap/{ => boundaries}/db/placeholder-data.js (100%) rename src/bootstrap/{ => boundaries}/db/seed.js (100%) diff --git a/package.json b/package.json index 62211ce..8691324 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "next start --port 4000", "lint": "next lint", "test": "vitest", - "seed": "node -r dotenv/config ./src/bootstrap/db/seed.js" + "seed": "node -r dotenv/config ./src/bootstrap/boundaries/db/seed.js" }, "dependencies": { "@heroicons/react": "^2.1.5", diff --git a/src/bootstrap/db/db.ts b/src/bootstrap/boundaries/db/db.ts similarity index 86% rename from src/bootstrap/db/db.ts rename to src/bootstrap/boundaries/db/db.ts index dbcd877..d6962af 100644 --- a/src/bootstrap/db/db.ts +++ b/src/bootstrap/boundaries/db/db.ts @@ -10,4 +10,4 @@ const dbConfigs = { database: envs.POSTGRES_DB, } -export const sql = postgres(dbConfigs); \ No newline at end of file +export const sql = postgres(dbConfigs); diff --git a/src/bootstrap/db/placeholder-data.js b/src/bootstrap/boundaries/db/placeholder-data.js similarity index 100% rename from src/bootstrap/db/placeholder-data.js rename to src/bootstrap/boundaries/db/placeholder-data.js diff --git a/src/bootstrap/db/seed.js b/src/bootstrap/boundaries/db/seed.js similarity index 100% rename from src/bootstrap/db/seed.js rename to src/bootstrap/boundaries/db/seed.js diff --git a/src/bootstrap/helpers/lib/actions.ts b/src/bootstrap/helpers/lib/actions.ts index 617b4d7..a408241 100644 --- a/src/bootstrap/helpers/lib/actions.ts +++ b/src/bootstrap/helpers/lib/actions.ts @@ -3,7 +3,7 @@ import { z } from 'zod'; import { revalidatePath } from 'next/cache'; import { redirect } from 'next/navigation'; -import { sql } from '@/bootstrap/db/db'; +import { sql } from '@/bootstrap/boundaries/db/db'; const FormSchema = z.object({ id: z.string(), diff --git a/src/feature/core/customer-invoice/data/repo/customer-invoice-db-repo.ts b/src/feature/core/customer-invoice/data/repo/customer-invoice-db-repo.ts index 9c19809..a12de93 100644 --- a/src/feature/core/customer-invoice/data/repo/customer-invoice-db-repo.ts +++ b/src/feature/core/customer-invoice/data/repo/customer-invoice-db-repo.ts @@ -1,4 +1,4 @@ -import { sql } from "@/bootstrap/db/db"; +import { sql } from "@/bootstrap/boundaries/db/db"; import { formatCurrency } from "@/feature/common/feature-helpers"; import CustomerInvoice from "@/feature/core/customer-invoice/domain/entity/customer-invoice"; import CustomerInvoiceRepo from "@/feature/core/customer-invoice/domain/i-repo/customer-invoice-repo"; diff --git a/src/feature/core/customer/data/repo/customer-db-repo.ts b/src/feature/core/customer/data/repo/customer-db-repo.ts index f1239a4..8c6fba4 100644 --- a/src/feature/core/customer/data/repo/customer-db-repo.ts +++ b/src/feature/core/customer/data/repo/customer-db-repo.ts @@ -1,4 +1,4 @@ -import { sql } from "@/bootstrap/db/db"; +import { sql } from "@/bootstrap/boundaries/db/db"; import { formatCurrency } from "@/feature/common/feature-helpers"; import Customer from "@/feature/core/customer/domain/entity/customer"; import CustomerRepo from "@/feature/core/customer/domain/i-repo/customer-repo"; diff --git a/src/feature/core/invoice/data/repo/invoice-db-repo.ts b/src/feature/core/invoice/data/repo/invoice-db-repo.ts index ea60b0f..c8e2bb9 100644 --- a/src/feature/core/invoice/data/repo/invoice-db-repo.ts +++ b/src/feature/core/invoice/data/repo/invoice-db-repo.ts @@ -1,4 +1,4 @@ -import { sql } from "@/bootstrap/db/db"; +import { sql } from "@/bootstrap/boundaries/db/db"; import { formatCurrency } from "@/feature/common/feature-helpers"; import InvoiceRepo from "@/feature/core/invoice/domain/i-repo/invoice-repo"; import { InvoiceParam } from "@/feature/core/invoice/domain/param/invoice-param"; diff --git a/src/feature/core/revenue/data/repo/revenue-db-repo.ts b/src/feature/core/revenue/data/repo/revenue-db-repo.ts index 92ac993..d8d771d 100644 --- a/src/feature/core/revenue/data/repo/revenue-db-repo.ts +++ b/src/feature/core/revenue/data/repo/revenue-db-repo.ts @@ -1,4 +1,4 @@ -import { sql } from "@/bootstrap/db/db"; +import { sql } from "@/bootstrap/boundaries/db/db"; import Revenue from "@/feature/core/revenue/domain/entity/revenue"; import RevenueRepo from "@/feature/core/revenue/domain/i-repo/revenue-repo"; import { connection } from "next/server"; diff --git a/tsconfig.json b/tsconfig.json index ef29509..0d0b9fb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,6 +25,6 @@ "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/bootstrap/db/seed.js", "src/bootstrap/db/placeholder-data.js"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/bootstrap/boundaries/db/seed.js", "src/bootstrap/boundaries/db/placeholder-data.js"], "exclude": ["node_modules"] }