[feature] Simpany 薪資申報寫入(準備試算 → 寫入 → 送出記帳士 → 寄薪資單) - #78
Merged
Merged
Conversation
- SimpanyClient 新增薪資寫入方法,走獨立的 assertSalaryWrite(method + 路徑逐條白名單: 申報明細 GET / calculate / PUT、setting、copy、payday、company-owner、settle、payslip/send), 唯讀的 assertSalaryReadOnly 不變;員工建立 / 修改(需身分證)刻意不在白名單 - src/lib/simpany-payroll.ts:prepareSalaryFiling(模板只換日期與金額、Simpany 試算、 缺人時規劃複製且需 allowCopy、存草稿)、applySalaryFiling(條件式搶草稿、負責人 → 發薪日 → PUT、讀回比對實發、失敗列出已寫入者)、settleSalaryFiling(三個確認 + canSettle)、sendPayslips - migrations/0029:simpany_salary_drafts - MCP:simpany_prepare_salary_filing / apply / settle(destructive)/ send_payslips,SERVER_VERSION 1.9.0 - 薪資頁月份格「準備申報」Sheet(zh-TW + en) - docs:integrations.md、mcp.md 寫入端點未實際呼叫驗證(開發期間禁止打 Simpany 寫入)。
✅ SonarQube Quality Gate passed — pathorsAI_internal0 open issues on this PR. |
yui0303
approved these changes
Sep 28, 2026
- simpany-payroll.ts:buildDeclarationPayload、prepareSalaryFiling、applySalaryFiling、 sendPayslips、salaryFilingDefaults 拆出 helper(S3776);optional chain(S6582); staleFormReason / baseSourceOf 取代反向條件與巢狀三元(S7735、S3358);去巢狀樣板字串(S4624) - tools-simpany.ts:prepareAuditLine / prepareNextStep(S4624、S3358) - simpany-salary-filing.tsx:stepAfterLoad、PreviewStep、AppliedStep、FilingActions 拆出(S3776); isPositive / isNonNegative 保留 NaN 語意(S1940);去巢狀三元與樣板字串 buildDeclarationPayload 以 312 組輸入與重構前版本逐字比對一致(含錯誤訊息)。
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.
把在 Simpany 介面上做的每月薪資申報搬進 internal(網頁與 MCP)。
assertSalaryWrite:只允許 declaration GET/PUT、calculate、copy、payday、company-owner、settle、payslip/send、setting;新增/修改員工(需身分證字號)不在範圍內。解析時只保留白名單欄位,身分證字號、地址、國籍不讀入。simpany_prepare_salary_filing、simpany_apply_salary_filing、simpany_settle_salary_filing(destructive)、simpany_send_payslips(server 1.9.0)。simpany_salary_drafts)已先在 prod 分支演練,再套用到 prod。驗證:tsc、lint、build、cf:build 通過;payload builder 以合成資料測過。開發期間沒有呼叫任何 Simpany 寫入端點,第一次實際申報會先給使用者看試算再寫入。