parts and areas tested
This commit is contained in:
@@ -10,11 +10,11 @@ export class BuildArea extends Base {
|
||||
@Field(() => ID)
|
||||
readonly _id: string;
|
||||
|
||||
@Field(() => Float)
|
||||
@Field()
|
||||
@Prop({ required: true })
|
||||
areaName: string;
|
||||
|
||||
@Field(() => Float)
|
||||
@Field()
|
||||
@Prop({ required: true })
|
||||
areaCode: string;
|
||||
|
||||
@@ -26,19 +26,19 @@ export class BuildArea extends Base {
|
||||
@Prop({ required: true })
|
||||
areaDirection: string;
|
||||
|
||||
@Field()
|
||||
@Field(() => Float)
|
||||
@Prop({ required: true })
|
||||
areaGrossSize: number;
|
||||
|
||||
@Field()
|
||||
@Field(() => Float)
|
||||
@Prop({ required: true })
|
||||
areaNetSize: number;
|
||||
|
||||
@Field()
|
||||
@Field(() => Float)
|
||||
@Prop({ required: true })
|
||||
width: number;
|
||||
|
||||
@Field()
|
||||
@Field(() => Float)
|
||||
@Prop({ required: true })
|
||||
size: number;
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ import { Base } from '@/models/base.model';
|
||||
@Schema({ timestamps: true })
|
||||
export class BuildParts extends Base {
|
||||
|
||||
@Field(() => ID)
|
||||
readonly _id: string;
|
||||
|
||||
@Field(() => ID)
|
||||
@Prop({ type: Types.ObjectId, ref: 'Build', required: true })
|
||||
buildId: Types.ObjectId;
|
||||
@@ -47,13 +50,14 @@ export class BuildParts extends Base {
|
||||
@Prop({ required: true })
|
||||
key: string;
|
||||
|
||||
@Field(() => ID)
|
||||
@Prop({ type: Types.ObjectId, ref: 'ApiEnumDropdown', required: true })
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Prop({ type: Types.ObjectId, ref: 'ApiEnumDropdown', required: false })
|
||||
directionId: Types.ObjectId;
|
||||
|
||||
@Field(() => ID)
|
||||
@Prop({ type: Types.ObjectId, ref: 'ApiEnumDropdown', required: true })
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Prop({ type: Types.ObjectId, ref: 'ApiEnumDropdown', required: false })
|
||||
typeId: Types.ObjectId;
|
||||
|
||||
}
|
||||
|
||||
export type BuildPartsDocument = BuildParts & Document;
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ObjectType, Field, ID, Int } from '@nestjs/graphql';
|
||||
import { Base } from '@/models/base.model';
|
||||
import { Person } from '@/models/person.model';
|
||||
import { Company } from '@/models/company.model';
|
||||
import { BuildTypes } from './build-types.model';
|
||||
|
||||
@ObjectType()
|
||||
@Schema({ timestamps: true })
|
||||
@@ -37,13 +38,13 @@ export class BuildIban extends Base {
|
||||
@ObjectType()
|
||||
export class BuildResponsible {
|
||||
|
||||
@Field(() => [String], { nullable: true, defaultValue: [] })
|
||||
@Prop({ type: [String], default: [] })
|
||||
company?: string[];
|
||||
@Field(() => String, { nullable: true })
|
||||
@Prop({ type: String, default: '' })
|
||||
company?: string;
|
||||
|
||||
@Field(() => [String], { nullable: true, defaultValue: [] })
|
||||
@Prop({ type: [String], default: [] })
|
||||
person?: string[];
|
||||
@Field(() => String, { nullable: true })
|
||||
@Prop({ type: String, default: '' })
|
||||
person?: string;
|
||||
|
||||
}
|
||||
|
||||
@@ -110,9 +111,9 @@ export class BuildInfo {
|
||||
@Prop({ required: true })
|
||||
garageCount: number;
|
||||
|
||||
@Field(() => Int)
|
||||
@Prop({ required: true })
|
||||
managementRoomId: number;
|
||||
@Field(() => String, { nullable: true })
|
||||
@Prop({ required: false })
|
||||
managementRoomId?: string;
|
||||
|
||||
}
|
||||
|
||||
@@ -123,13 +124,9 @@ export class Build {
|
||||
@Field()
|
||||
readonly _id: string;
|
||||
|
||||
// @Field(() => ID)
|
||||
// @Prop({ type: Types.ObjectId, ref: 'BuildType', required: true })
|
||||
// buildType: Types.ObjectId;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
@Prop({ required: true })
|
||||
buildType: string;
|
||||
@Field(() => BuildTypes)
|
||||
@Prop({ type: Types.ObjectId, ref: BuildTypes.name, required: true })
|
||||
buildType: Types.ObjectId;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
@Prop({ required: true })
|
||||
|
||||
@@ -6,6 +6,10 @@ import { Base } from '@/models/base.model';
|
||||
@ObjectType()
|
||||
@Schema({ timestamps: true })
|
||||
export class Company extends Base {
|
||||
|
||||
@Field(() => ID)
|
||||
readonly _id: string;
|
||||
|
||||
@Field(() => ID)
|
||||
@Prop({ required: true })
|
||||
name: string;
|
||||
|
||||
@@ -10,6 +10,7 @@ import { UserType } from '@/models/user-type.model';
|
||||
|
||||
@ObjectType()
|
||||
export class LivingSpaces extends Base {
|
||||
|
||||
@Field(() => ID)
|
||||
@Prop({ type: Types.ObjectId, ref: BuildParts.name, required: true })
|
||||
part: Types.ObjectId;
|
||||
@@ -25,8 +26,8 @@ export class LivingSpaces extends Base {
|
||||
@Field(() => ID)
|
||||
@Prop({ type: Types.ObjectId, ref: UserType.name, required: true })
|
||||
userType: Types.ObjectId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export type LivingSpacesDocument = LivingSpaces & Document;
|
||||
export const LivingSpacesSchema = SchemaFactory.createForClass(LivingSpaces);
|
||||
|
||||
@@ -36,6 +36,10 @@ export class User extends Base {
|
||||
@Field(() => ID)
|
||||
_id: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Prop({ required: false, default: '' })
|
||||
avatar?: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Prop({ default: () => new Date(Date.now() + 30 * 24 * 60 * 60 * 1000) })
|
||||
expiresAt?: Date;
|
||||
|
||||
Reference in New Issue
Block a user