Data Retention and Deletion Policy

How long Supplier Stock Sync keeps each kind of data, and how it is deleted. Each item names the code that enforces it.

DataKept forHow it ends
Run details (each change and each problem)90 daysDeleted by the hourly job (SystemRepo.pruneOld).
Run summaries400 daysDeleted by the hourly job once their details are gone.
Suppliers, feeds, feed credentials, mappings, settings, price approvalsWhile the app is installedDeleted with the store's data (below). A supplier deleted in the app takes its feeds, mappings, approvals and SKU records with it at once.
Price checks (catalogue audits)The last 10 per store, and at most 60 daysOlder ones are deleted when a new one finishes, and by the hourly job.
Shopify API usage (daily totals)400 daysDeleted by the hourly job.
Activity log and email log12 monthsDeleted by the hourly job. Neither holds feed credentials or tokens.
Webhook delivery ids (replay protection)30 daysDeleted by the hourly job.
Scheduled-slot records7 daysDeleted by the hourly job.
Rate-limit counters2 daysDeleted by the hourly job. Hold no personal data.
Shopify tokens (encrypted)While installedDeleted the moment the `app/uninstalled` webhook arrives.
Everything for a storeUntil uninstall + Shopify's `shop/redact` (48 h), or 30 days after uninstall at most`shop/redact` deletes immediately; the hourly job deletes any store uninstalled more than 30 days ago that never received one. Reinstalling within that time cancels the deletion.

Backups: Cloudflare D1 Time Travel keeps a 30-day point-in-time history; deleted data leaves it after 30 days.

Legal holds: if we are legally required to keep specific data longer, we keep only that data, only as long as required.