weaver-work-cli 0.1.45 → 0.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{attachment-content-CE3GMWTS.js → attachment-content-MCXQBD6N.js} +3 -3
- package/dist/chunks/{chunk-VIMCY4DI.js → chunk-4RWS2YYL.js} +2 -2
- package/dist/chunks/{chunk-4EXOIQDI.js → chunk-6AXKWFKG.js} +4 -14
- package/dist/chunks/{chunk-JWWTI63L.js → chunk-6V5ZPKHV.js} +2 -8
- package/dist/chunks/{chunk-3ZMAQQ3W.js → chunk-76H3IKH6.js} +39 -26
- package/dist/chunks/{chunk-LGKWL4OH.js → chunk-AD46OMQK.js} +86 -25
- package/dist/chunks/{chunk-3WBIQLMB.js → chunk-GSZTA43P.js} +2 -2
- package/dist/chunks/{chunk-OAE3AZBQ.js → chunk-IP4CWQCF.js} +6 -6
- package/dist/chunks/{chunk-77YP6I52.js → chunk-IRMIEDXN.js} +1 -1
- package/dist/chunks/{chunk-LRCPNDZA.js → chunk-J2VEB5K3.js} +11 -9
- package/dist/chunks/{chunk-T4MWQAQB.js → chunk-JFAWZX53.js} +128 -9
- package/dist/chunks/{chunk-GR76ZDDX.js → chunk-LIEQJIGM.js} +3 -0
- package/dist/chunks/{chunk-DGMYACGJ.js → chunk-OXHHJWNC.js} +1 -1
- package/dist/chunks/{chunk-LXFVWZLM.js → chunk-PSOMGA3U.js} +3 -3
- package/dist/chunks/{conflict-IYJETSGT.js → conflict-H7EHQXYY.js} +2 -2
- package/dist/chunks/{create-flow-7JLC7UID.js → create-flow-VRVJEOBX.js} +6 -6
- package/dist/chunks/{ehr-MYRDCHZ4.js → ehr-SH2LM3NK.js} +528 -40
- package/dist/chunks/{env-3MBHAWBL.js → env-66FPSJDV.js} +2 -2
- package/dist/chunks/{factory-TZEVU4DU.js → factory-UH2TZBVA.js} +1 -1
- package/dist/chunks/{group-chat-KL3HFKRM.js → group-chat-CAKMMV7K.js} +3 -3
- package/dist/chunks/{invoice-OQP3TMKQ.js → invoice-UEAHSYAE.js} +279 -1
- package/dist/chunks/{lazy-dispatch-UH6HGK2I.js → lazy-dispatch-25XGTXLM.js} +2 -2
- package/dist/chunks/{meeting-C67EHQ4Z.js → meeting-VTBFW4HI.js} +10 -10
- package/dist/chunks/{recruit-stage-AHY5QAMF.js → recruit-stage-CAKZTUA7.js} +917 -85
- package/dist/chunks/{registry-XPWPGHYE.js → registry-JVQBLFQ5.js} +10 -10
- package/dist/chunks/{room-recommend-CNWE5WQK.js → room-recommend-5U55FMXZ.js} +4 -4
- package/dist/chunks/{schedule-YYNYBQIE.js → schedule-IDETODCA.js} +4 -4
- package/dist/cmd/action.js +14 -10
- package/dist/index.js +7 -7
- package/dist/shortcuts/ehr/host.js +2 -2
- package/dist/shortcuts/ehr/index.js +14 -3
- package/dist/shortcuts/ehr/manifest.js +5 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +40 -10
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
- package/dist/shortcuts/ehr/operations/recruit-position.js +10 -8
- package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +137 -18
- package/dist/shortcuts/ehr/operations/recruit.js +180 -8
- package/dist/shortcuts/ehr/operations/registry.js +4 -0
- package/dist/shortcuts/ehr/operations.js +24 -0
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
- package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
- package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
- package/dist/shortcuts/invoice/host.js +3 -0
- package/dist/shortcuts/invoice/manifest.js +61 -0
- package/dist/shortcuts/invoice/operations/registry.js +2 -0
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +233 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +93 -18
- package/dist/shortcuts/meeting/operations/eb/factory.js +5 -8
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +2 -13
- package/dist/shortcuts/meeting/operations/invitation.js +27 -4
- package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +277 -20
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +31 -7
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +106 -16
- package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +273 -6
- package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
- package/dist/shortcuts/recruit-stage/shared.js +60 -6
- package/docs/invoice.md +1 -0
- package/package.json +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +2 -2
- package/skills/weaver-e10-jucailin/SKILL.md +12 -3
- package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
- package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
- package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -93
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
- package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +53 -9
- package/skills/weaver-e10-meeting/SKILL.md +48 -4
- package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +8 -5
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +16 -6
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +20 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +21 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +4 -0
- package/skills/weaver-e10-yepiaotong/SKILL.md +7 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +9 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +68 -6
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +3 -3
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +8 -15
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +6 -5
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +206 -92
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +26 -21
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +35 -0
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
meetingStateDir,
|
|
7
7
|
readCache,
|
|
8
8
|
resolveMeetingEnvMode
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-IRMIEDXN.js";
|
|
10
|
+
import "./chunk-6V5ZPKHV.js";
|
|
11
11
|
import "./chunk-7BDPM5ST.js";
|
|
12
12
|
import "./chunk-UG5G54VL.js";
|
|
13
13
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
ensureMeetingGroupChat,
|
|
7
7
|
meetingEbGroupChatOperations,
|
|
8
8
|
savePendingForm
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-IP4CWQCF.js";
|
|
10
|
+
import "./chunk-IRMIEDXN.js";
|
|
11
|
+
import "./chunk-6V5ZPKHV.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
invoicePartialError,
|
|
9
9
|
invoiceValidationError,
|
|
10
10
|
isInvoiceNetworkError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LIEQJIGM.js";
|
|
12
12
|
import {
|
|
13
13
|
reportPlatformError
|
|
14
14
|
} from "./chunk-6N4JPNFL.js";
|
|
@@ -1311,6 +1311,67 @@ var invoiceOperations = [
|
|
|
1311
1311
|
},
|
|
1312
1312
|
outputSchema: reimCandidatesOutputSchema
|
|
1313
1313
|
},
|
|
1314
|
+
{
|
|
1315
|
+
name: "invoice.reim.subsidy.submit",
|
|
1316
|
+
risk: "high-risk-write",
|
|
1317
|
+
fixed: {
|
|
1318
|
+
path: "/api/secondev/fna/expense/reimbursement/aiCreateWf",
|
|
1319
|
+
autoCommit: "1",
|
|
1320
|
+
currentEmpId: "session.userId",
|
|
1321
|
+
detailList: "invoices \u6BCF\u5F20\u4E00\u884C {relatedProcessId, relatedInvoiceId, reimbursedAmount}\uFF0CrelatedProcessId \u5168\u90E8\u76F8\u540C\uFF1BreimbursedAmount \u53D6\u8BE5\u53D1\u7968 total\uFF0C\u5408\u8BA1\u4E0D\u8D85\u8FC7 monthlyAllowance\uFF0C\u8D85\u989D\u90A3\u884C\u62A5\u300C\u989D\u5EA6 \u2212 \u524D\u9762\u884C\u7D2F\u52A0\u300D\uFF0C\u989D\u5EA6\u7528\u5B8C\u540E\u5269\u4E0B\u7684\u53D1\u7968\u4E0D\u8FDB\u660E\u7EC6"
|
|
1322
|
+
},
|
|
1323
|
+
inputSchema: {
|
|
1324
|
+
type: "object",
|
|
1325
|
+
additionalProperties: false,
|
|
1326
|
+
required: ["processTitle", "reason", "relatedProcessId", "invoices"],
|
|
1327
|
+
properties: {
|
|
1328
|
+
processTitle: { type: "string", minLength: 1, description: "\u62A5\u9500\u6D41\u7A0B\u6807\u9898\uFF0C\u5982\u300C\u9F9A\u4E3A\u660E10\u6708\u8BDD\u8D39\u62A5\u9500\u300D" },
|
|
1329
|
+
reason: { type: "string", minLength: 1, description: "\u62A5\u9500\u4E8B\u7531\uFF0C\u5982\u300C10\u6708\u8BDD\u8D39\u300D" },
|
|
1330
|
+
relatedProcessId: { ...positiveId, description: "\u8BDD\u8D39 / \u6CB9\u8D39\u4E8B\u524D\u7533\u8BF7\u7684 requestId" },
|
|
1331
|
+
invoices: {
|
|
1332
|
+
type: "array",
|
|
1333
|
+
minItems: 1,
|
|
1334
|
+
maxItems: 100,
|
|
1335
|
+
description: "\u672C\u6B21\u62A5\u9500\u7684\u53D1\u7968\uFF0C\u6BCF\u5F20\u751F\u6210\u4E00\u884C\u660E\u7EC6\uFF1B\u987A\u5E8F\u5373\u989D\u5EA6\u6263\u51CF\u987A\u5E8F",
|
|
1336
|
+
items: {
|
|
1337
|
+
type: "object",
|
|
1338
|
+
additionalProperties: false,
|
|
1339
|
+
required: ["fid", "total"],
|
|
1340
|
+
properties: {
|
|
1341
|
+
fid: { ...positiveId, description: "\u7968\u5939\u53D1\u7968 fid" },
|
|
1342
|
+
total: { type: "string", pattern: "^\\d+(\\.\\d{1,2})?$", description: "\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1\uFF08invoice.list \u7684 total\uFF09" }
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
monthlyAllowance: { type: "string", pattern: "^\\d+(\\.\\d{1,2})?$", description: "\u4E8B\u524D\u7533\u8BF7\u7684\u300C\u6708\u8865\u8D34\u989D\u5EA6\u300D\uFF1B\u4E0D\u4F20\u8868\u793A\u4E0D\u5C01\u9876" },
|
|
1347
|
+
customerId: { ...positiveId, default: "100504500000311504", description: "\u76F8\u5173\u5BA2\u6237 ID\uFF1B\u4E0D\u4F20\u9ED8\u8BA4\u6CDB\u5FAE\u4E0A\u6D77 100504500000311504" },
|
|
1348
|
+
projectId: { type: "string", pattern: "^([1-9]\\d*)?$", default: "", description: "\u76F8\u5173\u9879\u76EE ID\uFF1B\u6CA1\u6709\u6307\u5B9A\u65F6\u4E0D\u4F20\u6216\u4F20\u7A7A\u5B57\u7B26\u4E32" }
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
outputSchema: objectSchema({
|
|
1352
|
+
requestId: { type: "string", description: "\u521B\u5EFA\u5E76\u63D0\u4EA4\u6210\u529F\u7684\u62A5\u9500\u6D41\u7A0B requestId" },
|
|
1353
|
+
url: { type: "string", description: "\u62A5\u9500\u6D41\u7A0B\u8BE6\u60C5\u9875\uFF1A{baseUrl}/sp/workflow/flowpage/view/{requestId}" },
|
|
1354
|
+
processTitle: { type: "string" },
|
|
1355
|
+
invoiceCount: { type: "integer", description: "\u5B9E\u9645\u8FDB\u5165\u660E\u7EC6\u7684\u53D1\u7968\u5F20\u6570" },
|
|
1356
|
+
reimbursedAmount: { type: "string", description: "\u5404\u884C reimbursedAmount \u4E4B\u548C" },
|
|
1357
|
+
invoiceTotal: { type: "string", description: "\u4F20\u5165\u7684\u5168\u90E8\u53D1\u7968 total \u4E4B\u548C\uFF08\u542B\u6CA1\u8FDB\u660E\u7EC6\u7684\uFF09" },
|
|
1358
|
+
monthlyAllowance: { type: ["string", "null"] },
|
|
1359
|
+
capped: { type: "boolean", description: "\u662F\u5426\u6309\u6708\u8865\u8D34\u989D\u5EA6\u5C01\u9876" },
|
|
1360
|
+
details: arrayOf(objectSchema({
|
|
1361
|
+
relatedInvoiceId: { type: "string" },
|
|
1362
|
+
invoiceTotal: { type: "string" },
|
|
1363
|
+
reimbursedAmount: { type: "string" }
|
|
1364
|
+
}, ["relatedInvoiceId", "invoiceTotal", "reimbursedAmount"])),
|
|
1365
|
+
skippedInvoices: arrayOf(objectSchema({
|
|
1366
|
+
relatedInvoiceId: { type: "string" },
|
|
1367
|
+
invoiceTotal: { type: "string" }
|
|
1368
|
+
}, ["relatedInvoiceId", "invoiceTotal"]), { description: "\u989D\u5EA6\u7528\u5B8C\u540E\u6CA1\u8FDB\u660E\u7EC6\u3001\u7559\u5728\u7968\u5939\u7684\u53D1\u7968" }),
|
|
1369
|
+
debugTrace: { type: "array", description: "\u6392\u67E5\u7528\uFF1A\u5165\u53C2\u3001\u6BCF\u884C\u91D1\u989D\u5206\u644A\u3001\u8BF7\u6C42\u4F53\u3001\u63A5\u53E3\u8FD4\u56DE" },
|
|
1370
|
+
finalMarkdown: { type: "string", description: "[processTitle](url)\uFF0C\u76F4\u63A5\u5C55\u793A\u7ED9\u7528\u6237" },
|
|
1371
|
+
result: rawObject,
|
|
1372
|
+
workflow: workflowSchema
|
|
1373
|
+
}, ["requestId", "url", "processTitle", "invoiceCount", "reimbursedAmount", "invoiceTotal", "monthlyAllowance", "capped", "details", "skippedInvoices", "finalMarkdown", "result", "workflow"])
|
|
1374
|
+
},
|
|
1314
1375
|
{
|
|
1315
1376
|
name: "invoice.issuing.contracts.list",
|
|
1316
1377
|
risk: "read",
|
|
@@ -3498,6 +3559,222 @@ var InvoiceReimCandidatesListOperation = class {
|
|
|
3498
3559
|
}
|
|
3499
3560
|
};
|
|
3500
3561
|
|
|
3562
|
+
// src/shortcuts/invoice/operations/reim-subsidy.ts
|
|
3563
|
+
var SUBSIDY_SUBMIT_PATH = "/api/secondev/fna/expense/reimbursement/aiCreateWf";
|
|
3564
|
+
var DEFAULT_CUSTOMER_ID = "100504500000311504";
|
|
3565
|
+
function longId(id) {
|
|
3566
|
+
const rawJSON = JSON.rawJSON;
|
|
3567
|
+
return typeof rawJSON === "function" ? rawJSON(id) : id;
|
|
3568
|
+
}
|
|
3569
|
+
function optionalId(value, name) {
|
|
3570
|
+
return value === void 0 || value === null || value === "" ? "" : asPositiveString(value, name);
|
|
3571
|
+
}
|
|
3572
|
+
function amountCents2(value, name) {
|
|
3573
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
3574
|
+
const text3 = typeof value === "number" ? String(value) : value;
|
|
3575
|
+
const match = typeof text3 === "string" ? /^(\d+)(?:\.(\d{1,2}))?$/u.exec(text3.trim()) : null;
|
|
3576
|
+
const cents2 = match ? Number(match[1]) * 100 + Number((match[2] ?? "").padEnd(2, "0")) : NaN;
|
|
3577
|
+
if (!Number.isSafeInteger(cents2) || cents2 <= 0) {
|
|
3578
|
+
throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F\u5927\u4E8E 0\u3001\u6700\u591A\u4E24\u4F4D\u5C0F\u6570\u7684\u91D1\u989D`);
|
|
3579
|
+
}
|
|
3580
|
+
return cents2;
|
|
3581
|
+
}
|
|
3582
|
+
function formatCents2(cents2) {
|
|
3583
|
+
return cents2 % 100 === 0 ? String(cents2 / 100) : (cents2 / 100).toFixed(2);
|
|
3584
|
+
}
|
|
3585
|
+
function normalizeInvoices(value) {
|
|
3586
|
+
if (!Array.isArray(value) || value.length === 0) throw invoiceValidationError("input_invalid", "invoices \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4");
|
|
3587
|
+
if (value.length > 100) throw invoiceValidationError("input_invalid", "invoices \u5355\u6B21\u6700\u591A\u652F\u6301 100 \u5F20");
|
|
3588
|
+
const invoices = value.map((item, index) => {
|
|
3589
|
+
if (!item || typeof item !== "object") throw invoiceValidationError("input_invalid", `invoices[${index}] \u5FC5\u987B\u662F {fid,total}`);
|
|
3590
|
+
const fid = asPositiveString(String(item.fid ?? ""), `invoices[${index}].fid`);
|
|
3591
|
+
const cents2 = amountCents2(item.total, `invoices[${index}].total`);
|
|
3592
|
+
if (cents2 === null) throw invoiceValidationError("input_invalid", `invoices[${index}].total \u5FC5\u586B\uFF1A\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1`);
|
|
3593
|
+
return { fid, cents: cents2 };
|
|
3594
|
+
});
|
|
3595
|
+
if (new Set(invoices.map((item) => item.fid)).size !== invoices.length) {
|
|
3596
|
+
throw invoiceValidationError("input_invalid", "invoices \u4E0D\u80FD\u5305\u542B\u91CD\u590D fid");
|
|
3597
|
+
}
|
|
3598
|
+
return invoices;
|
|
3599
|
+
}
|
|
3600
|
+
function formatRemaining(cents2) {
|
|
3601
|
+
return Number.isFinite(cents2) ? formatCents2(cents2) : "\u4E0D\u5C01\u9876";
|
|
3602
|
+
}
|
|
3603
|
+
function workflowViewUrl(baseUrl, requestId) {
|
|
3604
|
+
return `${baseUrl.replace(/\/+$/, "")}/sp/workflow/flowpage/view/${requestId}`;
|
|
3605
|
+
}
|
|
3606
|
+
var InvoiceReimSubsidySubmitOperation = class {
|
|
3607
|
+
name = "invoice.reim.subsidy.submit";
|
|
3608
|
+
async execute(input, { host }) {
|
|
3609
|
+
const debugTrace = [];
|
|
3610
|
+
const debug = (step, detail) => {
|
|
3611
|
+
debugTrace.push({ step, detail });
|
|
3612
|
+
const message = `[${this.name}] ${step} ${typeof detail === "string" ? detail : JSON.stringify(detail)}`;
|
|
3613
|
+
host.debug?.(message);
|
|
3614
|
+
if (!process.env.NODE_TEST_CONTEXT) console.error(message);
|
|
3615
|
+
};
|
|
3616
|
+
debugger;
|
|
3617
|
+
const processTitle = asNonEmptyString(input.processTitle, "processTitle");
|
|
3618
|
+
const reason = asNonEmptyString(input.reason, "reason");
|
|
3619
|
+
const relatedProcessId = asPositiveString(input.relatedProcessId, "relatedProcessId");
|
|
3620
|
+
const invoices = normalizeInvoices(input.invoices);
|
|
3621
|
+
const customerId = optionalId(input.customerId, "customerId") || DEFAULT_CUSTOMER_ID;
|
|
3622
|
+
const projectId = optionalId(input.projectId, "projectId");
|
|
3623
|
+
const allowanceCents = amountCents2(input.monthlyAllowance, "monthlyAllowance");
|
|
3624
|
+
debug("1/5 \u5165\u53C2", {
|
|
3625
|
+
processTitle,
|
|
3626
|
+
reason,
|
|
3627
|
+
relatedProcessId,
|
|
3628
|
+
invoices: invoices.map((item) => ({ fid: item.fid, total: formatCents2(item.cents) })),
|
|
3629
|
+
monthlyAllowance: allowanceCents === null ? null : formatCents2(allowanceCents),
|
|
3630
|
+
customerId,
|
|
3631
|
+
projectId
|
|
3632
|
+
});
|
|
3633
|
+
let remainingCents = allowanceCents ?? Number.POSITIVE_INFINITY;
|
|
3634
|
+
const details = [];
|
|
3635
|
+
const skipped = [];
|
|
3636
|
+
for (const item of invoices) {
|
|
3637
|
+
if (remainingCents <= 0) {
|
|
3638
|
+
skipped.push(item);
|
|
3639
|
+
debug("2/5 \u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u4E0D\u8FDB\u660E\u7EC6", { fid: item.fid, total: formatCents2(item.cents) });
|
|
3640
|
+
continue;
|
|
3641
|
+
}
|
|
3642
|
+
const remainingBefore = remainingCents;
|
|
3643
|
+
const reimbursedCents = Math.min(item.cents, remainingCents);
|
|
3644
|
+
remainingCents -= reimbursedCents;
|
|
3645
|
+
details.push({ ...item, reimbursedCents });
|
|
3646
|
+
debug("2/5 \u660E\u7EC6\u884C", {
|
|
3647
|
+
fid: item.fid,
|
|
3648
|
+
total: formatCents2(item.cents),
|
|
3649
|
+
remainingBefore: formatRemaining(remainingBefore),
|
|
3650
|
+
reimbursedAmount: formatCents2(reimbursedCents),
|
|
3651
|
+
remainingAfter: formatRemaining(remainingCents)
|
|
3652
|
+
});
|
|
3653
|
+
}
|
|
3654
|
+
const relatedInvoiceIds = details.map((item) => item.fid);
|
|
3655
|
+
const invoiceTotalCents = invoices.reduce((sum, item) => sum + item.cents, 0);
|
|
3656
|
+
const reimbursedTotalCents = details.reduce((sum, item) => sum + item.reimbursedCents, 0);
|
|
3657
|
+
const capped = reimbursedTotalCents < invoiceTotalCents;
|
|
3658
|
+
debug("2/5 \u91D1\u989D\u6C47\u603B", {
|
|
3659
|
+
invoiceTotal: formatCents2(invoiceTotalCents),
|
|
3660
|
+
reimbursedAmount: formatCents2(reimbursedTotalCents),
|
|
3661
|
+
capped,
|
|
3662
|
+
detailCount: details.length,
|
|
3663
|
+
skippedCount: skipped.length,
|
|
3664
|
+
details: details.map((item) => ({
|
|
3665
|
+
fid: item.fid,
|
|
3666
|
+
total: formatCents2(item.cents),
|
|
3667
|
+
reimbursedAmount: formatCents2(item.reimbursedCents)
|
|
3668
|
+
})),
|
|
3669
|
+
skipped: skipped.map((item) => ({ fid: item.fid, total: formatCents2(item.cents) }))
|
|
3670
|
+
});
|
|
3671
|
+
debugger;
|
|
3672
|
+
const session = await host.getSession();
|
|
3673
|
+
const currentEmpId = asPositiveString(session.userId, "\u5F53\u524D\u4EBA\u5458 ID");
|
|
3674
|
+
const body = {
|
|
3675
|
+
autoCommit: "1",
|
|
3676
|
+
projectId: projectId ? longId(projectId) : "",
|
|
3677
|
+
customerId: longId(customerId),
|
|
3678
|
+
currentEmpId: longId(currentEmpId),
|
|
3679
|
+
processTitle,
|
|
3680
|
+
reason,
|
|
3681
|
+
detailList: details.map((item) => ({
|
|
3682
|
+
relatedProcessId: longId(relatedProcessId),
|
|
3683
|
+
relatedInvoiceId: longId(item.fid),
|
|
3684
|
+
reimbursedAmount: formatCents2(item.reimbursedCents)
|
|
3685
|
+
}))
|
|
3686
|
+
};
|
|
3687
|
+
debug("3/5 \u8BF7\u6C42\u4F53", {
|
|
3688
|
+
path: SUBSIDY_SUBMIT_PATH,
|
|
3689
|
+
autoCommit: body.autoCommit,
|
|
3690
|
+
processTitle: body.processTitle,
|
|
3691
|
+
reason: body.reason,
|
|
3692
|
+
currentEmpId,
|
|
3693
|
+
customerId,
|
|
3694
|
+
projectId,
|
|
3695
|
+
detailList: details.map((item) => ({
|
|
3696
|
+
relatedProcessId,
|
|
3697
|
+
relatedInvoiceId: item.fid,
|
|
3698
|
+
reimbursedAmount: formatCents2(item.reimbursedCents)
|
|
3699
|
+
}))
|
|
3700
|
+
});
|
|
3701
|
+
debugger;
|
|
3702
|
+
let result;
|
|
3703
|
+
try {
|
|
3704
|
+
result = await host.invoiceRequest({
|
|
3705
|
+
path: SUBSIDY_SUBMIT_PATH,
|
|
3706
|
+
method: "POST",
|
|
3707
|
+
body,
|
|
3708
|
+
operation: this.name,
|
|
3709
|
+
timeoutMs: 9e4
|
|
3710
|
+
});
|
|
3711
|
+
debug("4/5 \u63A5\u53E3\u8FD4\u56DE", result);
|
|
3712
|
+
debugger;
|
|
3713
|
+
} catch (error) {
|
|
3714
|
+
const failure = error;
|
|
3715
|
+
debug("4/5 \u8BF7\u6C42\u5F02\u5E38", { type: failure?.type, subtype: failure?.subtype, code: failure?.code, message: failure?.message });
|
|
3716
|
+
debugger;
|
|
3717
|
+
if (isInvoiceNetworkError(error)) {
|
|
3718
|
+
throw invoicePartialError("\u62A5\u9500\u63D0\u4EA4\u8BF7\u6C42\u53D1\u51FA\u540E\u8FDE\u63A5\u4E2D\u65AD\uFF0C\u7ED3\u679C\u4E0D\u786E\u5B9A\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5", {
|
|
3719
|
+
processTitle,
|
|
3720
|
+
relatedProcessId,
|
|
3721
|
+
relatedInvoiceIds,
|
|
3722
|
+
debugTrace,
|
|
3723
|
+
workflow: workflow(this.name, "EXECUTING")
|
|
3724
|
+
}, { stage: "submit" });
|
|
3725
|
+
}
|
|
3726
|
+
throw error;
|
|
3727
|
+
}
|
|
3728
|
+
const data = result?.data && typeof result.data === "object" ? result.data : {};
|
|
3729
|
+
const dataCode = data.code;
|
|
3730
|
+
if (result?.status === false || result?.fail === true || dataCode !== void 0 && Number(dataCode) !== 0) {
|
|
3731
|
+
debug("4/5 \u4E1A\u52A1\u5931\u8D25", { dataCode, msg: data.msg || result?.msg });
|
|
3732
|
+
throw new InvoiceCliError("api", "reim_subsidy_submit_failed", data.msg || result?.msg || "\u8BDD\u8D39 / \u6CB9\u8D39\u62A5\u9500\u63D0\u4EA4\u5931\u8D25", {
|
|
3733
|
+
code: dataCode ?? result?.code,
|
|
3734
|
+
details: { result, debugTrace },
|
|
3735
|
+
exitCode: 1
|
|
3736
|
+
});
|
|
3737
|
+
}
|
|
3738
|
+
const requestId = String(data.requestId ?? "").trim();
|
|
3739
|
+
if (!/^\d+$/u.test(requestId)) {
|
|
3740
|
+
throw invoicePartialError("\u62A5\u9500\u63D0\u4EA4\u63A5\u53E3\u8FD4\u56DE\u6210\u529F\u4F46\u6CA1\u6709\u6D41\u7A0B ID\uFF0C\u7ED3\u679C\u4E0D\u786E\u5B9A\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5", {
|
|
3741
|
+
processTitle,
|
|
3742
|
+
result,
|
|
3743
|
+
debugTrace,
|
|
3744
|
+
workflow: workflow(this.name, "VERIFYING")
|
|
3745
|
+
}, { stage: "submit-response" });
|
|
3746
|
+
}
|
|
3747
|
+
const url = workflowViewUrl(session.baseUrl, requestId);
|
|
3748
|
+
debug("5/5 \u5B8C\u6210", { requestId, url });
|
|
3749
|
+
return {
|
|
3750
|
+
status: "COMPLETE",
|
|
3751
|
+
data: {
|
|
3752
|
+
requestId,
|
|
3753
|
+
url,
|
|
3754
|
+
processTitle,
|
|
3755
|
+
invoiceCount: relatedInvoiceIds.length,
|
|
3756
|
+
reimbursedAmount: formatCents2(reimbursedTotalCents),
|
|
3757
|
+
invoiceTotal: formatCents2(invoiceTotalCents),
|
|
3758
|
+
monthlyAllowance: allowanceCents === null ? null : formatCents2(allowanceCents),
|
|
3759
|
+
capped,
|
|
3760
|
+
details: details.map((item) => ({
|
|
3761
|
+
relatedInvoiceId: item.fid,
|
|
3762
|
+
invoiceTotal: formatCents2(item.cents),
|
|
3763
|
+
reimbursedAmount: formatCents2(item.reimbursedCents)
|
|
3764
|
+
})),
|
|
3765
|
+
skippedInvoices: skipped.map((item) => ({
|
|
3766
|
+
relatedInvoiceId: item.fid,
|
|
3767
|
+
invoiceTotal: formatCents2(item.cents)
|
|
3768
|
+
})),
|
|
3769
|
+
debugTrace,
|
|
3770
|
+
finalMarkdown: `[${processTitle}](${url})`,
|
|
3771
|
+
result,
|
|
3772
|
+
workflow: workflow(this.name, "COMPLETE")
|
|
3773
|
+
}
|
|
3774
|
+
};
|
|
3775
|
+
}
|
|
3776
|
+
};
|
|
3777
|
+
|
|
3501
3778
|
// src/shortcuts/invoice/operations/update.ts
|
|
3502
3779
|
var InvoiceUpdatePrepareOperation = class {
|
|
3503
3780
|
name = "invoice.update.prepare";
|
|
@@ -3757,6 +4034,7 @@ function buildRegistry() {
|
|
|
3757
4034
|
new InvoiceReimCandidatesListOperation(),
|
|
3758
4035
|
new InvoiceReimEmployeeSuperiorsOperation(),
|
|
3759
4036
|
new InvoiceReimFieldSearchOperation(),
|
|
4037
|
+
new InvoiceReimSubsidySubmitOperation(),
|
|
3760
4038
|
new InvoiceIssuingContractsListOperation(),
|
|
3761
4039
|
new InvoiceIssuingContractDetailOperation()
|
|
3762
4040
|
];
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
createProgram,
|
|
6
6
|
registerCommands,
|
|
7
7
|
toCommandMetadata
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-J2VEB5K3.js";
|
|
9
9
|
import "./chunk-727FH2NI.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-LIEQJIGM.js";
|
|
11
11
|
import "./chunk-AJ62BGAW.js";
|
|
12
12
|
import "./chunk-6N4JPNFL.js";
|
|
13
13
|
import "./chunk-6NXT4ICB.js";
|
|
@@ -3,19 +3,19 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
meetingOperationDefinitions
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-76H3IKH6.js";
|
|
7
|
+
import "./chunk-IP4CWQCF.js";
|
|
8
|
+
import "./chunk-AD46OMQK.js";
|
|
9
|
+
import "./chunk-6AXKWFKG.js";
|
|
10
|
+
import "./chunk-4RWS2YYL.js";
|
|
11
|
+
import "./chunk-OXHHJWNC.js";
|
|
12
|
+
import "./chunk-PSOMGA3U.js";
|
|
13
|
+
import "./chunk-GSZTA43P.js";
|
|
14
14
|
import {
|
|
15
15
|
degradeMeetingEnvToStandard,
|
|
16
16
|
meetingStateDir,
|
|
17
17
|
readCache
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IRMIEDXN.js";
|
|
19
19
|
import {
|
|
20
20
|
MeetingCliError,
|
|
21
21
|
asObject,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
meetingAuthError,
|
|
24
24
|
meetingNetworkError,
|
|
25
25
|
meetingValidationError
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6V5ZPKHV.js";
|
|
27
27
|
import {
|
|
28
28
|
reportPlatformError
|
|
29
29
|
} from "./chunk-6N4JPNFL.js";
|