feat(scheduling): add algorithm pure functions and export mapRegion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-04-16 20:21:50 +08:00
co-authored by Claude Opus 4.6
parent 569b5ea349
commit 460c9906e1
2 changed files with 186 additions and 1 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ WHERE truck.is_deleted = 0
const REGIONS = ['嘉兴', '广东', '北京', '新疆', '其他'] as const;
const INVENTORY_REGIONS = ['江浙沪', '广东', '新疆', '其它'] as const;
function mapRegion(province: string | null, city: string | null): string {
export function mapRegion(province: string | null, city: string | null): string {
if (!province && !city) return '其他';
const loc = (city || province || '').trim();
if (loc.includes('嘉兴') || loc.includes('浙江') || loc.includes('上海') || loc.includes('江苏')) return '嘉兴';