using System;
using System.Collections.Generic;
using System.ServiceModel;

using BS.Shared.DataContracts;

namespace BeWo.Service.ServiceContracts
{
    [ServiceContract]
    public interface IResourceService
    {
        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        void DeactivateResource(long pOid, long pVersion);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        void DeactivateResources(Dictionary<long, long> pOid2Version);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        void DeleteBooking(long pOid, long pVersion);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        void DeleteBookings(Dictionary<long, long> pOid2Version);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        void DeleteResource(long pOid, long pVersion);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        void DeleteResources(Dictionary<long, long> pOid2Version);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<BookingSequenceDC> GetAllBookings(DateTime pStartSpan, DateTime pEndSpan);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<BookingSequenceDC> GetAllBookingsByResource(long pResourceOid, DateTime pStartSpan, DateTime pEndSpan);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<ResourceDC> GetAllResources();

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<long> InsertNewBookings(List<BookingSequenceDC> pBookings);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<long> InsertNewResources(List<ResourceDC> pResource);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<long> UpdateBookings(List<BookingSequenceDC> pBookings);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<long> UpdateResources(List<ResourceDC> pResource);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<BookingSequenceDC> UpdateBookingSequenceDCs(List<BookingSequenceDC> pBookings);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<ResourceDC> UpdateResourceDCs(List<ResourceDC> pResource);

        [FaultContract(typeof(BeWoFault))]
        [OperationContract]
        List<BookingSequenceDC> InsertNewBookingSequenceDCs(IEnumerable<BookingSequenceDC> pBookings);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
		List<ResourceAppointmentDC> UpdateResourceAppointments(List<ResourceAppointmentDC> pResourceAppointments);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
		List<ResourceAppointmentDC> InsertNewResourceAppointments(IEnumerable<ResourceAppointmentDC> pResourceAppointments);

	    [FaultContract(typeof (BeWoFault))]
	    [OperationContract]
		void DeleteResourceAppointments(Dictionary<long, long> pOid2Version);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<ResourceAppointmentDC> GetAllResourceAppointments();

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<ResourceAppointmentDC> GetResourceAppointmentsById(IEnumerable<long> pOids);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<ResourceAppointmentDC> LoadPossibleDuplicates(string pRecurrenceInfo);

	    [FaultContract(typeof (BeWoFault))]
	    [OperationContract]
	    List<SchedulerAppointmentDC> GetAllSchedulerAppointments();

        [FaultContract(typeof (BeWoFault))]
	    [OperationContract]
        SchedulerAppointmentDC GetSchedulerAppointmentByid(long oid);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    void DeleteSchedulerAppointments(Dictionary<long, long> pOid2Version);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
		List<SchedulerAppointmentDC> InsertSchedulerAppointments(IList<SchedulerAppointmentDC> pNewSchedulerAppointments);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<SchedulerAppointmentDC> UpdateSchedulerAppointments(List<SchedulerAppointmentDC> pNewSchedulerAppointments);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<SchedulerAppointmentDC> GetSchedulerAppointmentsById(IEnumerable<long> pOids);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    void DeactivateSchedulerAppointments(Dictionary<long, long> pOid2Version);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    Dictionary<ValueListEntryDC, List<ResourceDC>> GetAllCategories2ResourcesInDictionary();

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<SchedulerAppointmentDC> GetAllActiveSchedulerAppointments();

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<SchedulerAppointmentDC> GetAllOpenAppointmentsForEmployee(long pEmployeeOid);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<Employee2SchedulerAppointmentDC> InsertEmployee2SchedulerAppointments(IEnumerable<Employee2SchedulerAppointmentDC> pEmployee2SchedulerAppointments);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<Employee2SchedulerAppointmentDC> UpdateEmployee2SchedulerAppointments(List<Employee2SchedulerAppointmentDC> pEmployee2SchedulerAppointments);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    void DeleteEmployee2SchedulerAppointments(Dictionary<long, long> pOid2Version);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<SchedulerAppointmentDC> GetAllActiveAndNotDeclinedForEmployeeAppointments(long pEmployeeOid);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
		bool OverlappingAppointmentsExist(DateTime start, DateTime end, List<long> employees, List<long> customers, List<long> resources, long originator, long? appointmentOid, string recurrenceId = "", int ocurrenceIndex = 0);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
		List<SchedulerAppointmentDC> DeactivateSchedulerAppointmentsForSync(Dictionary<long, long> pOid2Version);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
		List<SchedulerAppointmentDC> GetAllActiveAppointmentsForEmployeeInInterval(DateTime start, DateTime end, long pEmployeeOid);

		[FaultContract(typeof(BeWoFault))]
		[OperationContract]
	    List<SchedulerAppointmentDC> GetAllActiveAppointmentsForEmployeeInInterval2(DateTime start, DateTime end, long pEmployeeOid, bool pHasRightToSeeAllEmployeeAppointments);
    }
}