package com.rosetta.messenger.domain.chats.usecase

import com.rosetta.messenger.network.AttachmentType
import com.rosetta.messenger.network.MessageAttachment
import javax.inject.Inject

data class CreateFileAttachmentCommand(
    val attachmentId: String,
    val preview: String,
    val blob: String = "",
    val transportTag: String = "",
    val transportServer: String = ""
)

class CreateFileAttachmentUseCase @Inject constructor() {
    operator fun invoke(command: CreateFileAttachmentCommand): MessageAttachment =
        MessageAttachment(
            id = command.attachmentId,
            blob = command.blob,
            type = AttachmentType.FILE,
            preview = command.preview,
            transportTag = command.transportTag,
            transportServer = command.transportServer
        )
}

data class CreateAvatarAttachmentCommand(
    val attachmentId: String,
    val preview: String,
    val blob: String = "",
    val transportTag: String = "",
    val transportServer: String = ""
)

class CreateAvatarAttachmentUseCase @Inject constructor() {
    operator fun invoke(command: CreateAvatarAttachmentCommand): MessageAttachment =
        MessageAttachment(
            id = command.attachmentId,
            blob = command.blob,
            type = AttachmentType.AVATAR,
            preview = command.preview,
            transportTag = command.transportTag,
            transportServer = command.transportServer
        )
}

data class CreateVideoCircleAttachmentCommand(
    val attachmentId: String,
    val preview: String,
    val width: Int,
    val height: Int,
    val blob: String = "",
    val localUri: String = "",
    val transportTag: String = "",
    val transportServer: String = ""
)

class CreateVideoCircleAttachmentUseCase @Inject constructor() {
    operator fun invoke(command: CreateVideoCircleAttachmentCommand): MessageAttachment =
        MessageAttachment(
            id = command.attachmentId,
            blob = command.blob,
            type = AttachmentType.VIDEO_CIRCLE,
            preview = command.preview,
            width = command.width,
            height = command.height,
            localUri = command.localUri,
            transportTag = command.transportTag,
            transportServer = command.transportServer
        )
}
