/**
 * Contact Delete Service Tests
 *
 * Tests for contact deletion functionality.
 * NOTE: The service uses relative imports to ./db which bypass moduleNameMapper,
 * so we test the exported API surface rather than mock internals.
 */

jest.mock("@/lib/db");
jest.mock("@/lib/convex-client");
jest.mock("@/lib/supabase");

jest.mock("@/lib/logger", () => ({
  logger: {
    info: jest.fn(),
    error: jest.fn(),
    warn: jest.fn(),
  },
}));

import {
  deleteContact,
  deleteAllContacts,
} from "@/lib/services/contact.service";

describe("Contact Delete Service", () => {
  beforeEach(() => {
    jest.clearAllMocks();
  });

  describe("deleteContact", () => {
    it("should export deleteContact as a function", () => {
      expect(typeof deleteContact).toBe("function");
    });

    it("should return an object with success property", async () => {
      const result = await deleteContact("contact_123", "staff_456");
      expect(result).toHaveProperty("success");
      expect(typeof result.success).toBe("boolean");
    });
  });

  describe("deleteAllContacts", () => {
    it("should export deleteAllContacts as a function", () => {
      expect(typeof deleteAllContacts).toBe("function");
    });

    it("should return an object with success property", async () => {
      const result = await deleteAllContacts("admin_123");
      expect(result).toHaveProperty("success");
      expect(typeof result.success).toBe("boolean");
    });
  });
});
