Skip to content

Commit

Permalink
Updates from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Centerville1 committed Nov 17, 2024
1 parent 941bb9e commit 030c1ee
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 231 deletions.
20 changes: 14 additions & 6 deletions Gordon360/Controllers/LostAndFoundController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ public async Task<ActionResult> UpdateReportStatus(int id, string status)
}

/// <summary>
/// Get all missing items, only for data entry level users
/// Get all missing item reports, only for data entry level users
/// </summary>
/// <param name="id">The id</param>
/// <returns></returns>
/// <returns>ObjectResult - an http status code, with an array of MissingItem objects in the body </returns>
[HttpGet]
[Route("missingitemsall")]
[StateYourBusiness(operation = Static.Names.Operation.READ_ALL, resource = Resource.LOST_AND_FOUND_MISSING_REPORT)]
Expand All @@ -80,6 +79,10 @@ public ActionResult<IEnumerable<MissingItemReportViewModel>> GetAllMissingItems(
}
}

/// <summary>
/// Get the list of missing item reports for the currently authenticated user.
/// </summary>
/// <returns>ObjectResult - an http status code, with an array of MissingItem objects in the body </returns>
[HttpGet]
[Route("missingitems")]
public ActionResult<IEnumerable<MissingItemReportViewModel>> GetMissingItems()
Expand All @@ -96,13 +99,18 @@ public ActionResult<IEnumerable<MissingItemReportViewModel>> GetMissingItems()
return NotFound();
}
}

/// <param name="id">The id</param>
/// <summary>
/// Get a missing item report with given ID.
/// </summary>
/// <param name="id">The id of the report to get</param>
/// <returns>ObjectResult - an http status code, with a MissingItem object in the body </returns>
[HttpGet]
[Route("missingitemsbyid/{id}")]
public ActionResult<MissingItemReportViewModel> GetMissingItem(int id)
{
MissingItemReportViewModel? result = lostAndFoundService.GetMissingItem(id);
var authenticatedUserUsername = AuthUtils.GetUsername(User);

MissingItemReportViewModel? result = lostAndFoundService.GetMissingItem(id, authenticatedUserUsername);
if (result != null)
{
return Ok(result);
Expand Down
38 changes: 0 additions & 38 deletions Gordon360/Models/CCT/Context/CCTContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public CCTContext(DbContextOptions<CCTContext> options)

public virtual DbSet<CUSTOM_PROFILE> CUSTOM_PROFILE { get; set; }

public virtual DbSet<Categories> Categories { get; set; }

public virtual DbSet<ChapelEvent> ChapelEvent { get; set; }

public virtual DbSet<Clifton_Strengths> Clifton_Strengths { get; set; }
Expand All @@ -58,8 +56,6 @@ public CCTContext(DbContextOptions<CCTContext> options)

public virtual DbSet<FacStaff> FacStaff { get; set; }

public virtual DbSet<FoundItems> FoundItems { get; set; }

public virtual DbSet<GuestUsers> GuestUsers { get; set; }

public virtual DbSet<Housing_Applicants> Housing_Applicants { get; set; }
Expand Down Expand Up @@ -96,8 +92,6 @@ public CCTContext(DbContextOptions<CCTContext> options)

public virtual DbSet<Minors> Minors { get; set; }

public virtual DbSet<Missing> Missing { get; set; }

public virtual DbSet<MissingItemData> MissingItemData { get; set; }

public virtual DbSet<MissingReports> MissingReports { get; set; }
Expand Down Expand Up @@ -148,8 +142,6 @@ public CCTContext(DbContextOptions<CCTContext> options)

public virtual DbSet<Statistic> Statistic { get; set; }

public virtual DbSet<Statuses> Statuses { get; set; }

public virtual DbSet<Student> Student { get; set; }

public virtual DbSet<StudentNewsExpiration> StudentNewsExpiration { get; set; }
Expand Down Expand Up @@ -246,11 +238,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.SESS_CDE).IsFixedLength();
});

modelBuilder.Entity<Categories>(entity =>
{
entity.HasKey(e => e.CategoryName).HasName("PK__Categori__8517B2E195D5FEE5");
});

modelBuilder.Entity<ChapelEvent>(entity =>
{
entity.ToView("ChapelEvent", "dbo");
Expand Down Expand Up @@ -316,13 +303,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.BuildingDescription).IsFixedLength();
});

modelBuilder.Entity<FoundItems>(entity =>
{
entity.HasKey(e => e.ID).HasName("PK__FoundIte__3214EC277B2634DE");

entity.Property(e => e.ID).ValueGeneratedNever();
});

modelBuilder.Entity<GuestUsers>(entity =>
{
entity.HasKey(e => e.ID).HasName("PK__GuestUse__3214EC2774F2F95F");
Expand Down Expand Up @@ -444,11 +424,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.ToView("Minors", "dbo");
});

modelBuilder.Entity<Missing>(entity =>
{
entity.HasKey(e => e.recordID).HasName("PK__Missing__D825197E645524A6");
});

modelBuilder.Entity<MissingItemData>(entity =>
{
entity.ToView("MissingItemData", "LostAndFound");
Expand All @@ -457,14 +432,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<MissingReports>(entity =>
{
entity.HasKey(e => e.ID).HasName("PK__MissingR__3214EC27985CEC3D");

entity.HasOne(d => d.categoryNavigation).WithMany(p => p.MissingReports)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__MissingRe__categ__0AB36FCB");

entity.HasOne(d => d.statusNavigation).WithMany(p => p.MissingReports)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__MissingRe__statu__0BA79404");
});

modelBuilder.Entity<PART_DEF>(entity =>
Expand Down Expand Up @@ -627,11 +594,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasConstraintName("FK_Statistic_ParticipantTeam");
});

modelBuilder.Entity<Statuses>(entity =>
{
entity.HasKey(e => e.StatusName).HasName("PK__Statuses__05E7698B0A94483B");
});

modelBuilder.Entity<Student>(entity =>
{
entity.ToView("Student", "dbo");
Expand Down
16 changes: 0 additions & 16 deletions Gordon360/Models/CCT/Context/efpt.CCT.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,30 +74,14 @@
"Name": "[LostAndFound].[ActionsTaken]",
"ObjectType": 0
},
{
"Name": "[LostAndFound].[Categories]",
"ObjectType": 0
},
{
"Name": "[LostAndFound].[FoundItems]",
"ObjectType": 0
},
{
"Name": "[LostAndFound].[GuestUsers]",
"ObjectType": 0
},
{
"Name": "[LostAndFound].[Missing]",
"ObjectType": 0
},
{
"Name": "[LostAndFound].[MissingReports]",
"ObjectType": 0
},
{
"Name": "[LostAndFound].[Statuses]",
"ObjectType": 0
},
{
"Name": "[RecIM].[Activity]",
"ObjectType": 0
Expand Down
21 changes: 0 additions & 21 deletions Gordon360/Models/CCT/LostAndFound/Categories.cs

This file was deleted.

20 changes: 0 additions & 20 deletions Gordon360/Models/CCT/LostAndFound/FoundItems.cs

This file was deleted.

72 changes: 0 additions & 72 deletions Gordon360/Models/CCT/LostAndFound/Missing.cs

This file was deleted.

8 changes: 0 additions & 8 deletions Gordon360/Models/CCT/LostAndFound/MissingReports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,4 @@ public partial class MissingReports

[InverseProperty("missing")]
public virtual ICollection<GuestUsers> GuestUsers { get; set; } = new List<GuestUsers>();

[ForeignKey("category")]
[InverseProperty("MissingReports")]
public virtual Categories categoryNavigation { get; set; }

[ForeignKey("status")]
[InverseProperty("MissingReports")]
public virtual Statuses statusNavigation { get; set; }
}
21 changes: 0 additions & 21 deletions Gordon360/Models/CCT/LostAndFound/Statuses.cs

This file was deleted.

Loading

0 comments on commit 030c1ee

Please sign in to comment.