Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Scheduler Entry Form To get PlanID from Plan Repo #791

Merged
merged 4 commits into from
Jan 31, 2025

Conversation

msalemcode
Copy link
Contributor

Update Add New Schedule code to get PlanID from Plan Repo instead of Using Dimension to look up plan Id

@msalemcode msalemcode requested a review from Copilot January 10, 2025 00:27

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

src/AdminSite/Controllers/SchedulerController.cs:235

  • Add a null check for 'subscriptionDetail' to prevent potential NullReferenceException.
var subscriptionDetail = this.subscriptionService.GetActiveSubscriptionsWithMeteredPlan().Where(s => s.Id == Convert.ToInt32(schedulerUsageViewModel.SelectedSubscription)).FirstOrDefault();

src/AdminSite/Controllers/SchedulerController.cs:237

  • Add a null check for 'selectedPlan' to prevent potential NullReferenceException.
var selectedPlan = this.plansRepository.GetById(subscriptionDetail.AmpplanId);

src/AdminSite/Controllers/SchedulerController.cs:234

  • [nitpick] Improve the comment to be more descriptive, e.g., 'Retrieve the active subscription detail to get the AMP Plan ID'.
//Get AMP Plan ID from Subscription Detail

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

src/AdminSite/Controllers/SchedulerController.cs:239

  • [nitpick] The error message could be more descriptive by including the subscriptionId to aid in debugging.
this.logger.LogError("Subscription detail not found for the given subscription ID.");

src/AdminSite/Controllers/SchedulerController.cs:247

  • [nitpick] The error message could be more descriptive by including the AmpplanId to aid in debugging.
this.logger.LogError("Plan detail not found for the given subscription.");

src/AdminSite/Controllers/SchedulerController.cs:243

  • Ensure that the new behavior of retrieving the plan by AmpplanId is covered by tests.
var selectedPlan = this.plansRepository.GetById(subscriptionDetail.AmpplanId);
Copy link

@fthorntonai fthorntonai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good
Pass: Fix Scheduler Entry Form To get PlanID from Plan Repo

@fthorntonai fthorntonai self-assigned this Jan 20, 2025
return this.View("Error", "Subscription detail not found.");
}
// Retrieve the active Plan detail by AMP Plan ID
var selectedPlan = this.plansRepository.GetById(subscriptionDetail.AmpplanId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msalemcode are we able to get the selected plan by ampplanId and offer id please? Imagine a scenarios a different planid with same name exists for both offers.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retested and approved with changes to Services/Services

Copy link
Contributor

@santhoshb-msft santhoshb-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added quick comment

@santhoshb-msft santhoshb-msft merged commit 13cbcc8 into Azure:main Jan 31, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants