Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions src/FunderMaps.Core/Entities/Incident.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ public sealed class Incident : RecordControl
/// </summary>
public string[]? DocumentFile { get; set; }

/// <summary>
/// Note.
/// </summary>
public string? Note { get; set; }

/// <summary>
/// Internal note.
/// </summary>
Expand All @@ -85,24 +80,6 @@ public sealed class Incident : RecordControl
[ArrayEnumDataTypeAttribute(typeof(EnvironmentDamageCharacteristics))]
public EnvironmentDamageCharacteristics[]? EnvironmentDamageCharacteristics { get; set; }

/// <summary>
/// Contact email.
/// </summary>
[Required, EmailAddress]
public string Email { get; set; } = default!;

/// <summary>
/// Contact name.
/// </summary>
public string? Name { get; set; }

/// <summary>
/// Contact phone number.
/// </summary>
[Phone]
[StringLength(16)]
public string? PhoneNumber { get; set; }

// TODO: Remove this property, replaced by building. Only being used by incidentService.
/// <summary>
/// An address identifier.
Expand Down
25 changes: 0 additions & 25 deletions src/FunderMaps.Data/Repositories/IncidentRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ INSERT INTO report.incident(
neighbor_recovery,
foundation_damage_cause,
document_file,
note,
internal_note,
contact,
contact_name,
contact_phone_number,
foundation_damage_characteristics,
environment_damage_characteristics,
building_id,
Expand All @@ -40,11 +36,7 @@ INSERT INTO report.incident(
@neighbor_recovery,
@foundation_damage_cause,
NULLIF(@document_file, '{}'::text[]),
NULLIF(trim(@note), ''),
NULLIF(trim(@internal_note), ''),
trim(lower(@email)),
NULLIF(trim(@name), ''),
NULLIF(trim(@phone_number), ''),
NULLIF(@foundation_damage_characteristics, '{}'::report.foundation_damage_characteristics[]),
NULLIF(@environment_damage_characteristics, '{}'::report.environment_damage_characteristics[]),
@building,
Expand All @@ -63,13 +55,9 @@ INSERT INTO report.incident(
context.AddParameterWithValue("neighbor_recovery", entity.NeighborRecovery);
context.AddParameterWithValue("foundation_damage_cause", entity.FoundationDamageCause);
context.AddParameterWithValue("document_file", entity.DocumentFile);
context.AddParameterWithValue("note", entity.Note);
context.AddParameterWithValue("internal_note", entity.InternalNote);
context.AddParameterWithValue("foundation_damage_characteristics", entity.FoundationDamageCharacteristics);
context.AddParameterWithValue("environment_damage_characteristics", entity.EnvironmentDamageCharacteristics);
context.AddParameterWithValue("email", entity.Email);
context.AddParameterWithValue("name", entity.Name);
context.AddParameterWithValue("phone_number", entity.PhoneNumber);
context.AddParameterWithValue("building", entity.Building);
context.AddParameterWithValue("audit_status", entity.AuditStatus);
context.AddParameterWithValue("question_type", entity.QuestionType);
Expand Down Expand Up @@ -163,11 +151,7 @@ public async Task<Incident> GetByIdAsync(string id)
i.neighbor_recovery,
i.foundation_damage_cause,
i.document_file,
i.note,
i.internal_note,
i.contact AS email,
i.contact_name AS name,
i.contact_phone_number AS phone_number,
i.create_date,
i.update_date,
i.delete_date,
Expand Down Expand Up @@ -202,11 +186,7 @@ public async IAsyncEnumerable<Incident> ListAllByBuildingIdAsync(string id)
i.neighbor_recovery,
i.foundation_damage_cause,
i.document_file,
i.note,
i.internal_note,
i.contact AS email,
i.contact_name AS name,
i.contact_phone_number AS phone_number,
i.create_date,
i.update_date,
i.delete_date,
Expand Down Expand Up @@ -241,11 +221,7 @@ public async IAsyncEnumerable<Incident> ListAllAsync(Navigation navigation)
i.neighbor_recovery,
i.foundation_damage_cause,
i.document_file,
i.note,
i.internal_note,
i.contact AS email,
i.contact_name AS name,
i.contact_phone_number AS phone_number,
i.create_date,
i.update_date,
i.delete_date,
Expand Down Expand Up @@ -281,7 +257,6 @@ UPDATE report.incident
neighbor_recovery = @NeighborRecovery,
foundation_damage_cause = @FoundationDamageCause,
document_file = NULLIF(@DocumentFile, '{}'::text[]),
note = NULLIF(trim(@Note), ''),
internal_note = NULLIF(trim(@InternalNote), ''),
foundation_damage_characteristics = NULLIF(@FoundationDamageCharacteristics, '{}'::report.foundation_damage_characteristics[]),
environment_damage_characteristics = NULLIF(@EnvironmentDamageCharacteristics, '{}'::report.environment_damage_characteristics[]),
Expand Down
Loading