creationDtoSql #1

Merged
AlexandreRuiz merged 7 commits from creationDtoSql into develop 3 years ago
  1. 15
      .gitignore
  2. 25
      Collaborateur_Epa_Back/Collaborateur_Epa_Back.sln
  3. 8
      Collaborateur_Epa_Back/Model/Class1.cs
  4. 7
      Collaborateur_Epa_Back/Model/Model.csproj
  5. 161
      Collaborateur_Epa_Back/db/db_1_0_0.sql
  6. 25
      Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs
  7. 31
      Collaborateur_Epa_Back/espacecollab.backend.api/Properties/launchSettings.json
  8. 9
      Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json
  9. 17
      Collaborateur_Epa_Back/espacecollab.backend.api/espacecollab.backend.api.csproj
  10. 9
      Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/espacecollab.backend.appservices.dtos.csproj
  11. 9
      Collaborateur_Epa_Back/espacecollab.backend.appservices/espacecollab.backend.appservices.csproj
  12. 22
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs
  13. 24
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs
  14. 21
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs
  15. 23
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs
  16. 21
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEffectuePeriodeEssaiSqlDto.cs
  17. 21
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs
  18. 44
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs
  19. 9
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumGenre.cs
  20. 11
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumIssue.cs
  21. 10
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumStatut.cs
  22. 21
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs
  23. 29
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs
  24. 29
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs
  25. 21
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs
  26. 27
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs
  27. 21
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs
  28. 25
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs
  29. 19
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs
  30. 9
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/espacecollab.backend.infrastructure.sql.dtos.csproj
  31. 153
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/db_1_0_0.sql
  32. 9
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/espacecollab.backend.infrastructure.sql.csproj
  33. 49
      Collaborateur_Epa_Back/espacecollab.backend.sln

15
.gitignore vendored

@ -1,4 +1,3 @@
# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
@ -208,7 +207,7 @@ PublishScripts/
*.nuget.targets
# Nuget personal access tokens and Credentials
nuget.config
# nuget.config
# Microsoft Azure Build Output
csx/
@ -388,14 +387,4 @@ FodyWeavers.xsd
.idea/
*.sln.iml
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
*.Development.json

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31729.503
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{41657DCB-D497-4D12-BE12-E9F1CB0731D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{41657DCB-D497-4D12-BE12-E9F1CB0731D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41657DCB-D497-4D12-BE12-E9F1CB0731D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41657DCB-D497-4D12-BE12-E9F1CB0731D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41657DCB-D497-4D12-BE12-E9F1CB0731D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0A56A44C-135E-4CE4-834B-8DFDF69DC415}
EndGlobalSection
EndGlobal

@ -1,8 +0,0 @@
using System;
namespace Model
{
public class Class1
{
}
}

@ -1,7 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>

@ -1,161 +0,0 @@
DROP DATABASE IF EXISTS collaborateur_epa;
CREATE DATABASE IF NOT EXISTS collaborateur_epa /*!40100 DEFAULT CHARACTER SET latin1 */;
USE collaborateur_epa;
DROP TABLE IF EXISTS agence;
CREATE TABLE IF NOT EXISTS agence(
id int NOT NULL AUTO_INCREMENT,
nom varchar(100) NOT NULL UNIQUE,
adresse_id int NOT NULL,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS business_unit;
CREATE TABLE IF NOT EXISTS business_unit(
id int NOT NULL AUTO_INCREMENT,
nom varchar(100) NOT NULL UNIQUE,
agence_id int NOT NULL,
CONSTRAINT FK_BUSINESS_UNIT_AGENCE FOREIGN KEY (agence_id) references agence(id),
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS site;
CREATE TABLE IF NOT EXISTS site(
id int NOT NULL AUTO_INCREMENT,
nom varchar(100) NOT NULL UNIQUE,
adresse varchar(200) NOT NULL,
business_unit_id int NOT NULL,
CONSTRAINT FK_SITE_BUSINESS_UNIT FOREIGN KEY (business_unit_id) references business_unit(id),
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS projet;
CREATE TABLE IF NOT EXISTS projet(
id int NOT NULL AUTO_INCREMENT,
nom varchar(100) NOT NULL UNIQUE,
client varchar(100) NOT NULL,
description varchar(100) NOT NULL,
date_debut date NOT NULL,
dateFin date NOT NULL,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS technologie;
CREATE TABLE IF NOT EXISTS technologie(
id int NOT NULL UNIQUE,
intitule varchar(100) NOT NULL UNIQUE,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS periode_essai;
CREATE TABLE IF NOT EXISTS periode_essai(
id int NOT NULL AUTO_INCREMENT,
date_debut date NOT NULL,
date_fin_prevue date NOT NULL,
date_fin_effective date NOT NULL,
commentaire varchar(100),
issue ENUM('VALIDEE','PROLONGEE_COLLAB','PROLONGEE_APSIDE','ARRETEE_COLLAB','ARRETEE_APSIDE'),
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS fonction;
CREATE TABLE IF NOT EXISTS fonction(
id int NOT NULL UNIQUE,
intitule varchar(100) NOT NULL UNIQUE,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS collaborateur;
CREATE TABLE IF NOT EXISTS collaborateur(
id int NOT NULL AUTO_INCREMENT,
nom varchar(100) NOT NULL UNIQUE,
prenom varchar(100) NOT NULL,
date_naissance date NOT NULL,
genre ENUM('MASCULIN','FEMININ','AUTRE'),
statut ENUM('CADRE','NON-CADRE','ALTERNANT','STAGIAIRE'),
nombre_enfants smallint,
telephone varchar(15),
mail_personnel varchar(100),
mail_apside varchar(100),
date_depart date,
parrain_id int,
CONSTRAINT FK_COLLABORATEUR_PARRAIN FOREIGN KEY (parrain_id) REFERENCES collaborateur(id),
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS referencement;
CREATE TABLE IF NOT EXISTS referencement(
id int NOT NULL AUTO_INCREMENT,
date_debut date NOT NULL,
date_fin date NOT NULL,
refere_id int NOT NULL,
referent_id int NOT NULL,
CONSTRAINT FK_COLLABORATEUR_REFERE FOREIGN KEY (refere_id) REFERENCES collaborateur(id),
CONSTRAINT FK_COLLABORATEUR_REFERENT FOREIGN KEY (referent_id) REFERENCES collaborateur(id),
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS collaborateur_est_fonction;
CREATE TABLE IF NOT EXISTS collaborateur_est_fonction(
collaborateur_id int NOT NULL,
fonction_id int NOT NULL,
PRIMARY KEY (collaborateur_id,fonction_id),
CONSTRAINT FK_COLLABORATEUR_FONCTION FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id),
CONSTRAINT FK_FONCTION_COLLABORATEUR FOREIGN KEY (fonction_id) REFERENCES fonction(id)
);
DROP TABLE IF EXISTS collaborateur_appartient_business_unit;
CREATE TABLE IF NOT EXISTS collaborateur_appartient_business_unit(
collaborateur_id int NOT NULL,
business_unit_id int NOT NULL,
PRIMARY KEY (collaborateur_id,business_unit_id),
CONSTRAINT FK_COLLABORATEUR_BUSINESS_UNIT FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id),
CONSTRAINT FK_BUSINESS_UNIT_COLLABORATEUR FOREIGN KEY (business_unit_id) REFERENCES business_unit(id)
);
DROP TABLE IF EXISTS collaborateur_effectue_periode_essai;
CREATE TABLE IF NOT EXISTS collaborateur_effectue_periode_essai(
collaborateur_id int NOT NULL,
periode_essai_id int NOT NULL,
PRIMARY KEY (collaborateur_id,periode_essai_id),
CONSTRAINT FK_COLLABORATEUR_PERIODE_ESSAI FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id),
CONSTRAINT FK_PERIODE_ESSAI_COLLABORATEUR FOREIGN KEY (periode_essai_id) REFERENCES periode_essai(id)
);
DROP TABLE IF EXISTS site_developpe_projet;
CREATE TABLE IF NOT EXISTS site_developpe_projet(
site_id int NOT NULL,
projet_id int NOT NULL,
PRIMARY KEY (site_id,projet_id),
CONSTRAINT FK_SITE_PROJET FOREIGN KEY (site_id) REFERENCES site(id),
CONSTRAINT FK_PROJET_SITE FOREIGN KEY (projet_id) REFERENCES projet(id)
);
DROP TABLE IF EXISTS projet_utilise_technologie;
CREATE TABLE IF NOT EXISTS projet_utilise_technologie(
projet_id int NOT NULL,
technologie_id int NOT NULL,
PRIMARY KEY (projet_id,technologie_id),
CONSTRAINT FK_PROJET_TECHNOLOGIE FOREIGN KEY (projet_id) REFERENCES projet(id),
CONSTRAINT FK_TECHNOLOGIE_PROJET FOREIGN KEY (technologie_id) REFERENCES technologie(id)
);
DROP TABLE IF EXISTS collaborateur_manage_projet;
CREATE TABLE IF NOT EXISTS collaborateur_manage_projet(
collaborateur_id int NOT NULL,
projet_id int NOT NULL,
PRIMARY KEY (collaborateur_id,projet_id),
CONSTRAINT FK_COLLABORATEUR_MANAGE_PROJET FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id),
CONSTRAINT FK_PROJET_MANAGE_COLLABORATEUR FOREIGN KEY (projet_id) REFERENCES projet(id)
);
DROP TABLE IF EXISTS collaborateur_collabore_projet;
CREATE TABLE IF NOT EXISTS collaborateur_collabore_projet(
collaborateur_id int NOT NULL,
projet_id int NOT NULL,
PRIMARY KEY (collaborateur_id,projet_id),
CONSTRAINT FK_COLLABORATEUR_COLLABORE_PROJET FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id),
CONSTRAINT FK_PROJET_COLLABORE_COLLABORATEUR FOREIGN KEY (projet_id) REFERENCES projet(id)
);

@ -0,0 +1,25 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();

@ -0,0 +1,31 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:27916",
"sslPort": 44341
}
},
"profiles": {
"espacecollab.backend.api": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7125;http://localhost:5125",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
</ItemGroup>
</Project>

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,22 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class AgenceSqlDto
{
public Guid Id { get; set; }
public string Name { get; set; }
[ExcludeFromCodeCoverage]
private AgenceSqlDto()
{
}
public AgenceSqlDto(Guid id, string name)
{
Id = id;
Name = name;
}
}
}

@ -0,0 +1,24 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class BusinessUnitSqlDto
{
public Guid Id { get; set; }
public string Name { get; set; }
public Guid AgenceId { get; set; }
[ExcludeFromCodeCoverage]
private BusinessUnitSqlDto()
{
}
public BusinessUnitSqlDto(Guid id, string name, Guid agenceId)
{
Id = id;
Name = name;
AgenceId = agenceId;
}
}
}

@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos.Associations
{
public class CollaborateurAppartientBusinessUnitSqlDto
{
public Guid CollaborateurId { get; set; }
public Guid BusinessUnitId { get; set; }
[ExcludeFromCodeCoverage]
private CollaborateurAppartientBusinessUnitSqlDto()
{
}
public CollaborateurAppartientBusinessUnitSqlDto(Guid collaborateurId, Guid businessUnitId)
{
CollaborateurId = collaborateurId;
BusinessUnitId = businessUnitId;
}
}
}

@ -0,0 +1,23 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class CollaborateurCollaboreProjetSqlDto
{
public Guid CollaborateurId { get; set; }
public Guid ProjetId { get; set; }
public bool IsManager { get; set; }
[ExcludeFromCodeCoverage]
private CollaborateurCollaboreProjetSqlDto()
{
}
public CollaborateurCollaboreProjetSqlDto(Guid collaborateurId, Guid projetId, bool isManager)
{
CollaborateurId = collaborateurId;
ProjetId = projetId;
IsManager = isManager;
}
}
}

@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos.Associations
{
public class CollaborateurEffectuePeriodeEssaiSqlDto
{
public Guid CollaborateurId { get; set; }
public Guid PeriodeEssaiId { get; set;}
[ExcludeFromCodeCoverage]
private CollaborateurEffectuePeriodeEssaiSqlDto()
{
}
public CollaborateurEffectuePeriodeEssaiSqlDto(Guid collaborateurId, Guid periodeEssaiId)
{
CollaborateurId = collaborateurId;
PeriodeEssaiId = periodeEssaiId;
}
}
}

@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos.Associations
{
public class CollaborateurEstFonctionSqlDto
{
public Guid CollaborateurId { get; set; }
public Guid FonctionId { get; set;}
[ExcludeFromCodeCoverage]
private CollaborateurEstFonctionSqlDto()
{
}
public CollaborateurEstFonctionSqlDto(Guid collaborateurId, Guid fonctionId)
{
CollaborateurId = collaborateurId;
FonctionId = fonctionId;
}
}
}

@ -0,0 +1,44 @@
using espacecollab.backend.infrastructure.sql.dtos.Enums;
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class CollaborateurSqlDto
{
public Guid Id { get; set; }
public string Name { get; set; }
public string FirstName { get; set; }
public DateTime BirthDate { get; set; }
public EnumGenre Gender { get; set; }
public EnumStatut Status { get; set; }
public int ChildrenNumber { get; set; }
public string Address { get; set; }
public string Telephone { get; set; }
public string PersonalMail { get; set; }
public string ApsideMail { get; set; }
public DateTime ResignationDate { get; set; }
public Guid ReferrerId { get; set; }
[ExcludeFromCodeCoverage]
private CollaborateurSqlDto()
{
}
public CollaborateurSqlDto(Guid id, string name, string firstName, DateTime birthDate, EnumGenre gender, EnumStatut status, int childrenNumber, string address, string telephone, string personalMail, string apsideMail, DateTime resignationDate, Guid referrerId)
{
Id = id;
Name = name;
FirstName = firstName;
BirthDate = birthDate;
Gender = gender;
Status = status;
ChildrenNumber = childrenNumber;
Address = address;
Telephone = telephone;
PersonalMail = personalMail;
ApsideMail = apsideMail;
ResignationDate = resignationDate;
ReferrerId = referrerId;
}
}
}

@ -0,0 +1,9 @@
namespace espacecollab.backend.infrastructure.sql.dtos.Enums
{
public enum EnumGenre
{
MASCULIN,
FEMININ,
AUTRE
}
}

@ -0,0 +1,11 @@
namespace espacecollab.backend.infrastructure.sql.dtos
{
public enum EnumIssue
{
VALIDEE,
PROLONGEE_COLLAB,
PROLONGEE_APSIDE,
ARRETEE_COLLAB,
ARRETEE_APSIDE
}
}

@ -0,0 +1,10 @@
namespace espacecollab.backend.infrastructure.sql.dtos.Enums
{
public enum EnumStatut
{
CADRE,
NONCADRE,
ALTERNANT,
STAGIAIRE
}
}

@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class FonctionSqlDto
{
public Guid Id { get; set; }
public string Name { get; set; }
[ExcludeFromCodeCoverage]
private FonctionSqlDto()
{
}
public FonctionSqlDto(Guid id, string name)
{
Id = id;
Name = name;
}
}
}

@ -0,0 +1,29 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class PeriodeEssaiSqlDto
{
public Guid Id { get; set; }
public DateTime StartingDate { get; set; }
public DateTime PlannedEndingDate { get; set; }
public DateTime RealEndingDate { get; set; }
public string Comment { get; set; }
public EnumIssue Issue { get; set; }
[ExcludeFromCodeCoverage]
private PeriodeEssaiSqlDto()
{
}
public PeriodeEssaiSqlDto(Guid id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssue issue)
{
Id = id;
StartingDate = startingDate;
PlannedEndingDate = plannedEndingDate;
RealEndingDate = realEndingDate;
Comment = comment;
Issue = issue;
}
}
}

@ -0,0 +1,29 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class ProjetSqlDto
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Client { get; set; }
public string Description { get; set; }
public DateTime StartingDate { get; set; }
public DateTime EndingDate { get; set; }
[ExcludeFromCodeCoverage]
private ProjetSqlDto()
{
}
public ProjetSqlDto(Guid id, string name, string client, string description, DateTime startingDate, DateTime endingDate)
{
Id = id;
Name = name;
Client = client;
Description = description;
StartingDate = startingDate;
EndingDate = endingDate;
}
}
}

@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class ProjetUtiliseTechnologieSqlDto
{
public Guid ProjetId { get; set; }
public Guid TechnologieId { get; set; }
[ExcludeFromCodeCoverage]
private ProjetUtiliseTechnologieSqlDto()
{
}
public ProjetUtiliseTechnologieSqlDto(Guid projetId, Guid technologieId)
{
ProjetId = projetId;
TechnologieId = technologieId;
}
}
}

@ -0,0 +1,27 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class ReferencementSqlDto
{
public Guid Id { get; set; }
public DateTime StartingDate { get; set; }
public DateTime EndingDate { get; set; }
public Guid ReferredId { get; set; }
public Guid ReferrerId { get; set; }
[ExcludeFromCodeCoverage]
private ReferencementSqlDto()
{
}
public ReferencementSqlDto(Guid id, DateTime startingDate, DateTime endingDate, Guid referredId, Guid referrerId)
{
Id = id;
StartingDate = startingDate;
EndingDate = endingDate;
ReferredId = referredId;
ReferrerId = referrerId;
}
}
}

@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class SiteDeveloppeProjetSqlDto
{
public Guid SiteId { get; set; }
public Guid ProjetId { get; set; }
[ExcludeFromCodeCoverage]
private SiteDeveloppeProjetSqlDto()
{
}
public SiteDeveloppeProjetSqlDto(Guid siteId, Guid projetId)
{
SiteId = siteId;
ProjetId = projetId;
}
}
}

@ -0,0 +1,25 @@
using System.Diagnostics.CodeAnalysis;
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class SiteSqlDto
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public Guid BusinessUnitId { get; set; }
[ExcludeFromCodeCoverage]
private SiteSqlDto()
{
}
public SiteSqlDto(Guid id, string name, string address, Guid businessUnitId)
{
Id = id;
Name = name;
Address = address;
BusinessUnitId = businessUnitId;
}
}
}

@ -0,0 +1,19 @@
namespace espacecollab.backend.infrastructure.sql.dtos
{
public class TechnologieSqlDto
{
public Guid Id { get; set; }
public string Name { get; set; }
[ExcludeFromCodeCoverage]
private TechnologieSqlDto()
{
}
public TechnologieSqlDto(Guid id, string name)
{
Id = id;
Name = name;
}
}
}

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,153 @@
DROP DATABASE IF EXISTS collaborateur_epa;
CREATE DATABASE IF NOT EXISTS collaborateur_epa /*!40100 DEFAULT CHARACTER SET latin1 */;
USE collaborateur_epa;
DROP TABLE IF EXISTS Agence;
CREATE TABLE IF NOT EXISTS Agence(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL UNIQUE,
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS BusinessUnit;
CREATE TABLE IF NOT EXISTS BusinessUnit(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL UNIQUE,
AgenceId int NOT NULL,
CONSTRAINT FK_BUSINESS_UNIT_AGENCE FOREIGN KEY (AgenceId) references Agence(Id),
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS Site;
CREATE TABLE IF NOT EXISTS Site(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL UNIQUE,
Address varchar(200) NOT NULL,
BusinessUnitId int NOT NULL,
CONSTRAINT FK_SITE_BUSINESS_UNIT FOREIGN KEY (BusinessUnitId) references BusinessUnit(Id),
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS Projet;
CREATE TABLE IF NOT EXISTS Projet(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL UNIQUE,
Client varchar(100) NOT NULL,
Description varchar(100) NOT NULL,
StartingDate date NOT NULL,
EndingDate date NOT NULL,
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS Technologie;
CREATE TABLE IF NOT EXISTS Technologie(
Id int NOT NULL UNIQUE,
Name varchar(100) NOT NULL UNIQUE,
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS PeriodeEssai;
CREATE TABLE IF NOT EXISTS PeriodeEssai(
Id int NOT NULL AUTO_INCREMENT,
StartingDate date NOT NULL,
PlannedEndingDate date NOT NULL,
RealEndingDate date NOT NULL,
Comment varchar(100) NOT NULL,
Issue ENUM('VALIDEE','PROLONGEE_COLLAB','PROLONGEE_APSIDE','ARRETEE_COLLAB','ARRETEE_APSIDE') NOT NULL,
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS Fonction;
CREATE TABLE IF NOT EXISTS Fonction(
Id int NOT NULL UNIQUE,
intitule varchar(100) NOT NULL UNIQUE,
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS Collaborateur;
CREATE TABLE IF NOT EXISTS Collaborateur(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL UNIQUE,
FirstName varchar(100) NOT NULL,
BirthDate date NOT NULL,
Gender ENUM('MASCULIN','FEMININ','AUTRE') NOT NULL,
Status ENUM('CADRE','NONCADRE','ALTERNANT','STAGIAIRE') NOT NULL,
ChildrenNumber smallint NOT NULL,
Address varchar(200) NOT NULL,
Telephone varchar(15) NOT NULL,
PersonalMail varchar(100) NOT NULL,
ApsideMail varchar(100) NOT NULL,
ResignationDate date NOT NULL,
ReferrerId int NOT NULL,
CONSTRAINT FK_COLLABORATEUR_PARRAIN FOREIGN KEY (ReferrerId) REFERENCES Collaborateur(Id),
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS Referencement;
CREATE TABLE IF NOT EXISTS Referencement(
Id int NOT NULL AUTO_INCREMENT,
StartingDate date NOT NULL,
EndingDate date NOT NULL,
ReferredId int NOT NULL,
ReferrerId int NOT NULL,
CONSTRAINT FK_COLLABORATEUR_REFERE FOREIGN KEY (ReferredId) REFERENCES Collaborateur(Id),
CONSTRAINT FK_COLLABORATEUR_REFERENT FOREIGN KEY (ReferrerId) REFERENCES Collaborateur(Id),
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS CollaborateurEstFonction;
CREATE TABLE IF NOT EXISTS CollaborateurEstFonction(
CollaborateurId int NOT NULL,
FonctionId int NOT NULL,
PRIMARY KEY (CollaborateurId,FonctionId),
CONSTRAINT FK_COLLABORATEUR_FONCTION FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id),
CONSTRAINT FK_FONCTION_COLLABORATEUR FOREIGN KEY (FonctionId) REFERENCES Fonction(Id)
);
DROP TABLE IF EXISTS CollaborateurAppartientBusinessUnit;
CREATE TABLE IF NOT EXISTS CollaborateurAppartientBusinessUnit(
CollaborateurId int NOT NULL,
BusinessUnitId int NOT NULL,
PRIMARY KEY (CollaborateurId,BusinessUnitId),
CONSTRAINT FK_COLLABORATEUR_BUSINESS_UNIT FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id),
CONSTRAINT FK_BUSINESS_UNIT_COLLABORATEUR FOREIGN KEY (BusinessUnitId) REFERENCES BusinessUnit(Id)
);
DROP TABLE IF EXISTS CollaborateurEffectuePeriodeEssai;
CREATE TABLE IF NOT EXISTS CollaborateurEffectuePeriodeEssai(
CollaborateurId int NOT NULL,
PeriodeEssaiId int NOT NULL,
PRIMARY KEY (CollaborateurId,PeriodeEssaiId),
CONSTRAINT FK_COLLABORATEUR_PERIODE_ESSAI FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id),
CONSTRAINT FK_PERIODE_ESSAI_COLLABORATEUR FOREIGN KEY (PeriodeEssaiId) REFERENCES PeriodeEssai(Id)
);
DROP TABLE IF EXISTS SiteDeveloppeProjet;
CREATE TABLE IF NOT EXISTS SiteDeveloppeProjet(
SiteId int NOT NULL,
ProjetId int NOT NULL,
PRIMARY KEY (SiteId,ProjetId),
CONSTRAINT FK_SITE_PROJET FOREIGN KEY (SiteId) REFERENCES Site(Id),
CONSTRAINT FK_PROJET_SITE FOREIGN KEY (ProjetId) REFERENCES Projet(Id)
);
DROP TABLE IF EXISTS ProjetUtiliseTechnologie;
CREATE TABLE IF NOT EXISTS ProjetUtiliseTechnologie(
ProjetId int NOT NULL,
TechnologieId int NOT NULL,
PRIMARY KEY (ProjetId,TechnologieId),
CONSTRAINT FK_PROJET_TECHNOLOGIE FOREIGN KEY (ProjetId) REFERENCES Projet(Id),
CONSTRAINT FK_TECHNOLOGIE_PROJET FOREIGN KEY (TechnologieId) REFERENCES Technologie(Id)
);
DROP TABLE IF EXISTS CollaborateurCollaboreProjet;
CREATE TABLE IF NOT EXISTS CollaborateurCollaboreProjet(
CollaborateurId int NOT NULL,
ProjetId int NOT NULL,
isManager boolean NOT NULL,
PRIMARY KEY (CollaborateurId,ProjetId),
CONSTRAINT FK_COLLABORATEUR_COLLABORE_PROJET FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id),
CONSTRAINT FK_PROJET_COLLABORE_COLLABORATEUR FOREIGN KEY (ProjetId) REFERENCES Projet(Id)
);

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.api", "espacecollab.backend.api\espacecollab.backend.api.csproj", "{A8DEB005-D7E2-4A96-B004-A66BBF12AC54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.appservices", "espacecollab.backend.appservices\espacecollab.backend.appservices.csproj", "{70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.appservices.dtos", "espacecollab.backend.appservices.dtos\espacecollab.backend.appservices.dtos.csproj", "{CB0CB8FC-0E53-4205-AAA3-4176211C922B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.infrastructure.sql", "espacecollab.backend.infrastructure.sql\espacecollab.backend.infrastructure.sql.csproj", "{590FF09D-0DF3-4881-8D86-E4FDAAC75FDC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.infrastructure.sql.dtos", "espacecollab.backend.infrastructure.sql.dtos\espacecollab.backend.infrastructure.sql.dtos.csproj", "{26C08CE0-E6E5-4E03-8AEA-233F93218A3B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A8DEB005-D7E2-4A96-B004-A66BBF12AC54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8DEB005-D7E2-4A96-B004-A66BBF12AC54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8DEB005-D7E2-4A96-B004-A66BBF12AC54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8DEB005-D7E2-4A96-B004-A66BBF12AC54}.Release|Any CPU.Build.0 = Release|Any CPU
{70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E}.Release|Any CPU.Build.0 = Release|Any CPU
{CB0CB8FC-0E53-4205-AAA3-4176211C922B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB0CB8FC-0E53-4205-AAA3-4176211C922B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB0CB8FC-0E53-4205-AAA3-4176211C922B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB0CB8FC-0E53-4205-AAA3-4176211C922B}.Release|Any CPU.Build.0 = Release|Any CPU
{590FF09D-0DF3-4881-8D86-E4FDAAC75FDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{590FF09D-0DF3-4881-8D86-E4FDAAC75FDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{590FF09D-0DF3-4881-8D86-E4FDAAC75FDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{590FF09D-0DF3-4881-8D86-E4FDAAC75FDC}.Release|Any CPU.Build.0 = Release|Any CPU
{26C08CE0-E6E5-4E03-8AEA-233F93218A3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26C08CE0-E6E5-4E03-8AEA-233F93218A3B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26C08CE0-E6E5-4E03-8AEA-233F93218A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26C08CE0-E6E5-4E03-8AEA-233F93218A3B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0A56A44C-135E-4CE4-834B-8DFDF69DC415}
EndGlobalSection
EndGlobal
Loading…
Cancel
Save