feat: 完善协议缴费分期、样本编码搜索与鸿蒙附件选择
支持移动端样本编码远程关键字检索、分期起始日刷新与鸿蒙微信附件选取,并同步收款账户选择、角色页与相关设计文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6e2656f999
commit
063727a7d8
45 files changed
+42669
-34713
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { calcStandardFqDueDate } from './protocol-payment-installment'
|
||||
|
||||
describe('calcStandardFqDueDate', () => {
|
||||
it('builds six periods as start, +1 year, then +half year', () => {
|
||||
const start = '20261021'
|
||||
assert.deepEqual(
|
||||
[0, 1, 2, 3, 4, 5].map((i) => calcStandardFqDueDate(start, i)),
|
||||
['20261021', '20271021', '20280421', '20281021', '20290421', '20291021']
|
||||
)
|
||||
})
|
||||
|
||||
it('clamps month-end when adding half a year', () => {
|
||||
assert.equal(calcStandardFqDueDate('20260831', 2), '20280229')
|
||||
assert.equal(calcStandardFqDueDate('20260831', 1), '20270831')
|
||||
})
|
||||
|
||||
it('returns empty for an invalid start date', () => {
|
||||
assert.equal(calcStandardFqDueDate('', 0), '')
|
||||
assert.equal(calcStandardFqDueDate('2026-10-21', -1), '')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user