updated graphql dtos & build and it depends
This commit is contained in:
parent
42983eab65
commit
2e329d8dfe
|
|
@ -6,7 +6,6 @@ import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
|
||||||
import { MongooseModule } from '@nestjs/mongoose';
|
import { MongooseModule } from '@nestjs/mongoose';
|
||||||
import { UsersModule } from './users/users.module';
|
import { UsersModule } from './users/users.module';
|
||||||
import { PeopleModule } from './people/people.module';
|
import { PeopleModule } from './people/people.module';
|
||||||
import { BuildService } from './build/build.service';
|
|
||||||
import { BuildModule } from './build/build.module';
|
import { BuildModule } from './build/build.module';
|
||||||
import { BuildPartsModule } from './build-parts/build-parts.module';
|
import { BuildPartsModule } from './build-parts/build-parts.module';
|
||||||
import { BuildAreaModule } from './build-area/build-area.module';
|
import { BuildAreaModule } from './build-area/build-area.module';
|
||||||
|
|
@ -20,14 +19,14 @@ import { UserTypesModule } from './user-types/user-types.module';
|
||||||
playground: true,
|
playground: true,
|
||||||
}),
|
}),
|
||||||
MongooseModule.forRoot(process.env.MONGODB_URI || "mongodb://evyosdbuser:evyosdbpassword@10.10.2.13:27017/evyosdb"),
|
MongooseModule.forRoot(process.env.MONGODB_URI || "mongodb://evyosdbuser:evyosdbpassword@10.10.2.13:27017/evyosdb"),
|
||||||
|
BuildModule,
|
||||||
UsersModule,
|
UsersModule,
|
||||||
PeopleModule,
|
PeopleModule,
|
||||||
BuildModule,
|
|
||||||
BuildPartsModule,
|
BuildPartsModule,
|
||||||
BuildAreaModule,
|
BuildAreaModule,
|
||||||
UserTypesModule,
|
UserTypesModule,
|
||||||
],
|
],
|
||||||
controllers: [AppController],
|
controllers: [AppController],
|
||||||
providers: [AppService, BuildService],
|
providers: [AppService],
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { InputType } from "@nestjs/graphql";
|
import { InputType, Field } from "@nestjs/graphql";
|
||||||
|
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
export class CreateBuildAreaInput {
|
export class CreateBuildAreaInput {
|
||||||
|
@Field()
|
||||||
|
uuid: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
import { InputType, Field, ID } from '@nestjs/graphql';
|
import { InputType, Field } from '@nestjs/graphql';
|
||||||
|
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
export class CreateBuildPartsInput {
|
export class CreateBuildPartsInput {
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
uuid: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { BuildResolver } from './build.resolver';
|
import { BuildResolver } from './build.resolver';
|
||||||
|
import { MongooseModule } from '@nestjs/mongoose';
|
||||||
|
import { BuildSchema } from '@/models/build.model';
|
||||||
|
import { BuildService } from './build.service';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
providers: [BuildResolver]
|
imports: [MongooseModule.forFeature([{ name: 'Build', schema: BuildSchema }])],
|
||||||
|
providers: [BuildResolver, BuildService]
|
||||||
})
|
})
|
||||||
export class BuildModule {}
|
export class BuildModule { }
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import type { GraphQLResolveInfo } from 'graphql';
|
||||||
|
|
||||||
@Resolver()
|
@Resolver()
|
||||||
export class BuildResolver {
|
export class BuildResolver {
|
||||||
|
|
||||||
constructor(private readonly buildService: BuildService) { }
|
constructor(private readonly buildService: BuildService) { }
|
||||||
|
|
||||||
@Query(() => [Build], { name: 'Builds' })
|
@Query(() => [Build], { name: 'Builds' })
|
||||||
|
|
@ -24,4 +25,5 @@ export class BuildResolver {
|
||||||
async createBuild(@Args('input') input: CreateBuildInput): Promise<Build> {
|
async createBuild(@Args('input') input: CreateBuildInput): Promise<Build> {
|
||||||
return this.buildService.create(input);
|
return this.buildService.create(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import { InputType } from "@nestjs/graphql";
|
import { InputType, Field, ID } from "@nestjs/graphql";
|
||||||
|
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
export class CreateBuildInput {
|
export class CreateBuildInput {
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
uuid: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,74 @@
|
||||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Document } from 'mongoose';
|
import { Document } from 'mongoose';
|
||||||
|
import { ObjectType, Field, ID, GraphQLISODateTime } from '@nestjs/graphql';
|
||||||
import { Base } from '@/models/base.model';
|
import { Base } from '@/models/base.model';
|
||||||
|
|
||||||
@Schema({ timestamps: true })
|
@Schema({ timestamps: true })
|
||||||
|
@ObjectType()
|
||||||
export class Person extends Base {
|
export class Person extends Base {
|
||||||
|
|
||||||
|
@Field(() => ID)
|
||||||
|
_id: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
firstName: string;
|
firstName: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
surname: string;
|
surname: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
middleName: string;
|
middleName: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
sexCode: string;
|
sexCode: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
personRef: string;
|
personRef: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
personTag: string;
|
personTag: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
fatherName: string;
|
fatherName: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
motherName: string;
|
motherName: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
countryCode: string;
|
countryCode: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true, unique: true })
|
||||||
|
@Field()
|
||||||
nationalIdentityId: string;
|
nationalIdentityId: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
birthPlace: string;
|
birthPlace: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field(() => GraphQLISODateTime)
|
||||||
birthDate: Date;
|
birthDate: Date;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
taxNo: string;
|
taxNo: string;
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
|
@Field()
|
||||||
birthname: string;
|
birthname: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PersonDocument = Person & Document;
|
export type PersonDocument = Person & Document;
|
||||||
export const PersonSchema = SchemaFactory.createForClass(Person);
|
export const PersonSchema = SchemaFactory.createForClass(Person);
|
||||||
|
|
||||||
|
// PersonSchema.index({ firstName: 1, surname: 1, middleName: 1 }, { unique: true });
|
||||||
|
// PersonSchema.index({ nationalIdentityId: 1 }, { unique: true });
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,47 @@
|
||||||
import { InputType, Field, ID } from '@nestjs/graphql';
|
import { InputType, Field, GraphQLISODateTime } from "@nestjs/graphql";
|
||||||
|
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
export class CreatePersonInput {
|
export class CreatePersonInput {
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
firstName: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
surname: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
middleName: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
sexCode: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
personRef: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
personTag: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
fatherName: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
motherName: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
countryCode: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
nationalIdentityId: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
birthPlace: string;
|
||||||
|
|
||||||
|
@Field(() => GraphQLISODateTime)
|
||||||
|
birthDate: Date;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
taxNo: string;
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
birthname: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import { InputType, Field, ID } from '@nestjs/graphql';
|
import { InputType, Field } from '@nestjs/graphql';
|
||||||
|
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
export class CreateUserTypesInput {
|
export class CreateUserTypesInput {
|
||||||
|
|
||||||
|
@Field()
|
||||||
|
uuid: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { UserTypesResolver } from './user-types.resolver';
|
import { UserTypesResolver } from './user-types.resolver';
|
||||||
import { UserTypesService } from './user-types.service';
|
import { UserTypesService } from './user-types.service';
|
||||||
|
import { UserTypeSchema, UserType } from '@/models/user-type.model';
|
||||||
|
import { MongooseModule } from '@nestjs/mongoose';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
providers: [UserTypesResolver, UserTypesService]
|
imports: [MongooseModule.forFeature([{ name: UserType.name, schema: UserTypeSchema }])],
|
||||||
|
providers: [UserTypesResolver, UserTypesService],
|
||||||
})
|
})
|
||||||
export class UserTypesModule {}
|
export class UserTypesModule { }
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import { UsersService } from './users.service';
|
||||||
import { UserSchema, User } from '@/models/user.model';
|
import { UserSchema, User } from '@/models/user.model';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [MongooseModule.forFeature([{ name: User.name, schema: UserSchema }])],
|
imports: [
|
||||||
providers: [UsersResolver, UsersService],
|
MongooseModule.forFeature([{ name: User.name, schema: UserSchema }])
|
||||||
|
],
|
||||||
|
providers: [UsersService, UsersResolver],
|
||||||
})
|
})
|
||||||
export class UsersModule { }
|
export class UsersModule { }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue