@dynamatix/cat-shared 0.0.149 → 0.0.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -324,10 +324,9 @@ function applyAuditMiddleware(schema, collectionName) {
|
|
|
324
324
|
const numericString = valueSansSymbol.replace(/,/g, '');
|
|
325
325
|
const numericValue = Number(numericString);
|
|
326
326
|
if (!Number.isFinite(numericValue)) return `£${valueSansSymbol}`;
|
|
327
|
-
const decimalPart = numericString.split('.')[1];
|
|
328
327
|
const formatted = numericValue.toLocaleString('en-GB', {
|
|
329
|
-
minimumFractionDigits:
|
|
330
|
-
maximumFractionDigits:
|
|
328
|
+
minimumFractionDigits: 2,
|
|
329
|
+
maximumFractionDigits: 2
|
|
331
330
|
});
|
|
332
331
|
return `£${formatted}`;
|
|
333
332
|
};
|
|
@@ -426,10 +425,10 @@ function applyAuditMiddleware(schema, collectionName) {
|
|
|
426
425
|
async function updateContextAuditCount(contextId, count) {
|
|
427
426
|
count = Number(count);
|
|
428
427
|
if (!contextId || isNaN(count)) return;
|
|
429
|
-
|
|
428
|
+
|
|
430
429
|
try {
|
|
431
430
|
const model = mongoose.models['Application'];
|
|
432
|
-
|
|
431
|
+
|
|
433
432
|
// Use direct collection access to bypass all Mongoose middleware
|
|
434
433
|
// This prevents workflow triggers from firing for audit count updates
|
|
435
434
|
await model.collection.updateOne(
|