diff --git a/models/Enonce.ts b/models/Enonce.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8756c4afc0a366ededea2b89774dedafbeef29d --- /dev/null +++ b/models/Enonce.ts @@ -0,0 +1,20 @@ +import GitlabRepository from '../../shared/types/Gitlab/GitlabRepository'; +import User from './User'; +import Exercice from './Exercice'; + + +interface Enonce { + name: string; + gitlabId: number; + gitlabLink: string; + gitlabCreationInfo: GitlabRepository; + gitlabLastInfo: GitlabRepository; + gitlabLastInfoDate: string; + published: boolean; + + staff: Array<User>; + exercices: Array<Exercice>; +} + + +export default Enonce; \ No newline at end of file diff --git a/models/Exercice.ts b/models/Exercice.ts new file mode 100644 index 0000000000000000000000000000000000000000..7198b8618818c14104218decf2c8a872197dfb88 --- /dev/null +++ b/models/Exercice.ts @@ -0,0 +1,16 @@ +import GitlabRepository from '../../shared/types/Gitlab/GitlabRepository'; + + +interface Exercice { + id: string; + enonceName: string; + name: string; + gitlabId: number; + gitlabLink: string; + gitlabCreationInfo: GitlabRepository; + gitlabLastInfo: GitlabRepository; + gitlabLastInfoDate: string; +} + + +export default Exercice; \ No newline at end of file diff --git a/models/User.ts b/models/User.ts new file mode 100644 index 0000000000000000000000000000000000000000..a2f3e167aaf26d8d83f5cac8406000f4b8bc6a31 --- /dev/null +++ b/models/User.ts @@ -0,0 +1,13 @@ +interface User { + id: number; + firstName: string; + lastName: string; + mail: string; + gitlabId: number; + role: string; + isTeachingStaff: boolean; + deleted: boolean; +} + + +export default User; diff --git a/types/ApiRoutes.ts b/types/ApiRoutes.ts new file mode 100644 index 0000000000000000000000000000000000000000..04c0ae614cc8d5d8e657463e92d766cc07f35db9 --- /dev/null +++ b/types/ApiRoutes.ts @@ -0,0 +1,13 @@ +enum ApiRoutes { + LOGIN = '/login', + TEST_SESSION = '/test_session', + GITLAB_CHECK_TEMPLATE_ACCESS = '/gitlab/project/{{id}}/checkTemplateAccess', + ENONCE_GET = '/enonces/{{nameOrUrl}}', + ENONCE_CREATE = '/enonces', + ENONCE_PUBLISH = '/enonces/{{nameOrUrl}}/publish', + ENONCE_UNPUBLISH = '/enonces/{{nameOrUrl}}/unpublish', + EXERCICE_CREATE = '/enonces/{{nameOrUrl}}/exercices', +} + + +export default ApiRoutes; \ No newline at end of file