Skip to content

Commit

Permalink
feat(workspace): update projects model (#747)
Browse files Browse the repository at this point in the history
Uses new project type instead of solution type.

BREAKING CHANGE: removed solution type.
  • Loading branch information
pcoelho-coveo authored Oct 6, 2023
1 parent 3a71f44 commit d9b5336
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
12 changes: 4 additions & 8 deletions src/resources/Projects/ProjectInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const projectResourceTypes = [

export type ProjectResourceType = (typeof projectResourceTypes)[number];

export enum SolutionType {
export enum ProjectType {
Commerce = 'COMMERCE',
Other = 'OTHER',
Service = 'SERVICE',
Expand All @@ -45,9 +45,9 @@ export interface BaseProjectModel {
*/
description: string;
/**
* The solution type of the project.
* The type of the project.
*/
solutionType: SolutionType;
type: ProjectType;
/**
* The list of usernames that will be points of contact for the project.
*
Expand All @@ -64,7 +64,7 @@ export interface BaseProjectModel {

export interface ProjectModel extends BaseProjectModel {
/**
* The unique identitifier of the project.
* The unique identifier of the project.
*/
id: string;
/**
Expand Down Expand Up @@ -114,8 +114,4 @@ export interface ListProjectParams extends Paginated {
* @example: 'ASC'
*/
order?: SortingOrder;
/**
* Whether to include resources when returning results.
*/
includeResources?: boolean;
}
10 changes: 5 additions & 5 deletions src/resources/Projects/tests/Project.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import API from '../../../APICore.js';
import Project from '../Project.js';
import {BaseProjectModel, ProjectModel, SolutionType} from '../ProjectInterfaces.js';
import {BaseProjectModel, ProjectModel, ProjectType} from '../ProjectInterfaces.js';

jest.mock('../../../APICore.js');

Expand All @@ -16,14 +16,14 @@ describe('Project', () => {
const mockNewProject: BaseProjectModel = {
name: 'Pokemon Project',
description: 'Project about pokemons',
solutionType: SolutionType.Commerce,
type: ProjectType.Commerce,
};

const mockProject: ProjectModel = {
id: mockProjectId,
name: 'Pokemon Project',
description: 'Project about pokemons',
solutionType: SolutionType.Commerce,
type: ProjectType.Commerce,
createdBy: '[email protected]',
updatedBy: '[email protected]',
createdDate: '2023-07-19T02:37:23.399Z',
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('Project', () => {
expect(api.post).toHaveBeenCalledWith(Project.baseUrl, {
name: 'Pokemon Project',
description: 'Project about pokemons',
solutionType: SolutionType.Commerce,
type: ProjectType.Commerce,
});
});
});
Expand All @@ -70,7 +70,7 @@ describe('Project', () => {
id: mockProjectId,
name: 'Pokemon Project',
description: 'Project about pokemons',
solutionType: SolutionType.Commerce,
type: ProjectType.Commerce,
createdBy: '[email protected]',
updatedBy: '[email protected]',
createdDate: '2023-07-19T02:37:23.399Z',
Expand Down

0 comments on commit d9b5336

Please sign in to comment.