import { Timestamp } from "typeorm";

export class HospitalEntity {
  plenome_id: number;
  HealthFacilityID: string;
  hospital_name: string;
  contact_no: string;
  address: string;
  state?: string;
  district?: string;
  pincode: string;
  website?: string;
  email?: string;
  hospital_reg_no: string;
  hospital_reg_date: Date;
  hospital_reg_expiry_date: Date;
  specialty?: any;
  services?: any;
  image?: string;
  logo?: string;
  bedcount?: number;
  description?: string;
  created_at: Timestamp;
}
// test

import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";

import { Document, Types } from "mongoose";

export type HospitalDocument = Hospital & Document;

@Schema({ timestamps: true })
export class Hospital {
  @Prop({ required: true })
  name: string;

  @Prop()
  logo: string;

  @Prop({ enum: ["Private", "Government", "Trust", "Other"] })
  type: string;

  @Prop()
  yearOfEstablishment: Date;

  @Prop({ required: true })
  email: string;

  @Prop()
  countryCode: number;

  @Prop()
  phone: number;

  @Prop()
  countryCode2: number;

  @Prop()
  phone2: number;

  @Prop()
  licenseNo: string;

  @Prop()
  certificate: string;

  @Prop()
  website: string;

  @Prop()
  address1: string;

  @Prop()
  city: string;

  @Prop()
  state: string;

  @Prop()
  country: string;

  @Prop()
  postalCode: number;

  // doctor reference

  @Prop({ type: Types.ObjectId, ref: "Doctor" })
  doctor: Types.ObjectId;
}

export const HospitalSchema = SchemaFactory.createForClass(Hospital);
