Skip to content

Commit

Permalink
Integrated changes in codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
simpat-jesus committed Oct 28, 2023
1 parent 4cd2a33 commit 94957f4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ BEGIN

INSERT [dbo].[ResourceClaims] ([ResourceName], [ClaimName], [ParentResourceClaimId])
VALUES (N'educationOrganizationNetworkAssociation', N'http://ed-fi.org/ods/identity/claims/educationOrganizationNetworkAssociation',
@educationOrganizationsResourceClaimId);
@relationshipBasedDataResourceClaimId);

END

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ begin

IF NOT EXISTS(SELECT 1 FROM dbo.ResourceClaims WHERE ResourceName ='educationOrganizationNetworkAssociation') THEN
insert into dbo.ResourceClaims (ResourceName, ClaimName, ParentResourceClaimId)
values ('educationOrganizationNetworkAssociation', 'http://ed-fi.org/ods/identity/claims/educationOrganizationNetworkAssociation', educationOrganizationsResourceClaimId);
values ('educationOrganizationNetworkAssociation', 'http://ed-fi.org/ods/identity/claims/educationOrganizationNetworkAssociation', relationshipBasedDataResourceClaimId);
END IF;

IF NOT EXISTS(SELECT 1 FROM dbo.ResourceClaims WHERE ResourceName ='educationOrganizationPeerAssociation') THEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ BEGIN

INSERT [dbo].[ResourceClaims] ([ResourceName], [ClaimName], [ParentResourceClaimId])
VALUES (N'educationOrganizationNetworkAssociation', N'http://ed-fi.org/ods/identity/claims/educationOrganizationNetworkAssociation',
@educationOrganizationsResourceClaimId);
@relationshipBasedDataResourceClaimId);

END

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ begin

IF NOT EXISTS(SELECT 1 FROM dbo.ResourceClaims WHERE ResourceName ='educationOrganizationNetworkAssociation') THEN
insert into dbo.ResourceClaims (ResourceName, ClaimName, ParentResourceClaimId)
values ('educationOrganizationNetworkAssociation', 'http://ed-fi.org/ods/identity/claims/educationOrganizationNetworkAssociation', educationOrganizationsResourceClaimId);
values ('educationOrganizationNetworkAssociation', 'http://ed-fi.org/ods/identity/claims/educationOrganizationNetworkAssociation', relationshipBasedDataResourceClaimId);
END IF;

IF NOT EXISTS(SELECT 1 FROM dbo.ResourceClaims WHERE ResourceName ='educationOrganizationPeerAssociation') THEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace EdFi.Ods.CodeGen.Generators
public class ResourceClaimMetadata : GeneratorBase
{
private IPersonEntitySpecification _personEntitySpecification;
private IEducationOrganizationEntitySpecification _educationOrganizationEntitySpecification;

protected override object Build()
{
Expand All @@ -25,6 +26,11 @@ protected override object Build()
new PersonTypesProvider(
new SuppliedDomainModelProvider(domainModel)));

_educationOrganizationEntitySpecification =
new EducationOrganizationEntitySpecification(
new EducationOrganizationTypesProvider(
new SuppliedDomainModelProvider(domainModel)));

var orderedAggregates = domainModel
.Entities
.Where(x => x.IsAggregateRoot && !x.IsAbstract)
Expand Down Expand Up @@ -58,7 +64,7 @@ private string GetParentResource(Entity entity)
: "systemDescriptors";
}

if (EducationOrganizationEntitySpecification.IsEducationOrganizationEntity(resourceName))
if (_educationOrganizationEntitySpecification.IsEducationOrganizationEntity(resourceName))
{
return "educationOrganizations";
}
Expand Down

0 comments on commit 94957f4

Please sign in to comment.