Tuesday, November 10, 2026

OnePlan Automation

 using Microsoft.Extensions.Options;

using OnePlanWeeklyNotifications.Models;
using OnePlanWeeklyNotifications.Options;
using OnePlanWeeklyNotifications.Services;

namespace OnePlanWeeklyNotifications
{
    /// <summary>
    /// Background service that sends weekly OnePlan approval reminders.
    /// Collects Project Approvers tasks whose deliverable status is "Submitted",
    /// resolves the assigned resources, and emails each resource a summary of pending items.
    /// Work type and status IDs are configured in appsettings.json (OnePlan section).
    /// </summary>
    public class Worker(
        ILogger<Worker> logger,
        IOnePlanClient onePlan,
        IEmailSender emailSender,
        IOptions<NotificationOptions> notificationOptions,
        IOptions<OnePlanOptions> onePlanOptions) : BackgroundService
    {
        // Weekly schedule and email subject settings (Notification section).
        private readonly NotificationOptions _schedule = notificationOptions.Value;

        // OnePlan API and filter settings (OnePlan section).
        private readonly OnePlanOptions _onePlan = onePlanOptions.Value;

        // Work type IDs that must never be notified (e.g. Backlog), loaded from configuration.
        private readonly HashSet<string> _excludedWorkTypeIds = new(onePlanOptions.Value.ExcludedWorkTypeIds, StringComparer.OrdinalIgnoreCase);

        /// <summary>
        /// Main loop: waits until the configured day/time, then runs the notification job.
        /// Currently runs once immediately (weekly delay is commented out for testing).
        /// </summary>
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                //var delay = GetDelayUntilNextRun(DateTime.Now);
                //logger.LogInformation("Next approval notification run at {NextRun}.", DateTime.Now.Add(delay));

                //await Task.Delay(delay, stoppingToken);

                try
                {
                    await RunAsync(stoppingToken);
                    // await emailSender.SendAsync("Mohammad.Chowdhury@PACCAR.com", "Test", "Test body", stoppingToken);
                }
                catch (Exception ex) when (ex is not OperationCanceledException)
                {
                    // Log and continue so one failed run doesn't stop the service.
                    logger.LogError(ex, "Weekly approval notification run failed.");
                }

                // TODO: remove when re-enabling the weekly delay above
                break;
            }
        }

        /// <summary>
        /// Collects pending deliverables, groups them by recipient email,
        /// and sends one HTML summary email per recipient. Failures are logged per recipient.
        /// </summary>
        private async Task RunAsync(CancellationToken ct)
        {
            var pending = await CollectPendingDeliverablesAsync(ct);
            logger.LogInformation("Found {Count} pending deliverable assignment(s).", pending.Count);

            // One email per recipient, containing all of their pending items.
            foreach (var group in pending.GroupBy(p => p.Resource.Fields.Mail!, StringComparer.OrdinalIgnoreCase))
            {
                var html = ApprovalEmailBuilder.Build(group.First().Resource, group, _onePlan.BaseUrl);
                try
                {
                    await emailSender.SendAsync(group.Key, _schedule.Subject, html, ct);
                    logger.LogInformation("Sent {Count} item(s) to {Email}.", group.Count(), group.Key);
                }
                catch (Exception ex) when (ex is not OperationCanceledException)
                {
                    // A failure for one recipient does not block the others.
                    logger.LogError(ex, "Failed to email {Email}.", group.Key);
                }
            }
        }

        /// <summary>
        /// Loads all work plans and their tasks, keeps only Project Approvers tasks that are
        /// pending approval and not in the excluded work types, then resolves each assigned
        /// resource (cached per run) and returns those with a valid email address.
        /// </summary>
        private async Task<List<PendingDeliverable>> CollectPendingDeliverablesAsync(CancellationToken ct)
        {
            var results = new List<PendingDeliverable>();

            // Cache resource lookups to avoid repeated API calls for the same person.
            var resourceCache = new Dictionary<string, Resource?>(StringComparer.OrdinalIgnoreCase);

            foreach (var plan in await onePlan.GetWorkPlansAsync(ct))
            {
                //if (plan.Id == "dd1f1d7c-161b-4dfe-9535-3ff894cd358b")
                //{
                    List<WorkPlanTask> tasks;
                    try
                    {
                        tasks = await onePlan.GetTasksAsync(plan.Id, ct);
                    }
                    catch (HttpRequestException ex)
                    {
                        // Skip this plan if its tasks can't be loaded.
                        logger.LogWarning(ex, "Failed to load tasks for plan {PlanId}.", plan.Id);
                        continue;
                    }

                    // Filter: not excluded work type, is Project Approvers, and status is pending approval.
                    var filtered = tasks.Where(t =>
                        !_excludedWorkTypeIds.Contains(t.WorkTypeId ?? string.Empty) &&
                        string.Equals(t.WorkTypeId, _onePlan.ProjectApproversWorkTypeId, StringComparison.OrdinalIgnoreCase) &&
                        string.Equals(t.Fields.DeliverableStatus, _onePlan.PendingApprovalStatusId, StringComparison.OrdinalIgnoreCase));

                    foreach (var task in filtered)
                    {
                        foreach (var assignment in task.Assignments)
                        {
                            if (string.IsNullOrWhiteSpace(assignment.ResourceId)) continue;

                            // Look up the assigned resource once per run; failed lookups are cached as null.
                            if (!resourceCache.TryGetValue(assignment.ResourceId, out var resource))
                            {
                                try
                                {
                                    resource = await onePlan.GetResourceAsync(assignment.ResourceId, ct);
                                }
                                catch (HttpRequestException ex)
                                {
                                    logger.LogWarning(ex, "Failed to load resource {ResourceId}.", assignment.ResourceId);
                                    resource = null;
                                }
                                resourceCache[assignment.ResourceId] = resource;
                            }

                            // Only include resources that have an email address.
                            if (resource is null || string.IsNullOrWhiteSpace(resource.Fields.Mail)) continue;
                            results.Add(new PendingDeliverable(plan, task, resource));
                        }
                    }
                }
                
           // }

                return results;
        }

        /// <summary>
        /// Calculates the time remaining until the next configured weekly run (DayOfWeek + TimeOfDay).
        /// If that time has already passed this week, schedules for next week.
        /// </summary>
        private TimeSpan GetDelayUntilNextRun(DateTime now)
        {
            var daysUntil = ((int)_schedule.DayOfWeek - (int)now.DayOfWeek + 7) % 7;
            var next = now.Date.AddDays(daysUntil).Add(_schedule.TimeOfDay);
            if (next <= now) next = next.AddDays(7);
            return next - now;
        }
    }
}

Sunday, August 23, 2026

Denton

Denton  House Address

2113 Paxton Way, Denton, TX 76209

 WiFi Info

Network: TE Paxton Password: Paxtonrental222
Peterbilt Motors Corporate Headquarters (Not a dealership)
1700 Woodbrook St, Denton, TX 76205

Islamic Society of Denton website is 1105 Greenlee St, Denton, TX 76201

Saturday, August 22, 2026

OutSystems

 https://www.youtube.com/watch?v=sNbSINPbE58&list=PLZorY18qtX6GK10LgrCwgWPO6BeB5HsgW&index=5

The diagram illustrates an OutSystems platform, detailing its components and tools, including service centers, app development, quality assurance, production, and various software integrations.

AI-generated content may be incorrect.
OutSystems একটি low-code development platform, যা দ্রুত অ্যাপ তৈরি, পরীক্ষা এবং প্রকাশ করতে সাহায্য করে। ছবিতে এর প্রধান কম্পোনেন্ট ও টুলগুলোর সম্পর্ক দেখানো হয়েছে।

🔧 প্রধান টুলসমূহ

  • Service Studio 👉 এটি হলো মূল ডেভেলপমেন্ট টুল যেখানে অ্যাপ ডিজাইন, লজিক তৈরি এবং ইউজার ইন্টারফেস তৈরি করা হয়।
  • Integration Studio 👉 এখানে বাইরের সিস্টেম বা API-এর সঙ্গে সংযোগ স্থাপন করা হয়। উদাহরণস্বরূপ, C# কোড বা অন্যান্য সার্ভিস ইন্টিগ্রেশন।
  • LifeTime 👉 এটি হলো ম্যানেজমেন্ট টুল যা বিভিন্ন এনভায়রনমেন্টে (Development, Quality, Production) অ্যাপ ডিপ্লয়মেন্ট ও ভার্সন কন্ট্রোল পরিচালনা করে।
  • Service Center 👉 এটি অ্যাপ মনিটরিং, পারফরম্যান্স ট্র্যাকিং এবং সার্ভার ম্যানেজমেন্টের জন্য ব্যবহৃত হয়।

 


Wednesday, August 19, 2026

Monday, August 10, 2026

Docker

 wsl --install

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

docker desktop engine ls

docker desktop engine use windows

open power shell with admin and run below command

Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All

1️⃣ Docker Desktop Install করো

Step 2: rancher  desktop statrt/run (icon click start menu)

Step 3
The image shows a Windows PowerShell session displaying error messages related to Docker, specifically issues with connecting to the Docker daemon, and commands for managing Docker contexts.

AI-generated content may be incorrect.

The image displays a user interface for the Visual Studio Code editor, specifically for a Docker project related to ASP.NET Core. It includes sections for building, debugging, and deploying a web application in a containerized environment.

AI-generated content may be incorrect.

docker run -d -p 8080:8080 mvc-app:latest  


Thursday, July 30, 2026

Microsoft Power Platform

 Microsoft Power Platform একটি কম্প্রিহেনসিভ টুলসেট, যা ব্যবসায়িক অ্যানালাইটিক্স, অ্যাপ্লিকেশন ডেভেলপমেন্ট, স্বয়ংক্রিয় কাজ এবং ভার্চুয়াল এজেন্ট তৈরির জন্য ডিজাইন করা হয়েছে। এর প্রধান চারটি উপাদান হল: Power BI, Power Apps, Power Automate, এবং Power Virtual Agents। নিচে প্রতিটি উপাদানের বিস্তারিত আলোচনা করা হলো:

https://sattacademy.com/guide/power-platform-%E0%A6%95%E0%A6%BF-%E0%A6%AA%E0%A6%BE%E0%A6%93%E0%A7%9F%E0%A6%BE%E0%A6%B0-%E0%A6%AA%E0%A7%8D%E0%A6%B2%E0%A6%BE%E0%A6%9F%E0%A6%AB%E0%A6%B0%E0%A7%8D%E0%A6%AE-%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE-%E0%A6%9F%E0%A6%BF%E0%A6%89%E0%A6%9F%E0%A7%8B%E0%A6%B0%E0%A6%BF%E0%A7%9F%E0%A6%BE%E0%A6%B2

১. Power BI

বিবরণ: Power BI একটি শক্তিশালী অ্যানালিটিক্স টুল যা ব্যবহারকারীদের ডেটা বিশ্লেষণ, রিপোর্ট তৈরি এবং ডেটা ভিজ্যুয়ালাইজেশন করতে সাহায্য করে।


বৈশিষ্ট্য:

ডেটা সংযোগ: বিভিন্ন উৎস (যেমন SQL Server, Excel, SharePoint, এবং ক্লাউড ভিত্তিক ডেটা) থেকে ডেটা সংগ্রহ করতে সক্ষম।

ভিজ্যুয়ালাইজেশন: ব্যবহারকারীরা বিভিন্ন প্রকারের চার্ট, গ্রাফ এবং ড্যাশবোর্ড তৈরি করতে পারেন।

রিপোর্ট শেয়ারিং: রিপোর্ট এবং ড্যাশবোর্ডগুলি সহজেই দলের সদস্যদের সাথে শেয়ার করা যায়।

ডেটা বিশ্লেষণ: ডেটা বিশ্লেষণের জন্য DAX (Data Analysis Expressions) ব্যবহার করা হয়, যা অত্যন্ত শক্তিশালী।

২. Power Apps

বিবরণ: Power Apps একটি লো-কোড প্ল্যাটফর্ম যা ব্যবহারকারীদের কাস্টম অ্যাপ্লিকেশন তৈরি করতে সাহায্য করে, বিশেষ করে যারা উন্নত প্রোগ্রামিং দক্ষতা রাখেন না।


বৈশিষ্ট্য:

লোগিক তৈরি: অ্যাপ্লিকেশন তৈরির জন্য ড্র্যাগ-অ্যান্ড-ড্রপ ইন্টারফেস।

শ্রেণীবদ্ধ অ্যাপ: কাস্টম মোবাইল এবং ওয়েব অ্যাপ্লিকেশন তৈরি করা যায়।

ডেটা সংযোগ: Microsoft Dataverse, SharePoint, এবং অন্যান্য ডেটাবেসে সহজে সংযোগ স্থাপন করা যায়।

শেয়ারিং এবং নিরাপত্তা: তৈরি করা অ্যাপ্লিকেশনগুলো সহজে শেয়ার করা যায় এবং নিরাপত্তা নিয়ন্ত্রণ করা যায়।

৩. Power Automate

বিবরণ: Power Automate (পূর্বে Microsoft Flow নামে পরিচিত) একটি স্বয়ংক্রিয়তা প্ল্যাটফর্ম যা ব্যবহারকারীদের বিভিন্ন কাজ ও প্রক্রিয়া অটোমেট করতে সহায়তা করে।


বৈশিষ্ট্য:

ওয়ার্কফ্লো তৈরি: বিভিন্ন অ্যাপ্লিকেশন এবং পরিষেবার মধ্যে কাজের প্রবাহ তৈরি করতে সক্ষম।

Triggers: নির্দিষ্ট ঘটনাগুলির উপর ভিত্তি করে স্বয়ংক্রিয় কাজ শুরু করা যায় (যেমন, নতুন ইমেইল আসা বা ফাইল আপলোড করা)।

Integration: শতাধিক অ্যাপ্লিকেশন এবং সেবার সাথে সংযোগ করতে সক্ষম (যেমন, SharePoint, OneDrive, Dynamics 365)।

Approval Processes: সহজে অনুমোদন প্রক্রিয়া তৈরি করা যায়।

৪. Power Virtual Agents

বিবরণ: Power Virtual Agents একটি টুল যা ব্যবহারকারীদের কোড ছাড়াই চ্যাটবট তৈরি করতে সাহায্য করে, যা গ্রাহক সহায়তা এবং ব্যবসায়িক যোগাযোগের জন্য ব্যবহৃত হয়।


বৈশিষ্ট্য:

চ্যাটবট নির্মাণ: ড্র্যাগ-অ্যান্ড-ড্রপ ইন্টারফেস ব্যবহার করে সহজে চ্যাটবট তৈরি করা যায়।

নির্ধারিত প্রশ্ন ও উত্তর: ব্যবহারকারীরা চ্যাটবটের প্রশ্ন ও উত্তর নির্ধারণ করতে পারেন।

Integration: Power Virtual Agents অন্যান্য Power Platform উপাদান এবং Microsoft 365-এর সাথে সংযোগ করতে সক্ষম।

নিরীক্ষণ এবং বিশ্লেষণ: চ্যাটবটের কার্যকারিতা বিশ্লেষণ করার জন্য রিপোর্টিং এবং বিশ্লেষণ সরঞ্জাম প্রদান করে।

উপসংহার

Microsoft Power Platform-এর এই চারটি উপাদান ব্যবসায়িক কাজের কার্যকারিতা বাড়াতে এবং স্বয়ংক্রিয়তা আনতে সাহায্য করে। Power BI ডেটা বিশ্লেষণের জন্য, Power Apps কাস্টম অ্যাপ্লিকেশন তৈরির জন্য, Power Automate কাজের প্রবাহ অটোমেট করার জন্য, এবং Power Virtual Agents গ্রাহক যোগাযোগের জন্য কার্যকরী। এই উপাদানগুলির সমন্বয় ব্যবসায়িক সমস্যাগুলি সমাধানে একটি শক্তিশালী প্ল্যাটফর্ম তৈরি করে।


Copied from SATT ACADEMY. Visit us at: https://sattacademy.com

OnePlan Automation

  using Microsoft.Extensions.Options; using OnePlanWeeklyNotifications.Models; using OnePlanWeeklyNotifications.Options; using OnePlanWe...