fix(registratura): remove intern direction — only intrat/iesit are valid

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-10 08:01:29 +02:00
parent a0dd35a066
commit 6786ac07d1
7 changed files with 4 additions and 31 deletions
-1
View File
@@ -166,7 +166,6 @@ export async function GET(req: NextRequest) {
const dirMap: Record<string, RegistryDirection> = { const dirMap: Record<string, RegistryDirection> = {
IN: "intrat", IN: "intrat",
OUT: "iesit", OUT: "iesit",
INT: "intern",
}; };
const dir = dirMap[type.toUpperCase()]; const dir = dirMap[type.toUpperCase()];
if (dir) entries = entries.filter((e) => e.direction === dir); if (dir) entries = entries.filter((e) => e.direction === dir);
@@ -2,7 +2,6 @@
import { import {
ArrowDownToLine, ArrowDownToLine,
ArrowRightLeft,
ArrowUpFromLine, ArrowUpFromLine,
Calendar, Calendar,
CheckCircle2, CheckCircle2,
@@ -65,12 +64,6 @@ const DIRECTION_CONFIG = {
class: class:
"bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-300", "bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-300",
}, },
intern: {
label: "Intern",
icon: ArrowRightLeft,
class:
"bg-purple-100 text-purple-800 dark:bg-purple-900/40 dark:text-purple-300",
},
} as const; } as const;
const STATUS_CONFIG = { const STATUS_CONFIG = {
@@ -15,7 +15,6 @@ import {
Globe, Globe,
ArrowDownToLine, ArrowDownToLine,
ArrowUpFromLine, ArrowUpFromLine,
ArrowRightLeft,
HardDrive, HardDrive,
FolderOpen, FolderOpen,
Link2, Link2,
@@ -555,19 +554,6 @@ export function RegistryEntryForm({
<ArrowUpFromLine className="h-4 w-4" /> <ArrowUpFromLine className="h-4 w-4" />
Ieșit Ieșit
</button> </button>
<button
type="button"
onClick={() => setDirection("intern")}
className={cn(
"flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all",
direction === "intern"
? "bg-purple-500 text-white shadow-sm"
: "text-muted-foreground hover:text-foreground hover:bg-background",
)}
>
<ArrowRightLeft className="h-4 w-4" />
Intern
</button>
</div> </div>
</div> </div>
<div> <div>
@@ -41,7 +41,6 @@ export function RegistryFilters({ filters, onUpdate }: RegistryFiltersProps) {
<SelectItem value="all">Toate</SelectItem> <SelectItem value="all">Toate</SelectItem>
<SelectItem value="intrat">Intrat</SelectItem> <SelectItem value="intrat">Intrat</SelectItem>
<SelectItem value="iesit">Ieșit</SelectItem> <SelectItem value="iesit">Ieșit</SelectItem>
<SelectItem value="intern">Intern</SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
@@ -82,7 +82,7 @@ const COLUMNS: ColumnDef[] = [
id: "direction", id: "direction",
label: "Dir.", label: "Dir.",
tooltip: tooltip:
"Direcție: Intrat = primit, Ieșit = trimis, Intern = intern", "Direcție: Intrat = primit, Ieșit = trimis",
defaultVisible: true, defaultVisible: true,
}, },
{ {
@@ -141,7 +141,6 @@ const STORAGE_KEY = "registratura:visible-columns";
const DIRECTION_LABELS: Record<string, string> = { const DIRECTION_LABELS: Record<string, string> = {
intrat: "Intrat", intrat: "Intrat",
iesit: "Ieșit", iesit: "Ieșit",
intern: "Intern",
}; };
function getDocTypeLabel(type: string): string { function getDocTypeLabel(type: string): string {
@@ -331,8 +330,6 @@ export function RegistryTable({
variant={ variant={
entry.direction === "intrat" entry.direction === "intrat"
? "default" ? "default"
: entry.direction === "intern"
? "outline"
: "secondary" : "secondary"
} }
className="text-xs" className="text-xs"
@@ -6,7 +6,7 @@
* - end-of-month (~last day, snapped to nearest previous working day) * - end-of-month (~last day, snapped to nearest previous working day)
* *
* Slots use the IN sequence by default. When a late IN document arrives, * Slots use the IN sequence by default. When a late IN document arrives,
* it claims the slot's number. OUT/INT docs get new typed numbers instead. * it claims the slot's number. OUT docs get new typed numbers instead.
*/ */
import { v4 as uuid } from "uuid"; import { v4 as uuid } from "uuid";
+1 -2
View File
@@ -2,13 +2,12 @@ import type { Visibility } from "@/core/module-registry/types";
import type { CompanyId } from "@/core/auth/types"; import type { CompanyId } from "@/core/auth/types";
/** Document direction */ /** Document direction */
export type RegistryDirection = "intrat" | "iesit" | "intern"; export type RegistryDirection = "intrat" | "iesit";
/** Maps direction to the numbering type code */ /** Maps direction to the numbering type code */
export const DIRECTION_TYPE_CODE: Record<RegistryDirection, string> = { export const DIRECTION_TYPE_CODE: Record<RegistryDirection, string> = {
intrat: "IN", intrat: "IN",
iesit: "OUT", iesit: "OUT",
intern: "INT",
}; };
/** New-format company prefixes for registry numbering */ /** New-format company prefixes for registry numbering */