module fb { export class NyObjektIntressent extends ResourceBase { ObjektIntressentId: number; PersonId: number; MaeklarObjektId: number; ObjektIntressentRoll: number; Underkontakter: ObjektIntressentUnderkontakt[]; Visningar: fb.ISlot[]; ObjSpekKaella: number; DigitalBudgivningAktiv: number; public static $rootName = "NyObjektIntressent"; constructor(data) { super(data, false, 'NyObjektIntressent'); } getPrimaryKey(): any { switch (this.ObjektIntressentRoll) { case fb.FasITDomain.ObjIntressentRoll.UTHYRARE: case fb.FasITDomain.ObjIntressentRoll.ANSVARIG_PERSON: case fb.FasITDomain.ObjIntressentRoll.MAEKLARASSISTENT: case fb.FasITDomain.ObjIntressentRoll.BANKKONTAKT: case fb.FasITDomain.ObjIntressentRoll.LAANGIVARE: // För dessa roller kan vi bara ha en intressentinstans så personid behövs inte för nyckeln // Genom detta undviks timing-problem om flera ändringar skulle köas för sparning return this.MaeklarObjektId + '-' + this.ObjektIntressentRoll; default: return this.PersonId + '-' + this.MaeklarObjektId + '-' + this.ObjektIntressentRoll; } } getForeignKeyObject(): fb.IForeignKeyObject { return { entity: fb.ForeignKeyEntity.MAEKLAROBJEKT, key: this.MaeklarObjektId } } } export interface ObjektIntressentUnderkontakt { ObjektIntressentId: number; ObjektIntressentRoll: number; } }