feat: add shared child batch creation
This commit is contained in:
1 parent
515b545b32
commit
6ac90f838a
32 files changed
+958
-90
No files matched your search
@@ -11,18 +11,19 @@ import {
|
||||
import { loadConfig } from '../src/config.js';
|
||||
import { resolveParserModeSnapshot, TaskError, TaskService } from '../src/task-service.js';
|
||||
|
||||
const rosterRouteIds = [
|
||||
const programOnlyRouteIds = [
|
||||
'shared_child_order_batch_create',
|
||||
'passenger_list_import_independent',
|
||||
'passenger_list_import_shared_child'
|
||||
] as const;
|
||||
const parserModes: ParserMode[] = ['ai', 'shadow', 'auto', 'program'];
|
||||
|
||||
test('only the two roster routes are hard Program-only in the machine registry', () => {
|
||||
test('the two roster routes and shared-child batch route are hard Program-only in the machine registry', () => {
|
||||
const programOnly = BUSINESS_ROUTES.filter((route) => route.parserPolicy === 'program_only');
|
||||
assert.deepEqual(programOnly.map((route) => route.routeId), rosterRouteIds);
|
||||
assert.deepEqual(programOnly.map((route) => route.routeId), programOnlyRouteIds);
|
||||
|
||||
for (const route of BUSINESS_ROUTES) {
|
||||
const expectedModes = rosterRouteIds.includes(route.routeId as typeof rosterRouteIds[number])
|
||||
const expectedModes = programOnlyRouteIds.includes(route.routeId as typeof programOnlyRouteIds[number])
|
||||
? ['program']
|
||||
: parserModes;
|
||||
assert.deepEqual(allowedParserModesForRoute(route), expectedModes, route.routeId);
|
||||
@@ -41,14 +42,14 @@ test('only the two roster routes are hard Program-only in the machine registry',
|
||||
}
|
||||
});
|
||||
|
||||
test('roster task snapshots stay Program with missing or hostile stored settings', async () => {
|
||||
const routeText = (routeId: typeof rosterRouteIds[number]) => {
|
||||
test('hard Program-only task snapshots stay Program with missing or hostile stored settings', async () => {
|
||||
const routeText = (routeId: typeof programOnlyRouteIds[number]) => {
|
||||
const route = BUSINESS_ROUTES.find((candidate) => candidate.routeId === routeId);
|
||||
assert.ok(route);
|
||||
return `${route.directive}\n单号:TEST-ORDER`;
|
||||
};
|
||||
|
||||
for (const routeId of rosterRouteIds) {
|
||||
for (const routeId of programOnlyRouteIds) {
|
||||
for (const storedMode of [null, ...parserModes] as const) {
|
||||
const client = {
|
||||
async query() {
|
||||
@@ -83,7 +84,7 @@ test('the public route mutation rejects AI, Shadow, and Auto before touching set
|
||||
DATABASE_URL: 'postgresql://invalid:invalid@127.0.0.1:1/invalid'
|
||||
}));
|
||||
const context = { organizationId: 'test-org', userId: 'test-user', requestId: 'test-request' };
|
||||
for (const routeId of rosterRouteIds) {
|
||||
for (const routeId of programOnlyRouteIds) {
|
||||
for (const mode of parserModes.filter((candidate) => candidate !== 'program')) {
|
||||
await assert.rejects(
|
||||
service.setParserRoutingMode(context, routeId, mode, 0),
|
||||
|
||||
Reference in new issue
Block a user