feat(TE-22637): per-PDF approval and rejection thresholds on upload - #66
Open
shrinishLT wants to merge 3 commits into
Open
feat(TE-22637): per-PDF approval and rejection thresholds on upload#66shrinishLT wants to merge 3 commits into
shrinishLT wants to merge 3 commits into
Conversation
SmartUIConfig gains withApprovalThreshold, withRejectionThreshold and withPdfThresholds; SmartUIPdf forwards them as the approvalThreshold, rejectionThreshold and thresholds multipart fields of POST /pdf/upload. Sides are boxed so an unset value is omitted (project fallback) while an explicit 0 is sent. Existing signatures are kept as delegating overloads. Verified on dev env pdf-thresholds: per-file over build-level resolution, no-threshold upload unchanged, unknown name and inverted band rejected by the server before any build is created. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QbnKfTzhr64osinPevTmVG
withApprovalThreshold, withRejectionThreshold and PdfThreshold take Number so int, long, float and double literals all work at the call site; the stored value stays a boxed Double so an unset side is still omitted from the request. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VwiEkDHT1WnU2ruSFkxYJa
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VwiEkDHT1WnU2ruSFkxYJa
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.
What
Java SDK half of TE-22637 (per-PDF approval/rejection threshold override at upload). Sibling PRs: smartui-rendering-service#1264 · dotlapse-event-service#2913 · migrations#6188 · smartui-cli#562 · RFC internal-docs#2963.
SmartUIConfiggains three options, forwarded bySmartUIPdf.uploadPDFas the new multipart fields ofPOST /pdf/upload:withApprovalThreshold(Double)approvalThresholdwithRejectionThreshold(Double)rejectionThresholdwithPdfThresholds(Map<String, PdfThreshold>)thresholds(JSON)pdfNamesentry)Resolution is per PDF:
thresholds[name]side → call-level side → project setting. A side leftnullis omitted from the request so the server falls back; an explicit0.0is sent (rejection0= never auto-reject). All validation (0–100,approval <= rejectionwhen rejection > 0, unknown names,use_default_thresholdsprojects) is done server-side before any build exists, and the server message surfaces in the SDK log and the wrapped exception.Existing
postPDFToSmartUI/uploadPDFssignatures are kept as delegating overloads; no behaviour change when no threshold is set.The three setters and
PdfThresholdtakeNumber, sowithApprovalThreshold(5),(5L),(2.5f),(1.25)and(null)all work; the value is stored as a boxedDoubleand serialised the same way. Version bumped to 1.0.25-beta.1 (Maven Central's latest is 1.0.24-beta.1; a new feature takes a fresh-beta.1as before).Verified on dev (
pdf-thresholds, 2026-09-09 16:12 IST)invoice 0/4,contract 3/5,report 1/5NULL/NULL, same as beforethresholdsnames a PDF not uploadedthresholds names pdfs that are not in this upload: nope.pdf, no build createdapprovalThreshold (6) cannot exceed rejectionThreshold (5), no build createdRequires the lsrs/DES side to be deployed; against an older backend the fields are ignored and the project defaults apply.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QbnKfTzhr64osinPevTmVG