Skip to content

Commit

Permalink
Added GTCWales job for QTS & Inductions
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKevJoy committed Dec 12, 2024
1 parent c6a262e commit 58c81db
Show file tree
Hide file tree
Showing 74 changed files with 8,799 additions and 100 deletions.
2,065 changes: 1,974 additions & 91 deletions TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Models/GeneratedCode.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,134 @@ public enum dfeta_initialteachertraining_StatusCode
Inactive = 2,
}

[System.Runtime.Serialization.DataContractAttribute()]
public enum dfeta_IntegrationInterface
{

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Appropriate Body Import", 7)]
AppropriateBodyImport = 389040001,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Capita Export Amend", 10)]
CapitaExportAmend = 389040004,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Capita Export New", 9)]
CapitaExportNew = 389040003,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Capita Import", 8)]
CapitaImport = 389040002,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("DMS Export QTS Date", 15)]
DMSExportQTSDate = 389040009,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("DMS Export TRN", 14)]
DMSExportTRN = 389040008,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("DMS Import", 13)]
DMSImport = 389040007,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("DMS Import TTR1", 0)]
DMSImportTTR1 = 389040014,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("DMS Import TTR4\\TTR5", 1)]
DMSImportTTR4TTR5 = 389040015,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Edubase", 11)]
Edubase = 389040005,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Edubase Links", 12)]
EdubaseLinks = 389040006,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("GTC Wales Import", 4)]
GTCWalesImport = 389040011,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("HESA Export", 3)]
HESAExport = 389040012,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("HESA Import", 6)]
HESAImport = 389040000,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("ITTPUpdate", 2)]
ITTPUpdate = 389040013,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("NPQ Export", 17, "#0000ff")]
NPQExport = 389040017,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("NPQ Import", 16, "#0000ff")]
NPQImport = 389040016,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Training Provider Import", 5)]
TrainingProviderImport = 389040010,
}

[System.Runtime.Serialization.DataContractAttribute()]
public enum dfeta_integrationtransaction_StatusCode
{

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Active", 0)]
Active = 1,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Inactive", 1)]
Inactive = 2,
}

[System.Runtime.Serialization.DataContractAttribute()]
public enum dfeta_integrationtransactionrecord_dfeta_DuplicateStatus
{

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Duplicate", 0)]
Duplicate = 389040000,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Duplicate Resolved", 1)]
DuplicateResolved = 389040002,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Not Applicable", 3)]
NotApplicable = 389040003,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Third Party Notified", 2)]
ThirdPartyNotified = 389040001,
}

[System.Runtime.Serialization.DataContractAttribute()]
public enum dfeta_integrationtransactionrecord_StatusCode
{

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Fail", 1)]
Fail = 389040000,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Inactive", 2)]
Inactive = 2,

[System.Runtime.Serialization.EnumMemberAttribute()]
[OptionSetMetadataAttribute("Success", 0)]
Success = 1,
}

[System.Runtime.Serialization.DataContractAttribute()]
public enum dfeta_ITTProgrammeType
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateHeQualificationTransactionalQuery : ICrmTransactionalQuery<Guid>
{
public required Guid Id { get; init; }
public required Guid ContactId { get; init; }
public required Guid? HECountryId { get; init; }
public required string? HECourseLength { get; init; }
public required Guid? HEEstablishmentId { get; init; }
public required Guid? HEQualificationId { get; init; }
public required dfeta_classdivision? HEClassDivision { get; init; }
public required Guid? HESubject1id { get; init; }
public required Guid? HESubject2id { get; init; }
public required Guid? HESubject3id { get; init; }
public required dfeta_qualification_dfeta_Type? Type { get; init; }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateInductionPeriodTransactionalQuery : ICrmTransactionalQuery<Guid>
{
public required Guid Id { get; init; }
public required Guid InductionId { get; init; }
public required Guid? AppropriateBodyId { get; init; }
public required DateTime? InductionStartDate { get; init; }
public required DateTime? InductionEndDate { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateInductionTransactionalQuery : ICrmTransactionalQuery<Guid>
{
public required Guid Id { get; init; }
public required Guid ContactId { get; init; }
public required DateTime? StartDate { get; init; }
public required DateTime? CompletionDate { get; init; }
public required dfeta_InductionStatus InductionStatus { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateInitialTeacherTrainingTransactionalQuery : ICrmTransactionalQuery<Guid>
{
public Guid Id { get; set; }
public required Guid ContactId { get; init; }
public required Guid? CountryId { get; init; }
public required Guid? ITTQualificationId { get; init; }
public required dfeta_ITTResult Result { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateIntegrationTransactionQuery : ICrmQuery<Guid>
{
public required int TypeId { get; init; }
public required DateTime StartDate { get; init; }
public required string? FileName { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateIntegrationTransactionRecordTransactionalQuery : ICrmTransactionalQuery<Guid>
{
public required Guid IntegrationTransactionId { get; init; }
public required string? Reference { get; init; }
public required Guid? ContactId { get; init; }
public required Guid? InitialTeacherTrainingId { get; init; }
public required Guid? QualificationId { get; init; }
public required Guid? InductionId { get; init; }
public required Guid? InductionPeriodId { get; init; }
public required dfeta_integrationtransactionrecord_dfeta_DuplicateStatus? DuplicateStatus { get; init; }
public required dfeta_integrationtransactionrecord_StatusCode? StatusCode { get; init; }
public required string? FailureMessage { get; init; }
public required string? RowData { get; init; }
public required string? FileName { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateQtsRegistrationTransactionalQuery : ICrmTransactionalQuery<Guid>
{
public required Guid Id { get; init; }
public required Guid ContactId { get; init; }
public required Guid TeacherStatusId { get; init; }
public required DateTime? QtsDate { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record CreateTaskTransactionalQuery : ICrmTransactionalQuery<Guid>
{
public required Guid ContactId { get; init; }
public required string Category { get; init; }
public required string Subject { get; init; }
public required string Description { get; init; }
public required DateTime? ScheduledEnd { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record FindActiveOrganisationsByAccountNumberQuery(string AccountNumber) : ICrmQuery<Account[]>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record GetActiveInitialTeacherTrainingsByContactIdQuery(Guid ContactId) :
ICrmQuery<dfeta_initialteachertraining[]>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record GetAllActiveIttQualificationsQuery : ICrmQuery<dfeta_ittqualification[]>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using TeachingRecordSystem.Core.Dqt;

public record GetAllActiveIttSubjectsQuery : ICrmQuery<dfeta_ittsubject[]>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record GetAllCountriesQuery : ICrmQuery<dfeta_country[]>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record UpdateInductionPeriodTransactionalQuery : ICrmTransactionalQuery<bool>
{
public required Guid InductionPeriodId { get; init; }
public required Guid? AppropriateBodyId { get; init; }
public required DateTime? InductionStartDate { get; init; }
public required DateTime? InductionEndDate { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record UpdateInductionTransactionalQuery : ICrmTransactionalQuery<bool>
{
public required Guid InductionId { get; init; }
public required DateTime? CompletionDate { get; init; }
public required dfeta_InductionStatus InductionStatus { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record UpdateIntegrationTransactionRecordTransactionalQuery : ICrmTransactionalQuery<bool>
{
public required Guid IntegrationTransactionRecordId { get; init; }
public required Guid IntegrationTransactionId { get; init; }
public required string? Reference { get; init; }
public required Guid? PersonId { get; init; }
public required Guid? InitialTeacherTrainingId { get; init; }
public required Guid? QualificationId { get; init; }
public required Guid? InductionId { get; init; }
public required Guid? InductionPeriodId { get; init; }
public required dfeta_integrationtransactionrecord_dfeta_DuplicateStatus? DuplicateStatus { get; init; }
public required dfeta_integrationtransactionrecord_StatusCode? StatusCode { get; init; }
public required string? FailureMessage { get; init; }
public required string? RowData { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace TeachingRecordSystem.Core.Dqt.Queries;

public record UpdateIntegrationTransactionTransactionalQuery : ICrmTransactionalQuery<bool>
{
public required Guid IntegrationTransactionId { get; init; }
public required DateTime? EndDate { get; init; }
public required int? TotalCount { get; init; }
public required int? SuccessCount { get; init; }
public required int? DuplicateCount { get; init; }
public required int? FailureCount { get; init; }
public required string? FailureMessage { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.Xrm.Sdk.Messages;
using TeachingRecordSystem.Core.Dqt.Queries;

namespace TeachingRecordSystem.Core.Dqt.QueryHandlers;

public class CreateHeQualificationTransactionalHandler : ICrmTransactionalQueryHandler<CreateHeQualificationTransactionalQuery, Guid>
{
public Func<Guid> AppendQuery(CreateHeQualificationTransactionalQuery query, RequestBuilder requestBuilder)
{
var createResponse = requestBuilder.AddRequest<CreateResponse>(new CreateRequest()
{
Target = new dfeta_qualification()
{
Id = query.Id,
dfeta_HE_CountryId = query.HECountryId?.ToEntityReference(dfeta_country.EntityLogicalName),
dfeta_HE_ClassDivision = query.HEClassDivision,
dfeta_HE_HEQualificationId = query.HEQualificationId?.ToEntityReference(dfeta_hequalification.EntityLogicalName),
dfeta_Type = query.Type,
dfeta_PersonId = query.ContactId.ToEntityReference(Contact.EntityLogicalName),
dfeta_HE_EstablishmentId = query.HEEstablishmentId?.ToEntityReference(Account.EntityLogicalName),
dfeta_HE_HESubject1Id = query.HESubject1id?.ToEntityReference(dfeta_hesubject.EntityLogicalName),
dfeta_HE_HESubject2Id = query.HESubject2id?.ToEntityReference(dfeta_hesubject.EntityLogicalName),
dfeta_HE_HESubject3Id = query.HESubject3id?.ToEntityReference(dfeta_hesubject.EntityLogicalName),
}
});
return () => createResponse.GetResponse().id;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.Xrm.Sdk.Messages;
using TeachingRecordSystem.Core.Dqt.Queries;

namespace TeachingRecordSystem.Core.Dqt.QueryHandlers;

public class CreateInductionPeriodTransactionalHandler : ICrmTransactionalQueryHandler<CreateInductionPeriodTransactionalQuery, Guid>
{
public Func<Guid> AppendQuery(CreateInductionPeriodTransactionalQuery query, RequestBuilder requestBuilder)
{
var createResponse = requestBuilder.AddRequest<CreateResponse>(new CreateRequest()
{
Target = new dfeta_inductionperiod()
{
Id = query.Id,
dfeta_InductionId = query.InductionId.ToEntityReference(dfeta_induction.EntityLogicalName),
dfeta_AppropriateBodyId = query.AppropriateBodyId?.ToEntityReference(Account.EntityLogicalName),
dfeta_StartDate = query.InductionStartDate,
dfeta_EndDate = query.InductionEndDate,
}
});

return () => createResponse.GetResponse().id;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Microsoft.Xrm.Sdk.Messages;
using TeachingRecordSystem.Core.Dqt.Queries;

namespace TeachingRecordSystem.Core.Dqt.QueryHandlers;

public class CreateInductionTransactionalHandler : ICrmTransactionalQueryHandler<CreateInductionTransactionalQuery, Guid>
{
public Func<Guid> AppendQuery(CreateInductionTransactionalQuery query, RequestBuilder requestBuilder)
{
var createResponse = requestBuilder.AddRequest<CreateResponse>(new CreateRequest()
{
Target = new dfeta_induction()
{
Id = query.Id,
dfeta_PersonId = query.ContactId.ToEntityReference(Contact.EntityLogicalName),
dfeta_StartDate = query.StartDate,
dfeta_CompletionDate = query.CompletionDate,
dfeta_InductionStatus = query.InductionStatus,
}
});
return () => createResponse.GetResponse().id;
}
}
Loading

0 comments on commit 58c81db

Please sign in to comment.