/*
 * Copyright (C) 2026 Fluxer Contributors
 *
 * This file is part of Fluxer.
 *
 * Fluxer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Fluxer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
 */

import {AuditLogActionType} from '@fluxer/constants/src/AuditLogActionType';
import {createInt32EnumType, withOpenApiType} from '@fluxer/schema/src/primitives/SchemaPrimitives';

export const AuditLogActionTypeSchema = withOpenApiType(
	createInt32EnumType(
		[
			[AuditLogActionType.GUILD_UPDATE, 'GUILD_UPDATE', 'Guild settings were updated'],
			[AuditLogActionType.CHANNEL_CREATE, 'CHANNEL_CREATE', 'Channel was created'],
			[AuditLogActionType.CHANNEL_UPDATE, 'CHANNEL_UPDATE', 'Channel was updated'],
			[AuditLogActionType.CHANNEL_DELETE, 'CHANNEL_DELETE', 'Channel was deleted'],
			[AuditLogActionType.CHANNEL_OVERWRITE_CREATE, 'CHANNEL_OVERWRITE_CREATE', 'Permission overwrite was created'],
			[AuditLogActionType.CHANNEL_OVERWRITE_UPDATE, 'CHANNEL_OVERWRITE_UPDATE', 'Permission overwrite was updated'],
			[AuditLogActionType.CHANNEL_OVERWRITE_DELETE, 'CHANNEL_OVERWRITE_DELETE', 'Permission overwrite was deleted'],
			[AuditLogActionType.MEMBER_KICK, 'MEMBER_KICK', 'Member was kicked'],
			[AuditLogActionType.MEMBER_PRUNE, 'MEMBER_PRUNE', 'Members were pruned'],
			[AuditLogActionType.MEMBER_BAN_ADD, 'MEMBER_BAN_ADD', 'Member was banned'],
			[AuditLogActionType.MEMBER_BAN_REMOVE, 'MEMBER_BAN_REMOVE', 'Member ban was removed'],
			[AuditLogActionType.MEMBER_UPDATE, 'MEMBER_UPDATE', 'Member was updated'],
			[AuditLogActionType.MEMBER_ROLE_UPDATE, 'MEMBER_ROLE_UPDATE', 'Member roles were updated'],
			[AuditLogActionType.MEMBER_MOVE, 'MEMBER_MOVE', 'Member was moved to a different voice channel'],
			[AuditLogActionType.MEMBER_DISCONNECT, 'MEMBER_DISCONNECT', 'Member was disconnected from a voice channel'],
			[AuditLogActionType.BOT_ADD, 'BOT_ADD', 'Bot was added to the guild'],
			[AuditLogActionType.ROLE_CREATE, 'ROLE_CREATE', 'Role was created'],
			[AuditLogActionType.ROLE_UPDATE, 'ROLE_UPDATE', 'Role was updated'],
			[AuditLogActionType.ROLE_DELETE, 'ROLE_DELETE', 'Role was deleted'],
			[AuditLogActionType.INVITE_CREATE, 'INVITE_CREATE', 'Invite was created'],
			[AuditLogActionType.INVITE_UPDATE, 'INVITE_UPDATE', 'Invite was updated'],
			[AuditLogActionType.INVITE_DELETE, 'INVITE_DELETE', 'Invite was deleted'],
			[AuditLogActionType.WEBHOOK_CREATE, 'WEBHOOK_CREATE', 'Webhook was created'],
			[AuditLogActionType.WEBHOOK_UPDATE, 'WEBHOOK_UPDATE', 'Webhook was updated'],
			[AuditLogActionType.WEBHOOK_DELETE, 'WEBHOOK_DELETE', 'Webhook was deleted'],
			[AuditLogActionType.EMOJI_CREATE, 'EMOJI_CREATE', 'Emoji was created'],
			[AuditLogActionType.EMOJI_UPDATE, 'EMOJI_UPDATE', 'Emoji was updated'],
			[AuditLogActionType.EMOJI_DELETE, 'EMOJI_DELETE', 'Emoji was deleted'],
			[AuditLogActionType.STICKER_CREATE, 'STICKER_CREATE', 'Sticker was created'],
			[AuditLogActionType.STICKER_UPDATE, 'STICKER_UPDATE', 'Sticker was updated'],
			[AuditLogActionType.STICKER_DELETE, 'STICKER_DELETE', 'Sticker was deleted'],
			[AuditLogActionType.MESSAGE_DELETE, 'MESSAGE_DELETE', 'Message was deleted'],
			[AuditLogActionType.MESSAGE_BULK_DELETE, 'MESSAGE_BULK_DELETE', 'Messages were bulk deleted'],
			[AuditLogActionType.MESSAGE_PIN, 'MESSAGE_PIN', 'Message was pinned'],
			[AuditLogActionType.MESSAGE_UNPIN, 'MESSAGE_UNPIN', 'Message was unpinned'],
		],
		'The type of action that occurred',
		'AuditLogActionType',
	),
	'AuditLogActionType',
);
