📋 Documentation: IrbyImaging.UI.Models.LegalDashboardInfo.cs


Table of Contents

  1. Overview & Purpose
  2. Key Functional Areas
  3. Dependencies & Technologies
  4. Data Models
  5. UML Class Diagram
  6. Usage Examples
  7. Error Handling & Validation
  8. API Endpoints Overview
  9. Third-party Integrations
  10. Conclusion & Next Steps

🧐 Overview & Purpose

The LegalDashboardInfo.cs file defines plain old CLR objects (POCOs) used by the Legal Dashboard in the IrbyImaging UI.
It encapsulates summary metrics about leased properties, grouped by their director and property type, to drive charts, grids, and KPI cards in your web or desktop application.

  • Namespace: IrbyImaging.UI.Models
  • Primary Role: Supply strongly‑typed view models for the Legal Dashboard.

🔑 Key Functional Areas

  • Data Modeling
    Defines classes and an enum to represent lease data.
  • UI Binding
    These models are ideal for ASP.NET Core Razor Pages, MVC Views, or WPF/UWP/Xamarin Forms data binding.
  • Extensibility
    Can be extended with additional metrics (e.g., Year‑to‑Date totals, Lease Start/End Dates).

🛠️ Dependencies & Technologies

Technology Version / Notes
.NET (Core / 5 / 6 / 7) Any version supporting C# 8.0+
C# POCO classes, no external NuGet required
UI Framework ASP.NET Core MVC/Razor, WPF, Xamarin, etc.

🚧 No external dependencies; purely a data model library.


📦 Data Models

1. LegalDashboardInfo

namespace IrbyImaging.UI.Models
{
    /// <summary>
    /// Root model for the Legal Dashboard view.
    /// Contains lease summary information for a single director.
    /// </summary>
    public class LegalDashboardInfo
    {
        /// <summary>
        /// Detailed metrics for the director’s leased properties.
        /// </summary>
        public LeaseDirectorInfo LeaseDirectorInfo { get; set; }
    }
}
  • Purpose: Acts as the top-level DTO passed from the controller/viewmodel to the view.
  • Properties:
    • LeaseDirectorInfo (required) – holds the actual lease statistics.

2. LeaseDirectorInfo

namespace IrbyImaging.UI.Models
{
    /// <summary>
    /// Encapsulates lease statistics for a particular director.
    /// </summary>
    public class LeaseDirectorInfo
    {
        /// <summary>
        /// The category of property (office, yard, etc.).
        /// </summary>
        public PropertyType PropertyType { get; set; }

        /// <summary>
        /// Name of the director responsible for the lease.
        /// </summary>
        public string Director { get; set; }

        /// <summary>
        /// Total number of properties under this director.
        /// </summary>
        public int NumberOfProperties { get; set; }

        /// <summary>
        /// Aggregated monthly expenses (in USD).
        /// </summary>
        public decimal MonthlyExpenses { get; set; }
    }
}
Property Type Description
PropertyType enum Category of the property (see below).
Director string Full name of the lease director.
NumberOfProperties int Count of properties managed.
MonthlyExpenses decimal Sum of monthly lease costs (currency).

3. PropertyType (enum)

namespace IrbyImaging.UI.Models
{
    /// <summary>
    /// Types of properties that can be leased.
    /// </summary>
    public enum PropertyType
    {
        /// <summary>Regional corporate offices.</summary>
        RegionalOffice,

        /// <summary>Project-specific offices or sites.</summary>
        ProjectOffice,

        /// <summary>Open yards used for staging/material storage.</summary>
        LaydownYard,
    }
}
Enum Member Description
RegionalOffice Corporate/regional administrative offices.
ProjectOffice Office located on a specific project.
LaydownYard Secure yard for equipment/materials.

📐 UML Class Diagram

+-----------------------+           +-----------------------+
| <<root>>              |           | LeaseDirectorInfo     |
| LegalDashboardInfo    |◄──────────|-----------------------|
|-----------------------|           | - PropertyType        |
| + LeaseDirectorInfo   |           | - Director            |
+-----------------------+           | - NumberOfProperties  |
                                     | - MonthlyExpenses     |
                                     +-----------------------+

                +--------------------+
                | <<enumeration>>    |
                | PropertyType       |
                |--------------------|
                | RegionalOffice     |
                | ProjectOffice      |
                | LaydownYard        |
                +--------------------+

🚀 Usage Examples

Instantiating the Models

using IrbyImaging.UI.Models;

var leaseInfo = new LeaseDirectorInfo
{
    PropertyType = PropertyType.RegionalOffice,
    Director = "Jane Doe",
    NumberOfProperties = 12,
    MonthlyExpenses = 15430.75m
};

var dashboard = new LegalDashboardInfo
{
    LeaseDirectorInfo = leaseInfo
};

// Now pass 'dashboard' into your controller/viewmodel

Binding to a View (Razor / XAML)

Razor (ASP.NET Core):

@model IrbyImaging.UI.Models.LegalDashboardInfo

<h2>Legal Dashboard</h2>
<ul>
  <li><strong>Director:</strong> @Model.LeaseDirectorInfo.Director</li>
  <li><strong>Property Type:</strong> @Model.LeaseDirectorInfo.PropertyType</li>
  <li><strong># Properties:</strong> @Model.LeaseDirectorInfo.NumberOfProperties</li>
  <li><strong>Monthly Expenses:</strong> @Model.LeaseDirectorInfo.MonthlyExpenses.ToString("C")</li>
</ul>

WPF (XAML):

<Window.DataContext>
    <local:LegalDashboardInfo />
</Window.DataContext>

<StackPanel>
    <TextBlock Text="{Binding LeaseDirectorInfo.Director}" />
    <TextBlock Text="{Binding LeaseDirectorInfo.PropertyType}" />
    <TextBlock Text="{Binding LeaseDirectorInfo.NumberOfProperties}" />
    <TextBlock Text="{Binding LeaseDirectorInfo.MonthlyExpenses, StringFormat=C}" />
</StackPanel>

⚙️ Error Handling & Validation

  • These classes are simple DTOs—no built‑in validation or error handling.
  • Recommended Extensions:
    • Data Annotations ([Required], [Range], [DataType(DataType.Currency)])
    • FluentValidation for richer rules.
public class LeaseDirectorInfo
{
    [Required]
    public string Director { get; set; }

    [Range(0, int.MaxValue)]
    public int NumberOfProperties { get; set; }

    [DataType(DataType.Currency)]
    public decimal MonthlyExpenses { get; set; }
}

📡 API Endpoints Overview

No direct API endpoints in this file.
These models are typically consumed by controllers or services that expose JSON endpoints, for example:

[HttpGet("api/legal/dashboard")]
public IActionResult GetLegalDashboard()
{
    var data = _dashboardService.GetLegalDashboardInfo();
    return Ok(data); // returns LegalDashboardInfo as JSON
}

🔗 Third-party Integrations

  • None at the model level.
  • Can be serialized via System.Text.Json or Newtonsoft.Json seamlessly.

🏁 Conclusion & Next Steps

The LegalDashboardInfo.cs file provides the foundation for your Legal Dashboard UI, defining the core data structures to represent lease metrics.

Next Steps:

  • Integrate with your controller or viewmodel layer.
  • Apply validation (Data Annotations or FluentValidation).
  • Extend with additional properties (e.g., lease start/end dates, YTD totals).
  • Create unit tests to verify serialization and default behaviors.

🎉 You’re now ready to harness these models to build dynamic, data‑driven legal dashboards in your IrbyImaging application!