import { IsObject } from 'class-validator' ; export interface IPrivilegedRequestInformation extends firebase . firestore . DocumentData { address : google . maps . GeocoderResult ; } export class PrivilegedRequestInformation implements IPrivilegedRequestInformation { constructor ( address ) { this . _address = address ; } @ IsObject ( ) private _address : google . maps . GeocoderResult ; get address ( ) : google . maps . GeocoderResult { return this . _address ; } set address ( value ) { this . _address = value ; } static factory = ( data ) : PrivilegedRequestInformation => new PrivilegedRequestInformation ( data . address ) ; toObject ( ) { return { address : this . address , } ; } } export const PrivilegedRequestInformationFirestoreConverter = { fromFirestore : ( data ) : PrivilegedRequestInformation => PrivilegedRequestInformation . factory ( data . data ( ) ) , toFirestore : ( modelObject ) : firebase . firestore . DocumentData => ( { address : modelObject . address , } ) , } ;