/**
 * qsfera Android client application
 *
 * @author Juan Carlos Garrote Gascón
 *
 * Copyright (C) 2023 ownCloud GmbH.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2,
 * as published by the Free Software Foundation.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package eu.qsfera.android.testutil

import eu.qsfera.android.domain.automaticuploads.model.UploadBehavior
import eu.qsfera.android.domain.transfers.model.OCTransfer
import eu.qsfera.android.domain.transfers.model.TransferStatus
import eu.qsfera.android.domain.transfers.model.UploadEnqueuedBy
import java.io.File

private fun absolutePath(vararg parts: String): String =
    parts.joinToString(File.separator, prefix = File.separator)

val OC_TRANSFER = OCTransfer(
    id = 0L,
    localPath = absolutePath("local", "path"),
    remotePath = absolutePath("remote", "path"),
    accountName = OC_ACCOUNT_NAME,
    fileSize = 1024L,
    status = TransferStatus.TRANSFER_IN_PROGRESS,
    localBehaviour = UploadBehavior.MOVE,
    forceOverwrite = true,
    createdBy = UploadEnqueuedBy.ENQUEUED_BY_USER,
    sourcePath = absolutePath("source", "path"),
)

val OC_FINISHED_TRANSFER = OC_TRANSFER.copy(
    status = TransferStatus.TRANSFER_SUCCEEDED
)

val OC_FAILED_TRANSFER = OC_TRANSFER.copy(
    status = TransferStatus.TRANSFER_FAILED
)

val OC_PENDING_TRANSFER = OC_TRANSFER.copy(
    status = TransferStatus.TRANSFER_QUEUED
)
