Skip to content

Consolidate database structure by removing duplicate category files - #14

Draft
indunil-k with Copilot wants to merge 15 commits into
mainfrom
copilot/fix-13
Draft

Consolidate database structure by removing duplicate category files#14
indunil-k with Copilot wants to merge 15 commits into
mainfrom
copilot/fix-13

Conversation

Copilot AI commented Aug 16, 2025

Copy link
Copy Markdown

This PR implements a centralized database approach by consolidating duplicate category-related files that were causing inconsistency in the codebase.

Problem

The repository contained duplicate category files with both correct spelling ("category") and incorrect spelling ("catagory"):

  • src/controllers/catagory.controller.ts (duplicate)
  • src/services/catagory.service.ts (duplicate)
  • src/routes/catagory.route.ts (duplicate)
  • CATAGORY_API.md (misspelled filename)

This violated the principle of having "one-centralized DB" as these duplicates could lead to:

  • Confusion about which files to modify
  • Inconsistent behavior if the wrong files were updated
  • Import errors and maintenance overhead
  • Fragmented database logic

Solution

Removed duplicate files:

  • Deleted all misspelled "catagory" service, controller, and route files
  • These files were not being imported anywhere in the codebase

Renamed documentation:

  • CATAGORY_API.mdCATEGORY_API.md for consistency

Verified centralization:

  • Confirmed single Prisma schema serves as the centralized database definition
  • All imports in index.ts correctly reference the consolidated category files
  • TypeScript compilation passes without errors
  • No orphaned references or broken imports

Result

The database structure is now properly centralized with:

  • Single source of truth for all category-related functionality
  • Consistent naming conventions throughout the codebase
  • Clean, maintainable architecture with no duplicate modules
  • All database relationships properly defined in one central schema

Fixes #13.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • binaries.prisma.sh
    • Triggering command: node scripts/postinstall.js (dns block)
    • Triggering command: node /home/REDACTED/work/backend/backend/node_modules/.bin/prisma -v (dns block)
    • Triggering command: node /home/REDACTED/work/backend/backend/node_modules/.bin/prisma generate (dns block)
  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/backend/backend/node_modules/prisma/build/child {"product":"prisma","version":"6.12.0","cli_install_type":"local","information":"","local_timestamp":"2025-08-16T16:40:33Z","project_hash":"cb50a275","cli_path":"/home/REDACTED/work/backend/backend/node_modules/.bin/prisma","cli_path_hash":"fdbaad87","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.4","ci":true,"ci_name":"GitHub Actions","command":"generate","schema_providers":["postgresql"],"schema_preview_features":[],"schema_generators_providers":["prisma-client-js"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-fdbaad87","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/work/backend/backend/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true} (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits August 16, 2025 16:37
Co-authored-by: indunil-k <161734455+indunil-k@users.noreply.github.com>
…ucture

Co-authored-by: indunil-k <161734455+indunil-k@users.noreply.github.com>
Co-authored-by: indunil-k <161734455+indunil-k@users.noreply.github.com>
Copilot AI changed the title [WIP] since our DB is highly relational, it is good to keep one-centralized DB Consolidate database structure by removing duplicate category files Aug 16, 2025
Copilot AI requested a review from indunil-k August 16, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

since our DB is highly relational, it is good to keep one-centralized DB

4 participants