feat(flow-ui): load branch staff from parsian seeds

Load seeded staff and product-specific codes, preserve intentional missing-code markers, and disable options without codes.
This commit is contained in:
2026-11-21 10:34:07 +03:30
parent 5242a22c6c
commit 5818f7f881
5 changed files with 135 additions and 58 deletions
+19
View File
@@ -58,3 +58,22 @@ test("policy aliases used by existing inquiry mappings populate all three fields
assert.equal(result.vehicle.BEGIN_DATE, "1404/02/01");
assert.equal(result.vehicle.END_DATE, "1405/02/01");
});
test("flow UI includes every seed expert in each assigned branch and both Kazemi codes", () => {
const context = inquiryContext({});
const branches = vm.runInContext("parsianBranchSeeds()", context);
for (const [file, key, role] of [
["file-makers.json", "fileMakers", "makers"],
["file-reviewers.json", "fileReviewers", "reviewers"],
]) {
const seeds = JSON.parse(fs.readFileSync(path.join(__dirname, "data/parsian-tehran", file)))[key];
for (const expert of seeds) {
for (const location of expert.locations) {
assert.ok(branches[location.id][role].some(r => r.name === `${expert.firstName} ${expert.lastName}`));
}
}
}
const kazemi = branches["210120"].reviewers.find(r => r.name.includes("کاظمي دولت سرا"));
assert.equal(kazemi.tp, "3992");
assert.equal(kazemi.body, "3991");
});