Add editable article prices with gross input and staffel tiers.

Wire PUT /prices, de-DE formatting, tax/staffel pills, and keep the category list cache in sync after photo/price updates.
This commit is contained in:
seb
2026-08-01 05:44:34 +02:00
parent 09fb1da335
commit 335f808421
9 changed files with 709 additions and 22 deletions

View File

@@ -223,6 +223,15 @@ const categorySlice = createSlice({
state.articlesTotal = state.articles.length;
state.rootArticles = state.rootArticles.filter((row) => row.sku !== sku);
},
/** Keep category tile list in sync with article detail (e.g. after photo upload). */
patchArticleInLists(state, action) {
const { sku, ...fields } = action.payload;
if (sku == null) return;
const patchList = (list) =>
list.map((row) => (row.sku === sku ? { ...row, ...fields } : row));
state.articles = patchList(state.articles);
state.rootArticles = patchList(state.rootArticles);
},
},
extraReducers: (builder) => {
builder
@@ -305,6 +314,7 @@ export const {
navigateBack,
resetCategoryState,
removeArticleBySku,
patchArticleInLists,
} = categorySlice.actions;
export const selectCategoryMap = (state) => state.category.categories;