Manage a resource's services from the panel

A "سرویس‌ها" action on each resource row opens a modal listing what that
resource performs, with its own duration and price. It follows the skills modal
exactly — same PUT-replaces-everything contract, same components, no new page
and no new route.

Leaving a cell empty means inherit, so the effective value is shown as the
placeholder along with where it came from: "40 — service default", "1,800,000
toman — branch". Without that the user cannot tell an unset field from a zero,
which is the one thing this screen has to communicate.

Two backend adjustments came out of wiring it up:

- the offering filter in findEligible is now scoped to the requirement's
  resource type. Registering lasers for a service was making the room in the
  same plan ineligible and breaking the whole booking — "who performs this" is
  about the performing role, not about rooms and support resources. The seeder
  caught this immediately.
- the scenario seeder now creates offerings and resource categories, so the
  demo data exercises this model instead of leaving every resource empty.

Three vitest tests: inherited value with its source, saving an override, and
clearing back to inheritance. Verified in the browser at 1440 dark, 1440
compact and 390 mobile — the last with no horizontal scroll.

Panel suite 648 green across 98 files, tsc clean, encore build succeeds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-08-01 22:57:55 +03:30
co-authored by Claude Opus 5
parent a6acf3bfe2
commit 26425bec31
10 changed files with 463 additions and 35 deletions
+22
View File
@@ -1238,3 +1238,25 @@ export interface ReportEnvelope<T> {
to: number;
rows: T[];
}
/** یک ردیف «این منبع این سرویس را می‌دهد» با مقدار مؤثر و منبعِ هر عدد. */
export interface ResourceServiceOffering {
service_uuid: string;
service_name: string;
/** null یعنی ارث از سطح بالاتر، نه صفر */
duration_minutes: number | null;
price_rials: number | null;
active: boolean;
effective_duration_minutes: number | null;
effective_price_rials: number;
duration_source: string | null;
price_source: string;
}
/** گزینهٔ انتخاب سرویس در مودال منبع. */
export interface ServiceItemOption {
uuid: string;
name: string;
duration_minutes?: number | null;
price_rials?: number | null;
}