using e_suite.API.Common.models;
using e_suite.Database.Audit;
using e_suite.Database.Core.Tables.CustomFields;
using e_suite.Database.Core.Tables.Domain;
using e_suite.Database.Core.Tables.Forms;
using e_suite.Database.Core.Tables.Glossaries;
using eSuite.Core.Miscellaneous;
using Sequence = e_suite.Database.Core.Tables.Sequences.Sequence;

namespace e_suite.API.Common.repository;

public interface ICustomFieldReferenceObjectRepository
{
    Task<Sequence?> GetSequenceByGeneralRefIdAsync(IGeneralIdRef idRef, CancellationToken cancellationToken);

    Task<FormTemplate?> GetFormTemplateByGeneralRefIdAsync(IGeneralIdRef idRef, CancellationToken cancellationToken);

    Task<Glossary?> GetGlossaryByGeneralRefIdAsync(IGeneralIdRef idRef, CancellationToken cancellationToken);

    Task<Domain?> GetDomainByGeneralRefIdAsync(IGeneralIdRef idRef, CancellationToken cancellationToken);

    Task CreateFormReferenceAsync(AuditUserDetails auditUserDetails, long customFieldId, long formId, CancellationToken cancellationToken);
    Task CreateGlossaryReferenceAsync(AuditUserDetails auditUserDetails, long customField, long formId, CancellationToken cancellationToken);
    Task CreateDomainReferenceAsync(AuditUserDetails auditUserDetails, long customField, long formId, CancellationToken cancellationToken);
    Task CreateSequenceReferenceAsync(AuditUserDetails auditUserDetails, long customField, long formId, CancellationToken cancellationToken);

    Task DeleteFormReferenceAsync(AuditUserDetails auditUserDetails, long customFieldId, CancellationToken cancellationToken);
    Task DeleteGlossaryReferenceAsync(AuditUserDetails auditUserDetails, long customField, CancellationToken cancellationToken);
    Task DeleteDomainReferenceAsync(AuditUserDetails auditUserDetails, long customField, CancellationToken cancellationToken);
    Task DeleteSequenceReferenceAsync(AuditUserDetails auditUserDetails, long customFiled, CancellationToken cancellationToken);

    Task EditFormReferenceAsync(AuditUserDetails auditUserDetails,CustomFieldFormTemplate customFieldFormTemplate, CancellationToken cancellationToken);
    Task EditGlossaryReferenceAsync(AuditUserDetails auditUserDetails, CustomFieldGlossary customFieldGlossary, CancellationToken cancellationToken);
    Task EditDomainReferenceAsync(AuditUserDetails auditUserDetails, CustomFieldGlossary customFieldGlossary, CancellationToken cancellationToken);
    Task EditSequenceReferenceAsync(AuditUserDetails auditUserDetails, CustomFieldSequence customFieldSequence, CancellationToken cancellationToken);

    Task<CustomFieldFormTemplate?> GetFormReferenceAsync(long customFieldId, CancellationToken cancellationToken);

    Task<CustomFieldSequence?> GetSequenceReferenceAsync(long customFieldId, CancellationToken cancellationToken);

    Task<CustomFieldGlossary?> GetGlossaryReferenceAsync(long cusotmFieldId, CancellationToken cancellationToken);
    Task<CustomFieldNumber?> GetNumbersParametersAsync(long customFieldId, CancellationToken cancellationToken);
    Task CreateCustomFieldNumbersAsync(AuditUserDetails auditUserDetails, CustomFieldNumber customFieldNumber, CancellationToken cancellationToken);
    Task EditCustomFieldNumbersAsync(AuditUserDetails auditUserDetails, CustomFieldNumber customFieldNumber, NumberFieldParameters numberFieldParameters, CancellationToken cancellationToken);
    Task DeleteCustomFieldNumbersAsync(AuditUserDetails auditUserDetails, CustomFieldNumber customFieldNumber, CancellationToken cancellationToken);

    Task<CustomFieldText?> GetTextsParametersAsync(long customFieldId, CancellationToken cancellationToken);
    Task CreateCustomFieldTextsAsync(AuditUserDetails auditUserDetails, CustomFieldText customFieldText, CancellationToken cancellationToken);
    Task EditCustomFieldTextsAsync(AuditUserDetails auditUserDetails, CustomFieldText customFieldText, TextFieldParameters textFieldParameters, CancellationToken cancellationToken);
    Task DeleteCustomFieldTextsAsync(AuditUserDetails auditUserDetails, CustomFieldText customFieldText, CancellationToken cancellationToken);
}