充值申请增加付款凭证与付款时间,管理端可核对后审核
- 打手端充值表单新增付款时间(必填)与付款凭证上传(最多5张) - 后端存储 paidAt 与 proofFiles 归一化数据 - 管理端资金申请列表新增付款凭证缩略图列,审核弹窗展示付款时间与凭证预览
This commit is contained in:
@@ -468,6 +468,8 @@ export async function createWorkerRechargeRequest(
|
||||
}
|
||||
|
||||
const note = String(payload.note || payload.remark || '').trim()
|
||||
const proofFiles = normalizeProofFiles(payload.proofFiles || payload.proofFilesList)
|
||||
const paidAt = String(payload.paidAt || '').trim()
|
||||
const created = await createWorkerFinanceRequest({
|
||||
workerId: worker.id,
|
||||
requestType: 'recharge',
|
||||
@@ -480,6 +482,8 @@ export async function createWorkerRechargeRequest(
|
||||
source: 'worker_profile_recharge',
|
||||
username: worker.username,
|
||||
phone: worker.phone || '',
|
||||
paidAt: paidAt || null,
|
||||
proofFiles,
|
||||
financeConfig: {
|
||||
channelName: financeConfig.recharge.channelName,
|
||||
accountName: financeConfig.recharge.accountName,
|
||||
@@ -2350,6 +2354,30 @@ function normalizeAmountFen(value: unknown, fallback: number): number {
|
||||
return Math.round(parsed * 100)
|
||||
}
|
||||
|
||||
function normalizeProofFiles(value: unknown): Array<Record<string, unknown>> {
|
||||
if (!Array.isArray(value)) return []
|
||||
const files: Array<Record<string, unknown>> = []
|
||||
for (const item of value) {
|
||||
if (!item || typeof item !== 'object') continue
|
||||
const file = item as Record<string, unknown>
|
||||
const url = String(file.url || '').trim()
|
||||
if (!url) continue
|
||||
files.push({
|
||||
url,
|
||||
thumbnailUrl: String(file.thumbnailUrl || file.thumbnail_url || '').trim(),
|
||||
mediumUrl: String(file.mediumUrl || file.medium_url || '').trim(),
|
||||
objectKey: String(file.objectKey || file.object_key || '').trim(),
|
||||
originalFilename: String(
|
||||
file.originalFilename || file.original_filename || file.name || '',
|
||||
).trim(),
|
||||
contentType: String(file.contentType || file.content_type || '').trim(),
|
||||
sizeBytes: Number(file.sizeBytes || file.size_bytes || 0),
|
||||
})
|
||||
if (files.length >= 10) break
|
||||
}
|
||||
return files
|
||||
}
|
||||
|
||||
function isIgnorableWorkerAuthError(error: unknown) {
|
||||
return IGNORABLE_WORKER_AUTH_ERROR_CODES.has(
|
||||
String((error as { errorCode?: string })?.errorCode || '').trim(),
|
||||
|
||||
Reference in New Issue
Block a user