Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMSBIOHUB-275: Remove Project Coordinator from SIMS #1104

Merged
merged 19 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
12bf786
SIMSBIOHUB-275: Removed Project Coordinator from codebase (pending da…
curtisupshall Sep 29, 2023
19612d6
SIMSBIOHUB-275: Added migration WIP
curtisupshall Sep 29, 2023
0155891
SIMSBIOHUB-275: fixed migration
curtisupshall Sep 29, 2023
7f8a9dc
SIMSBIOHUB-275: remove todo comment re: migration
curtisupshall Sep 29, 2023
1d94282
SIMSBIOHUB-275: Lint fix
curtisupshall Sep 29, 2023
e1c1e74
Merge branch 'dev' into SIMSBIOHUB-275
curtisupshall Sep 29, 2023
415b4ab
SIMSBIOHUB-275: Added family_name and given_name to participant object
curtisupshall Sep 29, 2023
f1f2073
SIMSBIOHUB-275: Updated EML service to use participant data
curtisupshall Sep 29, 2023
a4bc72e
SIMSBIOHUB-275: Remove deprecated tests
curtisupshall Sep 29, 2023
e934a1a
SIMSBIOHUB-275: Removed more deprecated tests
curtisupshall Sep 29, 2023
1d4f746
SIMSBIOHUB-265: Rename migrtion; add deprecation comment to columns
curtisupshall Oct 1, 2023
1cfb3fd
SIMSBIOHUB-275: Fix API tests
curtisupshall Oct 3, 2023
8a09cf0
SIMSBIOHUB-275: Fixed app tests
curtisupshall Oct 3, 2023
c984295
SIMSBIOHUB-275: Find coordinator from participants list
curtisupshall Oct 4, 2023
5791729
SIMSBIOHUB-275: Lint fix
curtisupshall Oct 4, 2023
0f1ea6b
Merge branch 'dev' into SIMSBIOHUB-275
curtisupshall Oct 4, 2023
5f181f1
SIMSBIOHUB-275: Added todo comments to empty tests; ignore-skip
curtisupshall Oct 4, 2023
6eb0e74
Merge branch 'SIMSBIOHUB-275' of github.com:bcgov/biohubbc into SIMSB…
curtisupshall Oct 4, 2023
50eef24
Merge branch 'dev' into SIMSBIOHUB-275
curtisupshall Oct 4, 2023
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
136 changes: 0 additions & 136 deletions api/src/models/project-create.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect } from 'chai';
import { describe } from 'mocha';
import {
PostCoordinatorData,
PostIUCNData,
PostLocationData,
PostObjectivesData,
Expand All @@ -17,10 +16,6 @@ describe('PostProjectObject', () => {
projectPostObject = new PostProjectObject(null);
});

it('sets coordinator', function () {
expect(projectPostObject.coordinator).to.equal(null);
});

it('sets project', function () {
expect(projectPostObject.project).to.equal(null);
});
Expand All @@ -37,71 +32,6 @@ describe('PostProjectObject', () => {
expect(projectPostObject.iucn).to.equal(null);
});
});

describe('All values provided', () => {
let projectPostObject: PostProjectObject;

const obj = {
coordinator: {
first_name: 'first',
last_name: 'last',
email_address: '[email protected]',
coordinator_agency: 'agency',
share_contact_details: 'true'
},
project: {
project_name: 'name_test_data',
project_programs: [1],
start_date: 'start_date_test_data',
end_date: 'end_date_test_data',
comments: 'comments_test_data'
},
objectives: {
objectives: 'these are the project objectives'
},
location: {
location_description: 'a location description',
geometry: [
{
type: 'Polygon',
coordinates: [
[
[-128, 55],
[-128, 55.5],
[-128, 56],
[-126, 58],
[-128, 55]
]
],
properties: {
name: 'Biohub Islands'
}
}
]
},
iucn: {
classificationDetails: [
{
classification: 1,
subClassification1: 2,
subClassification2: 3
}
]
},
partnerships: {
indigenous_partnerships: [1, 2],
stakeholder_partnerships: ['partner1, partner2']
}
};

before(() => {
projectPostObject = new PostProjectObject(obj);
});

it('sets coordinator', function () {
expect(projectPostObject.coordinator.first_name).to.equal(obj.coordinator.first_name);
});
});
});

describe('PostProjectData', () => {
Expand Down Expand Up @@ -200,72 +130,6 @@ describe('PostObjectivesData', () => {
});
});

describe('PostCoordinatorData', () => {
describe('No values provided', () => {
let projectCoordinatorData: PostCoordinatorData;

before(() => {
projectCoordinatorData = new PostCoordinatorData(null);
});

it('sets first_name', function () {
expect(projectCoordinatorData.first_name).to.eql(null);
});

it('sets last_name', function () {
expect(projectCoordinatorData.last_name).to.eql(null);
});

it('sets email_address', function () {
expect(projectCoordinatorData.email_address).to.eql(null);
});

it('sets coordinator_agency', function () {
expect(projectCoordinatorData.coordinator_agency).to.eql(null);
});

it('sets share_contact_details', function () {
expect(projectCoordinatorData.share_contact_details).to.eql(false);
});
});

describe('All values provided', () => {
let projectCoordinatorData: PostCoordinatorData;

const obj = {
first_name: 'first',
last_name: 'last',
email_address: '[email protected]',
coordinator_agency: 'agency',
share_contact_details: 'true'
};

before(() => {
projectCoordinatorData = new PostCoordinatorData(obj);
});

it('sets first_name', function () {
expect(projectCoordinatorData.first_name).to.eql(obj.first_name);
});

it('sets last_name', function () {
expect(projectCoordinatorData.last_name).to.eql(obj.last_name);
});

it('sets email_address', function () {
expect(projectCoordinatorData.email_address).to.eql(obj.email_address);
});

it('sets coordinator_agency', function () {
expect(projectCoordinatorData.coordinator_agency).to.eql(obj.coordinator_agency);
});

it('sets share_contact_details', function () {
expect(projectCoordinatorData.share_contact_details).to.eql(true);
});
});
});

describe('PostIUCNData', () => {
describe('No values provided', () => {
let projectIUCNData: PostIUCNData;
Expand Down
26 changes: 0 additions & 26 deletions api/src/models/project-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const defaultLog = getLogger('models/project-create');
* @class PostProjectObject
*/
export class PostProjectObject {
coordinator: PostCoordinatorData;
project: PostProjectData;
objectives: PostObjectivesData;
location: PostLocationData;
Expand All @@ -22,7 +21,6 @@ export class PostProjectObject {
constructor(obj?: any) {
defaultLog.debug({ label: 'PostProjectObject', message: 'params', obj });

this.coordinator = (obj?.coordinator && new PostCoordinatorData(obj.coordinator)) || null;
this.project = (obj?.project && new PostProjectData(obj.project)) || null;
this.objectives = (obj?.project && new PostObjectivesData(obj.objectives)) || null;
this.location = (obj?.location && new PostLocationData(obj.location)) || null;
Expand All @@ -31,30 +29,6 @@ export class PostProjectObject {
}
}

/**
* Processes POST /project contact data
*
* @export
* @class PostCoordinatorData
*/
export class PostCoordinatorData {
first_name: string;
last_name: string;
email_address: string;
coordinator_agency: string;
share_contact_details: boolean;

constructor(obj?: any) {
defaultLog.debug({ label: 'PostCoordinatorData', message: 'params', obj });

this.first_name = obj?.first_name || null;
this.last_name = obj?.last_name || null;
this.email_address = obj?.email_address || null;
this.coordinator_agency = obj?.coordinator_agency || null;
this.share_contact_details = (obj?.share_contact_details === 'true' && true) || false;
}
}

/**
* Processes POST /project project data.
*
Expand Down
77 changes: 1 addition & 76 deletions api/src/models/project-update.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { describe } from 'mocha';
import { PutCoordinatorData, PutIUCNData, PutLocationData, PutObjectivesData, PutProjectData } from './project-update';
import { PutIUCNData, PutLocationData, PutObjectivesData, PutProjectData } from './project-update';

describe('PutProjectData', () => {
describe('No values provided', () => {
Expand Down Expand Up @@ -107,81 +107,6 @@ describe('PutObjectivesData', () => {
});
});

describe('PutCoordinatorData', () => {
describe('No values provided', () => {
let data: PutCoordinatorData;

before(() => {
data = new PutCoordinatorData(null);
});

it('sets first_name', () => {
expect(data.first_name).to.equal(null);
});

it('sets last_name', () => {
expect(data.last_name).to.equal(null);
});

it('sets email_address', () => {
expect(data.email_address).to.equal(null);
});

it('sets coordinator_agency', () => {
expect(data.coordinator_agency).to.equal(null);
});

it('sets share_contact_details', () => {
expect(data.share_contact_details).to.equal(false);
});

it('sets revision_count', () => {
expect(data.revision_count).to.equal(null);
});
});

describe('all values provided', () => {
const obj = {
first_name: 'coordinator_first_name',
last_name: 'coordinator_last_name',
email_address: 'coordinator_email_address',
coordinator_agency: 'coordinator_agency_name',
share_contact_details: 'true',
revision_count: 1
};

let data: PutCoordinatorData;

before(() => {
data = new PutCoordinatorData(obj);
});

it('sets first_name', () => {
expect(data.first_name).to.equal('coordinator_first_name');
});

it('sets last_name', () => {
expect(data.last_name).to.equal('coordinator_last_name');
});

it('sets email_address', () => {
expect(data.email_address).to.equal('coordinator_email_address');
});

it('sets coordinator_agency', () => {
expect(data.coordinator_agency).to.equal('coordinator_agency_name');
});

it('sets share_contact_details', () => {
expect(data.share_contact_details).to.equal(true);
});

it('sets revision_count', () => {
expect(data.revision_count).to.equal(1);
});
});
});

describe('PutLocationData', () => {
describe('No values provided', () => {
let data: PutLocationData;
Expand Down
20 changes: 0 additions & 20 deletions api/src/models/project-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,6 @@ export class PutObjectivesData {
}
}

export class PutCoordinatorData {
first_name: string;
last_name: string;
email_address: string;
coordinator_agency: string;
share_contact_details: boolean;
revision_count: number;

constructor(obj?: any) {
defaultLog.debug({ label: 'PutCoordinatorData', message: 'params', obj });

this.first_name = obj?.first_name || null;
this.last_name = obj?.last_name || null;
this.email_address = obj?.email_address || null;
this.coordinator_agency = obj?.coordinator_agency || null;
this.share_contact_details = (obj?.share_contact_details === 'true' && true) || false;
this.revision_count = obj?.revision_count ?? null;
}
}

export class PutLocationData {
location_description: string;
geometry: Feature[];
Expand Down
Loading