docs: update specs and architecture docs with usp_/fn_ naming convention

This commit is contained in:
Joseph Doherty
2026-01-06 16:07:34 -05:00
parent 2c82ac78e3
commit 896ce59d8e
4 changed files with 45 additions and 45 deletions
+16 -16
View File
@@ -18,7 +18,7 @@ This specification documents stored procedures and functions that implement data
### Requirement: Submit search procedure
The system SHALL provide a SubmitSearch stored procedure that creates new search records in the database.
The system SHALL provide a usp_SubmitSearch stored procedure that creates new search records in the database.
#### Inputs
@@ -39,7 +39,7 @@ The system SHALL provide a SubmitSearch stored procedure that creates new search
#### Scenario: Submit new search
- **WHEN** SubmitSearch is called with valid username, search name, and criteria
- **WHEN** usp_SubmitSearch is called with valid username, search name, and criteria
- **THEN** a new Search record is inserted with Status = 1 (Queued)
- **AND** SubmitDT is set to the current timestamp
- **AND** the new SearchId is returned via the @o_SearchID OUTPUT parameter
@@ -54,7 +54,7 @@ The system SHALL provide a SubmitSearch stored procedure that creates new search
### Requirement: Start search procedure
The system SHALL provide a StartSearch stored procedure that marks a search as being actively processed.
The system SHALL provide a usp_StartSearch stored procedure that marks a search as being actively processed.
#### Inputs
@@ -72,7 +72,7 @@ The system SHALL provide a StartSearch stored procedure that marks a search as b
#### Scenario: Start processing a queued search
- **WHEN** StartSearch is called with a valid SearchID
- **WHEN** usp_StartSearch is called with a valid SearchID
- **THEN** the search Status is updated to 2 (Processing)
- **AND** StartDT is set to the current timestamp
@@ -80,7 +80,7 @@ The system SHALL provide a StartSearch stored procedure that marks a search as b
### Requirement: Complete search procedure
The system SHALL provide a CompleteSearch stored procedure that finalizes a search with results or failure status.
The system SHALL provide a usp_CompleteSearch stored procedure that finalizes a search with results or failure status.
#### Inputs
@@ -101,14 +101,14 @@ The system SHALL provide a CompleteSearch stored procedure that finalizes a sear
#### Scenario: Complete successful search
- **WHEN** CompleteSearch is called with WasSuccessful = 1 and Excel binary data
- **WHEN** usp_CompleteSearch is called with WasSuccessful = 1 and Excel binary data
- **THEN** the search Status is updated to 3 (Complete)
- **AND** the Results column contains the Excel binary
- **AND** EndDT is set to the current timestamp
#### Scenario: Complete failed search
- **WHEN** CompleteSearch is called with WasSuccessful = 0
- **WHEN** usp_CompleteSearch is called with WasSuccessful = 0
- **THEN** the search Status is updated to 4 (Failed)
- **AND** EndDT is set to the current timestamp
@@ -116,7 +116,7 @@ The system SHALL provide a CompleteSearch stored procedure that finalizes a sear
### Requirement: Reset partial searches procedure
The system SHALL provide a ResetPartialSearches stored procedure that recovers searches stuck in a processing state.
The system SHALL provide a usp_ResetPartialSearches stored procedure that recovers searches stuck in a processing state.
#### Inputs
@@ -135,7 +135,7 @@ The system SHALL provide a ResetPartialSearches stored procedure that recovers s
#### Scenario: Service restart recovery
- **WHEN** the worker service starts and calls ResetPartialSearches
- **WHEN** the worker service starts and calls usp_ResetPartialSearches
- **THEN** all searches with StartDT set but EndDT NULL are reset
- **AND** Status is changed back to 1 (Queued)
- **AND** StartDT is cleared to NULL
@@ -143,14 +143,14 @@ The system SHALL provide a ResetPartialSearches stored procedure that recovers s
#### Scenario: No stuck searches
- **WHEN** ResetPartialSearches is called with no searches in partial state
- **WHEN** usp_ResetPartialSearches is called with no searches in partial state
- **THEN** no records are modified
---
### Requirement: MIS matching function
The system SHALL provide a MatchMIS table-valued function that correlates work order operations with Manufacturing Information System (MIS) quality documents.
The system SHALL provide a fn_MatchMIS table-valued function that correlates work order operations with Manufacturing Information System (MIS) quality documents.
#### Inputs
@@ -198,14 +198,14 @@ Returns a table with the following columns:
#### Scenario: Match via work order routing with current MIS
- **WHEN** MatchMIS is called for a work order with routing data
- **WHEN** fn_MatchMIS is called for a work order with routing data
- **AND** a current MIS document exists for the matched sequence
- **THEN** results include RoutingMatch = 1 and full MIS details
- **AND** MasterMatch indicates whether route master also matched
#### Scenario: Match via route master when no routing exists
- **WHEN** MatchMIS is called for a work order without specific routing
- **WHEN** fn_MatchMIS is called for a work order without specific routing
- **AND** a route master entry exists for the item/branch/work center
- **THEN** results include MasterMatch = 1 and RoutingMatch = 0
- **AND** MIS details are included if available
@@ -244,7 +244,7 @@ Returns a table with the following columns:
[New Search]
|
v
SubmitSearch
usp_SubmitSearch
|
v
+-------+
@@ -253,7 +253,7 @@ Returns a table with the following columns:
+---+---+ |
| |
v |
StartSearch ResetPartialSearches
usp_StartSearch usp_ResetPartialSearches
| |
v |
+----------+ |
@@ -262,7 +262,7 @@ Returns a table with the following columns:
+----+-----+
|
v
CompleteSearch
usp_CompleteSearch
|
+---------------+
| |