diff --git a/prompts.txt b/prompts.txt index c41c966..6be0233 100644 --- a/prompts.txt +++ b/prompts.txt @@ -173,3 +173,8 @@ When I select Record Movement in the Parts page, can't we prepopulate the moveme ANd shouldn't some of the fields be defaulted to our best guess based on what we know about the part? + +Add login with admin/user where user can not see wholesale or reports +Add p&l reporting + + diff --git a/src/app.html b/src/app.html index c5c07fd..33e08a2 100644 --- a/src/app.html +++ b/src/app.html @@ -4,7 +4,7 @@ - AvtoAmbor + Замена Масла ГП %sveltekit.head% diff --git a/src/lib/components/Header.svelte b/src/lib/components/Header.svelte index b076594..04216e4 100644 --- a/src/lib/components/Header.svelte +++ b/src/lib/components/Header.svelte @@ -7,7 +7,7 @@
- {#if lang === 'tg'}АвтоАмбор{:else}AvtoAmbor{/if} + {$t('app.name')} {$t('app.tagline')} diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index dc935b8..8c95654 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -1,6 +1,6 @@ { "app": { - "name": "AvtoAmbor", + "name": "Zamena Masla GP", "tagline": "Auto parts inventory" }, "nav": { diff --git a/src/lib/i18n/tg.json b/src/lib/i18n/tg.json index e8d9a7b..57e1ffc 100644 --- a/src/lib/i18n/tg.json +++ b/src/lib/i18n/tg.json @@ -1,6 +1,6 @@ { "app": { - "name": "AvtoAmbor", + "name": "Замена Масла GP", "tagline": "Захираи қисмҳои эҳтиётии мошин" }, "nav": { diff --git a/src/lib/server/backup.js b/src/lib/server/backup.js index 91f48d5..b99f27a 100644 --- a/src/lib/server/backup.js +++ b/src/lib/server/backup.js @@ -4,7 +4,9 @@ // mtime has advanced since the previous backup (so an idle shop doesn't // accumulate identical snapshots). // - Backups land in ./backups/ at the repo root, named -// avtoambor-YYYY-MM-DD_HH-MM-SS.db (sortable, human-readable). +// zamena-masla-gp-YYYY-MM-DD_HH-MM-SS.db (sortable, human-readable). +// Legacy avtoambor-*.db backups are still recognized for listing and +// restore so existing snapshots remain accessible until they age out. // - After each new backup, prune older snapshots: keep ALL backups from the // last 7 days; for anything older, keep only the most recent backup of // each calendar day. @@ -19,9 +21,11 @@ import { resolve, dirname, join } from 'node:path'; const DATA_DIR = dirname(DB_FILE); export const BACKUP_DIR = resolve(DATA_DIR, '..', 'backups'); -const PREFIX = 'avtoambor-'; +const PREFIX = 'zamena-masla-gp-'; const EXT = '.db'; -const FILE_RE = /^avtoambor-(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})\.db$/; +// Read path accepts the new prefix and the legacy avtoambor- prefix so +// pre-rename snapshots stay listable and restorable. +const FILE_RE = /^(?:zamena-masla-gp-|avtoambor-)(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})\.db$/; const RETAIN_DAYS = 7; const DAY_MS = 24 * 60 * 60 * 1000; const TICK_MS = 5 * 60 * 1000; @@ -58,7 +62,7 @@ export function safeName(name) { export function listBackups() { ensureDir(); return readdirSync(BACKUP_DIR) - .filter((n) => n.startsWith(PREFIX) && n.endsWith(EXT) && FILE_RE.test(n)) + .filter((n) => n.endsWith(EXT) && FILE_RE.test(n)) .map((name) => { const p = join(BACKUP_DIR, name); const st = statSync(p);