فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

fix(A03): reject isolated history-only write transactions

davoodmehraban89 committed Oct 19, 2026 at 18:31 UTC fc40b065922622e6c2b555a6f0b74bebb0776b5e
1 file changed +6
src/core/StorageService.js
+6
@@ -219,6 +219,12 @@ class StorageServiceImpl {
219 if (mode === 'readwrite' && globalThis.FINORA?.License) globalThis.FINORA.License.assertWritable();
220 const db = await this.init();
221 const names = Array.isArray(storeNames) ? storeNames : [storeNames];
222 + // Immutable history must be appended alongside a business operation.
223 + // Read-only access to a history store remains permitted.
224 + if (mode === 'readwrite' && names.length === 1 && APPEND_ONLY_STORES.has(names[0])) {
225 + throw new Error('ثبت سابقه ممیزی یا اصلاح بدون تراکنش تجاری مجاز نیست');
226 + }
227 +
228
229 return new Promise((resolve, reject) => {
230 let tx;