Skip to content

Commit

Permalink
Merge pull request #728 from bcgov/ricander
Browse files Browse the repository at this point in the history
Ricander
  • Loading branch information
ychung-mot authored Oct 21, 2024
2 parents 2517c1b + 0444b23 commit b941c6d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion database/ddl/STR_DSS_Views_Sprint_16.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ left join dss_platform_type dpt on dpt.platform_type = do2.platform_type
left join dss_user_identity dui on dui.user_guid = do2.upd_user_guid
left join dss_organization_contact_person docp on docp.contacted_through_organization_id = do2.organization_id and docp.email_message_type = 'Notice of Takedown' and docp.is_primary = true
left join dss_organization_contact_person docp2 on docp2.contacted_through_organization_id = do2.organization_id and docp2.email_message_type = 'Takedown Request' and docp2.is_primary = true
left join dss_organization_contact_person docp3 on docp3.contacted_through_organization_id = do2.organization_id and docp3.email_message_type = 'Notice of Takedown' and docp.is_primary != true
left join dss_organization_contact_person docp3 on docp3.contacted_through_organization_id = do2.organization_id and docp3.email_message_type = 'Notice of Takedown' and docp3.is_primary != true
left join dss_organization_contact_person docp4 on docp4.contacted_through_organization_id = do2.organization_id and docp4.email_message_type = 'Takedown Request' and docp4.is_primary != true
where do2.organization_type = 'Platform';
10 changes: 10 additions & 0 deletions server/StrDss.Data/Repositories/OrganizationRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ public async Task<DssOrganization> CreatePlatformSubAsync(PlatformSubCreateDto d

await _dbSet.AddAsync(entity);

CreateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.PrimaryNoticeOfTakedownContactEmail, true);
CreateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.SecondaryNoticeOfTakedownContactEmail, false);
CreateContact(entity, EmailMessageTypes.TakedownRequest, dto.PrimaryTakedownRequestContactEmail, true);
CreateContact(entity, EmailMessageTypes.TakedownRequest, dto.SecondaryTakedownRequestContactEmail, false);

return entity;
}

Expand All @@ -283,6 +288,11 @@ public async Task UpdatePlatformSubAsync(PlatformSubUpdateDto dto)
.FirstAsync(x => x.OrganizationId == dto.OrganizationId);

_mapper.Map(dto, entity);

UpdateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.PrimaryNoticeOfTakedownContactEmail, true);
UpdateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.SecondaryNoticeOfTakedownContactEmail, false);
UpdateContact(entity, EmailMessageTypes.TakedownRequest, dto.PrimaryTakedownRequestContactEmail, true);
UpdateContact(entity, EmailMessageTypes.TakedownRequest, dto.SecondaryTakedownRequestContactEmail, false);
}
}
}
4 changes: 4 additions & 0 deletions server/StrDss.Model/OrganizationDtos/PlatformSubCreateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ public class PlatformSubCreateDto : IPlatformCreateDto
public long ManagingOrganizationId { get; set; }
public bool? IsActive { get; set; } = true;
public DateTime UpdDtm { get; set; }
public string? PrimaryNoticeOfTakedownContactEmail { get; set; }
public string? PrimaryTakedownRequestContactEmail { get; set; }
public string? SecondaryNoticeOfTakedownContactEmail { get; set; }
public string? SecondaryTakedownRequestContactEmail { get; set; }
}
}
4 changes: 4 additions & 0 deletions server/StrDss.Model/OrganizationDtos/PlatformSubUpdateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ public class PlatformSubUpdateDto : IPlatformUpdateDto
public long OrganizationId { get; set; }
public string OrganizationNm { get; set; } = null!;
public long ManagingOrganizationId { get; set; }
public string? PrimaryNoticeOfTakedownContactEmail { get; set; }
public string? PrimaryTakedownRequestContactEmail { get; set; }
public string? SecondaryNoticeOfTakedownContactEmail { get; set; }
public string? SecondaryTakedownRequestContactEmail { get; set; }
public bool? IsActive { get; set; }
public DateTime UpdDtm { get; set; }
}
Expand Down

0 comments on commit b941c6d

Please sign in to comment.