feat: prepare Zhinian desktop client for pilot release

This commit is contained in:
inman
2026-04-29 10:23:20 +08:00
parent f9361e686a
commit 47b83b79fc
149 changed files with 15341 additions and 3590 deletions

View File

@@ -0,0 +1,28 @@
export interface PriceAnomalyRuleInput {
roomType: string;
date: string;
price: number;
priceFloor?: number;
}
export type PriceAnomalyKind = 'below_floor' | 'large_gap' | 'unavailable' | 'missing_room' | 'parse_suspect';
export interface PriceAnomaly {
kind: PriceAnomalyKind;
roomType: string;
date: string;
message: string;
}
export function detectPriceFloorAnomaly(input: PriceAnomalyRuleInput): PriceAnomaly | null {
if (typeof input.priceFloor !== 'number') return null;
if (input.price >= input.priceFloor) return null;
return {
kind: 'below_floor',
roomType: input.roomType,
date: input.date,
message: `价格 ${input.price} 低于底价 ${input.priceFloor}`,
};
}