using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Serialization; using EnVisage.Models; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; namespace EnVisage.Code.DAL.Mongo { [BsonIgnoreExtraElements] [Serializable] public abstract class BaseDALClass { [BsonId] public ObjectId Id { get; set; } public string CreatedBy { get; set; } public DateTime CreatedAtUtc { get; set; } } [BsonIgnoreExtraElements] [Serializable] public class MixBase : BaseDALClass { public ObjectId Key { get; set; } public string Name { get; set; } public long StartDate { get; set; } public long EndDate { get; set; } public List Users { get; set; } } /// /// Represents information about any Mix. /// [BsonIgnoreExtraElements] [Serializable] public class Mix : MixBase { public List Teams { get; set; } public List TeamsViews { get; set; } public Dictionary Projects { get; set; } public List ManagedProjects { get; set; } public List UnscheduledProjects { get; set; } public List QueuedProjects { get; set; } public List UnassignedExpProjects { get; set; } // SA. ENV-1210 public List Layout { get; set; } public Mix() { Teams = new List(); TeamsViews = new List(); Users = new List(); Projects = new Dictionary(); ManagedProjects = new List(); UnscheduledProjects = new List(); QueuedProjects = new List(); UnassignedExpProjects = new List(); // SA. ENV-1210 Layout = new List(); } } [BsonIgnoreExtraElements] [Serializable] public class BaseAllocation { [BsonId] public ObjectId Id { get; set; } public ObjectId MixId { get; set; } public Guid ScenarioId { get; set; } public DateTime CreatedAtUtc { get; set; } public string CreatedBy { get; set; } public Dictionary Allocations { get; set; } public BaseAllocation() { Allocations = new Dictionary(); } } [BsonIgnoreExtraElements] [Serializable] public class MixTeamAllocation : BaseAllocation { public string TeamId { get; set; } public Guid ExpCatId { get; set; } public string Name { get; set; } public Dictionary AllResources { get; set; } public MixTeamAllocation() : base() { AllResources = new Dictionary(); } } [BsonIgnoreExtraElements] [Serializable] public class MixResourceAllocation : BaseAllocation { public string TeamId { get; set; } public Guid ExpCatId { get; set; } public string ResourceId { get; set; } public string Name { get; set; } public MixResourceAllocation() : base() { } } [BsonIgnoreExtraElements] [Serializable] public class MixExpenditureAllocation : BaseAllocation { public Guid ExpCatId { get; set; } public string ExpenditureCategoryName { get; set; } public int Type { get; set; } public int UseType { get; set; } //default is 1 public string CGEFX { get; set; } public Guid GLId { get; set; } public Guid UOMId { get; set; } public Guid CreditId { get; set; } public Guid? SysAttrOne { get; set; } public Guid? SysAttrTwo { get; set; } public int? SortOrder { get; set; } public decimal UOMValue { get; set; } public bool AllowResourceAssignment { get; set; } public Dictionary UnassignedAllocations { get; set; } public MixExpenditureAllocation() : base() { } } [BsonIgnoreExtraElements] [Serializable] public class QuantityItem { public decimal Quantity { get; set; } public decimal Cost { get; set; } } [BsonIgnoreExtraElements] [Serializable] public class CategoryExpenditureInMongoProject { public Guid ProjectId; public Guid ExpCatId; public Guid? TargetTeamId; public string Name; public bool AllowResourceAssignment; } }