/**
 * Generated by orval v8.5.3 🍺
 * Do not edit manually.
 * Api
 * TeaBoy OS API specification
 * OpenAPI spec version: 0.1.0
 */
import * as zod from "zod";

/**
 * @summary Health check
 */
export const HealthCheckResponse = zod.object({
  status: zod.string(),
});

/**
 * @summary Register a new user
 */
export const registerBodyPreferredLanguageDefault = `ar`;

export const RegisterBody = zod.object({
  username: zod.string(),
  email: zod.string(),
  password: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod.string().default(registerBodyPreferredLanguageDefault),
});

/**
 * @summary Login
 */
export const LoginBody = zod.object({
  username: zod.string(),
  password: zod.string(),
});

export const LoginResponse = zod.object({
  id: zod.number(),
  username: zod.string(),
  email: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod.string(),
  avatarUrl: zod.string().nullish(),
  isActive: zod.boolean(),
  roles: zod.array(zod.string()),
  createdAt: zod.coerce.date(),
});

/**
 * @summary Logout
 */
export const LogoutResponse = zod.object({
  success: zod.boolean(),
});

/**
 * @summary Get current user
 */
export const GetMeResponse = zod.object({
  id: zod.number(),
  username: zod.string(),
  email: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod.string(),
  avatarUrl: zod.string().nullish(),
  isActive: zod.boolean(),
  roles: zod.array(zod.string()),
  createdAt: zod.coerce.date(),
});

/**
 * @summary Update preferred language
 */
export const UpdateLanguageBody = zod.object({
  language: zod.string(),
});

export const UpdateLanguageResponse = zod.object({
  id: zod.number(),
  username: zod.string(),
  email: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod.string(),
  avatarUrl: zod.string().nullish(),
  isActive: zod.boolean(),
  roles: zod.array(zod.string()),
  createdAt: zod.coerce.date(),
});

/**
 * @summary List all active apps
 */
export const ListAppsResponseItem = zod.object({
  id: zod.number(),
  slug: zod.string(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  iconName: zod.string(),
  route: zod.string(),
  color: zod.string(),
  isActive: zod.boolean(),
  isSystem: zod.boolean(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});
export const ListAppsResponse = zod.array(ListAppsResponseItem);

/**
 * @summary Create a new app (admin)
 */
export const CreateAppBody = zod.object({
  slug: zod.string(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  iconName: zod.string(),
  route: zod.string(),
  color: zod.string(),
  isActive: zod.boolean().optional(),
  isSystem: zod.boolean().optional(),
  sortOrder: zod.number().optional(),
});

/**
 * @summary Get app by ID
 */
export const GetAppParams = zod.object({
  id: zod.coerce.number(),
});

export const GetAppResponse = zod.object({
  id: zod.number(),
  slug: zod.string(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  iconName: zod.string(),
  route: zod.string(),
  color: zod.string(),
  isActive: zod.boolean(),
  isSystem: zod.boolean(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});

/**
 * @summary Update app (admin)
 */
export const UpdateAppParams = zod.object({
  id: zod.coerce.number(),
});

export const UpdateAppBody = zod.object({
  nameAr: zod.string().optional(),
  nameEn: zod.string().optional(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  iconName: zod.string().optional(),
  route: zod.string().optional(),
  color: zod.string().optional(),
  isActive: zod.boolean().optional(),
  sortOrder: zod.number().optional(),
});

export const UpdateAppResponse = zod.object({
  id: zod.number(),
  slug: zod.string(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  iconName: zod.string(),
  route: zod.string(),
  color: zod.string(),
  isActive: zod.boolean(),
  isSystem: zod.boolean(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});

/**
 * @summary Delete app (admin)
 */
export const DeleteAppParams = zod.object({
  id: zod.coerce.number(),
});

/**
 * @summary Set the current user's preferred home apps order
 */
export const UpdateMyAppOrderBody = zod.object({
  order: zod
    .array(zod.number())
    .describe("App IDs in the desired display order"),
});

export const UpdateMyAppOrderResponseItem = zod.object({
  id: zod.number(),
  slug: zod.string(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  iconName: zod.string(),
  route: zod.string(),
  color: zod.string(),
  isActive: zod.boolean(),
  isSystem: zod.boolean(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});
export const UpdateMyAppOrderResponse = zod.array(UpdateMyAppOrderResponseItem);

/**
 * @summary Get application settings (public)
 */
export const GetAppSettingsResponse = zod.object({
  siteNameAr: zod.string(),
  siteNameEn: zod.string(),
  registrationOpen: zod.boolean(),
  footerTextAr: zod.string(),
  footerTextEn: zod.string(),
  updatedAt: zod.coerce.date().optional(),
});

/**
 * @summary Update application settings (admin)
 */
export const updateAppSettingsBodySiteNameArMax = 200;

export const updateAppSettingsBodySiteNameEnMax = 200;

export const updateAppSettingsBodyFooterTextArMax = 300;

export const updateAppSettingsBodyFooterTextEnMax = 300;

export const UpdateAppSettingsBody = zod.object({
  siteNameAr: zod
    .string()
    .min(1)
    .max(updateAppSettingsBodySiteNameArMax)
    .optional(),
  siteNameEn: zod
    .string()
    .min(1)
    .max(updateAppSettingsBodySiteNameEnMax)
    .optional(),
  registrationOpen: zod.boolean().optional(),
  footerTextAr: zod
    .string()
    .min(1)
    .max(updateAppSettingsBodyFooterTextArMax)
    .optional(),
  footerTextEn: zod
    .string()
    .min(1)
    .max(updateAppSettingsBodyFooterTextEnMax)
    .optional(),
});

export const UpdateAppSettingsResponse = zod.object({
  siteNameAr: zod.string(),
  siteNameEn: zod.string(),
  registrationOpen: zod.boolean(),
  footerTextAr: zod.string(),
  footerTextEn: zod.string(),
  updatedAt: zod.coerce.date().optional(),
});

/**
 * @summary Request a presigned URL for file upload
 */

export const RequestUploadUrlBody = zod.object({
  name: zod.string().min(1),
  size: zod.number().min(1),
  contentType: zod.string().min(1),
});

export const RequestUploadUrlResponse = zod.object({
  uploadURL: zod.string().url(),
  objectPath: zod.string(),
  metadata: zod
    .object({
      name: zod.string().min(1),
      size: zod.number().min(1),
      contentType: zod.string().min(1),
    })
    .optional(),
});

/**
 * @summary List all services
 */
export const ListServicesResponseItem = zod.object({
  id: zod.number(),
  categoryId: zod.number().nullish(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  imageUrl: zod.string().nullish(),
  price: zod.string().nullish(),
  isAvailable: zod.boolean(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});
export const ListServicesResponse = zod.array(ListServicesResponseItem);

/**
 * @summary Create a service (admin)
 */
export const CreateServiceBody = zod.object({
  categoryId: zod.number().nullish(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  imageUrl: zod.string().nullish(),
  price: zod.string().nullish(),
  isAvailable: zod.boolean().optional(),
  sortOrder: zod.number().optional(),
});

/**
 * @summary Get service by ID
 */
export const GetServiceParams = zod.object({
  id: zod.coerce.number(),
});

export const GetServiceResponse = zod.object({
  id: zod.number(),
  categoryId: zod.number().nullish(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  imageUrl: zod.string().nullish(),
  price: zod.string().nullish(),
  isAvailable: zod.boolean(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});

/**
 * @summary Update service (admin)
 */
export const UpdateServiceParams = zod.object({
  id: zod.coerce.number(),
});

export const UpdateServiceBody = zod.object({
  categoryId: zod.number().nullish(),
  nameAr: zod.string().optional(),
  nameEn: zod.string().optional(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  imageUrl: zod.string().nullish(),
  price: zod.string().nullish(),
  isAvailable: zod.boolean().optional(),
  sortOrder: zod.number().optional(),
});

export const UpdateServiceResponse = zod.object({
  id: zod.number(),
  categoryId: zod.number().nullish(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  descriptionAr: zod.string().nullish(),
  descriptionEn: zod.string().nullish(),
  imageUrl: zod.string().nullish(),
  price: zod.string().nullish(),
  isAvailable: zod.boolean(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});

/**
 * @summary Delete service (admin)
 */
export const DeleteServiceParams = zod.object({
  id: zod.coerce.number(),
});

/**
 * @summary List service categories
 */
export const ListServiceCategoriesResponseItem = zod.object({
  id: zod.number(),
  nameAr: zod.string(),
  nameEn: zod.string(),
  sortOrder: zod.number(),
  createdAt: zod.coerce.date(),
});
export const ListServiceCategoriesResponse = zod.array(
  ListServiceCategoriesResponseItem,
);

/**
 * @summary List conversations for current user
 */
export const ListConversationsResponseItem = zod.object({
  id: zod.number(),
  nameAr: zod.string().nullish(),
  nameEn: zod.string().nullish(),
  isGroup: zod.boolean(),
  createdBy: zod.number(),
  participants: zod.array(
    zod.object({
      id: zod.number(),
      username: zod.string(),
      displayNameAr: zod.string().nullish(),
      displayNameEn: zod.string().nullish(),
      avatarUrl: zod.string().nullish(),
      isAdmin: zod.boolean(),
    }),
  ),
  lastMessage: zod
    .object({
      id: zod.number(),
      conversationId: zod.number(),
      senderId: zod.number(),
      content: zod.string(),
      sender: zod.object({
        id: zod.number(),
        username: zod.string(),
        displayNameAr: zod.string().nullish(),
        displayNameEn: zod.string().nullish(),
        avatarUrl: zod.string().nullish(),
        isAdmin: zod.boolean(),
      }),
      createdAt: zod.coerce.date(),
      updatedAt: zod.coerce.date(),
    })
    .nullish(),
  unreadCount: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});
export const ListConversationsResponse = zod.array(
  ListConversationsResponseItem,
);

/**
 * @summary Create a conversation
 */
export const CreateConversationBody = zod.object({
  participantIds: zod.array(zod.number()),
  nameAr: zod.string().nullish(),
  nameEn: zod.string().nullish(),
  isGroup: zod.boolean().optional(),
});

/**
 * @summary Get conversation by ID
 */
export const GetConversationParams = zod.object({
  id: zod.coerce.number(),
});

export const GetConversationResponse = zod.object({
  id: zod.number(),
  nameAr: zod.string().nullish(),
  nameEn: zod.string().nullish(),
  isGroup: zod.boolean(),
  createdBy: zod.number(),
  participants: zod.array(
    zod.object({
      id: zod.number(),
      username: zod.string(),
      displayNameAr: zod.string().nullish(),
      displayNameEn: zod.string().nullish(),
      avatarUrl: zod.string().nullish(),
      isAdmin: zod.boolean(),
    }),
  ),
  lastMessage: zod
    .object({
      id: zod.number(),
      conversationId: zod.number(),
      senderId: zod.number(),
      content: zod.string(),
      sender: zod.object({
        id: zod.number(),
        username: zod.string(),
        displayNameAr: zod.string().nullish(),
        displayNameEn: zod.string().nullish(),
        avatarUrl: zod.string().nullish(),
        isAdmin: zod.boolean(),
      }),
      createdAt: zod.coerce.date(),
      updatedAt: zod.coerce.date(),
    })
    .nullish(),
  unreadCount: zod.number(),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});

/**
 * @summary List messages in a conversation
 */
export const ListMessagesParams = zod.object({
  id: zod.coerce.number(),
});

export const ListMessagesResponseItem = zod.object({
  id: zod.number(),
  conversationId: zod.number(),
  senderId: zod.number(),
  content: zod.string(),
  sender: zod.object({
    id: zod.number(),
    username: zod.string(),
    displayNameAr: zod.string().nullish(),
    displayNameEn: zod.string().nullish(),
    avatarUrl: zod.string().nullish(),
    isAdmin: zod.boolean(),
  }),
  createdAt: zod.coerce.date(),
  updatedAt: zod.coerce.date(),
});
export const ListMessagesResponse = zod.array(ListMessagesResponseItem);

/**
 * @summary Send a message
 */
export const SendMessageParams = zod.object({
  id: zod.coerce.number(),
});

export const SendMessageBody = zod.object({
  content: zod.string(),
});

/**
 * @summary Mark all messages in conversation as read
 */
export const MarkConversationReadParams = zod.object({
  id: zod.coerce.number(),
});

export const MarkConversationReadResponse = zod.object({
  success: zod.boolean(),
});

/**
 * @summary List notifications for current user
 */
export const ListNotificationsResponseItem = zod.object({
  id: zod.number(),
  userId: zod.number(),
  titleAr: zod.string(),
  titleEn: zod.string(),
  bodyAr: zod.string().nullish(),
  bodyEn: zod.string().nullish(),
  type: zod.string(),
  isRead: zod.boolean(),
  relatedId: zod.number().nullish(),
  relatedType: zod.string().nullish(),
  createdAt: zod.coerce.date(),
});
export const ListNotificationsResponse = zod.array(
  ListNotificationsResponseItem,
);

/**
 * @summary Mark notification as read
 */
export const MarkNotificationReadParams = zod.object({
  id: zod.coerce.number(),
});

export const MarkNotificationReadResponse = zod.object({
  id: zod.number(),
  userId: zod.number(),
  titleAr: zod.string(),
  titleEn: zod.string(),
  bodyAr: zod.string().nullish(),
  bodyEn: zod.string().nullish(),
  type: zod.string(),
  isRead: zod.boolean(),
  relatedId: zod.number().nullish(),
  relatedType: zod.string().nullish(),
  createdAt: zod.coerce.date(),
});

/**
 * @summary Mark all notifications as read
 */
export const MarkAllNotificationsReadResponse = zod.object({
  success: zod.boolean(),
});

/**
 * @summary List all users (admin)
 */
export const ListUsersResponseItem = zod.object({
  id: zod.number(),
  username: zod.string(),
  email: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod.string(),
  avatarUrl: zod.string().nullish(),
  isActive: zod.boolean(),
  roles: zod.array(zod.string()),
  createdAt: zod.coerce.date(),
});
export const ListUsersResponse = zod.array(ListUsersResponseItem);

/**
 * @summary Create a user (admin)
 */
export const createUserBodyPreferredLanguageDefault = `ar`;

export const CreateUserBody = zod.object({
  username: zod.string(),
  email: zod.string(),
  password: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod
    .string()
    .default(createUserBodyPreferredLanguageDefault),
});

/**
 * @summary Get user by ID (admin)
 */
export const GetUserParams = zod.object({
  id: zod.coerce.number(),
});

export const GetUserResponse = zod.object({
  id: zod.number(),
  username: zod.string(),
  email: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod.string(),
  avatarUrl: zod.string().nullish(),
  isActive: zod.boolean(),
  roles: zod.array(zod.string()),
  createdAt: zod.coerce.date(),
});

/**
 * @summary Update user (admin)
 */
export const UpdateUserParams = zod.object({
  id: zod.coerce.number(),
});

export const UpdateUserBody = zod.object({
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  isActive: zod.boolean().optional(),
  preferredLanguage: zod.string().optional(),
});

export const UpdateUserResponse = zod.object({
  id: zod.number(),
  username: zod.string(),
  email: zod.string(),
  displayNameAr: zod.string().nullish(),
  displayNameEn: zod.string().nullish(),
  preferredLanguage: zod.string(),
  avatarUrl: zod.string().nullish(),
  isActive: zod.boolean(),
  roles: zod.array(zod.string()),
  createdAt: zod.coerce.date(),
});

/**
 * @summary Delete user (admin)
 */
export const DeleteUserParams = zod.object({
  id: zod.coerce.number(),
});

/**
 * @summary Get home screen stats
 */
export const GetHomeStatsResponse = zod.object({
  totalApps: zod.number(),
  totalServices: zod.number(),
  unreadNotifications: zod.number(),
  unreadMessages: zod.number(),
  totalUsers: zod.number(),
});

/**
 * @summary Get admin dashboard trend stats
 */
export const GetAdminStatsResponse = zod.object({
  newUsersLast7Days: zod.number(),
  newUsersPrev7Days: zod.number(),
  activeServices: zod.number(),
  inactiveServices: zod.number(),
  signupsByDay: zod.array(
    zod.object({
      date: zod.string(),
      count: zod.number(),
    }),
  ),
});
