chore: import upstream snapshot with attribution
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:21:23 +08:00
commit b957a53def
5423 changed files with 863745 additions and 0 deletions
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft. All rights reserved.
namespace Step02.Models;
/// <summary>
/// Represents the data structure for a form capturing details of a new customer, including personal information, contact details, account id and account type.<br/>
/// Class used in <see cref="Step02a_AccountOpening"/>, <see cref="Step02b_AccountOpening"/> samples
/// </summary>
public class AccountDetails : NewCustomerForm
{
public Guid AccountId { get; set; }
public AccountType AccountType { get; set; }
}
public enum AccountType
{
PrimeABC,
Other,
}
@@ -0,0 +1,35 @@
// Copyright (c) Microsoft. All rights reserved.
namespace Step02.Models;
/// <summary>
/// Processes Events related to Account Opening scenarios.<br/>
/// Class used in <see cref="Step02a_AccountOpening"/>, <see cref="Step02b_AccountOpening"/> samples
/// </summary>
public static class AccountOpeningEvents
{
public static readonly string StartProcess = nameof(StartProcess);
public static readonly string NewCustomerFormWelcomeMessageComplete = nameof(NewCustomerFormWelcomeMessageComplete);
public static readonly string NewCustomerFormCompleted = nameof(NewCustomerFormCompleted);
public static readonly string NewCustomerFormNeedsMoreDetails = nameof(NewCustomerFormNeedsMoreDetails);
public static readonly string CustomerInteractionTranscriptReady = nameof(CustomerInteractionTranscriptReady);
public static readonly string NewAccountVerificationCheckPassed = nameof(NewAccountVerificationCheckPassed);
public static readonly string CreditScoreCheckApproved = nameof(CreditScoreCheckApproved);
public static readonly string CreditScoreCheckRejected = nameof(CreditScoreCheckRejected);
public static readonly string FraudDetectionCheckPassed = nameof(FraudDetectionCheckPassed);
public static readonly string FraudDetectionCheckFailed = nameof(FraudDetectionCheckFailed);
public static readonly string NewAccountDetailsReady = nameof(NewAccountDetailsReady);
public static readonly string NewMarketingRecordInfoReady = nameof(NewMarketingRecordInfoReady);
public static readonly string NewMarketingEntryCreated = nameof(NewMarketingEntryCreated);
public static readonly string CRMRecordInfoReady = nameof(CRMRecordInfoReady);
public static readonly string CRMRecordInfoEntryCreated = nameof(CRMRecordInfoEntryCreated);
public static readonly string WelcomePacketCreated = nameof(WelcomePacketCreated);
public static readonly string MailServiceSent = nameof(MailServiceSent);
}
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft. All rights reserved.
using Microsoft.SemanticKernel;
namespace Step02.Models;
/// <summary>
/// Represents the details of interactions between a user and service, including a unique identifier for the account,
/// a transcript of conversation with the user, and the type of user interaction.<br/>
/// Class used in <see cref="Step02a_AccountOpening"/>, <see cref="Step02b_AccountOpening"/> samples
/// </summary>
public record AccountUserInteractionDetails
{
public Guid AccountId { get; set; }
public List<ChatMessageContent> InteractionTranscript { get; set; } = [];
public UserInteractionType UserInteractionType { get; set; }
}
public enum UserInteractionType
{
Complaint,
AccountInfoRequest,
OpeningNewAccount
}
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft. All rights reserved.
namespace Step02.Models;
/// <summary>
/// Holds details for a new entry in a marketing database, including the account identifier, contact name, phone number, and email address.<br/>
/// Class used in <see cref="Step02a_AccountOpening"/>, <see cref="Step02b_AccountOpening"/> samples
/// </summary>
public record MarketingNewEntryDetails
{
public Guid AccountId { get; set; }
public string Name { get; set; }
public string PhoneNumber { get; set; }
public string Email { get; set; }
}
@@ -0,0 +1,69 @@
// Copyright (c) Microsoft. All rights reserved.
using System.Reflection;
using System.Text.Json.Serialization;
namespace Step02.Models;
/// <summary>
/// Represents the data structure for a form capturing details of a new customer, including personal information and contact details.<br/>
/// Class used in <see cref="Step02a_AccountOpening"/>, <see cref="Step02b_AccountOpening"/> samples
/// </summary>
public class NewCustomerForm
{
[JsonPropertyName("userFirstName")]
public string UserFirstName { get; set; } = string.Empty;
[JsonPropertyName("userLastName")]
public string UserLastName { get; set; } = string.Empty;
[JsonPropertyName("userDateOfBirth")]
public string UserDateOfBirth { get; set; } = string.Empty;
[JsonPropertyName("userState")]
public string UserState { get; set; } = string.Empty;
[JsonPropertyName("userPhoneNumber")]
public string UserPhoneNumber { get; set; } = string.Empty;
[JsonPropertyName("userId")]
public string UserId { get; set; } = string.Empty;
[JsonPropertyName("userEmail")]
public string UserEmail { get; set; } = string.Empty;
public NewCustomerForm CopyWithDefaultValues(string defaultStringValue = "Unanswered")
{
NewCustomerForm copy = new();
PropertyInfo[] properties = typeof(NewCustomerForm).GetProperties();
foreach (PropertyInfo property in properties)
{
// Get the value of the property
string? value = property.GetValue(this) as string;
// Check if the value is an empty string
if (string.IsNullOrEmpty(value))
{
property.SetValue(copy, defaultStringValue);
}
else
{
property.SetValue(copy, value);
}
}
return copy;
}
public bool IsFormCompleted()
{
return !string.IsNullOrEmpty(UserFirstName) &&
!string.IsNullOrEmpty(UserLastName) &&
!string.IsNullOrEmpty(UserId) &&
!string.IsNullOrEmpty(UserDateOfBirth) &&
!string.IsNullOrEmpty(UserState) &&
!string.IsNullOrEmpty(UserEmail) &&
!string.IsNullOrEmpty(UserPhoneNumber);
}
}