Retrieve the Business Online menu for a user¶
Query the Oracle-backed menu repository for a user's visible menu items and favorites. Trigger: OP-11 (build and attach the Business Online menu) step 3 (session cache miss).
| Field | Value |
|---|---|
| Operation ID | OP-12 |
| Trigger | OP-11 (build and attach the Business Online menu) step 3 (session cache miss) |
| Inputs | mailId, typically DOMAIN\user from User.Identity.Name |
| Outputs | BusinessOnlineMenu with Favorites and Items arrays |
| Primary components | MenuService.GetBusinessOnlineMenu(string mailId) |
| Entry point | src/Web.Mvc/Classes/MenuService.cs |
Steps¶
Enforce.ArgumentNotNullOrEmpty(mailId, "mailId")(BR-01).- When
mailIdcontains a backslash, keep only the portion after it — strips the domain prefix (BR-26). - Build the user filter set
{ mailId.ToUpper(), "UNSECURED" }so every user also receives the shared unsecured menu (BR-27). - Query
menuRepository.Query()(NHibernateIRepository<SAIF.Data.Model.Menu.BusinessOnlineMenuItem>) for rows whoseMenuUseris in that set and whoseIsVisible == "Y", ordered bySortOrder, materialized with.ToList()(BR-28, BR-29). The underlying table and mapping are defined inSAIF.Framework.Data.NHibernate, not in this repository.** - Partition the result: rows with
IsFavorite == "Y"becomeFavorites, rows withIsFavorite == "N"becomeItems. Rows with any otherIsFavoritevalue appear in neither collection (BR-30). - Map each data-model row onto a
BusinessOnlineMenuItemcontract object, convertingPageIdto string.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Session cache miss])
Guard[Guard mailId]
Strip[Strip domain prefix]
Filter[Build user filter set]
Query[Query menu repository]
Partition[Partition Favorites vs Items]
EndOk([Return BusinessOnlineMenu])
Start --> Guard
Guard --> Strip
Strip --> Filter
Filter --> Query
Query --> Partition
Partition --> EndOk
Failure and edge-case behavior¶
- No unexpected failure paths beyond argument-guard exceptions and delegated dependency behavior were identified for this operation.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
src/Web.Mvc/Classes/MenuService.cs