56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
using taloyhtio.idp.parser.common.domain;
|
|
|
|
namespace taloyhtio.idp.parser.common.model
|
|
{
|
|
[Table("mdbFlats")]
|
|
public class Flat : Entity, IAggregateRoot
|
|
{
|
|
public Flat() { }
|
|
|
|
|
|
/// <summary>
|
|
/// i.e.
|
|
/// Church street 4 A 1 (usually high-rise has this form)
|
|
/// Church street 4 A(usually terraced house has this form, letter actually points to a flat)
|
|
/// NOTE: flat titles which are loaded to AzureDB table should be the same as used in PMS
|
|
/// </summary>
|
|
public string FlatTitle { get; set; }
|
|
|
|
/// <summary>
|
|
/// Parent Condo of the flat in the same format as returned from PMS
|
|
/// </summary>
|
|
public string CondoPMS { get; set; }
|
|
|
|
/// <summary>
|
|
/// Taloyhtio PMC Id of condo to which current flat belongs to
|
|
/// </summary>
|
|
public Guid PMCTaloyhtioId { get; set; }
|
|
|
|
public List<FlatUser> Users { get; private set; } = new List<FlatUser>();
|
|
|
|
/// <summary>
|
|
///Depending on actual method which will be used for loading flats to AzureDB (see below) there also may be information about users which live in each flat
|
|
/// </summary>
|
|
public string FlatUsers
|
|
{
|
|
get { return Users == null || !Users.Any() ? null : JsonConvert.SerializeObject(Users); }
|
|
set
|
|
{
|
|
try
|
|
{
|
|
Users = JsonConvert.DeserializeObject<List<FlatUser>>(value);
|
|
}
|
|
catch (Exception)
|
|
{
|
|
Users = new List<FlatUser>();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|