# Napkin Runbook ## Curation Rules - Re-prioritize on every read. - Keep recurring, high-value notes only. - Max 10 items per category. - Each item includes date + "Do instead". ## Execution & Validation (Highest Priority) 1. **[2026-03-20] Use clean-build.sh after VS 2022 updates** Do instead: run `./clean-build.sh` before debugging OAuth or NuGet issues. 2. **[2026-03-20] Google OAuth fails in Edge browser** Do instead: test OAuth in Vivaldi or Chrome; clear browser data for localhost:49178. ## Razor View Editing 1. **[2026-03-20] replace_all corrupts @inject namespace if brand name appears in it** Do instead: run replace_all BEFORE adding @inject, or use namespace-specific strings to avoid replacing C# namespace occurrences. ## Shell & Command Reliability 1. **[2026-03-20] Windows environment — use Unix shell syntax** Do instead: use forward slashes and bash syntax (not PowerShell) in all shell commands. ## Domain Behavior Guardrails 1. **[2026-03-20] PageStatus enum has explicit numeric values** Do instead: always reference by name (e.g., `PageStatus.Creating`), never by magic number. Values: Creating=6, PendingModeration=4, Rejected=5, Active=0, Inactive=3, Expired=1, PendingPayment=2. 2. **[2026-03-20] Preview tokens expire in 4 hours** Do instead: generate fresh tokens via `POST /Admin/GeneratePreviewToken/{id}` before accessing non-Active pages. 3. **[2026-03-20] Non-Active pages require preview token for access** Do instead: always append `?preview={token}` when testing Creating/PendingModeration/Rejected pages. 4. **[2026-03-20] Plans source of truth is appsettings.json ["Plans"] section** Do instead: read plan limits/features from config, not README (README has outdated values). Plans: Trial(free,1p,3l), Basic(R$12.90,3p,8l), Professional(R$25.90,5p,20l,DECOY), Premium(R$29.90,15p,∞l,PDF), PremiumAffiliate(R$34.90,15p,∞l,links produto). Annual variants save 2 months. 5. **[2026-03-20] MaxLinks=-1 means unlimited (Premium and PremiumAffiliate)** Do instead: check `if (maxLinks == -1) return true;` before comparing counts. 6. **[2026-03-20] Subscription model stores plan limits at time of purchase** Do instead: read limits from Subscription entity (MaxLinks, AllowCustomThemes etc.), not from current plan config — they may diverge after plan changes. ## User Directives 1. **[2026-03-20] Project targets Brazilian/Spanish markets** Do instead: use pt-BR or es as default locale in UI text; keep pricing in BRL (R$). 2. **[2026-03-20] appsettings.json contains live credentials committed to git** Do instead: be aware that MongoDB, OAuth, SendGrid secrets are in the repo. Never log or expose them further. Do not add more secrets to appsettings.json.