# Technical documentation — superbowl_daily (Superbowl Daily)

Evidence date: 2026-10-02.

Source: `git@bitbucket.org:overdrive/superbowl_daily.git`, `main` at `1ba6c4a` (2026-08-04, author Renier van Rooyen).

Remote: `git@bitbucket.org:overdrive/superbowl_daily.git`. Only branch: `main`.

## Stack

| Item | Value | Evidence |
|---|---|---|
| Language | VB.NET, `Option Strict Off`, `Option Explicit On`, `Option Infer On` | `Superbowl Daily.vbproj` |
| UI | Windows Forms, startup `Superbowl_Daily.My.MyApplication` | vbproj `MyType`, `OutputType` WinExe |
| Framework | .NET Framework 4.8 | `TargetFrameworkVersion`, `app.config` `supportedRuntime` |
| Platform | x86, Prefer32Bit false | vbproj Debug and Release |
| Tooling | Visual Studio 15 solution; project `ToolsVersion` 12.0; `OldToolsVersion` 3.5 | `.sln`, vbproj |
| Data access | `System.Data.SqlClient` via `SqlDataAdapter.Fill` | `sqlDB_*.vb` |
| File import | `System.Data.OleDb`, Jet OLEDB 4.0 | `ConnectTxt`, `ConnectExcel` |
| Mail | `System.Net.Mail` | `MailLog`, `MailBrandon` |
| Tests | None in the tree | no test project, no CI file |

References are the framework assemblies only (`System`, `System.Data`, `System.Deployment`, `System.Drawing`, `System.Windows.Forms`, `System.Xml`, `System.Core`, `System.Xml.Linq`, `System.Data.DataSetExtensions`). No NuGet file and no third-party DLL reference.

## Repository layout

```text
.gitignore
BuildProcessTemplates/          Visual Studio 11 XAML (Azure, default, lab, upgrade)
scripts/alter_mstCustomer_strLiquorLicense.sql
Superbowl Daily/
  Superbowl Daily.sln
  Superbowl Daily.vssscc
  Superbowl Daily/
    Main.vb                     batch and UI logic
    Main.Designer.vb            form layout
    sqlDB_daily.vb              connection and staging SQL
    sqlDB_superbowl.vb          customer insert and unused master SQL
    sqlDB_stockcontrol.vb       product-period SQL used by the batch, plus unused copies
    Duodecimal.vb
    ErrorLogger.vb
    ApplicationEvents.vb
    Settings.vb                 empty MySettings partial
    app.config
    My Project/                 settings, manifest, assembly info
    App_Data/                   rgbc.ico, rgbc_logo.jpg
    bin/ and obj/               committed build outputs, including Imports samples
```

`.gitignore` is the Bitbucket template (Node, Java, Python, logs, executables). It does not ignore `bin/`, `obj/`, `.vs/`, or `*.pfx`. Those paths are committed. The template's `*.exe` rule did not keep executables out of history: `bin\Debug\app.publish\Superbowl Daily.exe` is a project content item.

## Application structure

Namespace `Superbowl_Daily`.

`frmMain` owns the batch. The three SQL classes are not a layered API. Each holds a shared `SqlConnection` chosen at compile time:

```vb
#If DEBUG Then
  SQLConnectionDebug
#Else
  SQLConnectionRelease
#End If
```

`doQueryDS` fills a `DataSet` and does not wrap a transaction. `GetRow` swallows fill errors and then reads `Rows(0)`, which throws if the table is empty. Several `Run()` steps depend on that throw being caught by a nearby `Try`.

`WriteLog` inserts `dlyImportLog` (`dtStamp`, `strFile`, `strAction`, `strLog`, `refStamp`, `blnEmail`). `dtStamp` is written as `Date.Now.Ticks` inside a SQL string. `MailLog` formats the first column with `New Date(dr(0))`. The column type is not defined in this repository, so whether that conversion succeeds is **Unknown / Requires Confirmation**.

## Configuration

User-scoped settings (`My.Settings`):

| Setting | Committed default | File disagreement |
|---|---|---|
| `UNAME` | `Daily Update` | same in `Settings.settings` and `app.config` |
| `Emails` | `pj@overdrive.co.za` | same |
| `SMTPHost` | `tullamore.rgbc.local` | same |
| `blnDebug` | `True` | same |
| `bfbeEmails` | empty | same |
| `SQLConnectionRelease` | integrated security, catalog `Superbowl`, timeout 60 | **Disagreement.** `Settings.settings` data source `Benriach`. `app.config` data source `Hennessy`. |
| `SQLConnectionDebug` | SQL authentication, catalog `Superbowl` | **Disagreement.** `Settings.settings` data source `sqlsrv02`. `app.config` data source `NB-MAANIE2\SQLEXPRESS`. |

Both debug strings contain a SQL user and a plaintext password. Both DEBUG mail methods contain a plaintext mailbox password. Those secrets are not copied into this document. They are in source and should be treated as exposed. Rotation is **Requires Confirmation**.

VB user settings load from the exe `.config` and can be overridden by a per-user `user.config`. Which file a given machine actually uses is **Unknown / Requires Confirmation**.

`app.manifest` requests `asInvoker` and also a `PermissionSet` with `Unrestricted="true"` for ClickOnce (`SameSite="site"`). `TargetZone` is `LocalIntranet`. `SignManifests` is false. `GenerateManifests` is true. A temporary ClickOnce key `Superbowl Daily_TemporaryKey.pfx` is in the project. `UpdateEnabled` is false. Publish URL is `C:\Documents and Settings\Pj\Desktop\rgbc Daily\`. Publisher `Silicon`. Product `Superbowl Daily`.

## Version identifiers

| Source | Value |
|---|---|
| Form caption | `Superbowl Daily Update v1.31` |
| `ApplicationVersion` | `1.31.0.*` |
| `AssemblyVersion` / `AssemblyFileVersion` | `1.4.0.0` |
| Changelog last line | `v1.34 - 20260624` |
| Assembly copyright | `Copyright © Silicon Overdrive 2009` |

The deployment version line in `frmMain_Load` that would set the caption from `My.Application.Deployment.CurrentVersion` is commented out.

## Databases

One catalog name appears: `Superbowl`.

Tables and objects the batch reads or writes (names only; definitions are not in this repository):

- Masters and dimensions: `mstPeriod`, `mstCompany`, `mstCustomer`, `mstBranch`, `mstProduct`, `mstBrand`, `mstExports`, `mstSnellArea`, `mstSnellsupergroup` (the last two only in commented SQL).
- Warehouse and facts: `dwdCustomer`, `dwdProduct`, `dwfSales`, `dwfStock`, `dwfSalba`, `dwfACLisp`, `dwfAdSpend`, `dwfRepCalls`, `dwfOffconSurvey`, `dwfOnconSurvey`, `dwfOffconPromo`, `dwfOnconPromo`, `dwfQFSales`.
- Staging: `stgCognos14`, `stgZMB`, `stgExports`, `stgSalesDataDownload`, `stgSalesData`.
- Stock control: `stkProductPeriod`.
- Maps: `mapACProduct`, `mapACStore`.
- Other: `sysQuery`, `dlyImportLog`, `dlyDataWarehouse`, `fsrRequisition`.

`sysQuery` columns used: `ID`, `strName`, `memQuery`, `intOrder`. IDs referenced: 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 31. Names referenced: `bfbe-Sales_Month_to_Date`, `bfbe-Customer_Master`.

`scripts/alter_mstCustomer_strLiquorLicense.sql` adds `strLiquorLicense VARCHAR(25) NULL` to `mstCustomer` and `dwdCustomer` if missing. It tells the reader to update production `sysQuery` IDs 8 and 31 afterwards. The script is not invoked by the executable.

There are no migrations, no ORM, and no stored-procedure calls by name. Behaviour of the post-steps that execute `memQuery` cannot be verified from this repository.

## File locations

Relative to `AppDomain.CurrentDomain.BaseDirectory`:

| Path | Use |
|---|---|
| `Imports\` | inbound files |
| `Imported\` | archived files, suffix `.yyyyMMddHHmmss` |
| `BFBE\` | `ZA_*_INVW.txt`, `ZA_*_CUST.txt` |
| `Output\` | Sales Charter CSVs before the share copy |
| `Logs\` | `error_yyyyMMdd.log` |

UNC:

| Path | Use |
|---|---|
| `\\Hennessy\Sales\snell\reports\rgbc\` | copy cognos09, cognos14, zmb59-daily, cognos12 |
| `\\Hennessy\Sales\ftp.bmi\AdSpend.xls` | move into `Imports\` |
| `\\Hennessy\Sales\eSalesCharter\` | copy disabled |
| `\\Hennessy\Sales\eSalesCharter\NewFiles\` | SCQ output copy |

Commented predecessors use `\\Benriach\...`.

## Auth and mail

No user table is consulted at runtime. `sqlDB_Superbowl.sql_get_Users` and related methods exist and have no caller in `Main.vb`.

Release `MailLog` and `MailBrandon`: `SmtpClient(My.Settings.SMTPHost)`, from `administrator@rgbc.co.za`, no explicit credentials in that branch (machine or relay default).

DEBUG `MailLog` and `MailBrandon`: `smtp.office365.com` port 587, SSL, explicit network credential. The password is hardcoded. Do not copy it further. This is a secret in Git.

`blnDebug` true also enables `MsgBox` on some mail failures. That flag is independent of the compile-time `DEBUG` symbol.

## Background work

There is no queue, Windows service, or timer. Work runs on the UI thread inside `Run()` and the button handlers. The form can close itself at the end of a release `Run()`.

`ErrorLogger` uses a `SyncLock` and swallows exceptions so logging cannot crash the batch. **Implemented.**

## Build, deploy, and history

Solution configurations: Debug and Release, Any CPU, both mapped to the x86 project settings.

Team Foundation binding in the solution: server `http://tfs01:8080/tfs/vs_projects_2018`, project path `Superbowl Daily`. `SccProjectName` in the vbproj is `SAK`. Whether TFS is still the system of record, now that Git on Bitbucket has the code, is **Unknown / Requires Confirmation**.

`BuildProcessTemplates/*.xaml` are the Visual Studio 11 default templates (Azure continuous deployment, default, lab, upgrade). No build definition, pipeline YAML, or server project file references them.

Committed under `bin\Debug\Imports\`: `cognos14.txt` (about 26,000 lines in the initial commit stat) and `xAdSpend.xls`. These are sample or captured inputs in source control, not a fixture project.

Git commits that change behaviour after the code landing:

| Commit | Date | Change |
|---|---|---|
| `32f0ac4` | 2026-06-30 | Initial code commit, including bin/obj and the temporary PFX |
| `2a4fdbe` | 2026-07-01 | Liquor licence on Cognos 9 insert/update, warehouse select/update SQL, and the alter script |
| `1ba6c4a` | 2026-08-04 | `ErrorLogger`, unhandled-exception hook, `Try` around copy, archive, period seed, BFBE, and `Run` |

## Security notes (evidence, not a review)

- Plaintext SQL password in `Settings.settings` and `app.config`.
- Plaintext SMTP password in the DEBUG branches of `MailLog` and `MailBrandon`.
- ClickOnce temporary key committed.
- SQL built by string concatenation. `CleanString` doubles single quotes only.
- `PermissionSet` unrestricted in the manifest.
- Build outputs and a Cognos extract committed.

No threat model or security document is in the repository.

## Development and testing process

No README, no test project, no scripted build. The practical build is Visual Studio (solution format 15) or MSBuild against `Superbowl Daily.vbproj`, .NET Framework 4.8 targeting pack, x86.

`blnDebug` true is the committed way to open the UI without auto-running. A DEBUG compile also selects the debug SQL string, copies rather than moves imports, leaves the form open, and sends mail through Office 365.

Verification performed for this document was static reading of `main` at `1ba6c4a`. The executable was not run. SQL Server and the Hennessy shares were not contacted.

## Related repository

`silicon_ark/superbowl_daily_2/` documents `git@bitbucket.org:overdrive/superbowl_daily_2.git` (product name Superbowl Daily 2). This repository does not reference it. The relationship is **Unknown / Requires Confirmation**.
