The appraisal store (src/market/appraisal/appraisal.ts) keeps a frontend RegionalMarketCache and defaults the market location to Jita client-side (jitaId in src/market/market.ts). Now that mammon serves per-location prices and owns caching — including defaulting an omitted locationId to Jita server-side — the frontend cache, the client-side default, and the (now stateless) Pinia store are all redundant.
Scope
Drop the cache. Remove RegionalMarketCache from the appraisal price path. Every getPrice/getPrices call goes to mammon; rely on mammon's caching. getPrices stays a thin wrapper that batches type ids by 100 (BATCH_SIZE) over getMammonPrices and flattens the results.
Drop the client-side Jita default. When no location is chosen, pass locationId through as undefined and let mammon default it (Jita). The generated client already makes locationId optional on currentPrices, so no client change is needed.
Collapse the store.useAppraisalStore holds no state after the cache is gone. Replace it with plain exported getPrice/getPrices functions (e.g. in src/market/appraisal/appraisal.ts) and update the three callers.
Delete now-dead code:
src/market/RegionalMarketCache.ts and its spec src/market/RegionalMarketCache.spec.ts.
src/market/market.ts (contains only jitaId).
The corresponding export * from './RegionalMarketCache' and export * from './market' lines in src/market/index.ts.
src/pages/market/CompareAppraisal.vue — store.getPrices passed to compareAppraisal → the exported getPrices function.
Out of scope
No changes to mammon or the pricing endpoint; the server-side Jita default is assumed to already work.
No changes to compare.ts / PricesForLocation (its locationId stays a required number — compare always supplies explicit locations).
No re-introduction of any client-side caching or in-memory dedupe.
Acceptance criteria
No RegionalMarketCache anywhere; the class, its spec, and its index.ts export are removed.
No jitaId / src/market/market.ts; its index.ts export is removed. No hardcoded Jita id remains on the frontend.
useAppraisalStore is gone; getPrice/getPrices are plain functions and the three callers use them directly.
Omitting a location relies on the backend default (undefined locationId reaches currentPrices).
getPrices still batches by 100.
Existing pages (item info, acquisitions, appraisal, compare) still price correctly.
npm run build passes.
Related
Depends on mammon serving per-location prices with a server-side Jita default when locationId is omitted.
## Summary
The appraisal store (`src/market/appraisal/appraisal.ts`) keeps a frontend `RegionalMarketCache` and defaults the market location to Jita **client-side** (`jitaId` in `src/market/market.ts`). Now that mammon serves per-location prices and owns caching — including defaulting an omitted `locationId` to Jita server-side — the frontend cache, the client-side default, and the (now stateless) Pinia store are all redundant.
## Scope
- **Drop the cache.** Remove `RegionalMarketCache` from the appraisal price path. Every `getPrice`/`getPrices` call goes to mammon; rely on mammon's caching. `getPrices` stays a thin wrapper that batches type ids by 100 (`BATCH_SIZE`) over `getMammonPrices` and flattens the results.
- **Drop the client-side Jita default.** When no location is chosen, pass `locationId` through as `undefined` and let mammon default it (Jita). The generated client already makes `locationId` optional on `currentPrices`, so no client change is needed.
- **Collapse the store.** `useAppraisalStore` holds no state after the cache is gone. Replace it with plain exported `getPrice`/`getPrices` functions (e.g. in `src/market/appraisal/appraisal.ts`) and update the three callers.
- **Delete now-dead code:**
- `src/market/RegionalMarketCache.ts` and its spec `src/market/RegionalMarketCache.spec.ts`.
- `src/market/market.ts` (contains only `jitaId`).
- The corresponding `export * from './RegionalMarketCache'` and `export * from './market'` lines in `src/market/index.ts`.
### Affected callers
- `src/pages/market/TypeInfo.vue` — `appraisalStore.getPrice(item)` → `getPrice(item)`.
- `src/market/acquisition/AcquisitionsPanel.vue` — `appraisalStore.getPrices(types)` → `getPrices(types)`.
- `src/pages/market/CompareAppraisal.vue` — `store.getPrices` passed to `compareAppraisal` → the exported `getPrices` function.
## Out of scope
- No changes to mammon or the pricing endpoint; the server-side Jita default is assumed to already work.
- No changes to `compare.ts` / `PricesForLocation` (its `locationId` stays a required `number` — compare always supplies explicit locations).
- No re-introduction of any client-side caching or in-memory dedupe.
## Acceptance criteria
- [x] No `RegionalMarketCache` anywhere; the class, its spec, and its `index.ts` export are removed.
- [x] No `jitaId` / `src/market/market.ts`; its `index.ts` export is removed. No hardcoded Jita id remains on the frontend.
- [x] `useAppraisalStore` is gone; `getPrice`/`getPrices` are plain functions and the three callers use them directly.
- [x] Omitting a location relies on the backend default (undefined `locationId` reaches `currentPrices`).
- [x] `getPrices` still batches by 100.
- [x] Existing pages (item info, acquisitions, appraisal, compare) still price correctly.
- [x] `npm run build` passes.
## Related
- Depends on mammon serving per-location prices with a server-side Jita default when `locationId` is omitted.
Sirttas
changed title from Simplify appraisal: drop the frontend price cache and the client-side Jita default to Simplify appraisal: drop the frontend price cache, the client-side Jita default, and the store2026-07-14 17:59:04 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The appraisal store (
src/market/appraisal/appraisal.ts) keeps a frontendRegionalMarketCacheand defaults the market location to Jita client-side (jitaIdinsrc/market/market.ts). Now that mammon serves per-location prices and owns caching — including defaulting an omittedlocationIdto Jita server-side — the frontend cache, the client-side default, and the (now stateless) Pinia store are all redundant.Scope
RegionalMarketCachefrom the appraisal price path. EverygetPrice/getPricescall goes to mammon; rely on mammon's caching.getPricesstays a thin wrapper that batches type ids by 100 (BATCH_SIZE) overgetMammonPricesand flattens the results.locationIdthrough asundefinedand let mammon default it (Jita). The generated client already makeslocationIdoptional oncurrentPrices, so no client change is needed.useAppraisalStoreholds no state after the cache is gone. Replace it with plain exportedgetPrice/getPricesfunctions (e.g. insrc/market/appraisal/appraisal.ts) and update the three callers.src/market/RegionalMarketCache.tsand its specsrc/market/RegionalMarketCache.spec.ts.src/market/market.ts(contains onlyjitaId).export * from './RegionalMarketCache'andexport * from './market'lines insrc/market/index.ts.Affected callers
src/pages/market/TypeInfo.vue—appraisalStore.getPrice(item)→getPrice(item).src/market/acquisition/AcquisitionsPanel.vue—appraisalStore.getPrices(types)→getPrices(types).src/pages/market/CompareAppraisal.vue—store.getPricespassed tocompareAppraisal→ the exportedgetPricesfunction.Out of scope
compare.ts/PricesForLocation(itslocationIdstays a requirednumber— compare always supplies explicit locations).Acceptance criteria
RegionalMarketCacheanywhere; the class, its spec, and itsindex.tsexport are removed.jitaId/src/market/market.ts; itsindex.tsexport is removed. No hardcoded Jita id remains on the frontend.useAppraisalStoreis gone;getPrice/getPricesare plain functions and the three callers use them directly.locationIdreachescurrentPrices).getPricesstill batches by 100.npm run buildpasses.Related
locationIdis omitted.Simplify appraisal: drop the frontend price cache and the client-side Jita defaultto Simplify appraisal: drop the frontend price cache, the client-side Jita default, and the store