Implement a matching algorithm that pairs food surplus postings with nearby organizations that need them. The algorithm should:
- Accept a list of surplus items (type, quantity, expiration date, location) and a list of needs (type, quantity needed, location, capacity)
- Score matches based on: distance (closer = better), expiration urgency (sooner = higher priority), quantity fit (minimize partial matches)
- Return ranked match suggestions with a confidence score
- Handle edge cases: no matches available, expired items, over-capacity
Input/output should be typed TypeScript interfaces. Include unit tests for the scoring logic.