working #13

Merged
derek merged 3 commits from working into main 2025-07-30 22:01:36 -07:00
15 changed files with 37 additions and 37 deletions
+1 -1
View File
@@ -43,4 +43,4 @@ Task:
Jobs/editor w/ Querystring JobID=# is not implimented yet Jobs/editor w/ Querystring JobID=# is not implimented yet
Company -> Edit employees not implimented yet Company -> Edit employees not implimented yet
Remove Account table from DB Resume fields in angular models need to be public
+1 -1
View File
@@ -1,5 +1,5 @@
export class Account { export class Account {
public id: number = -1; public id: number | null = null;
public userName: string = ""; public userName: string = "";
public email: string = ""; public email: string = "";
public emailVerified: boolean = false; public emailVerified: boolean = false;
+2 -2
View File
@@ -1,5 +1,5 @@
export class Company { export class Company {
public id: number = -1; public id: number | null = null;
public name: string = ""; public name: string = "";
public email: string = ""; public email: string = "";
public emailVerified: boolean = false; public emailVerified: boolean = false;
@@ -14,7 +14,7 @@ export class Company {
} }
export class Employee { export class Employee {
public id: number = -1; public id: number | null = null;
public accountID: number = 0; public accountID: number = 0;
public company: Company = new Company; public company: Company = new Company;
} }
+1 -1
View File
@@ -1,5 +1,5 @@
export class JobListing { export class JobListing {
public id: number = -1; public id: number | null = null;
public companyID: number = 0; public companyID: number = 0;
public title: string = ""; public title: string = "";
public postalCode: string = ""; public postalCode: string = "";
+10 -10
View File
@@ -1,5 +1,5 @@
export class Resume { export class Resume {
public id: number = -1; public id: number | null = null;
public accountID: number = 0; public accountID: number = 0;
public name: string = ""; public name: string = "";
public field: string = ""; public field: string = "";
@@ -20,7 +20,7 @@ export class Resume {
} }
export class ResumeExperience { export class ResumeExperience {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
jobTitle: string = ""; jobTitle: string = "";
company: string = ""; company: string = "";
@@ -35,14 +35,14 @@ export class ResumeExperience {
} }
export class ResumeExperienceBullet { export class ResumeExperienceBullet {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
resumeExperienceID: number = 0; resumeExperienceID: number = 0;
jobFunction: string = ""; jobFunction: string = "";
} }
export class ResumeMilitary { export class ResumeMilitary {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
country: string = ""; country: string = "";
rank: string = ""; rank: string = "";
@@ -53,7 +53,7 @@ export class ResumeMilitary {
} }
export class ResumeMilitaryBullet { export class ResumeMilitaryBullet {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
resumeMilitaryID: number = 0; resumeMilitaryID: number = 0;
achievement: string = ""; achievement: string = "";
@@ -61,7 +61,7 @@ export class ResumeMilitaryBullet {
} }
export class ResumeEducation { export class ResumeEducation {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
degreeType: string = ""; degreeType: string = "";
degreeField: string = ""; degreeField: string = "";
@@ -76,21 +76,21 @@ export class ResumeEducation {
} }
export class ResumeSkill { export class ResumeSkill {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
name: string = ""; name: string = "";
description: string = ""; description: string = "";
} }
export class ResumeLanguage { export class ResumeLanguage {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
language: string = ""; language: string = "";
proficiency: string = ""; proficiency: string = "";
} }
export class ResumeCertification { export class ResumeCertification {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
name: string = ""; name: string = "";
verificationURL: string = ""; verificationURL: string = "";
@@ -98,7 +98,7 @@ export class ResumeCertification {
} }
export class ResumeProject { export class ResumeProject {
id: number = -1; public id: number | null = null;
resumeID: number = 0; resumeID: number = 0;
name: string = ""; name: string = "";
url: string = ""; url: string = "";
@@ -1,5 +1,5 @@
<div class="top-bar"> <div class="top-bar">
<button *ngFor="let company of Employers" (click)="changeSelectedCompany(company.company.id)">{{ company.company.name.toUpperCase() }}</button> <button *ngFor="let company of Employers" (click)="changeSelectedCompany(company.company.id!)">{{ company.company.name.toUpperCase() }}</button>
<button routerLink="/company/connect" >CONNECT A COMPANY</button> <button routerLink="/company/connect" >CONNECT A COMPANY</button>
</div> </div>
<div class="content-frame"> <div class="content-frame">
@@ -18,6 +18,6 @@
<h1>Modified: {{ cur.modifiedTime }}</h1> <h1>Modified: {{ cur.modifiedTime }}</h1>
</div> </div>
<button [routerLink]="['/jobs/editor']" [queryParams]="{ JobID: cur.id }" >EDIT</button> <button [routerLink]="['/jobs/editor']" [queryParams]="{ JobID: cur.id }" >EDIT</button>
<button (click)="RemoveJobListing(cur.id)">DELETE</button> <button (click)="RemoveJobListing(cur.id!)">DELETE</button>
</div> </div>
</div> </div>
@@ -71,7 +71,7 @@ export class JobEditorComponent {
} }
PostJobListing(jobListing: JobListing){ PostJobListing(jobListing: JobListing){
jobListing.companyID = this.selectedCompany.id; jobListing.companyID = this.selectedCompany.id!;
this.http.post("api/joblisting", jobListing).subscribe({ this.http.post("api/joblisting", jobListing).subscribe({
next: data => { next: data => {
this.router.navigate([""]); this.router.navigate([""]);
+2 -2
View File
@@ -26,7 +26,7 @@ namespace BoredCareers.Controllers {
public async Task<IActionResult> SetCompany([FromBody] Company company, [FromQuery] bool newCompany = false) { public async Task<IActionResult> SetCompany([FromBody] Company company, [FromQuery] bool newCompany = false) {
if (isLoggedIn()) { if (isLoggedIn()) {
if (newCompany) { if (newCompany) {
Company? test = await _databaseService.GetCompany(company.ID); Company? test = await _databaseService.GetCompany(Convert.ToInt32(company.ID));
if (test == null) { if (test == null) {
company.ID = await _databaseService.SetCompany(company); company.ID = await _databaseService.SetCompany(company);
await _databaseService.SetEmployee(new Employee() { await _databaseService.SetEmployee(new Employee() {
@@ -37,7 +37,7 @@ namespace BoredCareers.Controllers {
} }
return NotFound("The company already exists"); return NotFound("The company already exists");
} else { } else {
if (await isLoggedInUserEmployeeOf(company.ID)) { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(company.ID))) {
await _databaseService.SetCompany(company); await _databaseService.SetCompany(company);
return Ok(); return Ok();
} }
+2 -2
View File
@@ -34,7 +34,7 @@ namespace BoredCareers.Controllers {
[HttpPost] [HttpPost]
public async Task<IActionResult> SetEmployee([FromBody] Employee employee) { public async Task<IActionResult> SetEmployee([FromBody] Employee employee) {
if (isLoggedIn()) { if (isLoggedIn()) {
if (await isLoggedInUserEmployeeOf(employee.Company.ID)) { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(employee.Company.ID))) {
await _databaseService.SetEmployee(employee); await _databaseService.SetEmployee(employee);
return Ok(); return Ok();
} }
@@ -48,7 +48,7 @@ namespace BoredCareers.Controllers {
if (isLoggedIn()) { if (isLoggedIn()) {
Employee? employee = await _databaseService.GetEmployee(EmployeeID); Employee? employee = await _databaseService.GetEmployee(EmployeeID);
if (employee != null) { if (employee != null) {
if (await isLoggedInUserEmployeeOf(employee.Company.ID)) { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(employee.Company.ID))) {
await _databaseService.DeleteEmployee(EmployeeID); await _databaseService.DeleteEmployee(EmployeeID);
return Ok(); return Ok();
} }
+1 -1
View File
@@ -1,6 +1,6 @@
namespace BoredCareers.Entities { namespace BoredCareers.Entities {
public class Account { public class Account {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public string UserName { get; set; } = ""; public string UserName { get; set; } = "";
public string Email { get; set; } = ""; public string Email { get; set; } = "";
public string Role { get; set; } = "Generic"; public string Role { get; set; } = "Generic";
+2 -2
View File
@@ -1,7 +1,7 @@
namespace BoredCareers.Entities { namespace BoredCareers.Entities {
public class Company { public class Company {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public string Email { get; set; } = ""; public string Email { get; set; } = "";
public bool EmailVerified { get; set; } = false; public bool EmailVerified { get; set; } = false;
@@ -16,7 +16,7 @@ namespace BoredCareers.Entities {
} }
public class Employee { public class Employee {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int AccountID { get; set; } // FK public int AccountID { get; set; } // FK
public Company Company { get; set; } = new Company(); // FK public Company Company { get; set; } = new Company(); // FK
} }
+1 -1
View File
@@ -1,7 +1,7 @@
namespace BoredCareers.Entities { namespace BoredCareers.Entities {
public class JobListing { public class JobListing {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int CompanyID { get; set; } // FK public int CompanyID { get; set; } // FK
public string Title { get; set; } = ""; public string Title { get; set; } = "";
public string PostalCode { get; set; } = ""; public string PostalCode { get; set; } = "";
+10 -10
View File
@@ -1,7 +1,7 @@
namespace BoredCareers.Entities { namespace BoredCareers.Entities {
public class Resume { public class Resume {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int AccountID { get; set; } // FK public int AccountID { get; set; } // FK
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public string Field { get; set; } = ""; public string Field { get; set; } = "";
@@ -22,7 +22,7 @@ namespace BoredCareers.Entities {
} }
public class ResumeExperience { public class ResumeExperience {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public string JobTitle { get; set; } = ""; public string JobTitle { get; set; } = "";
public string Company { get; set; } = ""; public string Company { get; set; } = "";
@@ -37,14 +37,14 @@ namespace BoredCareers.Entities {
} }
public class ResumeExperienceBullet { public class ResumeExperienceBullet {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public int ResumeExperienceID { get; set; } // FK public int ResumeExperienceID { get; set; } // FK
public string JobFunction { get; set; } = ""; public string JobFunction { get; set; } = "";
} }
public class ResumeMilitary { public class ResumeMilitary {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public string Country { get; set; } = ""; // 2 Letter Country Code public string Country { get; set; } = ""; // 2 Letter Country Code
public string Rank { get; set; } = ""; public string Rank { get; set; } = "";
@@ -55,7 +55,7 @@ namespace BoredCareers.Entities {
} }
public class ResumeMilitaryBullet { public class ResumeMilitaryBullet {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public int ResumeMilitaryID { get; set; } // FK public int ResumeMilitaryID { get; set; } // FK
public string Achievement { get; set; } = ""; public string Achievement { get; set; } = "";
@@ -63,7 +63,7 @@ namespace BoredCareers.Entities {
} }
public class ResumeEducation { public class ResumeEducation {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public string DegreeType { get; set; } = ""; public string DegreeType { get; set; } = "";
public string DegreeField { get; set; } = ""; public string DegreeField { get; set; } = "";
@@ -78,21 +78,21 @@ namespace BoredCareers.Entities {
} }
public class ResumeSkill { public class ResumeSkill {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public string Description { get; set; } = ""; public string Description { get; set; } = "";
} }
public class ResumeLanguage { public class ResumeLanguage {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public string Language { get; set; } = ""; public string Language { get; set; } = "";
public string Proficiency { get; set; } = ""; public string Proficiency { get; set; } = "";
} }
public class ResumeCertification { public class ResumeCertification {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public string VerificationURL { get; set; } = ""; public string VerificationURL { get; set; } = "";
@@ -100,7 +100,7 @@ namespace BoredCareers.Entities {
} }
public class ResumeProject { public class ResumeProject {
public int ID { get; set; } // PK public int? ID { get; set; } // PK
public int ResumeID { get; set; } // FK public int ResumeID { get; set; } // FK
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public string URL { get; set; } = ""; public string URL { get; set; } = "";
@@ -143,7 +143,7 @@ namespace BoredCareers.Services.DatabaseService {
// Split into grouped lists and add to experience // Split into grouped lists and add to experience
Dictionary<int, ResumeExperienceBullet[]> groupedExperienceBullets = experienceBullets.GroupBy(b => b.ResumeExperienceID).ToDictionary(g => g.Key, g => g.ToArray()); Dictionary<int, ResumeExperienceBullet[]> groupedExperienceBullets = experienceBullets.GroupBy(b => b.ResumeExperienceID).ToDictionary(g => g.Key, g => g.ToArray());
foreach (ResumeExperience cur in experience) { foreach (ResumeExperience cur in experience) {
cur.ExperienceBullets = groupedExperienceBullets[cur.ID]; cur.ExperienceBullets = groupedExperienceBullets[Convert.ToInt32(cur.ID)];
} }
// Add the parts to the resume // Add the parts to the resume