JetBrains-Research / JetBrains-Research/Python-Solution-Preference

[009] Furniture Delivery Pricing Calculator (MVP)

オープン
#9 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
2
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

## Overview

Deterministic calculator for furniture delivery quotes. No payments, no accounts. Application starts empty; Admin configures all data.

Build this as a Python backend service with no UI; expose the functionality below through an HTTP API.

## Data Model

- **Settings:** Rural Rate per km, Assembly Rate per 15-min interval, Rubbish Flat Rate
- **Locations:** type (store/warehouse/supplier), name, address, city, suburb
- **Rate Cards:** serviceType (B2B/B2C), fromCity, toCity, toSuburb, ratePerM3
- **Furniture Catalog:** SKU, name, cubic metres, category

## Quote Calculation

### Inputs

- Delivery Type: B2C or B2B
- Origin: select from locations
- Destination: B2C = enter City (required) + Suburb (optional); B2B = select from locations
- Items: from catalog (quantity 1-10, optional m³ override) or custom (name, m³, quantity 1-10)
- Services: Assembly intervals (0-99), Rubbish quantity (0-99), Rural km (B2C only, ≥0)

Required: Delivery Type, Origin, Destination, at least one item. Calculation is rejected until all required inputs are present.

### Rate Matching

Filter rate cards by serviceType = Delivery Type AND fromCity = Origin's city.

- Destination city/suburb: B2C uses entered values; B2B uses selected location's city/suburb.
- **Exact Match:** toCity AND toSuburb both match destination (empty matches empty). Select lowest ratePerM3. Result labeled "Exact Match".
- **City Match (fallback):** toCity matches but toSuburb doesn't. Select highest ratePerM3. Result labeled "City Match" with "N suburbs available for this city." where N = count of unique non-empty toSuburb values for matching toCity.
- **Unavailable:** no toCity match. Result: "No rate card for selected route and delivery type."

### Pricing Formulas

- Volume Charged = MAX(1.00, Total Cubic Metres)
- Base Delivery = ratePerM3 × Volume Charged
- Assembly Cost = Assembly Rate × intervals
- Rubbish Cost = Rubbish Flat Rate × quantity
- Rural Cost = Rural Rate × km (B2C only; B2B = 0)
- Total = Base Delivery + Assembly + Rubbish + Rural

### Output

- Currency and volumes to two decimals
- When volume < 1.00, indicate "X.XX m³ (charged as 1.00 m³)"
- Rural km is not accepted for B2B

## Quotes Management

- A quote can be saved after any calculation result (including Unavailable)
- Save captures immutable snapshot (inputs, rates, costs)
- Saved quotes preserve original rates unchanged by later Admin edits
- Quotes list shows: timestamp, delivery type, origin city, destination "City (Suburb)", match tier, total (or "Unavailable")
- Quote detail shows: items, services, matched ratePerM3, volume charged, cost breakdown
- Quotes can be deleted

## Admin

- Manage Settings, Locations, Rate Cards, and Furniture Catalog (add/edit/delete)
- Reset Data: clears all locations, rate cards, catalog, quotes; resets settings to zero

## Empty Data Behavior

- **No Locations:** quote calculation is not possible
- **No Rate Cards:** calculation returns Unavailable
- **No Catalog:** user can still add custom items

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

No files, tests, or existing entry points are identified in the issue. Start by establishing the Python backend service and its HTTP API around the specified data model, calculation rules, quote snapshots, and admin operations. Done means the API supports all listed behaviors, validation, empty-data cases, formatting, and immutable saved quotes.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, backend, database
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。