import { apiRequest } from "@/lib/api/api-service";
import { ApiResponse } from "@/types/api-response";
import { PermissionResponseDto, CreatePermissionDto } from "./types";

/**
 * Admin Permissions Service - Example Implementation
 * Matches Backend: /api/admin/permissions/*
 */

const getAll = () => {
  return apiRequest<ApiResponse<PermissionResponseDto[]>>({
    url: "/admin/permissions",
    client: "admin",
    method: "get",
  });
};

const create = (data: CreatePermissionDto) => {
  return apiRequest<ApiResponse<PermissionResponseDto>>({
    url: "/admin/permissions",
    client: "admin",
    method: "post",
    data,
  });
};

export const adminPermissionsService = {
  getAll,
  create,
};
