Skip to content

Fix/costing product calculation#59

Merged
ilramdhan merged 3 commits into
mutugading:mainfrom
ilramdhan:fix/costing-product-calculation
Jun 29, 2026
Merged

Fix/costing product calculation#59
ilramdhan merged 3 commits into
mutugading:mainfrom
ilramdhan:fix/costing-product-calculation

Conversation

@ilramdhan

Copy link
Copy Markdown
Member

Description

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🎨 UI/UX improvement
  • ♻️ Refactor
  • 📚 Documentation
  • 🔧 Chore (deps, config)

Module/Component Affected

  • Dashboard
  • Finance
  • HR / IT / CI / EXSIM
  • Components (common/)
  • Components (ui/)
  • Navigation
  • API Routes

Changes Made

Related Issues

Fixes #
Related to #

Screenshots

Before

After

Testing Performed

Manual Testing

  • Desktop (1440px+)
  • Tablet (768px)
  • Mobile (375px)
  • Light mode
  • Dark mode

Browser Testing

  • Chrome
  • Firefox
  • Safari
  • Edge

Build Verification

  • npm run lint passes
  • npx tsc --noEmit passes
  • npm run build succeeds

Accessibility

  • Keyboard navigation works
  • Screen reader compatible
  • Proper ARIA labels
  • Color contrast adequate

Performance

  • No unnecessary re-renders
  • Images optimized
  • Heavy components lazy loaded

Pre-merge Checklist

  • I have read and followed RULES.md
  • I have read and followed CONTRIBUTING.md
  • Loading states implemented (if data fetching)
  • Error handling present
  • Component props typed properly
  • Uses semantic color classes
  • Responsive design tested
  • Dark mode compatible
  • Screenshots included (for UI changes)

Reviewer Notes

ilramdhan and others added 3 commits June 29, 2026 13:57
Both routing and params-only dialogs now automatically retry failed
chunks until no more improvement is possible (max 5/3 passes).

Each retry pass benefits from newly-imported products in DbProductSet:
- Pass 1: ~50% chunks succeed (few products in DB)
- Pass 2: ~80% succeed (dependency chain resolves)
- Pass 3+: converges to ~100% or stops on no improvement

User no longer needs to manually click Retry multiple times.
UI shows 'Pass 2/5 — retrying N failed chunks...' during auto-retry.
Chunks already succeeded are skipped on subsequent passes.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…deps

Phase 1: import product_master + parameters (no cross-product refs)
Phase 2: import routing AFTER all products are in DB (no deadlocks)

Previously, chunk A could fail because it referenced products in chunk B,
while chunk B failed because it referenced products in chunk A. Auto-retry
could not resolve circular dependencies. The two-phase approach eliminates
this entirely:
- Phase 1 has no cross-product routing references → always converges
- Phase 2 runs after Phase 1 completes → all products in DbProductSet

Also adds BULK_PRODUCTS_ONLY_CONFIG and BULK_ROUTING_ONLY_CONFIG to
chunked-importer.ts for use in the two-phase dialog.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Replace the browser-side chunked importer (SheetJS web worker + multi-pass
auto-retry) with the v2 ETL flow: getImportUploadURL -> PUT the file directly
to MinIO (with progress) -> startCostingImport -> poll the job to DONE/PARTIAL
with an error-report link. A single unified bulk-import dialog drives both
datasets via a `kind` prop (product_routing | params_only).

Remove the chunked-importer + worker, the params-only dialog, and the old
bytes/validate BFF routes; add the upload-url + start BFF routes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ilramdhan ilramdhan merged commit f134492 into mutugading:main Jun 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant