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> = {
IN: "intrat",
OUT: "iesit",
INT: "intern",
};
const dir = dirMap[type.toUpperCase()];
if (dir) entries = entries.filter((e) => e.direction === dir);
@@ -2,7 +2,6 @@
import {
ArrowDownToLine,
ArrowRightLeft,
ArrowUpFromLine,
Calendar,
CheckCircle2,
@@ -65,12 +64,6 @@ const DIRECTION_CONFIG = {
class:
"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;
const STATUS_CONFIG = {
@@ -15,7 +15,6 @@ import {
Globe,
ArrowDownToLine,
ArrowUpFromLine,
ArrowRightLeft,
HardDrive,
FolderOpen,
Link2,
@@ -555,19 +554,6 @@ export function RegistryEntryForm({
<ArrowUpFromLine className="h-4 w-4" />
Ieșit
</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>
@@ -41,7 +41,6 @@ export function RegistryFilters({ filters, onUpdate }: RegistryFiltersProps) {
<SelectItem value="all">Toate</SelectItem>
<SelectItem value="intrat">Intrat</SelectItem>
<SelectItem value="iesit">Ieșit</SelectItem>
<SelectItem value="intern">Intern</SelectItem>
</SelectContent>
</Select>
@@ -82,7 +82,7 @@ const COLUMNS: ColumnDef[] = [
id: "direction",
label: "Dir.",
tooltip:
"Direcție: Intrat = primit, Ieșit = trimis, Intern = intern",
"Direcție: Intrat = primit, Ieșit = trimis",
defaultVisible: true,
},
{
@@ -141,7 +141,6 @@ const STORAGE_KEY = "registratura:visible-columns";
const DIRECTION_LABELS: Record<string, string> = {
intrat: "Intrat",
iesit: "Ieșit",
intern: "Intern",
};
function getDocTypeLabel(type: string): string {
@@ -331,9 +330,7 @@ export function RegistryTable({
variant={
entry.direction === "intrat"
? "default"
: entry.direction === "intern"
? "outline"
: "secondary"
: "secondary"
}
className="text-xs"
>
@@ -6,7 +6,7 @@
* - end-of-month (~last day, snapped to nearest previous working day)
*
* 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";
+1 -2
View File
@@ -2,13 +2,12 @@ import type { Visibility } from "@/core/module-registry/types";
import type { CompanyId } from "@/core/auth/types";
/** Document direction */
export type RegistryDirection = "intrat" | "iesit" | "intern";
export type RegistryDirection = "intrat" | "iesit";
/** Maps direction to the numbering type code */
export const DIRECTION_TYPE_CODE: Record<RegistryDirection, string> = {
intrat: "IN",
iesit: "OUT",
intern: "INT",
};
/** New-format company prefixes for registry numbering */