@resolveio/server-lib 22.3.228 → 22.3.229
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.
package/package.json
CHANGED
|
@@ -1870,10 +1870,10 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1870
1870
|
' const explicit = process.env.RESOLVEIO_QA_INCLUDE_BILLING_FIXTURES || process.env.RESOLVEIO_SUPPORT_QA_INCLUDE_BILLING_FIXTURES || process.env.RESOLVEIO_RUNNER_QA_INCLUDE_BILLING_FIXTURES || "";',
|
|
1871
1871
|
' if (/^(true|1|yes|on)$/i.test(explicit)) return true;',
|
|
1872
1872
|
' if (/^(false|0|no|off)$/i.test(explicit)) return false;',
|
|
1873
|
+
' if (shouldSeedPartInventorySnapshotContext()) return false;',
|
|
1873
1874
|
' const text = readSeedHintText();',
|
|
1874
1875
|
' const billingSurface = /\\b(invoice|invoicing|billing|billable|tax|taxes|surcharge|checkout|check\\s*out|pick\\s*ticket)\\b/i.test(text);',
|
|
1875
1876
|
' if (billingSurface) return true;',
|
|
1876
|
-
' if (shouldSeedPartInventorySnapshotContext()) return false;',
|
|
1877
1877
|
' return /\\binventory\\b/i.test(text);',
|
|
1878
1878
|
'}',
|
|
1879
1879
|
'',
|
|
@@ -2417,25 +2417,25 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
2417
2417
|
' const hintedQuery = identifierQuery(identifiers);',
|
|
2418
2418
|
' let hintedProductionDeliveries = [];',
|
|
2419
2419
|
' let hintedTruckTreatingDeliveries = [];',
|
|
2420
|
-
' if (hintedQuery) {',
|
|
2420
|
+
' if (includeBillingFixtures && hintedQuery) {',
|
|
2421
2421
|
' hintedProductionDeliveries = await copyByIds(sourceDb, targetDb, "production-deliveries", await selectDashboardReadyProductionDeliveryIds(sourceDb, { $and: [billableDeliveryQuery, hintedQuery] }, 3), summary, 3);',
|
|
2422
2422
|
' hintedTruckTreatingDeliveries = await copyByIds(sourceDb, targetDb, "production-deliveries", await selectTruckTreatDashboardReadyProductionDeliveryIds(sourceDb, { $and: [billableTruckTreatQuery, hintedQuery] }, 3), summary, 3);',
|
|
2423
2423
|
' if (hintedProductionDeliveries.length || hintedTruckTreatingDeliveries.length) summary.notes.push(`Preferred live records matching ticket identifiers: ${identifiers.join(", ")}`);',
|
|
2424
2424
|
' else summary.notes.push(`No billable live records matched ticket identifiers: ${identifiers.join(", ")}`);',
|
|
2425
2425
|
' }',
|
|
2426
2426
|
'',
|
|
2427
|
-
' let fallbackProductionDeliveries = hintedProductionDeliveries.length ? [] : await copyByIds(sourceDb, targetDb, "production-deliveries", await selectDashboardReadyProductionDeliveryIds(sourceDb, billableDeliveryQuery, 3), summary, 3);',
|
|
2428
|
-
' if (!hintedProductionDeliveries.length && !fallbackProductionDeliveries.length) {',
|
|
2427
|
+
' let fallbackProductionDeliveries = includeBillingFixtures && hintedProductionDeliveries.length ? [] : includeBillingFixtures ? await copyByIds(sourceDb, targetDb, "production-deliveries", await selectDashboardReadyProductionDeliveryIds(sourceDb, billableDeliveryQuery, 3), summary, 3) : [];',
|
|
2428
|
+
' if (includeBillingFixtures && !hintedProductionDeliveries.length && !fallbackProductionDeliveries.length) {',
|
|
2429
2429
|
' fallbackProductionDeliveries = await copyByIds(sourceDb, targetDb, "production-deliveries", await selectLocalhostDeliveryFixtureIds(sourceDb, billableDeliveryQuery, 3), summary, 3);',
|
|
2430
2430
|
' if (fallbackProductionDeliveries.length) summary.notes.push("Created localhost-only delivery invoice fixture from live delivery data by normalizing copied BOL status to Delivered in local Mongo.");',
|
|
2431
2431
|
' }',
|
|
2432
|
-
' const fallbackTruckTreatingDeliveries = hintedTruckTreatingDeliveries.length ? [] : await copyByIds(sourceDb, targetDb, "production-deliveries", await selectTruckTreatDashboardReadyProductionDeliveryIds(sourceDb, billableTruckTreatQuery, 3), summary, 3);',
|
|
2432
|
+
' const fallbackTruckTreatingDeliveries = includeBillingFixtures && hintedTruckTreatingDeliveries.length ? [] : includeBillingFixtures ? await copyByIds(sourceDb, targetDb, "production-deliveries", await selectTruckTreatDashboardReadyProductionDeliveryIds(sourceDb, billableTruckTreatQuery, 3), summary, 3) : [];',
|
|
2433
2433
|
' const productionDeliveries = [...hintedProductionDeliveries, ...fallbackProductionDeliveries];',
|
|
2434
2434
|
' const truckTreatingDeliveries = [...hintedTruckTreatingDeliveries, ...fallbackTruckTreatingDeliveries];',
|
|
2435
2435
|
' summary.selected.production_deliveries = productionDeliveries.map((doc) => doc._id);',
|
|
2436
2436
|
' summary.selected.truck_treating_deliveries = truckTreatingDeliveries.map((doc) => doc._id);',
|
|
2437
2437
|
' if (!productionDeliveries.length && !truckTreatingDeliveries.length) {',
|
|
2438
|
-
' summary.notes.push("No live billable delivery or truck-treatment records matched the Billing Dashboard awaiting-invoice filters.");',
|
|
2438
|
+
' summary.notes.push(includeBillingFixtures ? "No live billable delivery or truck-treatment records matched the Billing Dashboard awaiting-invoice filters." : "Skipped billable delivery/truck-treatment discovery because billing fixtures are disabled for this QA scope.");',
|
|
2439
2439
|
' }',
|
|
2440
2440
|
'',
|
|
2441
2441
|
' const sourceDocs = [...qaIdentityUsers, ...truckTreatingBolContextDocs, ...ticketAssetContextDocs, ...productionInterchangeablesContextDocs, ...partInventorySnapshotContextDocs, ...pricingImportWorkbookContextDocs, ...productionDeliveries, ...truckTreatingDeliveries];',
|