SEO_iamge_renamer_starting_.../packages/api/src/database/database.module.ts
DustyWalker e7e09d5e2c feat(db): implement complete database schema and models
- Add Prisma schema with PostgreSQL 15 support
- Create Users, Batches, Images, Payments, ApiKeys tables
- Implement proper foreign key relationships and indexes
- Add enum types for status fields (Plan, BatchStatus, ImageStatus, PaymentStatus)
- Support for JSON fields (vision_tags, metadata)
- UUID primary keys for security
- Created/updated timestamps with proper defaults

Database Layer Components:
- Prisma service with connection management and health checks
- Repository pattern for all entities with comprehensive CRUD operations
- TypeScript DTOs with class-validator decorations
- Swagger API documentation annotations
- Helper functions for business logic (quota management, pricing, etc.)

Development Support:
- Environment variables template
- Database seed script with realistic test data
- TypeScript configuration optimized for Nest.js
- Package.json with all required dependencies

Resolves database requirements from issues §78-81 establishing
the complete data layer foundation for the AI Bulk Image Renamer SaaS.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 17:02:03 +02:00

27 lines
No EOL
743 B
TypeScript

import { Module, Global } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { PrismaService } from './prisma.service';
import { UserRepository } from './repositories/user.repository';
import { BatchRepository } from './repositories/batch.repository';
import { ImageRepository } from './repositories/image.repository';
import { PaymentRepository } from './repositories/payment.repository';
@Global()
@Module({
imports: [ConfigModule],
providers: [
PrismaService,
UserRepository,
BatchRepository,
ImageRepository,
PaymentRepository,
],
exports: [
PrismaService,
UserRepository,
BatchRepository,
ImageRepository,
PaymentRepository,
],
})
export class DatabaseModule {}