import type { Visibility } from "@/core/module-registry/types";
import type { CompanyId } from "@/core/auth/types";

export type VaultEntryCategory =
  | "web"
  | "email"
  | "wifi"
  | "portale-primarii"
  | "avize-online"
  | "pin-semnatura"
  | "software"
  | "hardware"
  | "other";

/** Custom key-value field */
export interface CustomField {
  key: string;
  value: string;
}

/** Additional user credential for multi-user entries */
export interface VaultUser {
  username: string;
  password: string;
  email?: string;
  notes?: string;
}

export interface VaultEntry {
  id: string;
  label: string;
  username: string;
  email: string;
  password: string;
  url: string;
  category: VaultEntryCategory;
  company: CompanyId;
  /** Custom key-value fields */
  customFields: CustomField[];
  /** Additional users/credentials for shared accounts */
  additionalUsers: VaultUser[];
  notes: string;
  tags: string[];
  visibility: Visibility;
  createdAt: string;
  updatedAt: string;
}
