Skip to content

Commit

Permalink
chore: rename email fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ychung-mot committed Sep 27, 2024
1 parent 248265b commit 63c1bd3
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 56 deletions.
16 changes: 8 additions & 8 deletions database/ddl/STR_DSS_Views_Sprint_15.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ SELECT do2.organization_id
, do2.managing_organization_id
, do2.upd_dtm
, do2.upd_user_guid
, docp.organization_contact_person_id as notice_of_takedown_contact_id_1
, docp.email_address_dsc as notice_of_takedown_contact_email_1
, docp2.organization_contact_person_id as takedown_request_contact_id_1
, docp2.email_address_dsc as takedown_request_contact_email_1
, docp3.organization_contact_person_id as notice_of_takedown_contact_id_2
, docp3.email_address_dsc as notice_of_takedown_contact_email_2
, docp4.organization_contact_person_id as takedown_request_contact_id_2
, docp4.email_address_dsc as takedown_request_contact_email_2
, docp.organization_contact_person_id as primary_notice_of_takedown_contact_id
, docp.email_address_dsc as primary_notice_of_takedown_contact_email
, docp2.organization_contact_person_id as primary_takedown_request_contact_id
, docp2.email_address_dsc as primary_takedown_request_contact_email
, docp3.organization_contact_person_id as secondary_notice_of_takedown_contact_id
, docp3.email_address_dsc as secondary_notice_of_takedown_contact_email
, docp4.organization_contact_person_id as secondary_takedown_request_contact_id
, docp4.email_address_dsc as secondary_takedown_request_contact_email
FROM dss_organization do2
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
Expand Down
120 changes: 118 additions & 2 deletions postman/str-dss.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1605,15 +1605,131 @@
"method": "GET",
"header": [],
"url": {
"raw": "{{host}}/api/organizations/platforms/592",
"raw": "{{host}}/api/organizations/platforms/1402",
"host": [
"{{host}}"
],
"path": [
"api",
"organizations",
"platforms",
"592"
"1402"
]
}
},
"response": []
},
{
"name": "Create Platform",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"organizationId\": 0,\r\n \"organizationCd\": \"TESTCD2\",\r\n \"organizationNm\": \"TEST ORG 2\",\r\n \"updDtm\": \"2024-09-27T16:31:12.047Z\",\r\n \"primaryNoticeOfTakedownContactEmail\": \"email1@email.com\",\r\n \"primaryTakedownRequestContactEmail\": \"email2@email.com\",\r\n \"secondaryNoticeOfTakedownContactEmail\": \"email2@email.com\",\r\n \"secondaryTakedownRequestContactEmail\": \"email2@email.com\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{host}}/api/organizations/platforms",
"host": [
"{{host}}"
],
"path": [
"api",
"organizations",
"platforms"
]
}
},
"response": []
},
{
"name": "Create Sub Platform",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"organizationCd\": \"TESTCDSUB11\",\r\n \"organizationNm\": \"TEST ORG Sub 1\",\r\n \"managingOrganizationId\": 1402\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{host}}/api/organizations/platforms/subsidiaries",
"host": [
"{{host}}"
],
"path": [
"api",
"organizations",
"platforms",
"subsidiaries"
]
}
},
"response": []
},
{
"name": "Update Platform",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"organizationNm\": \"TEST ORG11\",\r\n \"updDtm\": \"2024-09-27T18:21:49.159676Z\",\r\n \"primaryNoticeOfTakedownContactEmail\": \"email1@email.com\",\r\n \"primaryTakedownRequestContactEmail\": \"email2@email.com\",\r\n \"secondaryNoticeOfTakedownContactEmail\": \"email2@email.com\",\r\n \"secondaryTakedownRequestContactEmail\": \"email2@email.com\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{host}}/api/organizations/platforms/1402",
"host": [
"{{host}}"
],
"path": [
"api",
"organizations",
"platforms",
"1402"
]
}
},
"response": []
},
{
"name": "Update Subsidiary",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"organizationNm\": \"TEST ORG11111\",\r\n \"updDtm\": \"2024-09-27T19:16:10.035433Z\",\r\n \"managingOrganizationId\": 1402\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{host}}/api/organizations/platforms/subsidiaries/1403",
"host": [
"{{host}}"
],
"path": [
"api",
"organizations",
"platforms",
"subsidiaries",
"1403"
]
}
},
Expand Down
28 changes: 14 additions & 14 deletions server/StrDss.Data/Entities/DssDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.ToView("dss_platform_vw");
entity.Property(e => e.ManagingOrganizationId).HasColumnName("managing_organization_id");
entity.Property(e => e.NoticeOfTakedownContactEmail1)
.HasMaxLength(320)
.HasColumnName("notice_of_takedown_contact_email_1");
entity.Property(e => e.NoticeOfTakedownContactEmail2)
.HasMaxLength(320)
.HasColumnName("notice_of_takedown_contact_email_2");
entity.Property(e => e.NoticeOfTakedownContactId1).HasColumnName("notice_of_takedown_contact_id_1");
entity.Property(e => e.NoticeOfTakedownContactId2).HasColumnName("notice_of_takedown_contact_id_2");
entity.Property(e => e.OrganizationCd)
.HasMaxLength(25)
.HasColumnName("organization_cd");
Expand All @@ -685,14 +677,22 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.OrganizationType)
.HasMaxLength(25)
.HasColumnName("organization_type");
entity.Property(e => e.TakedownRequestContactEmail1)
entity.Property(e => e.PrimaryNoticeOfTakedownContactEmail)
.HasMaxLength(320)
.HasColumnName("primary_notice_of_takedown_contact_email");
entity.Property(e => e.PrimaryNoticeOfTakedownContactId).HasColumnName("primary_notice_of_takedown_contact_id");
entity.Property(e => e.PrimaryTakedownRequestContactEmail)
.HasMaxLength(320)
.HasColumnName("primary_takedown_request_contact_email");
entity.Property(e => e.PrimaryTakedownRequestContactId).HasColumnName("primary_takedown_request_contact_id");
entity.Property(e => e.SecondaryNoticeOfTakedownContactEmail)
.HasMaxLength(320)
.HasColumnName("takedown_request_contact_email_1");
entity.Property(e => e.TakedownRequestContactEmail2)
.HasColumnName("secondary_notice_of_takedown_contact_email");
entity.Property(e => e.SecondaryNoticeOfTakedownContactId).HasColumnName("secondary_notice_of_takedown_contact_id");
entity.Property(e => e.SecondaryTakedownRequestContactEmail)
.HasMaxLength(320)
.HasColumnName("takedown_request_contact_email_2");
entity.Property(e => e.TakedownRequestContactId1).HasColumnName("takedown_request_contact_id_1");
entity.Property(e => e.TakedownRequestContactId2).HasColumnName("takedown_request_contact_id_2");
.HasColumnName("secondary_takedown_request_contact_email");
entity.Property(e => e.SecondaryTakedownRequestContactId).HasColumnName("secondary_takedown_request_contact_id");
entity.Property(e => e.UpdDtm).HasColumnName("upd_dtm");
entity.Property(e => e.UpdUserGuid).HasColumnName("upd_user_guid");
});
Expand Down
16 changes: 8 additions & 8 deletions server/StrDss.Data/Entities/DssPlatformVw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ public partial class DssPlatformVw

public Guid? UpdUserGuid { get; set; }

public long? NoticeOfTakedownContactId1 { get; set; }
public long? PrimaryNoticeOfTakedownContactId { get; set; }

public string? NoticeOfTakedownContactEmail1 { get; set; }
public string? PrimaryNoticeOfTakedownContactEmail { get; set; }

public long? TakedownRequestContactId1 { get; set; }
public long? PrimaryTakedownRequestContactId { get; set; }

public string? TakedownRequestContactEmail1 { get; set; }
public string? PrimaryTakedownRequestContactEmail { get; set; }

public long? NoticeOfTakedownContactId2 { get; set; }
public long? SecondaryNoticeOfTakedownContactId { get; set; }

public string? NoticeOfTakedownContactEmail2 { get; set; }
public string? SecondaryNoticeOfTakedownContactEmail { get; set; }

public long? TakedownRequestContactId2 { get; set; }
public long? SecondaryTakedownRequestContactId { get; set; }

public string? TakedownRequestContactEmail2 { get; set; }
public string? SecondaryTakedownRequestContactEmail { get; set; }
}
16 changes: 8 additions & 8 deletions server/StrDss.Data/Repositories/OrganizationRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ public async Task<DssOrganization> CreatePlatformAsync(PlatformCreateDto dto)

await _dbSet.AddAsync(entity);

CreateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.NoticeOfTakedownContactEmail1, true);
CreateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.NoticeOfTakedownContactEmail2, false);
CreateContact(entity, EmailMessageTypes.TakedownRequest, dto.TakedownRequestContactEmail1, true);
CreateContact(entity, EmailMessageTypes.TakedownRequest, dto.TakedownRequestContactEmail2, false);
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 Down Expand Up @@ -224,10 +224,10 @@ public async Task UpdatePlatformAsync(PlatformUpdateDto dto)

_mapper.Map(dto, entity);

UpdateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.NoticeOfTakedownContactEmail1, true);
UpdateContact(entity, EmailMessageTypes.NoticeOfTakedown, dto.NoticeOfTakedownContactEmail2, false);
UpdateContact(entity, EmailMessageTypes.TakedownRequest, dto.TakedownRequestContactEmail1, true);
UpdateContact(entity, EmailMessageTypes.TakedownRequest, dto.TakedownRequestContactEmail2, false);
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);
}

private void UpdateContact(DssOrganization entity, string messageType, string? emailAddress, bool isPrimary)
Expand Down
8 changes: 4 additions & 4 deletions server/StrDss.Model/OrganizationDtos/PlatformCreateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ public class PlatformCreateDto : IPlatformCreateDto
public string OrganizationCd { get; set; } = null!;
public string OrganizationNm { get; set; } = null!;
public DateTime UpdDtm { get; set; }
public string? NoticeOfTakedownContactEmail1 { get; set; }
public string? TakedownRequestContactEmail1 { get; set; }
public string? NoticeOfTakedownContactEmail2 { get; set; }
public string? TakedownRequestContactEmail2 { get; set; }
public string? PrimaryNoticeOfTakedownContactEmail { get; set; }
public string? PrimaryTakedownRequestContactEmail { get; set; }
public string? SecondaryNoticeOfTakedownContactEmail { get; set; }
public string? SecondaryTakedownRequestContactEmail { get; set; }
}
}
8 changes: 4 additions & 4 deletions server/StrDss.Model/OrganizationDtos/PlatformUpdateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ public class PlatformUpdateDto : IPlatformUpdateDto
public long OrganizationId { get; set; }
public string OrganizationNm { get; set; } = null!;
public DateTime UpdDtm { get; set; }
public string? NoticeOfTakedownContactEmail1 { get; set; }
public string? TakedownRequestContactEmail1 { get; set; }
public string? NoticeOfTakedownContactEmail2 { get; set; }
public string? TakedownRequestContactEmail2 { get; set; }
public string? PrimaryNoticeOfTakedownContactEmail { get; set; }
public string? PrimaryTakedownRequestContactEmail { get; set; }
public string? SecondaryNoticeOfTakedownContactEmail { get; set; }
public string? SecondaryTakedownRequestContactEmail { get; set; }
}
}
16 changes: 8 additions & 8 deletions server/StrDss.Model/OrganizationDtos/PlatformViewDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public PlatformViewDto()
public string OrganizationNm { get; set; } = null!;
public DateTime UpdDtm { get; set; }
public Guid? UpdUserGuid { get; set; }
public long? NoticeOfTakedownContactId1 { get; set; }
public string? NoticeOfTakedownContactEmail1 { get; set; }
public long? TakedownRequestContactId1 { get; set; }
public string? TakedownRequestContactEmail1 { get; set; }
public long? NoticeOfTakedownContactId2 { get; set; }
public string? NoticeOfTakedownContactEmail2 { get; set; }
public long? TakedownRequestContactId2 { get; set; }
public string? TakedownRequestContactEmail2 { get; set; }
public long? PrimaryNoticeOfTakedownContactId { get; set; }
public string? PrimaryNoticeOfTakedownContactEmail { get; set; }
public long? PrimaryTakedownRequestContactId { get; set; }
public string? PrimaryTakedownRequestContactEmail { get; set; }
public long? SecondaryNoticeOfTakedownContactId { get; set; }
public string? SecondaryNoticeOfTakedownContactEmail { get; set; }
public long? SecondaryTakedownRequestContactId { get; set; }
public string? SecondaryTakedownRequestContactEmail { get; set; }
public virtual ICollection<PlatformViewDto> Subsidiaries { get; set; }
}
}

0 comments on commit 63c1bd3

Please sign in to comment.