Skip to content

Commit 42f1cb2

Browse files
author
Antonio Contreras LEMONCODE
committed
Create project list api, project list api model and project list mock data from api
1 parent d940610 commit 42f1cb2

4 files changed

Lines changed: 90 additions & 0 deletions

File tree

src/pods/project-list/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './project-list.api';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export interface Project {
2+
id: string;
3+
active: boolean;
4+
code: string;
5+
projectName: string;
6+
lastDateIncurred: string;
7+
creationDate: string;
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Project } from './project-list.api-model';
2+
import { mockProjectList } from './project-list.mock-data';
3+
4+
let projectList = [...mockProjectList];
5+
6+
export const getProjectList = async (): Promise<Project[]> => {
7+
return projectList;
8+
};
9+
10+
export const deleteProject = async (id: string): Promise<boolean> => {
11+
projectList = projectList.filter(p => p.id !== id);
12+
return true;
13+
};
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { Project } from './project-list.api-model';
2+
3+
export const mockProjectList: Project[] = [
4+
{
5+
id: '1',
6+
active: true,
7+
code: '23212',
8+
projectName: 'Bankia',
9+
lastDateIncurred: '02/02/2020',
10+
creationDate: '01/08/2018',
11+
},
12+
{
13+
id: '2',
14+
active: true,
15+
code: '4323',
16+
projectName: 'Mapfre',
17+
lastDateIncurred: '05/02/2020',
18+
creationDate: '01/04/2018',
19+
},
20+
{
21+
id: '3',
22+
active: true,
23+
code: '002',
24+
projectName: 'Vacaciones',
25+
lastDateIncurred: '05/02/2020',
26+
creationDate: '01/04/2018',
27+
},
28+
{
29+
id: '4',
30+
active: true,
31+
code: '003',
32+
projectName: 'Baja Médica',
33+
lastDateIncurred: '05/03/2018',
34+
creationDate: '01/05/2019',
35+
},
36+
{
37+
id: '5',
38+
active: false,
39+
code: '2586',
40+
projectName: 'Proyecto interno',
41+
lastDateIncurred: '05/08/2020',
42+
creationDate: '01/10/2018',
43+
},
44+
{
45+
id: '6',
46+
active: false,
47+
code: '3025',
48+
projectName: 'BBVA',
49+
lastDateIncurred: '06/05/2020',
50+
creationDate: '01/03/2019',
51+
},
52+
{
53+
id: '7',
54+
active: false,
55+
code: '8563',
56+
projectName: 'Baja Médica',
57+
lastDateIncurred: '02/08/2018',
58+
creationDate: '01/11/2020',
59+
},
60+
{
61+
id: '8',
62+
active: true,
63+
code: '4125',
64+
projectName: 'Microsoft España',
65+
lastDateIncurred: '11/10/2018',
66+
creationDate: '01/07/2020',
67+
},
68+
];

0 commit comments

Comments
 (0)