//
//  AllWorkoutFetchable.swift
//  Werkout_ios
//
//  Created by Trey Tartt on 6/19/23.
//

import Foundation

class AllWorkoutFetchable: Fetchable {
    typealias Response = [Workout]
    var endPoint: String = "/workout/all/"
}

class WorkoutDetailFetchable: Fetchable {
    typealias Response = Workout
    var endPoint: String
        
    init(workoutID: Int) {
        self.endPoint = "/workout/"+String(workoutID)+"/details/"
    }
}

class AllMusclesFetchable: Fetchable {
    typealias Response = [Muscle]
    var endPoint: String = "/muscle/all/"
}

class AllEquipmentFetchable: Fetchable {
    typealias Response = [Equipment]
    var endPoint: String = "/equipment/all/"
}

class AllExerciseFetchable: Fetchable {
    typealias Response = [Exercise]
    var endPoint: String = "/exercise/all/"
}

class CompletedWorkoutFetchable: Fetchable {
    typealias Response = [CompletedWorkout]
    var endPoint: String = "/workout/completed/"
}

class PlannedWorkoutFetchable: Fetchable {
    typealias Response = [PlannedWorkout]
    var endPoint: String = "/workout/planned_workouts/"
}

class CreateWorkoutFetchable: Postable {
    var postableData: [String : Any]?
    var successStatus = 201
    
    typealias Response = Workout
    var endPoint: String = "/workout/create/"
    
    init(postData: [String: Any]) {
        self.postableData = postData
    }
}

class CompleteWorkoutFetchable: Postable {
    var postableData: [String : Any]?
    var successStatus = 201
    
    typealias Response = CompletedWorkoutPOSTReturn
    var endPoint: String = "/workout/complete/"
    
    init(postData: [String: Any]) {
        self.postableData = postData
    }
}

class LoginFetchable: Postable {
    var postableData: [String : Any]?
    var successStatus = 200
    
    typealias Response = RegisteredUser
    var endPoint: String = "/registered_user/login/"
    
    var attachToken: Bool {
        return false
    }
    
    init(postData: [String: Any]) {
        self.postableData = postData
    }
}

class PlanWorkoutFetchable: Postable {
    var postableData: [String : Any]?
    var successStatus = 201
    
    typealias Response = RegisteredUser
    var endPoint: String = "/workout/plan_workout/"
    
    init(postData: [String: Any]) {
        self.postableData = postData
    }
}

class AllNSFWVideosFetchable: Fetchable {
    typealias Response = [NSFWVideo]
    var endPoint: String = "/videos/nsfw_videos/"
}

class RefreshUserInfoFetcable: Fetchable {
    typealias Response = RegisteredUser
    var endPoint: String = "/registered_user/refresh/"
}
