Skip to content

Premium auditor lookup

This operation is a small but important helper: given an AD user ID, vendor number, and test-user indicator, it finds the matching premium auditor row and returns the full clsAuditor object.

Field Value
Operation ID OP-EU-07
Trigger Caller needs the premium auditor associated with a user/vendor combination
Inputs AD user ID, vendor number, test-user flag
Outputs Retrieved clsAuditor object
Primary components mdlAuditor.LoadAuditor
Entry point Business\SAIF.Business.External.Users\mdlAuditor.vb

Steps

  1. Query PA_AUDITOR for the exact AD user and vendor-number combination. The helper binds UserID and VendorNum and executes the first scalar lookup (SQL-041, PA_AUDITOR).
  2. Retry by vendor number only for test users. When the first query returns no auditor ID and the caller marked the account as a test user, the helper executes the vendor-only fallback query defined in the same lookup path (SQL-041, PA_AUDITOR).
  3. Hydrate the full auditor object from the resolved ID. The helper passes the selected auditor ID into clsAuditor.GetAuditorByAuditorID so callers receive the standard auditor business object.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Load auditor request]) --> Exact[Query by AD user ID and vendor]
    Exact --> Found{Auditor found?}
    Found -->|Yes| Load[Load full auditor object]
    Found -->|No| Test{Test user?}
    Test -->|Yes| Fallback[Query by vendor only]
    Test -->|No| Load
    Fallback --> Load
    Load --> Done([Return auditor object])

Failure and edge-case behavior

  • Non-test users do not get the vendor-only fallback path.
  • When neither query finds an auditor ID, the downstream clsAuditor.GetAuditorByAuditorID call determines what empty-object behavior the caller receives.

Sources

  • Business\SAIF.Business.External.Users\mdlAuditor.vb
  • Business\SAIF.Business.External.Users\clsAuditor.vb