Expose pending service pricing in facility UI
Show normal usage fees separately from the unspecified desire-match surcharge. Preserve free reception and omit guest pricing from warehouse and cleaning rooms. Validation: 155 suites / 12,310 checks; focused 700 checks; strict state and event equivalence; 16 normal and compact FRONT/BACK captures.
This commit is contained in:
@@ -44,6 +44,20 @@ static func quote_service(base_price: int, policy: Dictionary, service_attribute
|
||||
&"surcharge": surcharge, &"total": base + surcharge, &"eligible": true}
|
||||
|
||||
|
||||
## The normal fee follows its existing charging contract. The added need-match
|
||||
## rule has no approved assessment or amount. Null retains that uncertainty.
|
||||
static func pending_service_readmodel(normal_price: int, service_attribute: StringName) -> Dictionary:
|
||||
return {
|
||||
&"normal_price": normal_price,
|
||||
&"service_attribute": null if service_attribute.is_empty() else service_attribute,
|
||||
&"deficient_attributes": null,
|
||||
&"matches": null,
|
||||
&"surcharge": null,
|
||||
&"total": null,
|
||||
&"resolved": false,
|
||||
}
|
||||
|
||||
|
||||
static func satisfaction_modifier(
|
||||
policy: Dictionary,
|
||||
quality: int,
|
||||
|
||||
@@ -11,6 +11,10 @@ const KEY_PREFIX := "ui.business."
|
||||
const COMMAND: StringName = &"set_facility_policy"
|
||||
const GUEST_POLICY_EXPLANATION := "料金変更は新規受付から。受付済みの料金は変わりません。\n休業すると待機中のお客様は別の施設を探します。開始済みのサービスは完了まで続きます。休業中も給与と施設維持費は発生します。"
|
||||
const SUPPLY_POLICY_EXPLANATION := "休業中は調理と新しい補給を止めます。在庫と運搬中の荷物は保持し、積込済みの荷物は納品先の営業状況に従って配送します。消費期限は経過し、給与と施設維持費も発生します。"
|
||||
const SERVICE_ATTRIBUTE_NAMES := {
|
||||
&"": "未設定", &"appetite": "食欲", &"relaxation": "リラックス欲",
|
||||
&"sexual": "性欲", &"gambling": "ギャンブル欲",
|
||||
}
|
||||
const STATE_NAMES := {&"BROKEN": "故障中", &"NO_ACCESS": "経路なし", &"NO_POWER": "魔力不足", &"NO_STAFF": "職員不足", &"CLOSED": "休業中", &"DEGRADED": "状態悪化", &"OPEN": "稼働中"}
|
||||
const REASONS := {
|
||||
&"FACILITY_NOT_FOUND": "施設が見つかりません。選び直してください。",
|
||||
@@ -134,6 +138,7 @@ func refresh() -> void:
|
||||
business_open_button.set_pressed_no_signal(bool(draft.get(&"business_open", true)))
|
||||
var pending := _has_pending(selected_facility_id)
|
||||
var can_price := bool(row.get(&"can_price", false))
|
||||
var is_guest_service := StringName(row.get(&"category", &"")) in [&"guest_service", &"restricted_service"]
|
||||
var is_cleaning := StringName(row.get(&"definition_id", &"")) == &"cleaning_room"
|
||||
var is_supply := StringName(row.get(&"definition_id", &"")) in [&"kitchen", &"warehouse"]
|
||||
business_open_button.text = "営業する" if is_supply else "新規の受付を開く"
|
||||
@@ -167,16 +172,20 @@ func refresh() -> void:
|
||||
var mode := StringName(draft.get(&"price_mode", &"standard"))
|
||||
var quoted := FacilityPricing.apply_multiplier(FacilityPricing.quote(int(row.get(&"base_price", 0)), {&"price_mode": mode}) * int(row.get(&"donation_multiplier", 1)), int(row.get(&"floor_price_multiplier_bp", 10000)))
|
||||
var unit := String({&"standard_room": "泊", &"premium_room": "泊", &"cafeteria": "食"}.get(StringName(row.get(&"definition_id", &"")), "回"))
|
||||
quote_label.text = "設定後 %dG / %s\n現在 %dG · 標準 %dG" % [quoted, unit, int(row.get(&"price", 0)), int(row.get(&"base_price", 0))]
|
||||
quote_label.text = "通常料金 · 設定後 %dG / %s\n現在 %dG · 標準 %dG" % [quoted, unit, int(row.get(&"price", 0)), int(row.get(&"base_price", 0))]
|
||||
effect_label.text = _price_effect(mode)
|
||||
if int(row.get(&"donation_multiplier", 1)) == 3:
|
||||
effect_label.text += "\nアメリア配置:寄付金3倍"
|
||||
if int(row.get(&"floor_price_multiplier_bp", 10000)) == 12000:
|
||||
effect_label.text += "\nアンリ配置フロア:利用料金+20%"
|
||||
else:
|
||||
quote_label.text = "この施設に利用料金はありません。"
|
||||
quote_label.text = "通常の利用料金はありません(現在 %dG)。" % int(row.get(&"price", 0)) if is_guest_service else "この施設に利用料金はありません。"
|
||||
effect_label.text = "営業・休業を設定できます。" if is_supply else "受付の開閉だけを設定できます。"
|
||||
if is_cleaning: effect_label.text = "清掃業務の有効・無効を設定できます。"
|
||||
if can_price or is_guest_service:
|
||||
var service_pricing: Dictionary = row.get(&"service_pricing", {})
|
||||
var attribute: Variant = service_pricing.get(&"service_attribute", null)
|
||||
quote_label.text += "\nサービス属性:%s\n欲求一致加算:未設定" % String(SERVICE_ATTRIBUTE_NAMES.get(attribute, "未設定"))
|
||||
if int(row.get(&"faith_per_service", 0)) > 0:
|
||||
effect_label.text += "\n礼拝完了ごとに信仰+%d" % int(row[&"faith_per_service"])
|
||||
today_label.text = "本日の記帳 · 00:00〜\n売上 %dG · 直接支出 %dG\n給与の配賦と利益は翌日の帳簿で確認。" % [int(row.get(&"today_revenue", 0)), int(row.get(&"today_expenses", 0))]
|
||||
|
||||
Reference in New Issue
Block a user