feat(fleet): integrate trip management and fee coverage workflows

This commit is contained in:
2026-10-03 04:35:55 +08:00
parent bca08f8749
commit dc35288a1b
87 changed files with 3774 additions and 233 deletions
@@ -0,0 +1,22 @@
const kilogramsToPounds = 2.2046226218
export function physicalWeightKg(value: unknown): number | null {
if (value == null || value === '') return null
const number = Number(value)
return Number.isFinite(number) && number > 0 ? number : null
}
export function physicalWeightLb(value: unknown): number | null {
const weight = physicalWeightKg(value)
return weight === null ? null : weight * kilogramsToPounds
}
export function totalPhysicalWeightLb(items: readonly ({ grossWeightKg?: number | null } | undefined)[]): number | null {
let total = 0
for (const item of items) {
const weight = physicalWeightLb(item?.grossWeightKg)
if (weight === null) return null
total += weight
}
return total
}