Skip to content

Commit

Permalink
Merge pull request #1310 from bcgov/dev
Browse files Browse the repository at this point in the history
Release Dev to Test
  • Loading branch information
mauberti-bc authored Jun 24, 2024
2 parents 28e1356 + e4a401e commit 8fe4da3
Show file tree
Hide file tree
Showing 78 changed files with 817 additions and 3,392 deletions.
25 changes: 0 additions & 25 deletions api/src/models/project-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ describe('PostProjectData', () => {
expect(projectPostData.name).to.equal(null);
});

it('sets programs', function () {
expect(projectPostData.project_programs).to.have.length(0);
});

it('sets start_date', function () {
expect(projectPostData.start_date).to.equal(null);
});

it('sets end_date', function () {
expect(projectPostData.end_date).to.equal(null);
});

it('sets comments', function () {
expect(projectPostData.comments).to.equal(null);
});
Expand All @@ -58,7 +46,6 @@ describe('PostProjectData', () => {

const obj = {
project_name: 'name_test_data',
project_programs: [1],
start_date: 'start_date_test_data',
end_date: 'end_date_test_data',
comments: 'comments_test_data'
Expand All @@ -72,18 +59,6 @@ describe('PostProjectData', () => {
expect(projectPostData.name).to.equal('name_test_data');
});

it('sets type', function () {
expect(projectPostData.project_programs).to.eql([1]);
});

it('sets start_date', function () {
expect(projectPostData.start_date).to.equal('start_date_test_data');
});

it('sets end_date', function () {
expect(projectPostData.end_date).to.equal('end_date_test_data');
});

it('sets comments', function () {
expect(projectPostData.comments).to.equal('comments_test_data');
});
Expand Down
6 changes: 0 additions & 6 deletions api/src/models/project-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,12 @@ export class PostProjectObject {
*/
export class PostProjectData {
name: string;
project_programs: number[];
start_date: string;
end_date: string;
comments: string;

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

this.name = obj?.project_name || null;
this.project_programs = obj?.project_programs || [];
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.comments = obj?.comments || null;
}
}
Expand Down
27 changes: 0 additions & 27 deletions api/src/models/project-update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ describe('PutProjectData', () => {
expect(data.name).to.equal(null);
});

it('sets type', () => {
expect(data.project_programs).to.eql([]);
});

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

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

it('sets revision_count', () => {
expect(data.revision_count).to.equal(null);
});
Expand All @@ -34,9 +22,6 @@ describe('PutProjectData', () => {
describe('all values provided', () => {
const obj = {
project_name: 'project name',
project_programs: [1],
start_date: '2020-04-20T07:00:00.000Z',
end_date: '2020-05-20T07:00:00.000Z',
revision_count: 1
};

Expand All @@ -50,18 +35,6 @@ describe('PutProjectData', () => {
expect(data.name).to.equal('project name');
});

it('sets programs', () => {
expect(data.project_programs).to.eql([1]);
});

it('sets start_date', () => {
expect(data.start_date).to.eql('2020-04-20T07:00:00.000Z');
});

it('sets end_date', () => {
expect(data.end_date).to.equal('2020-05-20T07:00:00.000Z');
});

it('sets revision_count', () => {
expect(data.revision_count).to.equal(1);
});
Expand Down
6 changes: 0 additions & 6 deletions api/src/models/project-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ const defaultLog = getLogger('models/project-update');

export class PutProjectData {
name: string;
project_programs: number[];
start_date: string;
end_date: string;
revision_count: number;

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

this.name = obj?.project_name || null;
this.project_programs = obj?.project_programs || [];
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.revision_count = obj?.revision_count ?? null;
}
}
Expand Down
30 changes: 0 additions & 30 deletions api/src/models/project-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ describe('ProjectData', () => {
project_id: 1,
uuid: 'uuid',
project_name: '',
project_programs: [],
start_date: '2005-01-01',
end_date: '2006-01-01',
comments: '',
revision_count: 1
};
Expand All @@ -32,18 +29,6 @@ describe('ProjectData', () => {
it('sets name', () => {
expect(data.project_name).to.equal('');
});

it('sets programs', () => {
expect(data.project_programs).to.eql([]);
});

it('sets start_date', () => {
expect(data.start_date).to.eql('2005-01-01');
});

it('sets end_date', () => {
expect(data.end_date).to.eql('2006-01-01');
});
});

describe('all values provided', () => {
Expand All @@ -63,9 +48,6 @@ describe('ProjectData', () => {
project_id: 1,
uuid: 'uuid',
project_name: 'project name',
project_programs: [1],
start_date: '2020-04-20T07:00:00.000Z',
end_date: '2020-05-20T07:00:00.000Z',
comments: '',
revision_count: 1
};
Expand All @@ -78,18 +60,6 @@ describe('ProjectData', () => {
it('sets name', () => {
expect(data.project_name).to.equal(projectData.name);
});

it('sets type', () => {
expect(data.project_programs).to.eql([1]);
});

it('sets start_date', () => {
expect(data.start_date).to.eql('2020-04-20T07:00:00.000Z');
});

it('sets end_date', () => {
expect(data.end_date).to.eql('2020-05-20T07:00:00.000Z');
});
});
});

Expand Down
11 changes: 1 addition & 10 deletions api/src/models/project-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { ProjectUser } from '../repositories/project-participation-repository';
import { SystemUser } from '../repositories/user-repository';

export interface IProjectAdvancedFilters {
project_programs?: number[];
start_date?: string;
end_date?: string;
keyword?: string;
project_name?: string;
itis_tsns?: number[];
Expand All @@ -22,9 +19,6 @@ export const ProjectData = z.object({
project_id: z.number(),
uuid: z.string().uuid(),
project_name: z.string(),
project_programs: z.array(z.number()),
start_date: z.string(),
end_date: z.string().nullable(),
comments: z.string().nullable(),
revision_count: z.number()
});
Expand All @@ -34,10 +28,7 @@ export type ProjectData = z.infer<typeof ProjectData>;
export const ProjectListData = z.object({
project_id: z.number(),
name: z.string(),
project_programs: z.array(z.number()),
regions: z.array(z.string()),
start_date: z.string(),
end_date: z.string().nullable().optional()
regions: z.array(z.string())
});

export type ProjectListData = z.infer<typeof ProjectListData>;
Expand Down
28 changes: 2 additions & 26 deletions api/src/openapi/schemas/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ export const projectCreatePostRequestObject = {
project_name: {
type: 'string'
},
project_programs: {
type: 'array',
minItems: 1,
items: {
type: 'number'
}
},
start_date: {
type: 'string',
description: 'ISO 8601 date string'
Expand Down Expand Up @@ -112,7 +105,7 @@ const projectUpdateProperties = {
description: 'Basic project metadata',
type: 'object',
additionalProperties: false,
required: ['project_name', 'project_programs', 'start_date', 'end_date', 'revision_count'],
required: ['project_name', 'revision_count'],
nullable: true,
properties: {
project_id: {
Expand All @@ -129,23 +122,6 @@ const projectUpdateProperties = {
project_name: {
type: 'string'
},
project_programs: {
type: 'array',
items: {
type: 'number'
}
},
start_date: {
type: 'string',
format: 'date',
description: 'ISO 8601 date string for the project start date'
},
end_date: {
type: 'string',
format: 'date',
description: 'ISO 8601 date string for the project end date',
nullable: true
},
revision_count: {
type: 'number'
}
Expand Down Expand Up @@ -242,7 +218,7 @@ const projectUpdateProperties = {
type: 'string'
},
record_end_date: {
oneOf: [{ type: 'object' }, { type: 'string', format: 'date' }],
type: 'string',
description: 'Determines if the user record has expired',
nullable: true
},
Expand Down
11 changes: 3 additions & 8 deletions api/src/openapi/schemas/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export const surveyDetailsSchema: OpenAPIV3.SchemaObject = {
type: 'string'
},
start_date: {
description: 'Survey start date',
type: 'string',
format: 'date'
description: 'Survey start date. ISO 8601 date string.'
},
end_date: {
description: 'Survey end date',
Expand Down Expand Up @@ -94,13 +93,11 @@ export const surveyFundingSourceSchema: OpenAPIV3.SchemaObject = {
start_date: {
description: 'Funding source start date',
type: 'string',
format: 'date',
nullable: true
},
end_date: {
description: 'Funding source end date',
type: 'string',
format: 'date',
nullable: true
},
description: {
Expand Down Expand Up @@ -266,13 +263,11 @@ export const surveyFundingSourceDataSchema: OpenAPIV3.SchemaObject = {
start_date: {
description: 'Funding source start date',
type: 'string',
format: 'date',
nullable: true
},
end_date: {
description: 'Funding source end date',
type: 'string',
format: 'date',
nullable: true
},
description: {
Expand Down Expand Up @@ -575,8 +570,8 @@ export const surveySupplementaryDataSchema: OpenAPIV3.SchemaObject = {
minimum: 1
},
event_timestamp: {
oneOf: [{ type: 'object' }, { type: 'string', format: 'date' }],
description: 'ISO 8601 date string for the project start date'
type: 'string',
description: 'ISO 8601 date string'
},
submission_uuid: {
type: 'string',
Expand Down
6 changes: 3 additions & 3 deletions api/src/openapi/schemas/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const systemUserSchema: OpenAPIV3.SchemaObject = {
type: 'string'
},
record_end_date: {
oneOf: [{ type: 'object' }, { type: 'string', format: 'date' }],
type: 'string',
description: 'Determines if the user record has expired',
nullable: true
},
Expand Down Expand Up @@ -203,7 +203,7 @@ export const projectAndSystemUserSchema: OpenAPIV3.SchemaObject = {
type: 'string'
},
record_end_date: {
oneOf: [{ type: 'object' }, { type: 'string', format: 'date' }],
type: 'string',
description: 'Determines if the user record has expired',
nullable: true
},
Expand Down Expand Up @@ -277,7 +277,7 @@ export const surveyParticipationAndSystemUserSchema: OpenAPIV3.SchemaObject = {
type: 'string'
},
record_end_date: {
oneOf: [{ type: 'object' }, { type: 'string', format: 'date' }],
type: 'string',
description: 'Determines if the user record has expired',
nullable: true
},
Expand Down
4 changes: 2 additions & 2 deletions api/src/paths/administrative-activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ GET.apiDoc = {
nullable: true
},
create_date: {
oneOf: [{ type: 'object' }, { type: 'string', format: 'date' }],
description: 'ISO 8601 date string for the project start date'
type: 'string',
description: 'ISO 8601 date string'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/src/paths/administrative-activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ POST.apiDoc = {
},
date: {
description: 'The date this administrative activity was made',
oneOf: [{ type: 'object' }, { type: 'string', format: 'date' }]
type: 'string'
}
}
}
Expand Down
Loading

0 comments on commit 8fe4da3

Please sign in to comment.