@zeniai/client-epic-state 5.0.90-betaAR6 → 5.0.90-betaAR7
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.
|
@@ -224,21 +224,46 @@ const getCategoryValueForTransaction = (key, transaction) => {
|
|
|
224
224
|
return undefined;
|
|
225
225
|
}
|
|
226
226
|
case 'payee': {
|
|
227
|
+
/*
|
|
228
|
+
* localData wins over the top-level transaction fields. Two reasons:
|
|
229
|
+
*
|
|
230
|
+
* 1. Matches what the row renders. `TransactionCategorizationListRow`
|
|
231
|
+
* reads `transaction.transactionReviewLocalData.vendor?.name` as
|
|
232
|
+
* its canonical payee source — not `transaction.vendorName`. If
|
|
233
|
+
* the user has manually picked a vendor in the grid (still
|
|
234
|
+
* unsaved), the row updates immediately but the pre-fix filter
|
|
235
|
+
* kept comparing against the stale top-level value, so filtering
|
|
236
|
+
* "Acme" against a row the user just relabeled to "Acme" would
|
|
237
|
+
* silently exclude it.
|
|
238
|
+
*
|
|
239
|
+
* 2. Brings payee in line with the other content-bearing fields.
|
|
240
|
+
* After this change, every field that has a localData mirror
|
|
241
|
+
* (`amount`, `category`, `class`, `payee`) reads localData
|
|
242
|
+
* first. The remaining fields (`payment_account_name`,
|
|
243
|
+
* `payment_account_type`) don't have a localData equivalent
|
|
244
|
+
* yet — when they do, this precedence becomes the universal
|
|
245
|
+
* rule.
|
|
246
|
+
*
|
|
247
|
+
* vendor is checked before customer at each level — TC transactions
|
|
248
|
+
* are overwhelmingly expense-side, so vendor is the common case. A
|
|
249
|
+
* transaction with both a vendor AND a customer locally set is rare
|
|
250
|
+
* and the existing behavior (vendor wins) is preserved.
|
|
251
|
+
*/
|
|
252
|
+
const localData = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
253
|
+
const localVendorName = localData?.vendor?.name;
|
|
254
|
+
if (isNonEmptyString(localVendorName)) {
|
|
255
|
+
return localVendorName;
|
|
256
|
+
}
|
|
257
|
+
const localCustomerName = localData?.customer?.name;
|
|
258
|
+
if (isNonEmptyString(localCustomerName)) {
|
|
259
|
+
return localCustomerName;
|
|
260
|
+
}
|
|
227
261
|
if (isNonEmptyString(transaction.vendorName)) {
|
|
228
262
|
return transaction.vendorName;
|
|
229
263
|
}
|
|
230
264
|
if (isNonEmptyString(transaction.customerName)) {
|
|
231
265
|
return transaction.customerName;
|
|
232
266
|
}
|
|
233
|
-
const localData = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
234
|
-
const vendorName = localData?.vendor?.name;
|
|
235
|
-
if (isNonEmptyString(vendorName)) {
|
|
236
|
-
return vendorName;
|
|
237
|
-
}
|
|
238
|
-
const customerName = localData?.customer?.name;
|
|
239
|
-
if (isNonEmptyString(customerName)) {
|
|
240
|
-
return customerName;
|
|
241
|
-
}
|
|
242
267
|
return undefined;
|
|
243
268
|
}
|
|
244
269
|
case 'payment_account_name': {
|
|
@@ -227,21 +227,46 @@ const getCategoryValueForTransaction = (key, transaction) => {
|
|
|
227
227
|
return undefined;
|
|
228
228
|
}
|
|
229
229
|
case 'payee': {
|
|
230
|
+
/*
|
|
231
|
+
* localData wins over the top-level transaction fields. Two reasons:
|
|
232
|
+
*
|
|
233
|
+
* 1. Matches what the row renders. `TransactionCategorizationListRow`
|
|
234
|
+
* reads `transaction.transactionReviewLocalData.vendor?.name` as
|
|
235
|
+
* its canonical payee source — not `transaction.vendorName`. If
|
|
236
|
+
* the user has manually picked a vendor in the grid (still
|
|
237
|
+
* unsaved), the row updates immediately but the pre-fix filter
|
|
238
|
+
* kept comparing against the stale top-level value, so filtering
|
|
239
|
+
* "Acme" against a row the user just relabeled to "Acme" would
|
|
240
|
+
* silently exclude it.
|
|
241
|
+
*
|
|
242
|
+
* 2. Brings payee in line with the other content-bearing fields.
|
|
243
|
+
* After this change, every field that has a localData mirror
|
|
244
|
+
* (`amount`, `category`, `class`, `payee`) reads localData
|
|
245
|
+
* first. The remaining fields (`payment_account_name`,
|
|
246
|
+
* `payment_account_type`) don't have a localData equivalent
|
|
247
|
+
* yet — when they do, this precedence becomes the universal
|
|
248
|
+
* rule.
|
|
249
|
+
*
|
|
250
|
+
* vendor is checked before customer at each level — TC transactions
|
|
251
|
+
* are overwhelmingly expense-side, so vendor is the common case. A
|
|
252
|
+
* transaction with both a vendor AND a customer locally set is rare
|
|
253
|
+
* and the existing behavior (vendor wins) is preserved.
|
|
254
|
+
*/
|
|
255
|
+
const localData = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
256
|
+
const localVendorName = localData?.vendor?.name;
|
|
257
|
+
if (isNonEmptyString(localVendorName)) {
|
|
258
|
+
return localVendorName;
|
|
259
|
+
}
|
|
260
|
+
const localCustomerName = localData?.customer?.name;
|
|
261
|
+
if (isNonEmptyString(localCustomerName)) {
|
|
262
|
+
return localCustomerName;
|
|
263
|
+
}
|
|
230
264
|
if (isNonEmptyString(transaction.vendorName)) {
|
|
231
265
|
return transaction.vendorName;
|
|
232
266
|
}
|
|
233
267
|
if (isNonEmptyString(transaction.customerName)) {
|
|
234
268
|
return transaction.customerName;
|
|
235
269
|
}
|
|
236
|
-
const localData = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
237
|
-
const vendorName = localData?.vendor?.name;
|
|
238
|
-
if (isNonEmptyString(vendorName)) {
|
|
239
|
-
return vendorName;
|
|
240
|
-
}
|
|
241
|
-
const customerName = localData?.customer?.name;
|
|
242
|
-
if (isNonEmptyString(customerName)) {
|
|
243
|
-
return customerName;
|
|
244
|
-
}
|
|
245
270
|
return undefined;
|
|
246
271
|
}
|
|
247
272
|
case 'payment_account_name': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.90-
|
|
3
|
+
"version": "5.0.90-betaAR7",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|