katoikia-app/servicio-comunidad-viviendas/src/schemas/community.schema.ts

44 lines
709 B
TypeScript
Raw Normal View History

2022-06-29 10:12:27 +00:00
import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
import { House, HouseSchema } from './house.schema';
2022-06-29 10:12:27 +00:00
export type CommunityDocument = Community & Document;
@Schema({ collection: 'communities' })
export class Community {
2022-07-25 04:38:48 +00:00
@Prop()
id_admin: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
name_admin: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
name: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
province: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
canton: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
district: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
num_houses: number;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
phone: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
status: string;
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
@Prop()
date_entry: Date;
2022-07-25 04:38:48 +00:00
@Prop({ type: [HouseSchema] })
houses: Array<House>;
}
2022-06-29 10:12:27 +00:00
2022-07-25 04:38:48 +00:00
export const CommunitySchema = SchemaFactory.createForClass(Community);