feat(data-access): add SqlObjects constants and update references
Add centralized SqlObjects class with constants for stored procedure and function names using usp_/fn_ prefixes. Update LotFinderRepository and MisQueryBuilder to use the new naming convention.
This commit is contained in:
@@ -159,7 +159,7 @@ public sealed class MisQueryBuilder
|
|||||||
mm.Status,
|
mm.Status,
|
||||||
mm.ReleaseDate
|
mm.ReleaseDate
|
||||||
FROM MIS_CTE c CROSS APPLY
|
FROM MIS_CTE c CROSS APPLY
|
||||||
dbo.MatchMIS(c.WorkOrderNumber, c.ItemNumber, c.BranchCode, c.RoutingType,
|
dbo.fn_MatchMIS(c.WorkOrderNumber, c.ItemNumber, c.BranchCode, c.RoutingType,
|
||||||
c.IssueDate, c.WorkCenterCode, c.StepNumber, c.EndDT,
|
c.IssueDate, c.WorkCenterCode, c.StepNumber, c.EndDT,
|
||||||
c.FunctionCode, c.FunctionOperationDescription) AS mm;
|
c.FunctionCode, c.FunctionOperationDescription) AS mm;
|
||||||
""";
|
""";
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public partial class LotFinderRepository
|
|||||||
search.SubmitDt = DateTime.UtcNow;
|
search.SubmitDt = DateTime.UtcNow;
|
||||||
|
|
||||||
await using var connection = await _connectionFactory.CreateLotFinderConnectionAsync(ct);
|
await using var connection = await _connectionFactory.CreateLotFinderConnectionAsync(ct);
|
||||||
await using var command = new SqlCommand("SubmitSearch", connection)
|
await using var command = new SqlCommand(SqlObjects.SubmitSearch, connection)
|
||||||
{
|
{
|
||||||
CommandType = CommandType.StoredProcedure,
|
CommandType = CommandType.StoredProcedure,
|
||||||
CommandTimeout = _options.Value.DefaultTimeoutSeconds
|
CommandTimeout = _options.Value.DefaultTimeoutSeconds
|
||||||
@@ -147,7 +147,7 @@ public partial class LotFinderRepository
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogAndThrow(ex, operation, "SubmitSearch");
|
LogAndThrow(ex, operation, SqlObjects.SubmitSearch);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
namespace JdeScoping.DataAccess;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constants for SQL stored procedure and function names.
|
||||||
|
/// </summary>
|
||||||
|
public static class SqlObjects
|
||||||
|
{
|
||||||
|
// Stored Procedures
|
||||||
|
public const string SubmitSearch = "usp_SubmitSearch";
|
||||||
|
public const string StartSearch = "usp_StartSearch";
|
||||||
|
public const string CompleteSearch = "usp_CompleteSearch";
|
||||||
|
public const string ResetPartialSearches = "usp_ResetPartialSearches";
|
||||||
|
public const string ValidateSearchCriteria = "usp_ValidateSearchCriteria";
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
public const string MatchMis = "fn_MatchMIS";
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user