Repository navigation
fix(rolecheck): FX read for SM, import toast, catalog factory filter, HR payroll month (RC-01..04) - #1196
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… main
- RC-01: GET /api/fx-rates read widens to sales_manager (owner ruling
2026-10-29) so the deal page converts SM's foreign-currency prices to THB.
Writes stay CEO-only.
- RC-02: import's S17 completion toast reads its own projection
(GET /api/import/deals/{id}) instead of GET /api/tickets/{id}, which
TicketService#get refuses for import. No ticket access widened.
- RC-03: the /catalog factory filter reads the names-only
GET /api/factory-configs/names (sales + sales_manager can read it) instead
of the ceo/import-only /api/price-import/factories, which stays unwidened.
- RC-04: the HR landing sends the current Bangkok payrollMonth to
GET /api/payroll (400 without it), under its own query key so it never
overwrites PayrollPage's differently-shaped cache entry for that month.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- account can read GET /api/factory-configs/names (owner ruling
2026-10-29): it can open /catalog, whose factory filter reads it.
- Import's RECEIVED toast decides from the rows GET /api/import/deals/{id}
already carries; the duplicate listForTicket fetch is gone.
- PayrollPage opens on the Bangkok month (was UTC), matching the HR landing.
- The HR landing shows "โหลดรอบเงินเดือนไม่สำเร็จ" when the payroll read
fails instead of claiming the period has not started.
- Stale fx-rates comment in PricingRequestDetailPage; catalog test collapsed
to one case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
waritctd
force-pushed
the
claude/vibrant-taussig-9be69b
branch
from
October 29, 2026 05:25
d0e8404 to
d938c14
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the four errors found by the 2026-10-29 role-by-role check of main (self-service lock on). Each one was a request the server refused or rejected, and the page swallowed the error.
GET /api/fx-rateson every deal-page load, so foreign-currency prices didn't convert to THBFxRateController.READ_ROLESaddssales_manager. Writes stay CEO-only.api.tickets.get, whichTicketService#getrefuses for import, so the "รับครบทุกโรงงาน" toast never showedImportFulfilmentPagereadsapi.importDeals.get→deal.fulfillmentStatus(import's own projection; import scope covers ORDER_RECEIVED→end). No ticket access widened.GET /api/price-import/factorieson/catalog, so the factory filter was silently emptyCatalogSearchPagereads the names-onlyGET /api/factory-configs/names(#1194; ceo/import/sales/SM)./price-import/factoriesis not widened, because it carries supplier emails./namesGET /api/payrollon every load (nopayrollMonth)HrOverviewsends the current Bangkok month, under its own query key[...payrollCurrent(m), 'overview']Tests (written first, shown red, then green)
FxRateControllerTest›listIsAllowedForTheRuledReadRoles/listIsForbiddenForEveryRoleOutsideTheRuling: SM allowed. employee/warehouse/qc/hr/account still 403. Write cases unchanged (still CEO-only).CatalogPricingReadAuthzIntegrationTest› newsalesManagerCanReadFxRatesPerOwnerRuling20261029; SM removed from the deny list. Real Postgres.ImportFulfilmentPage.test.jsx› X4 block (5 cases revised).tickets.getis now mocked the way Java answers import (403), where before it was faked as a success. The toast is keyed onimportDeals.get. The negative cases still never claim completion.CatalogSearchPage.test.jsx›fills the factory filter for sales|sales_manager from the names-only endpoint.priceImport.factoriesis mocked as 403, as Java answers sales.HrOverview.test.jsx›asks for the current Bangkok payroll month(2026-10-31T18:00Z →2026-11) andleaves the payroll page cache entry for the same month untouched.Deliberately not covered:
hasRolemirrors, which aren't authoritative.Review
Sonnet implemented, and Opus reviewed twice: the full diff, then the delta after rework.
CatalogPricingReadAuthzIntegrationTest11/11 andPriceImportFactoryMasterDataAuthzIntegrationTest25/25 passed on a throwaway Postgres.Code-review round (commit d938c14)
/code-reviewfound 6 issues; all are fixed on this PR, tests first (each shown red, then a revert check by Opus):GET /api/factory-configs/names(owner ruling 2026-10-29), so its/catalogfilter fills. Pinned byFactoryConfigControllerTest.GET /api/import/deals/{id}already carries. The duplicatelistForTicketfetch is dropped.opens on the current Bangkok month, not the UTC month.โหลดรอบเงินเดือนไม่สำเร็จwhen the payroll read fails, instead of "not started". Pinned bysays the payroll period failed to load….PricingRequestDetailPage.jsxis fixed (no test: comment-only), and the cosmeticit.eachcatalog test is collapsed to one case.🤖 Generated with Claude Code