130 lines
4.2 KiB
C#
130 lines
4.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Xml.Serialization;
|
|
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
namespace EnVisage.Code.DAL.Mongo
|
|
{
|
|
/// <summary>
|
|
/// Represents information about any Mix.
|
|
/// </summary>
|
|
[BsonIgnoreExtraElements]
|
|
[Serializable]
|
|
public class MixTeam
|
|
{
|
|
[BsonId]
|
|
public string Id { get; set; }
|
|
public bool IsNew { get; set; }
|
|
public string Name { get; set; }
|
|
public Guid? CompanyId { get; set; }
|
|
public Guid? CostCenterId { get; set; }
|
|
public Guid[] UserId { get; set; }
|
|
public string Group { get; set; }
|
|
public Dictionary<string, ExpCategoryCapacity> ExpCategories { get; set; }
|
|
public MixTeamCapacity[] PlannedCapacity { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets and extra property that stores any fields from Mongo object which are not defined in this class.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This property could contain any values from removed properties. For example, if you remove property from the class to, you can use Metadata property
|
|
/// to read removed values from Mongo objects and update any related objects if necessary.
|
|
/// </remarks>
|
|
[BsonExtraElements]
|
|
public BsonDocument Metadata { get; set; }
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
[Serializable]
|
|
public class MixTeamCapacity
|
|
{
|
|
[BsonId]
|
|
public string Id { get; set; }
|
|
//public string MixId { get; set; }
|
|
//public string TeamId { get; set; }
|
|
public string ExpCatId { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets a dictionary with capcity values by week. Key - weekending date in milliseconds, value - category need in # of resources.
|
|
/// </summary>
|
|
public Dictionary<string, decimal> Values { get; set; }
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
[Serializable]
|
|
public class MixTeamView
|
|
{
|
|
[BsonId]
|
|
public string Id { get; set; }
|
|
public bool IsNew { get; set; }
|
|
public string Name { get; set; }
|
|
public string Group { get; set; }
|
|
public Guid? CompanyId { get; set; }
|
|
public Guid? CostCenterId { get; set; }
|
|
public Guid? CapacityTeamId { get; set; }
|
|
public bool CopyPlanned { get; set; }
|
|
public WidgetExpCategory[] Data { get; set; }
|
|
public Guid[] UserId { get; set; }
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
[Serializable]
|
|
public class WidgetExpCategory
|
|
{
|
|
public Guid Id { get; set; }
|
|
public bool InPlan { get; set; }
|
|
public string Name { get; set; }
|
|
public WidgetExpCatPosition[] Positions { get; set; }
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
[Serializable]
|
|
public class WidgetExpCatPosition
|
|
{
|
|
public string StartDate { get; set; }
|
|
public string EndDate { get; set; }
|
|
public DateTime? SDate { get; set; }
|
|
public DateTime? EDate { get; set; }
|
|
public int Need { get; set; }
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
[Serializable]
|
|
public class ExpCategoryCapacity
|
|
{
|
|
public Guid Id { get; set; }
|
|
public string Name { get; set; }
|
|
public decimal UomValue { get; set; }
|
|
public bool AllowResourceAssignment { get; set; }
|
|
|
|
/// <summary>Key - week ending date in milliseconds, value - capacity</summary>
|
|
public Dictionary<string, decimal> PlannedCapacityValues { get; set; }
|
|
|
|
/// <summary>Key - week ending date in milliseconds, value - capacity</summary>
|
|
public Dictionary<string, decimal> ActualCapacityValues { get; set; }
|
|
|
|
/// <summary>Key - week ending date in milliseconds, value - capacity</summary>
|
|
public Dictionary<string, decimal> NeedCapacity { get; set; }
|
|
|
|
/// <summary>Key - week ending date in milliseconds, value - capacity</summary>
|
|
public Dictionary<string, decimal> AllocatedCapacity { get; set; }
|
|
/// <summary>
|
|
/// Resource allocations
|
|
/// </summary>
|
|
public Dictionary<string, ActivityResource> Resources { get; set; }
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
[Serializable]
|
|
public class ActivityResource
|
|
{
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>Contains total allocated resource capacity between active scenarios for certain week ending (key in milliseconds).</summary>
|
|
public Dictionary<string, decimal> AllocatedCapacity { get; set; }
|
|
|
|
/// <summary>Contains total available resource capacity for certain week ending (key in milliseconds). Takes from EC UoM value.</summary>
|
|
public Dictionary<string, decimal> TotalCapacity { get; set; }
|
|
}
|
|
} |