Created Service, Module and Controller for Formular and Field

This commit is contained in:
2026-02-02 12:18:11 +01:00
parent 76857b8611
commit 3dd2b43cc4
14 changed files with 115 additions and 35 deletions

View File

@@ -6,6 +6,11 @@ import { MercuriusDriver, MercuriusDriverConfig } from '@nestjs/mercurius';
import { EventsModule } from './events/events.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { EventEntity } from './events/events.entity';
import { FormularController } from './formular/formular.controller';
import { FormularService } from './formular/formular.service';
import { FieldsService } from './fields/fields.service';
import { FormularModule } from './formular/formular.module';
import { FieldsModule } from './fields/fields.module';
@Module({
imports: [
@@ -25,11 +30,13 @@ import { EventEntity } from './events/events.entity';
synchronize: true,
entities: [EventEntity]
}),
FormularModule,
FieldsModule,
],
controllers: [AppController],
providers: [AppService, AppController],
controllers: [AppController, FormularController],
providers: [AppService, AppController, FormularService, FieldsService],
})
export class AppModule {}

Submodule src/dto updated: 3798232611...d6ae29cd12

View File

@@ -1,5 +1,4 @@
import { Inject, Injectable } from '@nestjs/common';
import { MyEvent } from 'src/dto/event.dto';
import { Repository } from 'typeorm';
import { EventEntity } from './events.entity';
import { InjectRepository } from '@nestjs/typeorm';

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { FieldsController } from './fields.controller';
describe('FieldsController', () => {
let controller: FieldsController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [FieldsController],
}).compile();
controller = module.get<FieldsController>(FieldsController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@@ -0,0 +1,4 @@
import { Controller } from '@nestjs/common';
@Controller('fields')
export class FieldsController {}

View File

@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { FieldsController } from './fields.controller';
@Module({
controllers: [FieldsController]
})
export class FieldsModule {}

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { FieldsService } from './fields.service';
describe('FieldsService', () => {
let service: FieldsService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [FieldsService],
}).compile();
service = module.get<FieldsService>(FieldsService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class FieldsService {}

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { FormularController } from './formular.controller';
describe('FormularController', () => {
let controller: FormularController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [FormularController],
}).compile();
controller = module.get<FormularController>(FormularController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@@ -0,0 +1,6 @@
import { Controller } from '@nestjs/common';
@Controller('/api/formulare')
export class FormularController {
}

View File

@@ -0,0 +1,4 @@
import { Module } from '@nestjs/common';
@Module({})
export class FormularModule {}

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { FormularService } from './formular.service';
describe('FormularService', () => {
let service: FormularService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [FormularService],
}).compile();
service = module.get<FormularService>(FormularService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class FormularService {}