feat: 15 UPC proceeding types in 3 groups + category field
Added 10 new UPC types: DNI, EPO, AMD, CCI, EVP, DAM, COS, REH, DEF, RST. Grouped as: Hauptverfahren / Verfahren im Verfahren / Rechtsbehelfe. Frontend dropdown shows sub-groups within jurisdiction. German names throughout.
This commit is contained in:
@@ -86,21 +86,37 @@ export function DeadlineCalculator() {
|
||||
>
|
||||
<option value="">Bitte wählen...</option>
|
||||
{(() => {
|
||||
const grouped = new Map<string, ProceedingType[]>();
|
||||
for (const pt of proceedingTypes ?? []) {
|
||||
const key = pt.jurisdiction ?? "Sonstige";
|
||||
if (!grouped.has(key)) grouped.set(key, []);
|
||||
grouped.get(key)!.push(pt);
|
||||
}
|
||||
const labels: Record<string, string> = {
|
||||
UPC: "UPC-Verfahren",
|
||||
const types = proceedingTypes ?? [];
|
||||
const categoryLabels: Record<string, string> = {
|
||||
hauptverfahren: "Hauptverfahren",
|
||||
im_verfahren: "Verfahren im Verfahren",
|
||||
rechtsbehelf: "Rechtsbehelfe",
|
||||
};
|
||||
const jurisdictionLabels: Record<string, string> = {
|
||||
UPC: "UPC",
|
||||
DE: "Deutsche Patentverfahren",
|
||||
};
|
||||
return Array.from(grouped.entries()).map(([jurisdiction, types]) => (
|
||||
<optgroup key={jurisdiction} label={labels[jurisdiction] ?? jurisdiction}>
|
||||
{types.map((pt) => (
|
||||
// Group by jurisdiction + category
|
||||
const groups: { key: string; label: string; items: typeof types }[] = [];
|
||||
const seen = new Set<string>();
|
||||
for (const pt of types) {
|
||||
const j = pt.jurisdiction ?? "Sonstige";
|
||||
const c = (pt as Record<string, unknown>).category as string ?? "hauptverfahren";
|
||||
const key = `${j}::${c}`;
|
||||
if (!seen.has(key)) {
|
||||
seen.add(key);
|
||||
const jLabel = jurisdictionLabels[j] ?? j;
|
||||
const cLabel = categoryLabels[c] ?? c;
|
||||
const label = j === "DE" ? jLabel : `${jLabel} — ${cLabel}`;
|
||||
groups.push({ key, label, items: [] });
|
||||
}
|
||||
groups.find((g) => g.key === key)!.items.push(pt);
|
||||
}
|
||||
return groups.map((g) => (
|
||||
<optgroup key={g.key} label={g.label}>
|
||||
{g.items.map((pt) => (
|
||||
<option key={pt.id} value={pt.code}>
|
||||
{pt.name} ({pt.code})
|
||||
{pt.name}
|
||||
</option>
|
||||
))}
|
||||
</optgroup>
|
||||
|
||||
@@ -197,6 +197,7 @@ export interface ProceedingType {
|
||||
name: string;
|
||||
description?: string;
|
||||
jurisdiction?: string;
|
||||
category?: string;
|
||||
default_color: string;
|
||||
sort_order: number;
|
||||
is_active: boolean;
|
||||
|
||||
Reference in New Issue
Block a user