Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df59a97d4f | |||
| e1c505e7a1 | |||
| 76cbe90521 | |||
| bb1120f967 | |||
| 75876b3ab3 | |||
| e6d47a4005 | |||
| f11e5e274b | |||
| 62fb8ec932 | |||
| 8df7f06d60 | |||
| eb99eca363 | |||
| b3ee30a9cc | |||
| 80db4dd531 | |||
| 8bce9df5a1 | |||
| 1fff5f816f | |||
| f86fd80efc | |||
| 01b7675703 | |||
| 747ad10090 | |||
| 727494aab4 | |||
| c3eed1f45e | |||
| 28d98d9e93 | |||
| f523986475 | |||
| a543da795f | |||
| 6b9342491f | |||
| 401541999c | |||
| a64956c980 | |||
| 7f30ccaaf1 | |||
| bc38121232 | |||
| 1ef27a1b79 | |||
| 0edf6c11a1 | |||
| 881f8559c1 | |||
| 8f6cf126be | |||
| 60e0df2b1a | |||
| 331a48e478 | |||
| a12d2433d7 | |||
| d048d78cb2 | |||
| c054b9d88c | |||
| 9d08c8a352 | |||
| 3be49dcdeb | |||
| cc9e3e9ea1 | |||
| f80a9489c1 | |||
| 0cae4924cb | |||
| 81c5c47d97 | |||
| 3d06cc4f1d | |||
| ac830bf865 | |||
| 24ef10cdd1 | |||
| 34e3fbdd24 | |||
| 5e0884a420 | |||
| 5d203bed67 | |||
| cd0dd8d7e1 | |||
| a17170abab | |||
| 0352b20bcd | |||
| 8547dbbfdd | |||
| 47265d3c9c | |||
| 815cbb0fc2 | |||
| 147c1ff5df | |||
| 108cec1a7a | |||
| 2936fe7d15 | |||
| 46595d0f35 | |||
| aaec5bfb06 | |||
| c93becfbb4 | |||
| 0c5d3c18dc | |||
| 2c4f97f8f3 | |||
| c8cd5d9257 | |||
| ae8a33b7b6 | |||
| c2f50acf00 | |||
| beea881718 | |||
| cad550de7f | |||
| 4879d3f38c | |||
| 231c085000 | |||
| 8d649356b5 | |||
| aacba4f4dd | |||
| 9699048ed1 | |||
| 1e14bb01c9 | |||
| 706c621177 | |||
| 6a8e5b9a8f | |||
| a37fd87ac5 | |||
| 0a6547821b | |||
| ad15395e0b | |||
| 0f6788a1b2 | |||
| 461a3b759e | |||
| c1735c6369 | |||
| d6e6fbd70f | |||
| 4f52093742 | |||
| 47c2f78e74 | |||
| 6e4ce9caf3 | |||
| 9591fa1723 | |||
| 2e868889fc | |||
| 70de2a5a66 | |||
| 9301800d0b | |||
| c67cdf8dd8 | |||
| f75eecc712 | |||
| 3b0f25d450 | |||
| f1ef5302c1 | |||
| a701909d9d | |||
| 115f4de993 | |||
| 9740d92cbf | |||
| 1c0fc26f7e | |||
| 7364a75a2c | |||
| e0a4e88eca | |||
| ac515b8d61 | |||
| 05b5026c6b | |||
| e677ff0f0a | |||
| 3588200211 | |||
| 9a6bd0151d | |||
| 93cfa6d6ce | |||
| f0a4644710 | |||
| ab6c73cbaa | |||
| 3d7400ce89 |
+17
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="@romaric-thibault.fr" uuid="d39cb28a-f071-4fe6-bb03-b2350028b821">
|
||||||
|
<driver-ref>sqlserver.jb</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<jdbc-driver>com.jetbrains.jdbc.sqlserver.SqlServerDriver</jdbc-driver>
|
||||||
|
<jdbc-url>Server=romaric-thibault.fr,1433</jdbc-url>
|
||||||
|
<jdbc-additional-properties>
|
||||||
|
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||||
|
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||||
|
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||||
|
</jdbc-additional-properties>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="db-tree-configuration">
|
||||||
|
<option name="data" value="---------------------------------------- 1:0:d39cb28a-f071-4fe6-bb03-b2350028b821 " />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+983
@@ -0,0 +1,983 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
IIS configuration sections.
|
||||||
|
|
||||||
|
For schema documentation, see
|
||||||
|
%IIS_BIN%\config\schema\IIS_schema.xml.
|
||||||
|
|
||||||
|
Please make a backup of this file before making any changes to it.
|
||||||
|
|
||||||
|
NOTE: The following environment variables are available to be used
|
||||||
|
within this file and are understood by the IIS Express.
|
||||||
|
|
||||||
|
%IIS_USER_HOME% - The IIS Express home directory for the user
|
||||||
|
%IIS_SITES_HOME% - The default home directory for sites
|
||||||
|
%IIS_BIN% - The location of the IIS Express binaries
|
||||||
|
%SYSTEMDRIVE% - The drive letter of %IIS_BIN%
|
||||||
|
|
||||||
|
-->
|
||||||
|
<configuration>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
The <configSections> section controls the registration of sections.
|
||||||
|
Section is the basic unit of deployment, locking, searching and
|
||||||
|
containment for configuration settings.
|
||||||
|
|
||||||
|
Every section belongs to one section group.
|
||||||
|
A section group is a container of logically-related sections.
|
||||||
|
|
||||||
|
Sections cannot be nested.
|
||||||
|
Section groups may be nested.
|
||||||
|
|
||||||
|
<section
|
||||||
|
name="" [Required, Collection Key] [XML name of the section]
|
||||||
|
allowDefinition="Everywhere" [MachineOnly|MachineToApplication|AppHostOnly|Everywhere] [Level where it can be set]
|
||||||
|
overrideModeDefault="Allow" [Allow|Deny] [Default delegation mode]
|
||||||
|
allowLocation="true" [true|false] [Allowed in location tags]
|
||||||
|
/>
|
||||||
|
|
||||||
|
The recommended way to unlock sections is by using a location tag:
|
||||||
|
<location path="Default Web Site" overrideMode="Allow">
|
||||||
|
<system.webServer>
|
||||||
|
<asp />
|
||||||
|
</system.webServer>
|
||||||
|
</location>
|
||||||
|
|
||||||
|
-->
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="system.applicationHost">
|
||||||
|
<section name="applicationPools" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="configHistory" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="customMetadata" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="listenerAdapters" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="log" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="serviceAutoStartProviders" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="sites" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="webLimits" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
</sectionGroup>
|
||||||
|
<sectionGroup name="system.webServer">
|
||||||
|
<section name="asp" overrideModeDefault="Deny" />
|
||||||
|
<section name="caching" overrideModeDefault="Allow" />
|
||||||
|
<section name="cgi" overrideModeDefault="Deny" />
|
||||||
|
<section name="defaultDocument" overrideModeDefault="Allow" />
|
||||||
|
<section name="directoryBrowse" overrideModeDefault="Allow" />
|
||||||
|
<section name="fastCgi" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="globalModules" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="handlers" overrideModeDefault="Deny" />
|
||||||
|
<section name="httpCompression" overrideModeDefault="Allow" allowDefinition="Everywhere" />
|
||||||
|
<section name="httpErrors" overrideModeDefault="Allow" />
|
||||||
|
<section name="httpLogging" overrideModeDefault="Deny" />
|
||||||
|
<section name="httpProtocol" overrideModeDefault="Allow" />
|
||||||
|
<section name="httpRedirect" overrideModeDefault="Allow" />
|
||||||
|
<section name="httpTracing" overrideModeDefault="Deny" />
|
||||||
|
<section name="isapiFilters" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />
|
||||||
|
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />
|
||||||
|
<section name="applicationInitialization" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
|
||||||
|
<section name="odbcLogging" overrideModeDefault="Deny" />
|
||||||
|
<sectionGroup name="security">
|
||||||
|
<section name="access" overrideModeDefault="Deny" />
|
||||||
|
<section name="applicationDependencies" overrideModeDefault="Deny" />
|
||||||
|
<sectionGroup name="authentication">
|
||||||
|
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
|
||||||
|
<section name="basicAuthentication" overrideModeDefault="Deny" />
|
||||||
|
<section name="clientCertificateMappingAuthentication" overrideModeDefault="Deny" />
|
||||||
|
<section name="digestAuthentication" overrideModeDefault="Deny" />
|
||||||
|
<section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Deny" />
|
||||||
|
<section name="windowsAuthentication" overrideModeDefault="Allow" />
|
||||||
|
</sectionGroup>
|
||||||
|
<section name="authorization" overrideModeDefault="Allow" />
|
||||||
|
<section name="ipSecurity" overrideModeDefault="Deny" />
|
||||||
|
<section name="dynamicIpSecurity" overrideModeDefault="Deny" />
|
||||||
|
<section name="isapiCgiRestriction" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||||
|
<section name="requestFiltering" overrideModeDefault="Allow" />
|
||||||
|
</sectionGroup>
|
||||||
|
<section name="serverRuntime" overrideModeDefault="Deny" />
|
||||||
|
<section name="serverSideInclude" overrideModeDefault="Deny" />
|
||||||
|
<section name="staticContent" overrideModeDefault="Allow" />
|
||||||
|
<sectionGroup name="tracing">
|
||||||
|
<section name="traceFailedRequests" overrideModeDefault="Allow" />
|
||||||
|
<section name="traceProviderDefinitions" overrideModeDefault="Deny" />
|
||||||
|
</sectionGroup>
|
||||||
|
<section name="urlCompression" overrideModeDefault="Allow" />
|
||||||
|
<section name="validation" overrideModeDefault="Allow" />
|
||||||
|
<sectionGroup name="webdav">
|
||||||
|
<section name="globalSettings" overrideModeDefault="Deny" />
|
||||||
|
<section name="authoring" overrideModeDefault="Deny" />
|
||||||
|
<section name="authoringRules" overrideModeDefault="Deny" />
|
||||||
|
</sectionGroup>
|
||||||
|
<sectionGroup name="rewrite">
|
||||||
|
<section name="allowedServerVariables" overrideModeDefault="Deny" />
|
||||||
|
<section name="rules" overrideModeDefault="Allow" />
|
||||||
|
<section name="outboundRules" overrideModeDefault="Allow" />
|
||||||
|
<section name="globalRules" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
|
||||||
|
<section name="providers" overrideModeDefault="Allow" />
|
||||||
|
<section name="rewriteMaps" overrideModeDefault="Allow" />
|
||||||
|
</sectionGroup>
|
||||||
|
<section name="webSocket" overrideModeDefault="Deny" />
|
||||||
|
<section name="aspNetCore" overrideModeDefault="Allow" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
|
<configProtectedData>
|
||||||
|
<providers>
|
||||||
|
<add name="IISWASOnlyRsaProvider" type="" description="Uses RsaCryptoServiceProvider to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useMachineContainer="true" useOAEP="false" />
|
||||||
|
<add name="AesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisConfigurationKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="AQIAAA5mAAAApAAA/HKxkz6alrlAPez0IUgujj/6k3WxCDriHp6jvpv3yEZmo7h6SMzGLxo4mTrIQVHSkB7tmElHKfUFTzE2BWF7nFWHY6Z6qmGBauFzwJMwESjril7Gjz69RBFH259HQ6aRDq9Xfx7U7H4HtdmnKNqGjgl/hwPQBGeIlWiDh+sYv3vKB0QU971tjX6H2B+9armlnC8UOuA6JYMDMI/VLLL16sng0fWAy5JYe0YVABVjiAWDW264RZW9Tr1Oax4qHZKg+SdjULxeOc2YmpX+d0yeITo1HkPF1hN1gHpIPIUDo05ilHUNfR3OkjVCIQK4cFKCq1s8NH+y+13MxUC4Fn1AlQ==" />
|
||||||
|
<add name="IISWASOnlyAesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="AQIAAA5mAAAApAAALmU8lTC+v2qtfQiiiquvvLpUQqKLEXs+jSKoWCM/uPhyB++k4dwug19mGidNK5FYiWK2KYE1yhjVJcbp12E98Q0R2nT7eBiCMY2JairxQ591rqABK7keGaIjwH7PwGzSpILl3RJ4YFvJ/7ZXEJxeDZIjW8ZxWVXx+/VyHs9U3WguLEkgMUX3jrxJi8LouxaIVPJAv/YQ1ZCWs8zImitxX/C/7o7yaIxznfsN5nGQzQfpUDPeby99aw2zPVTtZI2LaWIBON8guABvZ6JtJVDWmfdK6sodbnwdZkr6/Z2rfvamT1dC1SpQrGG7ulR/f9/GXvCaW10ZVKxekBF/CYlNMg==" />
|
||||||
|
</providers>
|
||||||
|
</configProtectedData>
|
||||||
|
<system.applicationHost>
|
||||||
|
<applicationPools>
|
||||||
|
<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
|
||||||
|
<add name="Clr4ClassicAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
|
||||||
|
<add name="Clr2IntegratedAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
|
||||||
|
<add name="Clr2ClassicAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
|
||||||
|
<add name="UnmanagedClassicAppPool" managedRuntimeVersion="" managedPipelineMode="Classic" autoStart="true" />
|
||||||
|
<applicationPoolDefaults managedRuntimeVersion="v4.0">
|
||||||
|
<processModel loadUserProfile="true" setProfileEnvironment="false" />
|
||||||
|
</applicationPoolDefaults>
|
||||||
|
<add name="BeReadyBackend AppPool" managedRuntimeVersion="" />
|
||||||
|
</applicationPools>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
The <listenerAdapters> section defines the protocols with which the
|
||||||
|
Windows Process Activation Service (WAS) binds.
|
||||||
|
|
||||||
|
-->
|
||||||
|
<listenerAdapters>
|
||||||
|
<add name="http" />
|
||||||
|
</listenerAdapters>
|
||||||
|
<sites>
|
||||||
|
<siteDefaults>
|
||||||
|
<!-- To enable logging, please change the below attribute "enabled" to "true" -->
|
||||||
|
<logFile logFormat="W3C" directory="%AppData%\Microsoft\IISExpressLogs" enabled="false" />
|
||||||
|
<traceFailedRequestsLogging directory="%AppData%\Microsoft" enabled="false" maxLogFileSizeKB="1024" />
|
||||||
|
</siteDefaults>
|
||||||
|
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
|
||||||
|
<virtualDirectoryDefaults allowSubDirConfig="true" />
|
||||||
|
<site name="BeReadyBackend" id="1">
|
||||||
|
<application path="/" applicationPool="BeReadyBackend AppPool">
|
||||||
|
<virtualDirectory path="/" physicalPath="C:\Users\mathy\Documents\BeReady\BeReadyBackend\BeReadyBackend" />
|
||||||
|
</application>
|
||||||
|
<bindings>
|
||||||
|
<binding protocol="http" bindingInformation="*:8557:localhost" />
|
||||||
|
<binding protocol="https" bindingInformation="*:44342:localhost" />
|
||||||
|
</bindings>
|
||||||
|
</site>
|
||||||
|
</sites>
|
||||||
|
<webLimits />
|
||||||
|
</system.applicationHost>
|
||||||
|
<system.webServer>
|
||||||
|
<serverRuntime />
|
||||||
|
<asp scriptErrorSentToBrowser="true">
|
||||||
|
<cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
|
||||||
|
<limits />
|
||||||
|
</asp>
|
||||||
|
<caching enabled="true" enableKernelCache="true"></caching>
|
||||||
|
<cgi />
|
||||||
|
<defaultDocument enabled="true">
|
||||||
|
<files>
|
||||||
|
<add value="Default.htm" />
|
||||||
|
<add value="Default.asp" />
|
||||||
|
<add value="index.htm" />
|
||||||
|
<add value="index.html" />
|
||||||
|
<add value="iisstart.htm" />
|
||||||
|
<add value="default.aspx" />
|
||||||
|
</files>
|
||||||
|
</defaultDocument>
|
||||||
|
<directoryBrowse enabled="false" />
|
||||||
|
<fastCgi />
|
||||||
|
<!--
|
||||||
|
|
||||||
|
The <globalModules> section defines all native-code modules.
|
||||||
|
To enable a module, specify it in the <modules> section.
|
||||||
|
|
||||||
|
-->
|
||||||
|
<globalModules>
|
||||||
|
<add name="HttpLoggingModule" image="%IIS_BIN%\loghttp.dll" />
|
||||||
|
<add name="UriCacheModule" image="%IIS_BIN%\cachuri.dll" />
|
||||||
|
<add name="TokenCacheModule" image="%IIS_BIN%\cachtokn.dll" />
|
||||||
|
<add name="DynamicCompressionModule" image="%IIS_BIN%\compdyn.dll" />
|
||||||
|
<add name="StaticCompressionModule" image="%IIS_BIN%\compstat.dll" />
|
||||||
|
<add name="DefaultDocumentModule" image="%IIS_BIN%\defdoc.dll" />
|
||||||
|
<add name="DirectoryListingModule" image="%IIS_BIN%\dirlist.dll" />
|
||||||
|
<add name="ProtocolSupportModule" image="%IIS_BIN%\protsup.dll" />
|
||||||
|
<add name="HttpRedirectionModule" image="%IIS_BIN%\redirect.dll" />
|
||||||
|
<add name="ServerSideIncludeModule" image="%IIS_BIN%\iis_ssi.dll" />
|
||||||
|
<add name="StaticFileModule" image="%IIS_BIN%\static.dll" />
|
||||||
|
<add name="AnonymousAuthenticationModule" image="%IIS_BIN%\authanon.dll" />
|
||||||
|
<add name="CertificateMappingAuthenticationModule" image="%IIS_BIN%\authcert.dll" />
|
||||||
|
<add name="UrlAuthorizationModule" image="%IIS_BIN%\urlauthz.dll" />
|
||||||
|
<add name="BasicAuthenticationModule" image="%IIS_BIN%\authbas.dll" />
|
||||||
|
<add name="WindowsAuthenticationModule" image="%IIS_BIN%\authsspi.dll" />
|
||||||
|
<add name="IISCertificateMappingAuthenticationModule" image="%IIS_BIN%\authmap.dll" />
|
||||||
|
<add name="IpRestrictionModule" image="%IIS_BIN%\iprestr.dll" />
|
||||||
|
<add name="DynamicIpRestrictionModule" image="%IIS_BIN%\diprestr.dll" />
|
||||||
|
<add name="RequestFilteringModule" image="%IIS_BIN%\modrqflt.dll" />
|
||||||
|
<add name="CustomLoggingModule" image="%IIS_BIN%\logcust.dll" />
|
||||||
|
<add name="CustomErrorModule" image="%IIS_BIN%\custerr.dll" />
|
||||||
|
<add name="FailedRequestsTracingModule" image="%IIS_BIN%\iisfreb.dll" />
|
||||||
|
<add name="RequestMonitorModule" image="%IIS_BIN%\iisreqs.dll" />
|
||||||
|
<add name="IsapiModule" image="%IIS_BIN%\isapi.dll" />
|
||||||
|
<add name="IsapiFilterModule" image="%IIS_BIN%\filter.dll" />
|
||||||
|
<add name="CgiModule" image="%IIS_BIN%\cgi.dll" />
|
||||||
|
<add name="FastCgiModule" image="%IIS_BIN%\iisfcgi.dll" />
|
||||||
|
<!-- <add name="WebDAVModule" image="%IIS_BIN%\webdav.dll" /> -->
|
||||||
|
<add name="RewriteModule" image="%IIS_BIN%\rewrite.dll" />
|
||||||
|
<add name="ConfigurationValidationModule" image="%IIS_BIN%\validcfg.dll" />
|
||||||
|
<add name="WebSocketModule" image="%IIS_BIN%\iiswsock.dll" />
|
||||||
|
<add name="WebMatrixSupportModule" image="%IIS_BIN%\webmatrixsup.dll" />
|
||||||
|
<add name="ManagedEngine" image="%windir%\Microsoft.NET\Framework\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness32" />
|
||||||
|
<add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness64" />
|
||||||
|
<add name="ManagedEngineV4.0_32bit" image="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
|
||||||
|
<add name="ManagedEngineV4.0_64bit" image="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
|
||||||
|
<add name="ApplicationInitializationModule" image="%IIS_BIN%\warmup.dll" />
|
||||||
|
<add name="AspNetCoreModuleV2" image="%IIS_BIN%\Asp.Net Core Module\V2\aspnetcorev2.dll" />
|
||||||
|
</globalModules>
|
||||||
|
<httpCompression directory="%TEMP%">
|
||||||
|
<scheme name="gzip" dll="%IIS_BIN%\gzip.dll" />
|
||||||
|
<dynamicTypes>
|
||||||
|
<add mimeType="text/*" enabled="true" />
|
||||||
|
<add mimeType="message/*" enabled="true" />
|
||||||
|
<add mimeType="application/x-javascript" enabled="true" />
|
||||||
|
<add mimeType="application/javascript" enabled="true" />
|
||||||
|
<add mimeType="*/*" enabled="false" />
|
||||||
|
</dynamicTypes>
|
||||||
|
<staticTypes>
|
||||||
|
<add mimeType="text/*" enabled="true" />
|
||||||
|
<add mimeType="message/*" enabled="true" />
|
||||||
|
<add mimeType="application/javascript" enabled="true" />
|
||||||
|
<add mimeType="application/atom+xml" enabled="true" />
|
||||||
|
<add mimeType="application/xaml+xml" enabled="true" />
|
||||||
|
<add mimeType="image/svg+xml" enabled="true" />
|
||||||
|
<add mimeType="*/*" enabled="false" />
|
||||||
|
</staticTypes>
|
||||||
|
</httpCompression>
|
||||||
|
<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
|
||||||
|
<error statusCode="401" prefixLanguageFilePath="%IIS_BIN%\custerr" path="401.htm" />
|
||||||
|
<error statusCode="403" prefixLanguageFilePath="%IIS_BIN%\custerr" path="403.htm" />
|
||||||
|
<error statusCode="404" prefixLanguageFilePath="%IIS_BIN%\custerr" path="404.htm" />
|
||||||
|
<error statusCode="405" prefixLanguageFilePath="%IIS_BIN%\custerr" path="405.htm" />
|
||||||
|
<error statusCode="406" prefixLanguageFilePath="%IIS_BIN%\custerr" path="406.htm" />
|
||||||
|
<error statusCode="412" prefixLanguageFilePath="%IIS_BIN%\custerr" path="412.htm" />
|
||||||
|
<error statusCode="500" prefixLanguageFilePath="%IIS_BIN%\custerr" path="500.htm" />
|
||||||
|
<error statusCode="501" prefixLanguageFilePath="%IIS_BIN%\custerr" path="501.htm" />
|
||||||
|
<error statusCode="502" prefixLanguageFilePath="%IIS_BIN%\custerr" path="502.htm" />
|
||||||
|
</httpErrors>
|
||||||
|
<httpLogging dontLog="false" />
|
||||||
|
<httpProtocol>
|
||||||
|
<customHeaders>
|
||||||
|
<clear />
|
||||||
|
<add name="X-Powered-By" value="ASP.NET" />
|
||||||
|
</customHeaders>
|
||||||
|
<redirectHeaders>
|
||||||
|
<clear />
|
||||||
|
</redirectHeaders>
|
||||||
|
</httpProtocol>
|
||||||
|
<httpRedirect enabled="false" />
|
||||||
|
<httpTracing />
|
||||||
|
<isapiFilters>
|
||||||
|
<filter name="ASP.Net_2.0.50727-64" path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness64,runtimeVersionv2.0" />
|
||||||
|
<filter name="ASP.Net_2.0.50727.0" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness32,runtimeVersionv2.0" />
|
||||||
|
<filter name="ASP.Net_2.0_for_v1.1" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv1.1" />
|
||||||
|
<filter name="ASP.Net_4.0_32bit" path="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="bitness32,runtimeVersionv4.0" />
|
||||||
|
<filter name="ASP.Net_4.0_64bit" path="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="bitness64,runtimeVersionv4.0" />
|
||||||
|
</isapiFilters>
|
||||||
|
<odbcLogging />
|
||||||
|
<security>
|
||||||
|
<access sslFlags="None" />
|
||||||
|
<applicationDependencies>
|
||||||
|
<application name="Active Server Pages" groupId="ASP" />
|
||||||
|
</applicationDependencies>
|
||||||
|
<authentication>
|
||||||
|
<anonymousAuthentication enabled="true" userName="" />
|
||||||
|
<basicAuthentication enabled="false" />
|
||||||
|
<clientCertificateMappingAuthentication enabled="false" />
|
||||||
|
<digestAuthentication enabled="false" />
|
||||||
|
<iisClientCertificateMappingAuthentication enabled="false"></iisClientCertificateMappingAuthentication>
|
||||||
|
<windowsAuthentication enabled="false">
|
||||||
|
<providers>
|
||||||
|
<add value="Negotiate" />
|
||||||
|
<add value="NTLM" />
|
||||||
|
</providers>
|
||||||
|
</windowsAuthentication>
|
||||||
|
</authentication>
|
||||||
|
<authorization>
|
||||||
|
<add accessType="Allow" users="*" />
|
||||||
|
</authorization>
|
||||||
|
<ipSecurity allowUnlisted="true" />
|
||||||
|
<isapiCgiRestriction notListedIsapisAllowed="true" notListedCgisAllowed="true">
|
||||||
|
<add path="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" allowed="true" groupId="ASP.NET_v4.0" description="ASP.NET_v4.0" />
|
||||||
|
<add path="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" allowed="true" groupId="ASP.NET_v4.0" description="ASP.NET_v4.0" />
|
||||||
|
<add path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" />
|
||||||
|
<add path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" />
|
||||||
|
</isapiCgiRestriction>
|
||||||
|
<requestFiltering>
|
||||||
|
<fileExtensions allowUnlisted="true" applyToWebDAV="true">
|
||||||
|
<add fileExtension=".asa" allowed="false" />
|
||||||
|
<add fileExtension=".asax" allowed="false" />
|
||||||
|
<add fileExtension=".ascx" allowed="false" />
|
||||||
|
<add fileExtension=".master" allowed="false" />
|
||||||
|
<add fileExtension=".skin" allowed="false" />
|
||||||
|
<add fileExtension=".browser" allowed="false" />
|
||||||
|
<add fileExtension=".sitemap" allowed="false" />
|
||||||
|
<add fileExtension=".config" allowed="false" />
|
||||||
|
<add fileExtension=".cs" allowed="false" />
|
||||||
|
<add fileExtension=".csproj" allowed="false" />
|
||||||
|
<add fileExtension=".vb" allowed="false" />
|
||||||
|
<add fileExtension=".vbproj" allowed="false" />
|
||||||
|
<add fileExtension=".webinfo" allowed="false" />
|
||||||
|
<add fileExtension=".licx" allowed="false" />
|
||||||
|
<add fileExtension=".resx" allowed="false" />
|
||||||
|
<add fileExtension=".resources" allowed="false" />
|
||||||
|
<add fileExtension=".mdb" allowed="false" />
|
||||||
|
<add fileExtension=".vjsproj" allowed="false" />
|
||||||
|
<add fileExtension=".java" allowed="false" />
|
||||||
|
<add fileExtension=".jsl" allowed="false" />
|
||||||
|
<add fileExtension=".ldb" allowed="false" />
|
||||||
|
<add fileExtension=".dsdgm" allowed="false" />
|
||||||
|
<add fileExtension=".ssdgm" allowed="false" />
|
||||||
|
<add fileExtension=".lsad" allowed="false" />
|
||||||
|
<add fileExtension=".ssmap" allowed="false" />
|
||||||
|
<add fileExtension=".cd" allowed="false" />
|
||||||
|
<add fileExtension=".dsprototype" allowed="false" />
|
||||||
|
<add fileExtension=".lsaprototype" allowed="false" />
|
||||||
|
<add fileExtension=".sdm" allowed="false" />
|
||||||
|
<add fileExtension=".sdmDocument" allowed="false" />
|
||||||
|
<add fileExtension=".mdf" allowed="false" />
|
||||||
|
<add fileExtension=".ldf" allowed="false" />
|
||||||
|
<add fileExtension=".ad" allowed="false" />
|
||||||
|
<add fileExtension=".dd" allowed="false" />
|
||||||
|
<add fileExtension=".ldd" allowed="false" />
|
||||||
|
<add fileExtension=".sd" allowed="false" />
|
||||||
|
<add fileExtension=".adprototype" allowed="false" />
|
||||||
|
<add fileExtension=".lddprototype" allowed="false" />
|
||||||
|
<add fileExtension=".exclude" allowed="false" />
|
||||||
|
<add fileExtension=".refresh" allowed="false" />
|
||||||
|
<add fileExtension=".compiled" allowed="false" />
|
||||||
|
<add fileExtension=".msgx" allowed="false" />
|
||||||
|
<add fileExtension=".vsdisco" allowed="false" />
|
||||||
|
<add fileExtension=".rules" allowed="false" />
|
||||||
|
</fileExtensions>
|
||||||
|
<verbs allowUnlisted="true" applyToWebDAV="true" />
|
||||||
|
<hiddenSegments applyToWebDAV="true">
|
||||||
|
<add segment="web.config" />
|
||||||
|
<add segment="bin" />
|
||||||
|
<add segment="App_code" />
|
||||||
|
<add segment="App_GlobalResources" />
|
||||||
|
<add segment="App_LocalResources" />
|
||||||
|
<add segment="App_WebReferences" />
|
||||||
|
<add segment="App_Data" />
|
||||||
|
<add segment="App_Browsers" />
|
||||||
|
</hiddenSegments>
|
||||||
|
</requestFiltering>
|
||||||
|
</security>
|
||||||
|
<serverSideInclude ssiExecDisable="false" />
|
||||||
|
<staticContent lockAttributes="isDocFooterFileName">
|
||||||
|
<mimeMap fileExtension=".323" mimeType="text/h323" />
|
||||||
|
<mimeMap fileExtension=".3g2" mimeType="video/3gpp2" />
|
||||||
|
<mimeMap fileExtension=".3gp2" mimeType="video/3gpp2" />
|
||||||
|
<mimeMap fileExtension=".3gp" mimeType="video/3gpp" />
|
||||||
|
<mimeMap fileExtension=".3gpp" mimeType="video/3gpp" />
|
||||||
|
<mimeMap fileExtension=".aac" mimeType="audio/aac" />
|
||||||
|
<mimeMap fileExtension=".aaf" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".aca" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".accdb" mimeType="application/msaccess" />
|
||||||
|
<mimeMap fileExtension=".accde" mimeType="application/msaccess" />
|
||||||
|
<mimeMap fileExtension=".accdt" mimeType="application/msaccess" />
|
||||||
|
<mimeMap fileExtension=".acx" mimeType="application/internet-property-stream" />
|
||||||
|
<mimeMap fileExtension=".adt" mimeType="audio/vnd.dlna.adts" />
|
||||||
|
<mimeMap fileExtension=".adts" mimeType="audio/vnd.dlna.adts" />
|
||||||
|
<mimeMap fileExtension=".afm" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".ai" mimeType="application/postscript" />
|
||||||
|
<mimeMap fileExtension=".aif" mimeType="audio/x-aiff" />
|
||||||
|
<mimeMap fileExtension=".aifc" mimeType="audio/aiff" />
|
||||||
|
<mimeMap fileExtension=".aiff" mimeType="audio/aiff" />
|
||||||
|
<mimeMap fileExtension=".appcache" mimeType="text/cache-manifest" />
|
||||||
|
<mimeMap fileExtension=".application" mimeType="application/x-ms-application" />
|
||||||
|
<mimeMap fileExtension=".art" mimeType="image/x-jg" />
|
||||||
|
<mimeMap fileExtension=".asd" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".asf" mimeType="video/x-ms-asf" />
|
||||||
|
<mimeMap fileExtension=".asi" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".asm" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".asr" mimeType="video/x-ms-asf" />
|
||||||
|
<mimeMap fileExtension=".asx" mimeType="video/x-ms-asf" />
|
||||||
|
<mimeMap fileExtension=".atom" mimeType="application/atom+xml" />
|
||||||
|
<mimeMap fileExtension=".au" mimeType="audio/basic" />
|
||||||
|
<mimeMap fileExtension=".avi" mimeType="video/avi" />
|
||||||
|
<mimeMap fileExtension=".axs" mimeType="application/olescript" />
|
||||||
|
<mimeMap fileExtension=".bas" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".bcpio" mimeType="application/x-bcpio" />
|
||||||
|
<mimeMap fileExtension=".bin" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".bmp" mimeType="image/bmp" />
|
||||||
|
<mimeMap fileExtension=".c" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".cab" mimeType="application/vnd.ms-cab-compressed" />
|
||||||
|
<mimeMap fileExtension=".calx" mimeType="application/vnd.ms-office.calx" />
|
||||||
|
<mimeMap fileExtension=".cat" mimeType="application/vnd.ms-pki.seccat" />
|
||||||
|
<mimeMap fileExtension=".cdf" mimeType="application/x-cdf" />
|
||||||
|
<mimeMap fileExtension=".chm" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".class" mimeType="application/x-java-applet" />
|
||||||
|
<mimeMap fileExtension=".clp" mimeType="application/x-msclip" />
|
||||||
|
<mimeMap fileExtension=".cmx" mimeType="image/x-cmx" />
|
||||||
|
<mimeMap fileExtension=".cnf" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".cod" mimeType="image/cis-cod" />
|
||||||
|
<mimeMap fileExtension=".cpio" mimeType="application/x-cpio" />
|
||||||
|
<mimeMap fileExtension=".cpp" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".crd" mimeType="application/x-mscardfile" />
|
||||||
|
<mimeMap fileExtension=".crl" mimeType="application/pkix-crl" />
|
||||||
|
<mimeMap fileExtension=".crt" mimeType="application/x-x509-ca-cert" />
|
||||||
|
<mimeMap fileExtension=".csh" mimeType="application/x-csh" />
|
||||||
|
<mimeMap fileExtension=".css" mimeType="text/css" />
|
||||||
|
<mimeMap fileExtension=".csv" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".cur" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".dcr" mimeType="application/x-director" />
|
||||||
|
<mimeMap fileExtension=".deploy" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".der" mimeType="application/x-x509-ca-cert" />
|
||||||
|
<mimeMap fileExtension=".dib" mimeType="image/bmp" />
|
||||||
|
<mimeMap fileExtension=".dir" mimeType="application/x-director" />
|
||||||
|
<mimeMap fileExtension=".disco" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".dll" mimeType="application/x-msdownload" />
|
||||||
|
<mimeMap fileExtension=".dll.config" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".dlm" mimeType="text/dlm" />
|
||||||
|
<mimeMap fileExtension=".doc" mimeType="application/msword" />
|
||||||
|
<mimeMap fileExtension=".docm" mimeType="application/vnd.ms-word.document.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".docx" mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
|
||||||
|
<mimeMap fileExtension=".dot" mimeType="application/msword" />
|
||||||
|
<mimeMap fileExtension=".dotm" mimeType="application/vnd.ms-word.template.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".dotx" mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.template" />
|
||||||
|
<mimeMap fileExtension=".dsp" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".dtd" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".dvi" mimeType="application/x-dvi" />
|
||||||
|
<mimeMap fileExtension=".dvr-ms" mimeType="video/x-ms-dvr" />
|
||||||
|
<mimeMap fileExtension=".dwf" mimeType="drawing/x-dwf" />
|
||||||
|
<mimeMap fileExtension=".dwp" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".dxr" mimeType="application/x-director" />
|
||||||
|
<mimeMap fileExtension=".eml" mimeType="message/rfc822" />
|
||||||
|
<mimeMap fileExtension=".emz" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
|
||||||
|
<mimeMap fileExtension=".eps" mimeType="application/postscript" />
|
||||||
|
<mimeMap fileExtension=".esd" mimeType="application/vnd.ms-cab-compressed" />
|
||||||
|
<mimeMap fileExtension=".etx" mimeType="text/x-setext" />
|
||||||
|
<mimeMap fileExtension=".evy" mimeType="application/envoy" />
|
||||||
|
<mimeMap fileExtension=".exe" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".exe.config" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".fdf" mimeType="application/vnd.fdf" />
|
||||||
|
<mimeMap fileExtension=".fif" mimeType="application/fractals" />
|
||||||
|
<mimeMap fileExtension=".fla" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".flr" mimeType="x-world/x-vrml" />
|
||||||
|
<mimeMap fileExtension=".flv" mimeType="video/x-flv" />
|
||||||
|
<mimeMap fileExtension=".gif" mimeType="image/gif" />
|
||||||
|
<mimeMap fileExtension=".glb" mimeType="model/gltf-binary" />
|
||||||
|
<mimeMap fileExtension=".gtar" mimeType="application/x-gtar" />
|
||||||
|
<mimeMap fileExtension=".gz" mimeType="application/x-gzip" />
|
||||||
|
<mimeMap fileExtension=".h" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".hdf" mimeType="application/x-hdf" />
|
||||||
|
<mimeMap fileExtension=".hdml" mimeType="text/x-hdml" />
|
||||||
|
<mimeMap fileExtension=".hhc" mimeType="application/x-oleobject" />
|
||||||
|
<mimeMap fileExtension=".hhk" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".hhp" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".hlp" mimeType="application/winhlp" />
|
||||||
|
<mimeMap fileExtension=".hqx" mimeType="application/mac-binhex40" />
|
||||||
|
<mimeMap fileExtension=".hta" mimeType="application/hta" />
|
||||||
|
<mimeMap fileExtension=".htc" mimeType="text/x-component" />
|
||||||
|
<mimeMap fileExtension=".htm" mimeType="text/html" />
|
||||||
|
<mimeMap fileExtension=".html" mimeType="text/html" />
|
||||||
|
<mimeMap fileExtension=".htt" mimeType="text/webviewhtml" />
|
||||||
|
<mimeMap fileExtension=".hxt" mimeType="text/html" />
|
||||||
|
<mimeMap fileExtension=".ico" mimeType="image/x-icon" />
|
||||||
|
<mimeMap fileExtension=".ics" mimeType="text/calendar" />
|
||||||
|
<mimeMap fileExtension=".ief" mimeType="image/ief" />
|
||||||
|
<mimeMap fileExtension=".iii" mimeType="application/x-iphone" />
|
||||||
|
<mimeMap fileExtension=".inf" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".ins" mimeType="application/x-internet-signup" />
|
||||||
|
<mimeMap fileExtension=".isp" mimeType="application/x-internet-signup" />
|
||||||
|
<mimeMap fileExtension=".IVF" mimeType="video/x-ivf" />
|
||||||
|
<mimeMap fileExtension=".jar" mimeType="application/java-archive" />
|
||||||
|
<mimeMap fileExtension=".java" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".jck" mimeType="application/liquidmotion" />
|
||||||
|
<mimeMap fileExtension=".jcz" mimeType="application/liquidmotion" />
|
||||||
|
<mimeMap fileExtension=".jfif" mimeType="image/pjpeg" />
|
||||||
|
<mimeMap fileExtension=".jpb" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".jpe" mimeType="image/jpeg" />
|
||||||
|
<mimeMap fileExtension=".jpeg" mimeType="image/jpeg" />
|
||||||
|
<mimeMap fileExtension=".jpg" mimeType="image/jpeg" />
|
||||||
|
<mimeMap fileExtension=".js" mimeType="application/javascript" />
|
||||||
|
<mimeMap fileExtension=".json" mimeType="application/json" />
|
||||||
|
<mimeMap fileExtension=".jsonld" mimeType="application/ld+json" />
|
||||||
|
<mimeMap fileExtension=".jsx" mimeType="text/jscript" />
|
||||||
|
<mimeMap fileExtension=".latex" mimeType="application/x-latex" />
|
||||||
|
<mimeMap fileExtension=".less" mimeType="text/css" />
|
||||||
|
<mimeMap fileExtension=".lit" mimeType="application/x-ms-reader" />
|
||||||
|
<mimeMap fileExtension=".lpk" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".lsf" mimeType="video/x-la-asf" />
|
||||||
|
<mimeMap fileExtension=".lsx" mimeType="video/x-la-asf" />
|
||||||
|
<mimeMap fileExtension=".lzh" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".m13" mimeType="application/x-msmediaview" />
|
||||||
|
<mimeMap fileExtension=".m14" mimeType="application/x-msmediaview" />
|
||||||
|
<mimeMap fileExtension=".m1v" mimeType="video/mpeg" />
|
||||||
|
<mimeMap fileExtension=".m2ts" mimeType="video/vnd.dlna.mpeg-tts" />
|
||||||
|
<mimeMap fileExtension=".m3u" mimeType="audio/x-mpegurl" />
|
||||||
|
<mimeMap fileExtension=".m4a" mimeType="audio/mp4" />
|
||||||
|
<mimeMap fileExtension=".m4v" mimeType="video/mp4" />
|
||||||
|
<mimeMap fileExtension=".man" mimeType="application/x-troff-man" />
|
||||||
|
<mimeMap fileExtension=".manifest" mimeType="application/x-ms-manifest" />
|
||||||
|
<mimeMap fileExtension=".map" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".mdb" mimeType="application/x-msaccess" />
|
||||||
|
<mimeMap fileExtension=".mdp" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".me" mimeType="application/x-troff-me" />
|
||||||
|
<mimeMap fileExtension=".mht" mimeType="message/rfc822" />
|
||||||
|
<mimeMap fileExtension=".mhtml" mimeType="message/rfc822" />
|
||||||
|
<mimeMap fileExtension=".mid" mimeType="audio/mid" />
|
||||||
|
<mimeMap fileExtension=".midi" mimeType="audio/mid" />
|
||||||
|
<mimeMap fileExtension=".mix" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".mmf" mimeType="application/x-smaf" />
|
||||||
|
<mimeMap fileExtension=".mno" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".mny" mimeType="application/x-msmoney" />
|
||||||
|
<mimeMap fileExtension=".mov" mimeType="video/quicktime" />
|
||||||
|
<mimeMap fileExtension=".movie" mimeType="video/x-sgi-movie" />
|
||||||
|
<mimeMap fileExtension=".mp2" mimeType="video/mpeg" />
|
||||||
|
<mimeMap fileExtension=".mp3" mimeType="audio/mpeg" />
|
||||||
|
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
|
||||||
|
<mimeMap fileExtension=".mp4v" mimeType="video/mp4" />
|
||||||
|
<mimeMap fileExtension=".mpa" mimeType="video/mpeg" />
|
||||||
|
<mimeMap fileExtension=".mpe" mimeType="video/mpeg" />
|
||||||
|
<mimeMap fileExtension=".mpeg" mimeType="video/mpeg" />
|
||||||
|
<mimeMap fileExtension=".mpg" mimeType="video/mpeg" />
|
||||||
|
<mimeMap fileExtension=".mpp" mimeType="application/vnd.ms-project" />
|
||||||
|
<mimeMap fileExtension=".mpv2" mimeType="video/mpeg" />
|
||||||
|
<mimeMap fileExtension=".ms" mimeType="application/x-troff-ms" />
|
||||||
|
<mimeMap fileExtension=".msi" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".mso" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".mvb" mimeType="application/x-msmediaview" />
|
||||||
|
<mimeMap fileExtension=".mvc" mimeType="application/x-miva-compiled" />
|
||||||
|
<mimeMap fileExtension=".nc" mimeType="application/x-netcdf" />
|
||||||
|
<mimeMap fileExtension=".nsc" mimeType="video/x-ms-asf" />
|
||||||
|
<mimeMap fileExtension=".nws" mimeType="message/rfc822" />
|
||||||
|
<mimeMap fileExtension=".ocx" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".oda" mimeType="application/oda" />
|
||||||
|
<mimeMap fileExtension=".odc" mimeType="text/x-ms-odc" />
|
||||||
|
<mimeMap fileExtension=".ods" mimeType="application/oleobject" />
|
||||||
|
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
|
||||||
|
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
|
||||||
|
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
|
||||||
|
<mimeMap fileExtension=".one" mimeType="application/onenote" />
|
||||||
|
<mimeMap fileExtension=".onea" mimeType="application/onenote" />
|
||||||
|
<mimeMap fileExtension=".onetoc" mimeType="application/onenote" />
|
||||||
|
<mimeMap fileExtension=".onetoc2" mimeType="application/onenote" />
|
||||||
|
<mimeMap fileExtension=".onetmp" mimeType="application/onenote" />
|
||||||
|
<mimeMap fileExtension=".onepkg" mimeType="application/onenote" />
|
||||||
|
<mimeMap fileExtension=".osdx" mimeType="application/opensearchdescription+xml" />
|
||||||
|
<mimeMap fileExtension=".otf" mimeType="font/otf" />
|
||||||
|
<mimeMap fileExtension=".p10" mimeType="application/pkcs10" />
|
||||||
|
<mimeMap fileExtension=".p12" mimeType="application/x-pkcs12" />
|
||||||
|
<mimeMap fileExtension=".p7b" mimeType="application/x-pkcs7-certificates" />
|
||||||
|
<mimeMap fileExtension=".p7c" mimeType="application/pkcs7-mime" />
|
||||||
|
<mimeMap fileExtension=".p7m" mimeType="application/pkcs7-mime" />
|
||||||
|
<mimeMap fileExtension=".p7r" mimeType="application/x-pkcs7-certreqresp" />
|
||||||
|
<mimeMap fileExtension=".p7s" mimeType="application/pkcs7-signature" />
|
||||||
|
<mimeMap fileExtension=".pbm" mimeType="image/x-portable-bitmap" />
|
||||||
|
<mimeMap fileExtension=".pcx" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".pcz" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".pdf" mimeType="application/pdf" />
|
||||||
|
<mimeMap fileExtension=".pfb" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".pfm" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".pfx" mimeType="application/x-pkcs12" />
|
||||||
|
<mimeMap fileExtension=".pgm" mimeType="image/x-portable-graymap" />
|
||||||
|
<mimeMap fileExtension=".pko" mimeType="application/vnd.ms-pki.pko" />
|
||||||
|
<mimeMap fileExtension=".pma" mimeType="application/x-perfmon" />
|
||||||
|
<mimeMap fileExtension=".pmc" mimeType="application/x-perfmon" />
|
||||||
|
<mimeMap fileExtension=".pml" mimeType="application/x-perfmon" />
|
||||||
|
<mimeMap fileExtension=".pmr" mimeType="application/x-perfmon" />
|
||||||
|
<mimeMap fileExtension=".pmw" mimeType="application/x-perfmon" />
|
||||||
|
<mimeMap fileExtension=".png" mimeType="image/png" />
|
||||||
|
<mimeMap fileExtension=".pnm" mimeType="image/x-portable-anymap" />
|
||||||
|
<mimeMap fileExtension=".pnz" mimeType="image/png" />
|
||||||
|
<mimeMap fileExtension=".pot" mimeType="application/vnd.ms-powerpoint" />
|
||||||
|
<mimeMap fileExtension=".potm" mimeType="application/vnd.ms-powerpoint.template.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".potx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.template" />
|
||||||
|
<mimeMap fileExtension=".ppam" mimeType="application/vnd.ms-powerpoint.addin.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".ppm" mimeType="image/x-portable-pixmap" />
|
||||||
|
<mimeMap fileExtension=".pps" mimeType="application/vnd.ms-powerpoint" />
|
||||||
|
<mimeMap fileExtension=".ppsm" mimeType="application/vnd.ms-powerpoint.slideshow.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".ppsx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.slideshow" />
|
||||||
|
<mimeMap fileExtension=".ppt" mimeType="application/vnd.ms-powerpoint" />
|
||||||
|
<mimeMap fileExtension=".pptm" mimeType="application/vnd.ms-powerpoint.presentation.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".pptx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation" />
|
||||||
|
<mimeMap fileExtension=".prf" mimeType="application/pics-rules" />
|
||||||
|
<mimeMap fileExtension=".prm" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".prx" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".ps" mimeType="application/postscript" />
|
||||||
|
<mimeMap fileExtension=".psd" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".psm" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".psp" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".pub" mimeType="application/x-mspublisher" />
|
||||||
|
<mimeMap fileExtension=".qt" mimeType="video/quicktime" />
|
||||||
|
<mimeMap fileExtension=".qtl" mimeType="application/x-quicktimeplayer" />
|
||||||
|
<mimeMap fileExtension=".qxd" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".ra" mimeType="audio/x-pn-realaudio" />
|
||||||
|
<mimeMap fileExtension=".ram" mimeType="audio/x-pn-realaudio" />
|
||||||
|
<mimeMap fileExtension=".rar" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".ras" mimeType="image/x-cmu-raster" />
|
||||||
|
<mimeMap fileExtension=".rf" mimeType="image/vnd.rn-realflash" />
|
||||||
|
<mimeMap fileExtension=".rgb" mimeType="image/x-rgb" />
|
||||||
|
<mimeMap fileExtension=".rm" mimeType="application/vnd.rn-realmedia" />
|
||||||
|
<mimeMap fileExtension=".rmi" mimeType="audio/mid" />
|
||||||
|
<mimeMap fileExtension=".roff" mimeType="application/x-troff" />
|
||||||
|
<mimeMap fileExtension=".rpm" mimeType="audio/x-pn-realaudio-plugin" />
|
||||||
|
<mimeMap fileExtension=".rtf" mimeType="application/rtf" />
|
||||||
|
<mimeMap fileExtension=".rtx" mimeType="text/richtext" />
|
||||||
|
<mimeMap fileExtension=".scd" mimeType="application/x-msschedule" />
|
||||||
|
<mimeMap fileExtension=".sct" mimeType="text/scriptlet" />
|
||||||
|
<mimeMap fileExtension=".sea" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".setpay" mimeType="application/set-payment-initiation" />
|
||||||
|
<mimeMap fileExtension=".setreg" mimeType="application/set-registration-initiation" />
|
||||||
|
<mimeMap fileExtension=".sgml" mimeType="text/sgml" />
|
||||||
|
<mimeMap fileExtension=".sh" mimeType="application/x-sh" />
|
||||||
|
<mimeMap fileExtension=".shar" mimeType="application/x-shar" />
|
||||||
|
<mimeMap fileExtension=".sit" mimeType="application/x-stuffit" />
|
||||||
|
<mimeMap fileExtension=".sldm" mimeType="application/vnd.ms-powerpoint.slide.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".sldx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.slide" />
|
||||||
|
<mimeMap fileExtension=".smd" mimeType="audio/x-smd" />
|
||||||
|
<mimeMap fileExtension=".smi" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".smx" mimeType="audio/x-smd" />
|
||||||
|
<mimeMap fileExtension=".smz" mimeType="audio/x-smd" />
|
||||||
|
<mimeMap fileExtension=".snd" mimeType="audio/basic" />
|
||||||
|
<mimeMap fileExtension=".snp" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".spc" mimeType="application/x-pkcs7-certificates" />
|
||||||
|
<mimeMap fileExtension=".spl" mimeType="application/futuresplash" />
|
||||||
|
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />
|
||||||
|
<mimeMap fileExtension=".src" mimeType="application/x-wais-source" />
|
||||||
|
<mimeMap fileExtension=".ssm" mimeType="application/streamingmedia" />
|
||||||
|
<mimeMap fileExtension=".sst" mimeType="application/vnd.ms-pki.certstore" />
|
||||||
|
<mimeMap fileExtension=".stl" mimeType="application/vnd.ms-pki.stl" />
|
||||||
|
<mimeMap fileExtension=".sv4cpio" mimeType="application/x-sv4cpio" />
|
||||||
|
<mimeMap fileExtension=".sv4crc" mimeType="application/x-sv4crc" />
|
||||||
|
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
|
||||||
|
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
|
||||||
|
<mimeMap fileExtension=".swf" mimeType="application/x-shockwave-flash" />
|
||||||
|
<mimeMap fileExtension=".t" mimeType="application/x-troff" />
|
||||||
|
<mimeMap fileExtension=".tar" mimeType="application/x-tar" />
|
||||||
|
<mimeMap fileExtension=".tcl" mimeType="application/x-tcl" />
|
||||||
|
<mimeMap fileExtension=".tex" mimeType="application/x-tex" />
|
||||||
|
<mimeMap fileExtension=".texi" mimeType="application/x-texinfo" />
|
||||||
|
<mimeMap fileExtension=".texinfo" mimeType="application/x-texinfo" />
|
||||||
|
<mimeMap fileExtension=".tgz" mimeType="application/x-compressed" />
|
||||||
|
<mimeMap fileExtension=".thmx" mimeType="application/vnd.ms-officetheme" />
|
||||||
|
<mimeMap fileExtension=".thn" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".tif" mimeType="image/tiff" />
|
||||||
|
<mimeMap fileExtension=".tiff" mimeType="image/tiff" />
|
||||||
|
<mimeMap fileExtension=".toc" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".tr" mimeType="application/x-troff" />
|
||||||
|
<mimeMap fileExtension=".trm" mimeType="application/x-msterminal" />
|
||||||
|
<mimeMap fileExtension=".ts" mimeType="video/vnd.dlna.mpeg-tts" />
|
||||||
|
<mimeMap fileExtension=".tsv" mimeType="text/tab-separated-values" />
|
||||||
|
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".tts" mimeType="video/vnd.dlna.mpeg-tts" />
|
||||||
|
<mimeMap fileExtension=".txt" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".u32" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".uls" mimeType="text/iuls" />
|
||||||
|
<mimeMap fileExtension=".ustar" mimeType="application/x-ustar" />
|
||||||
|
<mimeMap fileExtension=".vbs" mimeType="text/vbscript" />
|
||||||
|
<mimeMap fileExtension=".vcf" mimeType="text/x-vcard" />
|
||||||
|
<mimeMap fileExtension=".vcs" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".vdx" mimeType="application/vnd.ms-visio.viewer" />
|
||||||
|
<mimeMap fileExtension=".vml" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".vsd" mimeType="application/vnd.visio" />
|
||||||
|
<mimeMap fileExtension=".vss" mimeType="application/vnd.visio" />
|
||||||
|
<mimeMap fileExtension=".vst" mimeType="application/vnd.visio" />
|
||||||
|
<mimeMap fileExtension=".vsto" mimeType="application/x-ms-vsto" />
|
||||||
|
<mimeMap fileExtension=".vsw" mimeType="application/vnd.visio" />
|
||||||
|
<mimeMap fileExtension=".vsx" mimeType="application/vnd.visio" />
|
||||||
|
<mimeMap fileExtension=".vtx" mimeType="application/vnd.visio" />
|
||||||
|
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
|
||||||
|
<mimeMap fileExtension=".wav" mimeType="audio/wav" />
|
||||||
|
<mimeMap fileExtension=".wax" mimeType="audio/x-ms-wax" />
|
||||||
|
<mimeMap fileExtension=".wbmp" mimeType="image/vnd.wap.wbmp" />
|
||||||
|
<mimeMap fileExtension=".wcm" mimeType="application/vnd.ms-works" />
|
||||||
|
<mimeMap fileExtension=".wdb" mimeType="application/vnd.ms-works" />
|
||||||
|
<mimeMap fileExtension=".webm" mimeType="video/webm" />
|
||||||
|
<mimeMap fileExtension=".wks" mimeType="application/vnd.ms-works" />
|
||||||
|
<mimeMap fileExtension=".wm" mimeType="video/x-ms-wm" />
|
||||||
|
<mimeMap fileExtension=".wma" mimeType="audio/x-ms-wma" />
|
||||||
|
<mimeMap fileExtension=".wmd" mimeType="application/x-ms-wmd" />
|
||||||
|
<mimeMap fileExtension=".wmf" mimeType="application/x-msmetafile" />
|
||||||
|
<mimeMap fileExtension=".wml" mimeType="text/vnd.wap.wml" />
|
||||||
|
<mimeMap fileExtension=".wmlc" mimeType="application/vnd.wap.wmlc" />
|
||||||
|
<mimeMap fileExtension=".wmls" mimeType="text/vnd.wap.wmlscript" />
|
||||||
|
<mimeMap fileExtension=".wmlsc" mimeType="application/vnd.wap.wmlscriptc" />
|
||||||
|
<mimeMap fileExtension=".wmp" mimeType="video/x-ms-wmp" />
|
||||||
|
<mimeMap fileExtension=".wmv" mimeType="video/x-ms-wmv" />
|
||||||
|
<mimeMap fileExtension=".wmx" mimeType="video/x-ms-wmx" />
|
||||||
|
<mimeMap fileExtension=".wmz" mimeType="application/x-ms-wmz" />
|
||||||
|
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
|
||||||
|
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
|
||||||
|
<mimeMap fileExtension=".wps" mimeType="application/vnd.ms-works" />
|
||||||
|
<mimeMap fileExtension=".wri" mimeType="application/x-mswrite" />
|
||||||
|
<mimeMap fileExtension=".wrl" mimeType="x-world/x-vrml" />
|
||||||
|
<mimeMap fileExtension=".wrz" mimeType="x-world/x-vrml" />
|
||||||
|
<mimeMap fileExtension=".wsdl" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".wtv" mimeType="video/x-ms-wtv" />
|
||||||
|
<mimeMap fileExtension=".wvx" mimeType="video/x-ms-wvx" />
|
||||||
|
<mimeMap fileExtension=".x" mimeType="application/directx" />
|
||||||
|
<mimeMap fileExtension=".xaf" mimeType="x-world/x-vrml" />
|
||||||
|
<mimeMap fileExtension=".xaml" mimeType="application/xaml+xml" />
|
||||||
|
<mimeMap fileExtension=".xap" mimeType="application/x-silverlight-app" />
|
||||||
|
<mimeMap fileExtension=".xbap" mimeType="application/x-ms-xbap" />
|
||||||
|
<mimeMap fileExtension=".xbm" mimeType="image/x-xbitmap" />
|
||||||
|
<mimeMap fileExtension=".xdr" mimeType="text/plain" />
|
||||||
|
<mimeMap fileExtension=".xht" mimeType="application/xhtml+xml" />
|
||||||
|
<mimeMap fileExtension=".xhtml" mimeType="application/xhtml+xml" />
|
||||||
|
<mimeMap fileExtension=".xla" mimeType="application/vnd.ms-excel" />
|
||||||
|
<mimeMap fileExtension=".xlam" mimeType="application/vnd.ms-excel.addin.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".xlc" mimeType="application/vnd.ms-excel" />
|
||||||
|
<mimeMap fileExtension=".xlm" mimeType="application/vnd.ms-excel" />
|
||||||
|
<mimeMap fileExtension=".xls" mimeType="application/vnd.ms-excel" />
|
||||||
|
<mimeMap fileExtension=".xlsb" mimeType="application/vnd.ms-excel.sheet.binary.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".xlsm" mimeType="application/vnd.ms-excel.sheet.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".xlsx" mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
|
||||||
|
<mimeMap fileExtension=".xlt" mimeType="application/vnd.ms-excel" />
|
||||||
|
<mimeMap fileExtension=".xltm" mimeType="application/vnd.ms-excel.template.macroEnabled.12" />
|
||||||
|
<mimeMap fileExtension=".xltx" mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.template" />
|
||||||
|
<mimeMap fileExtension=".xlw" mimeType="application/vnd.ms-excel" />
|
||||||
|
<mimeMap fileExtension=".xml" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".xof" mimeType="x-world/x-vrml" />
|
||||||
|
<mimeMap fileExtension=".xpm" mimeType="image/x-xpixmap" />
|
||||||
|
<mimeMap fileExtension=".xps" mimeType="application/vnd.ms-xpsdocument" />
|
||||||
|
<mimeMap fileExtension=".xsd" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".xsf" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".xsl" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".xslt" mimeType="text/xml" />
|
||||||
|
<mimeMap fileExtension=".xsn" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".xtp" mimeType="application/octet-stream" />
|
||||||
|
<mimeMap fileExtension=".xwd" mimeType="image/x-xwindowdump" />
|
||||||
|
<mimeMap fileExtension=".z" mimeType="application/x-compress" />
|
||||||
|
<mimeMap fileExtension=".zip" mimeType="application/x-zip-compressed" />
|
||||||
|
</staticContent>
|
||||||
|
<tracing>
|
||||||
|
<traceFailedRequests>
|
||||||
|
<add path="*">
|
||||||
|
<traceAreas>
|
||||||
|
<add provider="ASP" verbosity="Verbose" />
|
||||||
|
<add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
|
||||||
|
<add provider="ISAPI Extension" verbosity="Verbose" />
|
||||||
|
<add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,Rewrite,WebSocket" verbosity="Verbose" />
|
||||||
|
</traceAreas>
|
||||||
|
<failureDefinitions statusCodes="200-999" />
|
||||||
|
</add>
|
||||||
|
</traceFailedRequests>
|
||||||
|
<traceProviderDefinitions>
|
||||||
|
<add name="WWW Server" guid="{3a2a4e84-4c21-4981-ae10-3fda0d9b0f83}">
|
||||||
|
<areas>
|
||||||
|
<clear />
|
||||||
|
<add name="Authentication" value="2" />
|
||||||
|
<add name="Security" value="4" />
|
||||||
|
<add name="Filter" value="8" />
|
||||||
|
<add name="StaticFile" value="16" />
|
||||||
|
<add name="CGI" value="32" />
|
||||||
|
<add name="Compression" value="64" />
|
||||||
|
<add name="Cache" value="128" />
|
||||||
|
<add name="RequestNotifications" value="256" />
|
||||||
|
<add name="Module" value="512" />
|
||||||
|
<add name="Rewrite" value="1024" />
|
||||||
|
<add name="FastCGI" value="4096" />
|
||||||
|
<add name="WebSocket" value="16384" />
|
||||||
|
</areas>
|
||||||
|
</add>
|
||||||
|
<add name="ASP" guid="{06b94d9a-b15e-456e-a4ef-37c984a2cb4b}">
|
||||||
|
<areas>
|
||||||
|
<clear />
|
||||||
|
</areas>
|
||||||
|
</add>
|
||||||
|
<add name="ISAPI Extension" guid="{a1c2040e-8840-4c31-ba11-9871031a19ea}">
|
||||||
|
<areas>
|
||||||
|
<clear />
|
||||||
|
</areas>
|
||||||
|
</add>
|
||||||
|
<add name="ASPNET" guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}">
|
||||||
|
<areas>
|
||||||
|
<add name="Infrastructure" value="1" />
|
||||||
|
<add name="Module" value="2" />
|
||||||
|
<add name="Page" value="4" />
|
||||||
|
<add name="AppServices" value="8" />
|
||||||
|
</areas>
|
||||||
|
</add>
|
||||||
|
</traceProviderDefinitions>
|
||||||
|
</tracing>
|
||||||
|
<urlCompression />
|
||||||
|
<validation />
|
||||||
|
<webdav>
|
||||||
|
<globalSettings>
|
||||||
|
<propertyStores>
|
||||||
|
<add name="webdav_simple_prop" image="%IIS_BIN%\webdav_simple_prop.dll" image32="%IIS_BIN%\webdav_simple_prop.dll" />
|
||||||
|
</propertyStores>
|
||||||
|
<lockStores>
|
||||||
|
<add name="webdav_simple_lock" image="%IIS_BIN%\webdav_simple_lock.dll" image32="%IIS_BIN%\webdav_simple_lock.dll" />
|
||||||
|
</lockStores>
|
||||||
|
</globalSettings>
|
||||||
|
<authoring>
|
||||||
|
<locks enabled="true" lockStore="webdav_simple_lock" />
|
||||||
|
</authoring>
|
||||||
|
<authoringRules />
|
||||||
|
</webdav>
|
||||||
|
<webSocket />
|
||||||
|
<applicationInitialization />
|
||||||
|
</system.webServer>
|
||||||
|
<location path="" overrideMode="Allow">
|
||||||
|
<system.webServer>
|
||||||
|
<modules>
|
||||||
|
<add name="IsapiFilterModule" lockItem="true" />
|
||||||
|
<add name="BasicAuthenticationModule" lockItem="true" />
|
||||||
|
<add name="IsapiModule" lockItem="true" />
|
||||||
|
<add name="HttpLoggingModule" lockItem="true" />
|
||||||
|
<add name="DynamicCompressionModule" lockItem="true" />
|
||||||
|
<add name="StaticCompressionModule" lockItem="true" />
|
||||||
|
<add name="DefaultDocumentModule" lockItem="true" />
|
||||||
|
<add name="DirectoryListingModule" lockItem="true" />
|
||||||
|
<add name="ProtocolSupportModule" lockItem="true" />
|
||||||
|
<add name="HttpRedirectionModule" lockItem="true" />
|
||||||
|
<add name="ServerSideIncludeModule" lockItem="true" />
|
||||||
|
<add name="StaticFileModule" lockItem="true" />
|
||||||
|
<add name="AnonymousAuthenticationModule" lockItem="false" />
|
||||||
|
<add name="CertificateMappingAuthenticationModule" lockItem="true" />
|
||||||
|
<add name="UrlAuthorizationModule" lockItem="true" />
|
||||||
|
<add name="WindowsAuthenticationModule" lockItem="false" />
|
||||||
|
<add name="IISCertificateMappingAuthenticationModule" lockItem="true" />
|
||||||
|
<add name="WebMatrixSupportModule" lockItem="true" />
|
||||||
|
<add name="IpRestrictionModule" lockItem="true" />
|
||||||
|
<add name="DynamicIpRestrictionModule" lockItem="true" />
|
||||||
|
<add name="RequestFilteringModule" lockItem="true" />
|
||||||
|
<add name="CustomLoggingModule" lockItem="true" />
|
||||||
|
<add name="CustomErrorModule" lockItem="true" />
|
||||||
|
<add name="FailedRequestsTracingModule" lockItem="true" />
|
||||||
|
<add name="CgiModule" lockItem="true" />
|
||||||
|
<add name="FastCgiModule" lockItem="true" />
|
||||||
|
<!-- <add name="WebDAVModule" /> -->
|
||||||
|
<add name="RewriteModule" />
|
||||||
|
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" preCondition="managedHandler" />
|
||||||
|
<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="managedHandler" />
|
||||||
|
<add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" preCondition="managedHandler" />
|
||||||
|
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" preCondition="managedHandler" />
|
||||||
|
<add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" preCondition="managedHandler" />
|
||||||
|
<add name="RoleManager" type="System.Web.Security.RoleManagerModule" preCondition="managedHandler" />
|
||||||
|
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" preCondition="managedHandler" />
|
||||||
|
<add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" preCondition="managedHandler" />
|
||||||
|
<add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" preCondition="managedHandler" />
|
||||||
|
<add name="Profile" type="System.Web.Profile.ProfileModule" preCondition="managedHandler" />
|
||||||
|
<add name="UrlMappingsModule" type="System.Web.UrlMappingsModule" preCondition="managedHandler" />
|
||||||
|
<add name="ApplicationInitializationModule" lockItem="true" />
|
||||||
|
<add name="WebSocketModule" lockItem="true" />
|
||||||
|
<add name="ServiceModel-4.0" type="System.ServiceModel.Activation.ServiceHttpModule,System.ServiceModel.Activation,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
|
||||||
|
<add name="ConfigurationValidationModule" lockItem="true" />
|
||||||
|
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler,runtimeVersionv4.0" />
|
||||||
|
<add name="ScriptModule-4.0" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
|
||||||
|
<add name="AspNetCoreModuleV2" />
|
||||||
|
</modules>
|
||||||
|
<handlers accessPolicy="Read, Script">
|
||||||
|
<!-- <add name="WebDAV" path="*" verb="PROPFIND,PROPPATCH,MKCOL,PUT,COPY,DELETE,MOVE,LOCK,UNLOCK" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" /> -->
|
||||||
|
<add name="AXD-ISAPI-4.0_64bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="PageHandlerFactory-ISAPI-4.0_64bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="SimpleHandlerFactory-ISAPI-4.0_64bit" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="WebServiceHandlerFactory-ISAPI-4.0_64bit" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-rem-ISAPI-4.0_64bit" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-soap-ISAPI-4.0_64bit" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="svc-ISAPI-4.0_64bit" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||||
|
<add name="rules-ISAPI-4.0_64bit" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||||
|
<add name="xoml-ISAPI-4.0_64bit" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||||
|
<add name="xamlx-ISAPI-4.0_64bit" path="*.xamlx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||||
|
<add name="aspq-ISAPI-4.0_64bit" path="*.aspq" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="cshtm-ISAPI-4.0_64bit" path="*.cshtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="cshtml-ISAPI-4.0_64bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="vbhtm-ISAPI-4.0_64bit" path="*.vbhtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="vbhtml-ISAPI-4.0_64bit" path="*.vbhtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="AXD-ISAPI-4.0_32bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="PageHandlerFactory-ISAPI-4.0_32bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="SimpleHandlerFactory-ISAPI-4.0_32bit" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="WebServiceHandlerFactory-ISAPI-4.0_32bit" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-rem-ISAPI-4.0_32bit" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-soap-ISAPI-4.0_32bit" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="svc-ISAPI-4.0_32bit" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||||
|
<add name="rules-ISAPI-4.0_32bit" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||||
|
<add name="xoml-ISAPI-4.0_32bit" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||||
|
<add name="xamlx-ISAPI-4.0_32bit" path="*.xamlx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||||
|
<add name="aspq-ISAPI-4.0_32bit" path="*.aspq" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="cshtm-ISAPI-4.0_32bit" path="*.cshtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="cshtml-ISAPI-4.0_32bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="vbhtm-ISAPI-4.0_32bit" path="*.vbhtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="vbhtml-ISAPI-4.0_32bit" path="*.vbhtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="TraceHandler-Integrated-4.0" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="WebAdminHandler-Integrated-4.0" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="AssemblyResourceLoader-Integrated-4.0" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="PageHandlerFactory-Integrated-4.0" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="SimpleHandlerFactory-Integrated-4.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.SimpleHandlerFactory" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="WebServiceHandlerFactory-Integrated-4.0" path="*.asmx" verb="GET,HEAD,POST,DEBUG" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-rem-Integrated-4.0" path="*.rem" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-soap-Integrated-4.0" path="*.soap" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="svc-Integrated-4.0" path="*.svc" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="rules-Integrated-4.0" path="*.rules" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="xoml-Integrated-4.0" path="*.xoml" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="xamlx-Integrated-4.0" path="*.xamlx" verb="GET,HEAD,POST,DEBUG" type="System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="aspq-Integrated-4.0" path="*.aspq" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="cshtm-Integrated-4.0" path="*.cshtm" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="cshtml-Integrated-4.0" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="vbhtm-Integrated-4.0" path="*.vbhtm" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="vbhtml-Integrated-4.0" path="*.vbhtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="ScriptHandlerFactoryAppServices-Integrated-4.0" path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="ScriptResourceIntegrated-4.0" path="*ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
|
<add name="ASPClassic" path="*.asp" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="%IIS_BIN%\asp.dll" resourceType="File" />
|
||||||
|
<add name="SecurityCertificate" path="*.cer" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="%IIS_BIN%\asp.dll" resourceType="File" />
|
||||||
|
<add name="ISAPI-dll" path="*.dll" verb="*" modules="IsapiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
|
||||||
|
<add name="TraceHandler-Integrated" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="WebAdminHandler-Integrated" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="AssemblyResourceLoader-Integrated" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="PageHandlerFactory-Integrated" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.SimpleHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="WebServiceHandlerFactory-Integrated" path="*.asmx" verb="GET,HEAD,POST,DEBUG" type="System.Web.Services.Protocols.WebServiceHandlerFactory,System.Web.Services,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-rem-Integrated" path="*.rem" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,System.Runtime.Remoting,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-soap-Integrated" path="*.soap" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,System.Runtime.Remoting,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||||
|
<add name="AXD-ISAPI-2.0" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="PageHandlerFactory-ISAPI-2.0" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="SimpleHandlerFactory-ISAPI-2.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="WebServiceHandlerFactory-ISAPI-2.0" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-rem-ISAPI-2.0" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-soap-ISAPI-2.0" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="AXD-ISAPI-2.0-64" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="PageHandlerFactory-ISAPI-2.0-64" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="SimpleHandlerFactory-ISAPI-2.0-64" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="WebServiceHandlerFactory-ISAPI-2.0-64" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-rem-ISAPI-2.0-64" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="HttpRemotingHandlerFactory-soap-ISAPI-2.0-64" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="CGI-exe" path="*.exe" verb="*" modules="CgiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
|
||||||
|
<add name="SSINC-stm" path="*.stm" verb="GET,HEAD,POST" modules="ServerSideIncludeModule" resourceType="File" />
|
||||||
|
<add name="SSINC-shtm" path="*.shtm" verb="GET,HEAD,POST" modules="ServerSideIncludeModule" resourceType="File" />
|
||||||
|
<add name="SSINC-shtml" path="*.shtml" verb="GET,HEAD,POST" modules="ServerSideIncludeModule" resourceType="File" />
|
||||||
|
<add name="TRACEVerbHandler" path="*" verb="TRACE" modules="ProtocolSupportModule" requireAccess="None" />
|
||||||
|
<add name="OPTIONSVerbHandler" path="*" verb="OPTIONS" modules="ProtocolSupportModule" requireAccess="None" />
|
||||||
|
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||||
|
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />
|
||||||
|
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
|
||||||
|
</handlers>
|
||||||
|
</system.webServer>
|
||||||
|
</location>
|
||||||
|
<location path="BeReadyBackend" inheritInChildApplications="false">
|
||||||
|
<system.webServer>
|
||||||
|
<security>
|
||||||
|
<authentication>
|
||||||
|
<anonymousAuthentication enabled="true" />
|
||||||
|
<windowsAuthentication enabled="false" />
|
||||||
|
</authentication>
|
||||||
|
</security>
|
||||||
|
<handlers>
|
||||||
|
<add name="aspNetCore" path="*" verb="*" resourceType="Unspecified" modules="AspNetCoreModuleV2" />
|
||||||
|
</handlers>
|
||||||
|
<modules>
|
||||||
|
<remove name="WebMatrixSupportModule" />
|
||||||
|
</modules>
|
||||||
|
<aspNetCore stdoutLogEnabled="false" startupTimeLimit="3600" requestTimeout="23:00:00" processPath="%ANCM_LAUNCHER_PATH%" hostingModel="InProcess" arguments="%ANCM_LAUNCHER_ARGS%" />
|
||||||
|
<httpCompression>
|
||||||
|
<dynamicTypes>
|
||||||
|
<add mimeType="text/event-stream" enabled="false" />
|
||||||
|
</dynamicTypes>
|
||||||
|
</httpCompression>
|
||||||
|
</system.webServer>
|
||||||
|
</location>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:Boolean x:Key="/Default/CodeEditing/SuppressNullableWarningFix/Enabled/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEndpoint_002ESend_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fc2fa49f697e4d07c58aa3f35484a5103de685287155db8b628f2cdce16b69_003FEndpoint_002ESend_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEndpoint_002ESetup_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003F656240c46e44c14018dc6190e77764a3404d76b559ed75474669c553eb6227dd_003FEndpoint_002ESetup_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIHubClients_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fd6ae5218e3a0462f8a94591a77a902637b750_003Faf_003F6ad738e4_003FIHubClients_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIHubContext_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F731dbe51d65849048244493644b992cd78910_003Fda_003Fd14ae6ee_003FIHubContext_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARepositoryBaseOfT_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003F5023b5be698d783ffe9f42b2e944a85a7a66b61bc5e19c76c591036343fd16_003FRepositoryBaseOfT_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARepositoryBaseOfT_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F5023b5be698d783ffe9f42b2e944a85a7a66b61bc5e19c76c591036343fd16_003FRepositoryBaseOfT_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARepositoryBaseOfT_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003F5023b5be698d783ffe9f42b2e944a85a7a66b61bc5e19c76c591036343fd16_003FRepositoryBaseOfT_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||||
@@ -7,13 +7,23 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="9.3.1" />
|
||||||
|
<PackageReference Include="AutoMapper" Version="16.0.0" />
|
||||||
|
<PackageReference Include="AutoMapper.Collection" Version="13.0.0" />
|
||||||
|
<PackageReference Include="BCrypt.Net-Next" Version="4.1.0" />
|
||||||
|
<PackageReference Include="FastEndpoints" Version="7.2.0" />
|
||||||
|
<PackageReference Include="FastEndpoints.Security" Version="7.2.0" />
|
||||||
|
<PackageReference Include="FastEndpoints.Swagger" Version="7.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.24"/>
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.24"/>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.2.9" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.20" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.20" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.20">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.20">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.20" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.20" />
|
||||||
|
<PackageReference Include="PasswordGenerator" Version="2.1.0" />
|
||||||
|
<PackageReference Include="Plainquire.Page" Version="7.0.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2"/>
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
@BeReadyBackend_HostAddress = http://localhost:5235
|
|
||||||
|
|
||||||
GET {{BeReadyBackend_HostAddress}}/weatherforecast/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace BeReadyBackend;
|
||||||
|
|
||||||
|
public class BeReadyDbContext : DbContext
|
||||||
|
{
|
||||||
|
public DbSet<Achievement> Achievements { get; set; }
|
||||||
|
public DbSet<Designation> Designations { get; set; }
|
||||||
|
public DbSet<Group> Groups { get; set; }
|
||||||
|
public DbSet<Message> Messages { get; set; }
|
||||||
|
public DbSet<RandomChallenge> RandomChallenges { get; set; }
|
||||||
|
public DbSet<User> Users { get; set; }
|
||||||
|
public DbSet<UserAchievement> UserAchievements { get; set; }
|
||||||
|
public DbSet<UserFriend> UserFriends { get; set; }
|
||||||
|
public DbSet<UserGroup> UserGroups { get; set; }
|
||||||
|
public DbSet<UserRandomChallenge> UserRandomChallenges { get; set; }
|
||||||
|
public DbSet<Post> Posts { get; set; }
|
||||||
|
public DbSet<UserPost> UserPosts { get; set; }
|
||||||
|
|
||||||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
|
{
|
||||||
|
string connectionString =
|
||||||
|
"Server=romaric-thibault.fr;" +
|
||||||
|
"Database=beready;" +
|
||||||
|
"User Id=beready;" +
|
||||||
|
"Password=beready;" +
|
||||||
|
"TrustServerCertificate=true;";
|
||||||
|
|
||||||
|
optionsBuilder.UseSqlServer(connectionString);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder.Entity<UserFriend>()
|
||||||
|
.HasOne(x => x.User)
|
||||||
|
.WithMany(x => x.UserFriends)
|
||||||
|
.HasForeignKey(x => x.UserId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
modelBuilder.Entity<UserFriend>()
|
||||||
|
.HasOne(x => x.Friend)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey(x => x.FriendId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
|
||||||
|
modelBuilder.Entity<Post>()
|
||||||
|
.HasOne(x => x.User)
|
||||||
|
.WithMany(x => x.Posts)
|
||||||
|
.HasForeignKey(x => x.UserId)
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
modelBuilder.Entity<UserPost>()
|
||||||
|
.HasOne(x => x.User)
|
||||||
|
.WithMany(x => x.UserPosts)
|
||||||
|
.HasForeignKey(x => x.UserId)
|
||||||
|
.OnDelete(DeleteBehavior.NoAction);
|
||||||
|
|
||||||
|
modelBuilder.Entity<UserPost>()
|
||||||
|
.HasOne(x => x.Post)
|
||||||
|
.WithMany(x => x.UserPosts)
|
||||||
|
.HasForeignKey(x => x.PostId)
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Achievements;
|
||||||
|
|
||||||
|
public class GetAchievementDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Label { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Achievements;
|
||||||
|
|
||||||
|
public class UnlockAchievementDto
|
||||||
|
{
|
||||||
|
public int AchievementId { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Auth;
|
||||||
|
|
||||||
|
public class GetTokenDto
|
||||||
|
{
|
||||||
|
public string? Token { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Auth;
|
||||||
|
|
||||||
|
public class LoginDto
|
||||||
|
{
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public string? Password { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Auth;
|
||||||
|
|
||||||
|
public class RefreshTokenDto
|
||||||
|
{
|
||||||
|
public string? Token { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Designations;
|
||||||
|
|
||||||
|
public class GetDesignationDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Label { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Friends;
|
||||||
|
|
||||||
|
public class GetFriendDto
|
||||||
|
{
|
||||||
|
public int FriendId { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public int Score { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Friends;
|
||||||
|
|
||||||
|
public class GetFriendRequestDto
|
||||||
|
{
|
||||||
|
public int UserId { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public int Score { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Friends;
|
||||||
|
|
||||||
|
public class SendFriendDto
|
||||||
|
{
|
||||||
|
public int FriendId { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Groups;
|
||||||
|
|
||||||
|
public class CreateGroupDto
|
||||||
|
{
|
||||||
|
public string? Label { get; set; }
|
||||||
|
public List<CreateUserGroupDto>? UserGroups { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Groups;
|
||||||
|
|
||||||
|
public class CreateUserGroupDto
|
||||||
|
{
|
||||||
|
public int UserId { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using BeReadyBackend.DTO.Messages;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.DTO.Groups;
|
||||||
|
|
||||||
|
public class GetGroupDetailsDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Label { get; set; }
|
||||||
|
public DateTime CreationDate { get; set; }
|
||||||
|
|
||||||
|
public List<GetMessageDto>? Messages { get; set; }
|
||||||
|
public List<GetUserGroupDto>? Users { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Groups;
|
||||||
|
|
||||||
|
public class GetGroupDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Label { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Groups;
|
||||||
|
|
||||||
|
public class GetUserGroupDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public string? Grade { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Messages;
|
||||||
|
|
||||||
|
public class CreateMessageDto
|
||||||
|
{
|
||||||
|
public int GroupId { get; set; }
|
||||||
|
public string? Libelle { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Messages;
|
||||||
|
|
||||||
|
public class GetMessageDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Libelle { get; set; }
|
||||||
|
public DateTime SendDate { get; set; }
|
||||||
|
public int UserId { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Posts;
|
||||||
|
|
||||||
|
public class GetPostDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Libelle { get; set; }
|
||||||
|
public DateTime CreationDate { get; set; }
|
||||||
|
public int Likes { get; set; }
|
||||||
|
public bool IsLiked { get; set; }
|
||||||
|
public string? Proof { get; set; }
|
||||||
|
public int UserId { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BeReadyBackend.DTO.RandomChallenges;
|
||||||
|
|
||||||
|
public class GetRandomChallengeDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? Label { get; set; }
|
||||||
|
public string? Libelle { get; set; }
|
||||||
|
public bool IsAlreadyPast { get; set; }
|
||||||
|
public DateTime? GeneratedAt { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class CreateUserDto
|
||||||
|
{
|
||||||
|
public string? FirstName { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public string? Email { get; set; }
|
||||||
|
public string? Password { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class GetUserChallengeDto
|
||||||
|
{
|
||||||
|
public string? ChallengeTitle { get; set; }
|
||||||
|
public string? ChallengeDescription { get; set; }
|
||||||
|
public DateOnly ChallengeStartDate { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class GetUserDetailsDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? FirstName { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public string? Email { get; set; }
|
||||||
|
public int? DesignationId { get; set; }
|
||||||
|
public string? DesignationName { get; set; }
|
||||||
|
public DateTime CreationDate { get; set; }
|
||||||
|
public GetUserStatsDto? GetUserStatsDto { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class GetUserDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string? FirstName { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public int? DesignationId { get; set; }
|
||||||
|
public string? DesignationName { get; set; }
|
||||||
|
public GetUserStatsDto? GetUserStatsDto { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class GetUserProofDto
|
||||||
|
{
|
||||||
|
public string? Proof { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class GetUserStatsDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public int TotalLikes { get; set; }
|
||||||
|
public int TotalChallenge { get; set; }
|
||||||
|
public int Series { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class PatchUserDesignationDto
|
||||||
|
{
|
||||||
|
public int? DesignationId { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class PatchUserPasswordDto
|
||||||
|
{
|
||||||
|
public string? Password { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace BeReadyBackend.DTO.Users;
|
||||||
|
|
||||||
|
public class UpdateUserDto
|
||||||
|
{
|
||||||
|
public string? FirstName { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Username { get; set; }
|
||||||
|
public string? Email { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using BeReadyBackend.DTO.Achievements;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.UserAchievements;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Achievements;
|
||||||
|
|
||||||
|
public class GetUserAchievementsEndpoint(
|
||||||
|
UserAchievementsRepository userAchievementsRepository,
|
||||||
|
UserService userService)
|
||||||
|
: EndpointWithoutRequest<List<GetAchievementDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Achievements/Users/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
List<GetAchievementDto> userAchievements = await userAchievementsRepository.ProjectToListAsync<GetAchievementDto>(new GetUserAchievementByUserIdSpec(userId), ct);
|
||||||
|
|
||||||
|
await Send.OkAsync(userAchievements, ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using BeReadyBackend.DTO.Auth;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
using FastEndpoints.Security;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Auth;
|
||||||
|
|
||||||
|
public class LoginEndpoint(UsersRepository usersRepository, AutoMapper.IMapper mapper) : Endpoint<LoginDto, GetTokenDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Post("/Auth/Login");
|
||||||
|
AllowAnonymous();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(LoginDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByUsernameSpec(req.Username!), ct);
|
||||||
|
|
||||||
|
if (user == null)
|
||||||
|
{
|
||||||
|
await Send.UnauthorizedAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BCrypt.Net.BCrypt.Verify(req.Password + user.Salt, user.Password))
|
||||||
|
{
|
||||||
|
string jwtToken = JwtBearer.CreateToken(o =>
|
||||||
|
{
|
||||||
|
o.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong";
|
||||||
|
o.ExpireAt = DateTime.UtcNow.AddDays(15);
|
||||||
|
o.User.Claims.Add(("Username", user.Username)!);
|
||||||
|
o.User.Claims.Add(("FullName", user.FirstName + user.Name));
|
||||||
|
o.User.Claims.Add(("UserId", user.Id.ToString()));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
await Send.OkAsync(new GetTokenDto { Token = jwtToken }, ct);
|
||||||
|
}
|
||||||
|
else await Send.UnauthorizedAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using BeReadyBackend.DTO.Auth;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
using FastEndpoints.Security;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Auth;
|
||||||
|
|
||||||
|
public class RefreshTokenEndpoint(UsersRepository usersRepository, AutoMapper.IMapper mapper) : Endpoint<RefreshTokenDto, GetTokenDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Post("/Auth/RefreshToken");
|
||||||
|
AllowAnonymous();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(RefreshTokenDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
JwtSecurityTokenHandler handler = new();
|
||||||
|
JwtSecurityToken? token = handler.ReadJwtToken(req.Token);
|
||||||
|
string? username = token.Claims.FirstOrDefault(c => c.Type == "Username")?.Value;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(username))
|
||||||
|
{
|
||||||
|
await Send.UnauthorizedAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
User? user = await usersRepository.FirstOrDefaultAsync(new GetUserByUsernameSpec(username), ct);
|
||||||
|
if (user is null)
|
||||||
|
{
|
||||||
|
await Send.UnauthorizedAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string jwtToken = JwtBearer.CreateToken(o =>
|
||||||
|
{
|
||||||
|
o.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong";
|
||||||
|
o.ExpireAt = DateTime.UtcNow.AddDays(15);
|
||||||
|
o.User.Claims.Add(("Username", user.Username)!);
|
||||||
|
o.User.Claims.Add(("FullName", user.FirstName + user.Name));
|
||||||
|
o.User.Claims.Add(("UserId", user.Id.ToString()));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
await Send.OkAsync(new GetTokenDto { Token = jwtToken }, ct);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
await Send.UnauthorizedAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using BeReadyBackend.DTO.Designations;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Designations;
|
||||||
|
|
||||||
|
public class GetAllDesignationsEndpoint(DesignationsRepository designationsRepository) : EndpointWithoutRequest<List<GetDesignationDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Designations/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
await Send.OkAsync(await designationsRepository.ProjectToListAsync<GetDesignationDto>(ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Friends;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Friends;
|
||||||
|
|
||||||
|
public class AcceptFriendRequest
|
||||||
|
{
|
||||||
|
public int FriendId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AcceptFriendRequestEndpoint(UserService userService, UserFriendsRepository userFriendsRepository) : Endpoint<AcceptFriendRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Put("/Friends/{@FriendId}/Request/", x => new { x.FriendId });
|
||||||
|
Description(x => x.Accepts<AcceptFriendRequest>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(AcceptFriendRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
UserFriend? userFriend = await userFriendsRepository.SingleOrDefaultAsync(new GetFriendRequestByIdsSpec(req.FriendId, userId), ct);
|
||||||
|
|
||||||
|
if (userFriend is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
userFriend.IsAccepted = true;
|
||||||
|
|
||||||
|
UserFriend friend = new()
|
||||||
|
{
|
||||||
|
UserId = userId,
|
||||||
|
FriendId = req.FriendId,
|
||||||
|
IsAccepted = true
|
||||||
|
};
|
||||||
|
|
||||||
|
await userFriendsRepository.AddAsync(friend, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Friends;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Friends;
|
||||||
|
|
||||||
|
public class DeleteFriendRequest
|
||||||
|
{
|
||||||
|
public int FriendId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteFriendEndpoint(UserFriendsRepository userFriendsRepository, UserService userService) : Endpoint<DeleteFriendRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Delete("/Friends/{@FriendId}", x => new { x.FriendId });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(DeleteFriendRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
UserFriend? userFriend = await userFriendsRepository.SingleOrDefaultAsync(new GetFriendByCriteriaSpec(userId, req.FriendId), ct);
|
||||||
|
UserFriend? friendUser = await userFriendsRepository.SingleOrDefaultAsync(new GetFriendByCriteriaSpec(req.FriendId, userId), ct);
|
||||||
|
|
||||||
|
if (userFriend is null || friendUser is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await userFriendsRepository.DeleteAsync(userFriend, ct);
|
||||||
|
await userFriendsRepository.DeleteAsync(friendUser, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using BeReadyBackend.DTO.Friends;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Friends;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Friends;
|
||||||
|
|
||||||
|
public class GetAllFriendRequestsEndpoint(UserFriendsRepository userFriendsRepository, UserService userService) : EndpointWithoutRequest<List<GetFriendRequestDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Friends/Requests/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
await Send.OkAsync(await userFriendsRepository.ProjectToListAsync<GetFriendRequestDto>(new GetFriendRequestSpec(userId), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using BeReadyBackend.DTO.Friends;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Friends;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Friends;
|
||||||
|
|
||||||
|
public class GetAllFriendsEndpoint(UserFriendsRepository userFriendsRepository, UserService userService) : EndpointWithoutRequest<List<GetFriendDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Friends/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
await Send.OkAsync(await userFriendsRepository.ProjectToListAsync<GetFriendDto>(new GetFriendsByUserIdSpec(userId), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Friends;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Friends;
|
||||||
|
|
||||||
|
public class RejectFriendRequest
|
||||||
|
{
|
||||||
|
public int FriendId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RejectFriendRequestEndpoint(UserService userService, UserFriendsRepository userFriendsRepository) : Endpoint<RejectFriendRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Delete("/Friends/{@FriendId}/Request/", x => new { x.FriendId });
|
||||||
|
Description(x => x.Accepts<RejectFriendRequest>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(RejectFriendRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
UserFriend? userFriend = await userFriendsRepository.SingleOrDefaultAsync(new GetFriendRequestByIdsSpec(req.FriendId, userId), ct);
|
||||||
|
|
||||||
|
if (userFriend is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await userFriendsRepository.DeleteAsync(userFriend, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using BeReadyBackend.DTO.Friends;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Friends;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Friends;
|
||||||
|
|
||||||
|
public class SendFriendRequestEndpoint(UserFriendsRepository userFriendsRepository, UserService userService, AutoMapper.IMapper mapper) : Endpoint<SendFriendDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Post("/Friends/{@FriendId}/", x => new { x.FriendId });
|
||||||
|
Description(x => x.Accepts<SendFriendDto>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(SendFriendDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
UserFriend? userFriend = await userFriendsRepository.SingleOrDefaultAsync(new GetFriendByCriteriaSpec(userId, req.FriendId), ct);
|
||||||
|
|
||||||
|
if (userFriend is not null)
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Cet utilisateur est déjà ami avec cette personne", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
userFriend = mapper.Map<UserFriend>(req);
|
||||||
|
userFriend.UserId = userId;
|
||||||
|
userFriend.IsAccepted = false;
|
||||||
|
|
||||||
|
await userFriendsRepository.AddAsync(userFriend, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
using BeReadyBackend.DTO.Groups;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
using Group = BeReadyBackend.Models.Group;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class CreateGroupEndpoint(
|
||||||
|
UserGroupsRepository userGroupsRepository,
|
||||||
|
GroupsRepository groupsRepository,
|
||||||
|
UsersRepository usersRepository,
|
||||||
|
UserService userService,
|
||||||
|
AutoMapper.IMapper mapper) : Endpoint<CreateGroupDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Post("/Groups/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CreateGroupDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
Group group = new();
|
||||||
|
mapper.Map(req, group);
|
||||||
|
group.CreationDate = DateTime.Now;
|
||||||
|
group.UserGroups = [];
|
||||||
|
|
||||||
|
await groupsRepository.AddAsync(group, ct);
|
||||||
|
|
||||||
|
UserGroup userGroup;
|
||||||
|
foreach (CreateUserGroupDto user in req.UserGroups!)
|
||||||
|
{
|
||||||
|
User? userChecking = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(user.UserId), ct);
|
||||||
|
if (userChecking is null) continue;
|
||||||
|
userGroup = new UserGroup
|
||||||
|
{
|
||||||
|
UserId = user.UserId,
|
||||||
|
GroupId = group.Id,
|
||||||
|
Grade = "Member"
|
||||||
|
};
|
||||||
|
group.UserGroups?.Add(userGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
userGroup = new UserGroup
|
||||||
|
{
|
||||||
|
UserId = userId,
|
||||||
|
GroupId = group.Id,
|
||||||
|
Grade = "Admin"
|
||||||
|
};
|
||||||
|
group.UserGroups?.Add(userGroup);
|
||||||
|
|
||||||
|
await userGroupsRepository.AddRangeAsync(group.UserGroups!, ct);
|
||||||
|
await Send.OkAsync(await groupsRepository.ProjectToSingleAsync<GetGroupDto>(new GetGroupByIdSpec(group.Id), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
using Group = BeReadyBackend.Models.Group;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class GroupDeletedRequest
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteGroupEndpoint(GroupsRepository groupsRepository, UserGroupsRepository userGroupsRepository, UserService userService) : Endpoint<GroupDeletedRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Delete("/Groups/{@Id}", x => new { x.Id });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(GroupDeletedRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
Group? group = await groupsRepository.SingleOrDefaultAsync(new GetGroupByIdSpec(req.Id), ct);
|
||||||
|
|
||||||
|
if (group is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isAdmin = group.UserGroups?.Any(x => x.UserId == userId && x.Grade == "Admin") ?? false;
|
||||||
|
|
||||||
|
if (!isAdmin)
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Vous n'avez pas les droits pour supprimer ce groupe", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (group.UserGroups?.Count > 0)
|
||||||
|
await userGroupsRepository.DeleteRangeAsync(group.UserGroups, ct);
|
||||||
|
|
||||||
|
await groupsRepository.DeleteAsync(group, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using FastEndpoints;
|
||||||
|
using Group = BeReadyBackend.Models.Group;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class DeleteUserFromGroupRequest
|
||||||
|
{
|
||||||
|
public int GroupId { get; set; }
|
||||||
|
public int UserId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteUserFromGroupEndpoint(UserGroupsRepository userGroupsRepository, UserService userService) : Endpoint<DeleteUserFromGroupRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Delete("/Groups/{@GroupId}/Users/{@UserId}", x => new { x.GroupId, x.UserId });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(DeleteUserFromGroupRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
UserGroup? member = await userGroupsRepository.SingleOrDefaultAsync(new GetUserInGroupByIdsSpec(req.GroupId, req.UserId), ct);
|
||||||
|
UserGroup? user = await userGroupsRepository.SingleOrDefaultAsync(new GetUserInGroupByIdsSpec(req.GroupId, userId), ct);
|
||||||
|
|
||||||
|
if (member is null || user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.Grade != "Admin" || member.Grade == "Admin")
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Vous n'avez pas les droits pour supprimer ce membre du groupe", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await userGroupsRepository.DeleteAsync(member, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using BeReadyBackend.DTO.Groups;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class UserGroupRequest
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetAllGroupUsersEndpoint(UserGroupsRepository userGroupsRepository, UserService userService) : Endpoint<UserGroupRequest, List<GetUserGroupDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Groups/{@Id}/Users/", x => new { x.Id });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(UserGroupRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
List<GetUserGroupDto> usersGroup = await userGroupsRepository.ProjectToListAsync<GetUserGroupDto>(new GetUserGroupByIdSpec(req.Id, userId), ct);
|
||||||
|
await Send.OkAsync(usersGroup, ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using BeReadyBackend.DTO.Groups;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class GetAllGroupsEndpoint(UserGroupsRepository userGroupsRepository, UserService userService) : EndpointWithoutRequest<List<GetGroupDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Groups/Users/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
List<GetGroupDto> groups = await userGroupsRepository.ProjectToListAsync<GetGroupDto>(new GetGroupsByUserIdSpec(userId), ct);
|
||||||
|
await Send.OkAsync(groups, ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using BeReadyBackend.DTO.Groups;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class GroupRequest
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetGroupDetailsEndpoint(GroupsRepository groupsRepository) : Endpoint<GroupRequest, GetGroupDetailsDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Groups/{@Id}/", x => new { x.Id });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(GroupRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
await Send.OkAsync(await groupsRepository.ProjectToSingleAsync<GetGroupDetailsDto>(new GetGroupByIdSpec(req.Id), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using FastEndpoints;
|
||||||
|
using Group = FastEndpoints.Group;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class GroupLeavedRequest
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LeaveGroupEndpoint(UserService userService, GroupsRepository groupsRepository, UserGroupsRepository userGroupsRepository) : Endpoint<GroupLeavedRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Delete("/Groups/{@Id}/User", x => new { x.Id });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(GroupLeavedRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
Models.Group? group = await groupsRepository.SingleOrDefaultAsync(new GetGroupByIdSpec(req.Id), ct);
|
||||||
|
UserGroup? user = await userGroupsRepository.SingleOrDefaultAsync(new GetUserInGroupByIdsSpec(req.Id, userId), ct);
|
||||||
|
|
||||||
|
if (group is null || user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await userGroupsRepository.DeleteAsync(user, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using BeReadyBackend.DTO.Groups;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Groups;
|
||||||
|
|
||||||
|
public class UserRoleRequest
|
||||||
|
{
|
||||||
|
public int GroupId { get; set; }
|
||||||
|
public int UserId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PatchGroupUserRoleEndpoint(UserGroupsRepository userGroupsRepository, UserService userService, GroupsRepository groupsRepository)
|
||||||
|
: Endpoint<UserRoleRequest, GetGroupDetailsDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Patch("/Groups/{@GroupId}/Users/{@UserId}/Role/", x => new { x.GroupId, x.UserId });
|
||||||
|
Description(x => x.Accepts<UserRoleRequest>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(UserRoleRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
UserGroup? member = await userGroupsRepository.SingleOrDefaultAsync(new GetUserInGroupByIdsSpec(req.GroupId, req.UserId), ct);
|
||||||
|
UserGroup? user = await userGroupsRepository.SingleOrDefaultAsync(new GetUserInGroupByIdsSpec(req.GroupId, userId), ct);
|
||||||
|
|
||||||
|
if (member is null || user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.Grade != "Admin")
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Vous n'avez pas les droits pour changer le rôle de ce membre", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
member.Grade = "Admin";
|
||||||
|
await userGroupsRepository.SaveChangesAsync(ct);
|
||||||
|
await Send.OkAsync(await groupsRepository.ProjectToSingleAsync<GetGroupDetailsDto>(new GetGroupByIdSpec(req.GroupId), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using BeReadyBackend.DTO.Messages;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Specifications.Messages;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Messages;
|
||||||
|
|
||||||
|
public class GetMessagesRequest
|
||||||
|
{
|
||||||
|
public int GroupId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetMessagesEndpoint(MessagesRepository messagesRepository) : Endpoint<GetMessagesRequest, List<GetMessageDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Messages/Groups/{@GroupId}/", x => new { x.GroupId });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(GetMessagesRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
List<GetMessageDto> messages = await messagesRepository.ProjectToListAsync<GetMessageDto>(new GetMessageByGroupIdSpec(req.GroupId), ct);
|
||||||
|
await Send.OkAsync(messages, ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
using BeReadyBackend.DTO.Messages;
|
||||||
|
using BeReadyBackend.Hubs;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Groups;
|
||||||
|
using BeReadyBackend.Specifications.Messages;
|
||||||
|
using FastEndpoints;
|
||||||
|
using Microsoft.AspNetCore.SignalR;
|
||||||
|
using Group = System.Text.RegularExpressions.Group;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Messages;
|
||||||
|
|
||||||
|
public class SendMessageEndpoint(
|
||||||
|
UserService userService,
|
||||||
|
GroupsRepository groupsRepository,
|
||||||
|
AutoMapper.IMapper mapper,
|
||||||
|
MessagesRepository messagesRepository,
|
||||||
|
IHubContext<GroupHub> hubContext)
|
||||||
|
: Endpoint<CreateMessageDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Post("/Messages/Groups/{@GroupId}/", x => new { x.GroupId });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CreateMessageDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
Models.Group? group = await groupsRepository.SingleOrDefaultAsync(new GetGroupByIdSpec(req.GroupId), ct);
|
||||||
|
if (group is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Message message = new();
|
||||||
|
mapper.Map(req, message);
|
||||||
|
message.SendDate = DateTime.Now;
|
||||||
|
message.UserId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
await messagesRepository.AddAsync(message, ct);
|
||||||
|
GetMessageDto messageDto = await messagesRepository.ProjectToSingleAsync<GetMessageDto>(new GetMessageByIdSpec(message.Id), ct);
|
||||||
|
await hubContext.Clients.Group($"group-{req.GroupId}").SendAsync("ReceiveMessage", messageDto, cancellationToken: ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using BeReadyBackend.DTO.Posts;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Posts;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Posts;
|
||||||
|
|
||||||
|
public class GetAllPostsEndpoint(PostsRepository postsRepository, UserService userService) : EndpointWithoutRequest<List<GetPostDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Posts/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
List<Post> posts = await postsRepository.ListAsync(new GetPostNotMeSpec(userId), ct);
|
||||||
|
|
||||||
|
List<GetPostDto> result = posts.Select(x => new GetPostDto
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
Libelle = x.Libelle,
|
||||||
|
CreationDate = x.CreationDate,
|
||||||
|
Likes = x.Likes,
|
||||||
|
Proof = x.User?.UserRandomChallenges?
|
||||||
|
.SingleOrDefault(u =>
|
||||||
|
u.RandomChallenge?.GeneratedAt is not null
|
||||||
|
&& DateOnly.FromDateTime(u.RandomChallenge.GeneratedAt.Value) == DateOnly.FromDateTime(x.CreationDate))
|
||||||
|
?.Proof,
|
||||||
|
UserId = x.UserId,
|
||||||
|
Username = x.User?.Username,
|
||||||
|
IsLiked = x.UserPosts?.Count(y => y.UserId == userId) > 0
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
await Send.OkAsync(result, ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Posts;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Posts;
|
||||||
|
|
||||||
|
public class PatchLikeRequest
|
||||||
|
{
|
||||||
|
public int PostId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PatchLikeEndpoint(UserPostsRepository userPostsRepository, UsersRepository usersRepository, UserService userService, PostsRepository postsRepository)
|
||||||
|
: Endpoint<PatchLikeRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Patch("/Posts/{@PostId}/Like", x => new { x.PostId });
|
||||||
|
Description(x => x.Accepts<PatchLikeRequest>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(PatchLikeRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
Post? post = await postsRepository.SingleOrDefaultAsync(new GetPostByIdSpec(req.PostId), ct);
|
||||||
|
if (post is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct);
|
||||||
|
if (user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserPost? userPost = await userPostsRepository.SingleOrDefaultAsync(new GetUserPostByIdsSpec(userId, req.PostId), ct);
|
||||||
|
if (userPost is not null)
|
||||||
|
{
|
||||||
|
post.Likes = Math.Max(0, post.Likes - 1);
|
||||||
|
post.User!.TotalLikes = Math.Max(0, post.User.TotalLikes - 1);
|
||||||
|
|
||||||
|
await userPostsRepository.DeleteAsync(userPost, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
post.Likes++;
|
||||||
|
post.User!.TotalLikes++;
|
||||||
|
|
||||||
|
UserPost liked = new()
|
||||||
|
{
|
||||||
|
UserId = userId,
|
||||||
|
PostId = req.PostId
|
||||||
|
};
|
||||||
|
|
||||||
|
await userPostsRepository.AddAsync(liked, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
using BeReadyBackend.DTO.RandomChallenges;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Specifications.RandomChallenges;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.RandomChallenges;
|
||||||
|
|
||||||
|
public class GenerateRandomChallengeEndpoint(
|
||||||
|
RandomChallengesRepository randomChallengesRepository,
|
||||||
|
UserRandomChallengesRepository userRandomChallengesRepository,
|
||||||
|
UsersRepository usersRepository)
|
||||||
|
: EndpointWithoutRequest<GetRandomChallengeDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Post("/RandomChallenges/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
RandomChallenge? randomChallenge = await randomChallengesRepository.SingleOrDefaultAsync(new GetRandomChallengeByDateSpec(), ct);
|
||||||
|
|
||||||
|
if (randomChallenge is null)
|
||||||
|
{
|
||||||
|
randomChallenge = await randomChallengesRepository.FirstOrDefaultAsync(new GetRandomChallengesNotAlreadyPastSpec(), ct);
|
||||||
|
if (randomChallenge is null)
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Il n'y a plus de défis en stock", 500, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<User> userList = await usersRepository.ListAsync(new GetAllUsersSpec(), ct);
|
||||||
|
|
||||||
|
List<UserRandomChallenge> userRandomChallenges = userList.Select(user => new UserRandomChallenge
|
||||||
|
{
|
||||||
|
UserId = user.Id,
|
||||||
|
RandomChallengeId = randomChallenge.Id
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
await userRandomChallengesRepository.AddRangeAsync(userRandomChallenges, ct);
|
||||||
|
|
||||||
|
randomChallenge.IsAlreadyPast = true;
|
||||||
|
randomChallenge.GeneratedAt = DateTime.Now;
|
||||||
|
await randomChallengesRepository.SaveChangesAsync(ct);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Send.OkAsync(await randomChallengesRepository.ProjectToSingleAsync<GetRandomChallengeDto>(new GetRandomChallengeByIdSpec(randomChallenge.Id), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using BeReadyBackend.DTO.RandomChallenges;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.RandomChallenges;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.RandomChallenges;
|
||||||
|
|
||||||
|
public class GetRandomChallengeRequest
|
||||||
|
{
|
||||||
|
public int RandomChallengeId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetRandomChallengeEndpoint(
|
||||||
|
RandomChallengesRepository randomChallengesRepository,
|
||||||
|
UserRandomChallengesRepository userRandomChallengesRepository,
|
||||||
|
UserService usersService)
|
||||||
|
: Endpoint<GetRandomChallengeRequest, GetRandomChallengeDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/RandomChallenges/{@RandomChallengeId}", x => new { x.RandomChallengeId });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(GetRandomChallengeRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = usersService.GetUserIdFromToken();
|
||||||
|
UserRandomChallenge? randomChallenge = await userRandomChallengesRepository.SingleOrDefaultAsync(new GetRandomChallengeByCriteriaSpec(req.RandomChallengeId, userId), ct);
|
||||||
|
|
||||||
|
if (randomChallenge is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Send.OkAsync(await randomChallengesRepository.ProjectToSingleAsync<GetRandomChallengeDto>(new GetRandomChallengeByIdSpec(req.RandomChallengeId), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.RandomChallenges;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.RandomChallenges;
|
||||||
|
|
||||||
|
public class RandomChallengeProofRequest
|
||||||
|
{
|
||||||
|
public int RandomChallengeId { get; set; }
|
||||||
|
public IFormFile? Proof { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PatchProofEndpoint(
|
||||||
|
UsersRepository usersRepository,
|
||||||
|
UserRandomChallengesRepository userRandomChallengesRepository,
|
||||||
|
UserService userService,
|
||||||
|
RandomChallengesRepository randomChallengesRepository,
|
||||||
|
PostsRepository postsRepository) : Endpoint<RandomChallengeProofRequest>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Patch("/RandomChallenges/{@RandomChallengeId}/Proof", x => new { x.RandomChallengeId });
|
||||||
|
AllowFormData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(RandomChallengeProofRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
RandomChallenge? randomChallenge = await randomChallengesRepository.SingleOrDefaultAsync(new GetRandomChallengeByIdSpec(req.RandomChallengeId), ct);
|
||||||
|
if (randomChallenge is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (randomChallenge.GeneratedAt != null && DateOnly.FromDateTime(DateTime.Now) > DateOnly.FromDateTime(randomChallenge.GeneratedAt.Value))
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Le défi est terminé", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserRandomChallenge? userRandomChallenge =
|
||||||
|
await userRandomChallengesRepository.SingleOrDefaultAsync(new GetRandomChallengeByCriteriaSpec(req.RandomChallengeId, userId), ct);
|
||||||
|
if (userRandomChallenge is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userRandomChallenge.Proof is not null)
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Vous avez déjà déposé une preuve", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct);
|
||||||
|
if (user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (req.Proof == null || req.Proof.Length == 0)
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Photo non fournie", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Encodage en base64
|
||||||
|
using MemoryStream memoryStream = new();
|
||||||
|
await req.Proof.CopyToAsync(memoryStream, ct);
|
||||||
|
byte[] proofBytes = memoryStream.ToArray();
|
||||||
|
|
||||||
|
userRandomChallenge.Proof = Convert.ToBase64String(proofBytes);
|
||||||
|
|
||||||
|
user.TotalChallenge++;
|
||||||
|
|
||||||
|
UserRandomChallenge? lastChallenge = await userRandomChallengesRepository.SingleOrDefaultAsync(new GetLastRandomChallengeSpec(userId), ct);
|
||||||
|
|
||||||
|
if (lastChallenge is not null || user.Series == 0) user.Series++;
|
||||||
|
else user.Series = 1;
|
||||||
|
|
||||||
|
await usersRepository.SaveChangesAsync(ct);
|
||||||
|
await userRandomChallengesRepository.SaveChangesAsync(ct);
|
||||||
|
|
||||||
|
Post post = new()
|
||||||
|
{
|
||||||
|
CreationDate = DateTime.Now,
|
||||||
|
Libelle = randomChallenge.Label,
|
||||||
|
UserId = userId,
|
||||||
|
RandomChallengeId = req.RandomChallengeId,
|
||||||
|
};
|
||||||
|
|
||||||
|
await postsRepository.AddAsync(post, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Specifications.RandomChallenges;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
using PasswordGenerator;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class CreateUserEndpoint(
|
||||||
|
UsersRepository usersRepository,
|
||||||
|
RandomChallengesRepository randomChallengesRepository,
|
||||||
|
UserRandomChallengesRepository userRandomChallengesRepository,
|
||||||
|
AutoMapper.IMapper mapper) : Endpoint<CreateUserDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Post("/Users/");
|
||||||
|
AllowAnonymous();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CreateUserDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
User? user = await usersRepository.FirstOrDefaultAsync(new GetUserByCriteriaSpec(req.Username!, req.Email!, null), ct);
|
||||||
|
|
||||||
|
if (user is not null)
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Un utilisateur possède déjà ce pseudo ou cette email", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string salt = new Password().IncludeLowercase().IncludeUppercase().IncludeNumeric().LengthRequired(24).Next();
|
||||||
|
|
||||||
|
user = mapper.Map<User>(req);
|
||||||
|
|
||||||
|
user.Salt = salt;
|
||||||
|
user.Password = BCrypt.Net.BCrypt.HashPassword(req.Password + salt);
|
||||||
|
|
||||||
|
await usersRepository.AddAsync(user, ct);
|
||||||
|
|
||||||
|
RandomChallenge? randomChallenge = await randomChallengesRepository.SingleOrDefaultAsync(new GetRandomChallengeByDateSpec(), ct);
|
||||||
|
if (randomChallenge is not null)
|
||||||
|
{
|
||||||
|
UserRandomChallenge userRandomChallenge = new()
|
||||||
|
{
|
||||||
|
UserId = user.Id,
|
||||||
|
RandomChallengeId = randomChallenge.Id
|
||||||
|
};
|
||||||
|
await userRandomChallengesRepository.AddAsync(userRandomChallenge, ct);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Friends;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class DeleteUserEndpoint(UsersRepository usersRepository, UserFriendsRepository userFriendsRepository, UserService userService) : EndpointWithoutRequest
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Delete("/Users/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
List<UserFriend> friends = await userFriendsRepository.ListAsync(new GetAllFriendsRelationsByIdSpec(userId), ct);
|
||||||
|
await userFriendsRepository.DeleteRangeAsync(friends, ct);
|
||||||
|
|
||||||
|
await usersRepository.DeleteAsync((await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct))!, ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.RandomChallenges;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class GetAllUserChallengesEndpoint(UserRandomChallengesRepository userRandomChallengesRepository, UserService userService, AutoMapper.IMapper mapper)
|
||||||
|
: EndpointWithoutRequest<List<GetUserChallengeDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Users/Challenges/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
List<UserRandomChallenge>? userRandomChallenge = await userRandomChallengesRepository.ListAsync(new GetUserRandomChallengeByIdSpec(userId), ct);
|
||||||
|
|
||||||
|
List<GetUserChallengeDto> challenges = userRandomChallenge
|
||||||
|
.Select(x => mapper.Map<GetUserChallengeDto>(x.RandomChallenge))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
await Send.OkAsync(challenges.OrderByDescending(x => x.ChallengeStartDate).ToList(), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class GetAllUserProofsEndpoint(UserRandomChallengesRepository userRandomChallengesRepository, UserService userService, AutoMapper.IMapper mapper)
|
||||||
|
: EndpointWithoutRequest<List<GetUserProofDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Users/Proofs/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
List<UserRandomChallenge> userProofs = await userRandomChallengesRepository.ListAsync(new GetUserProofByUserIdSpec(userId), ct);
|
||||||
|
|
||||||
|
List<GetUserProofDto> proofs = userProofs
|
||||||
|
.Select(mapper.Map<GetUserProofDto>)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
await Send.OkAsync(proofs, ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class GetAllUsersEndpoint(UsersRepository usersRepository, UserService userService) : EndpointWithoutRequest<List<GetUserDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Users/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
await Send.OkAsync(await usersRepository.ProjectToListAsync<GetUserDto>(new GetUserNotMeSpec(userId), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class GetOverallRankingEndpoint(UsersRepository usersRepository) : EndpointWithoutRequest<List<GetUserDto>>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/OverallRanking/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
await Send.OkAsync(await usersRepository.ProjectToListAsync<GetUserDto>(new GetUsersByScoreSpec(), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class GetUserDetailsEndpoint(UsersRepository usersRepository, UserService userService, AutoMapper.IMapper mapper, AchievementService achievementService)
|
||||||
|
: EndpointWithoutRequest<GetUserDetailsDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Users/Details");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct);
|
||||||
|
await achievementService.CheckAchievement(userId);
|
||||||
|
|
||||||
|
await Send.OkAsync(mapper.Map<GetUserDetailsDto>(user), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class UserRequest
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetUserEndpoint(UsersRepository usersRepository, UserService userService, AutoMapper.IMapper mapper) : Endpoint<UserRequest, GetUserDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Get("/Users/{@Id}/", x => new { x.Id });
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(UserRequest req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(req.Id), ct);
|
||||||
|
|
||||||
|
if (user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Send.OkAsync(mapper.Map<GetUserDto>(user), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class PatchUserDesignationEndpoint(UsersRepository usersRepository, UserService userService, AutoMapper.IMapper mapper) : Endpoint<PatchUserDesignationDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Patch("/Users/Designation");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(PatchUserDesignationDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct);
|
||||||
|
|
||||||
|
if (user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mapper.Map(req, user);
|
||||||
|
|
||||||
|
await usersRepository.SaveChangesAsync(ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
using PasswordGenerator;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class PatchUserPasswordEndpoint(UsersRepository usersRepository, UserService userService) : Endpoint<PatchUserPasswordDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Patch("/Users/Password");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(PatchUserPasswordDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct);
|
||||||
|
|
||||||
|
if (user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string salt = new Password().IncludeLowercase().IncludeUppercase().IncludeNumeric().LengthRequired(24).Next();
|
||||||
|
user.Salt = salt;
|
||||||
|
user.Password = BCrypt.Net.BCrypt.HashPassword(req.Password + salt);
|
||||||
|
|
||||||
|
await usersRepository.SaveChangesAsync(ct);
|
||||||
|
await Send.NoContentAsync(ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
using BeReadyBackend.Repositories;
|
||||||
|
using BeReadyBackend.Services;
|
||||||
|
using BeReadyBackend.Specifications.Users;
|
||||||
|
using FastEndpoints;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Endpoints.Users;
|
||||||
|
|
||||||
|
public class UpdateUserEndpoint(UsersRepository usersRepository, UserService userService, AutoMapper.IMapper mapper) : Endpoint<UpdateUserDto>
|
||||||
|
{
|
||||||
|
public override void Configure()
|
||||||
|
{
|
||||||
|
Put("/Users/");
|
||||||
|
AllowAnonymous();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task HandleAsync(UpdateUserDto req, CancellationToken ct)
|
||||||
|
{
|
||||||
|
int userId = userService.GetUserIdFromToken();
|
||||||
|
|
||||||
|
User? user = await usersRepository.FirstOrDefaultAsync(new GetUserByCriteriaSpec(req.Username!, req.Email!, userId), ct);
|
||||||
|
|
||||||
|
if (user is not null)
|
||||||
|
{
|
||||||
|
await Send.StringAsync("Un utilisateur possède déjà ce pseudo ou cette email", 400, cancellation: ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct);
|
||||||
|
|
||||||
|
if (user is null)
|
||||||
|
{
|
||||||
|
await Send.NotFoundAsync(ct);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mapper.Map(req, user);
|
||||||
|
|
||||||
|
await usersRepository.SaveChangesAsync(ct);
|
||||||
|
await Send.OkAsync(await usersRepository.ProjectToSingleAsync<GetUserDetailsDto>(new GetUserByIdSpec(userId), ct), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using BeReadyBackend.DTO.Messages;
|
||||||
|
using Microsoft.AspNetCore.SignalR;
|
||||||
|
using Microsoft.Extensions.Primitives;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Hubs;
|
||||||
|
|
||||||
|
public class GroupHub : Hub
|
||||||
|
{
|
||||||
|
public async Task SendMessageToGroup(int groupId, CreateMessageDto message)
|
||||||
|
{
|
||||||
|
await Clients.Group($"group-{groupId}").SendAsync("ReceiveMessage", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task OnConnectedAsync()
|
||||||
|
{
|
||||||
|
HttpContext? httpContext = Context.GetHttpContext();
|
||||||
|
if (httpContext!.Request.Query.TryGetValue("groupId", out StringValues groupId))
|
||||||
|
{
|
||||||
|
await Groups.AddToGroupAsync(Context.ConnectionId, $"group-{groupId}");
|
||||||
|
}
|
||||||
|
|
||||||
|
await base.OnConnectedAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using BeReadyBackend.DTO.Achievements;
|
||||||
|
using BeReadyBackend.DTO.Friends;
|
||||||
|
using BeReadyBackend.DTO.Groups;
|
||||||
|
using BeReadyBackend.DTO.Messages;
|
||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.MappingProfiles;
|
||||||
|
|
||||||
|
public class DtoToEntityMappings : Profile
|
||||||
|
{
|
||||||
|
public DtoToEntityMappings()
|
||||||
|
{
|
||||||
|
CreateMap<UnlockAchievementDto, UserAchievement>();
|
||||||
|
|
||||||
|
CreateMap<CreateUserDto, User>();
|
||||||
|
CreateMap<UpdateUserDto, User>();
|
||||||
|
CreateMap<PatchUserDesignationDto, User>();
|
||||||
|
|
||||||
|
CreateMap<SendFriendDto, UserFriend>();
|
||||||
|
|
||||||
|
CreateMap<CreateGroupDto, Group>()
|
||||||
|
.ForMember(dest => dest.UserGroups, opt => opt.Ignore());
|
||||||
|
|
||||||
|
CreateMap<CreateMessageDto, Message>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using BeReadyBackend.DTO.Achievements;
|
||||||
|
using BeReadyBackend.DTO.Designations;
|
||||||
|
using BeReadyBackend.DTO.Friends;
|
||||||
|
using BeReadyBackend.DTO.Groups;
|
||||||
|
using BeReadyBackend.DTO.Messages;
|
||||||
|
using BeReadyBackend.DTO.RandomChallenges;
|
||||||
|
using BeReadyBackend.DTO.Users;
|
||||||
|
using BeReadyBackend.Models;
|
||||||
|
|
||||||
|
namespace BeReadyBackend.MappingProfiles;
|
||||||
|
|
||||||
|
public class EntityToDtoMappings : Profile
|
||||||
|
{
|
||||||
|
public EntityToDtoMappings()
|
||||||
|
{
|
||||||
|
CreateMap<Achievement, GetAchievementDto>();
|
||||||
|
|
||||||
|
CreateMap<UserAchievement, GetAchievementDto>()
|
||||||
|
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Achievement!.Id))
|
||||||
|
.ForMember(dest => dest.Label, opt => opt.MapFrom(src => src.Achievement!.Label))
|
||||||
|
.ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Achievement!.Description));
|
||||||
|
|
||||||
|
CreateMap<User, GetUserDto>()
|
||||||
|
.ForMember(dest => dest.GetUserStatsDto, opt => opt.MapFrom(src => src))
|
||||||
|
.ForMember(dest => dest.DesignationName, opt => opt.MapFrom(src => src.Designation!.Label));
|
||||||
|
|
||||||
|
CreateMap<User, GetUserDetailsDto>()
|
||||||
|
.ForMember(dest => dest.DesignationName, opt => opt.MapFrom(src => src.Designation!.Label))
|
||||||
|
.ForMember(dest => dest.GetUserStatsDto, opt => opt.MapFrom(src => src));
|
||||||
|
|
||||||
|
CreateMap<User, GetUserStatsDto>();
|
||||||
|
|
||||||
|
CreateMap<UserRandomChallenge, GetUserProofDto>();
|
||||||
|
|
||||||
|
CreateMap<RandomChallenge, GetUserChallengeDto>()
|
||||||
|
.ForMember(dest => dest.ChallengeTitle, opt => opt.MapFrom(src => src.Label))
|
||||||
|
.ForMember(dest => dest.ChallengeDescription, opt => opt.MapFrom(src => src.Libelle))
|
||||||
|
.ForMember(dest => dest.ChallengeStartDate, opt => opt.MapFrom(src => DateOnly.FromDateTime(src.GeneratedAt!.Value)));
|
||||||
|
|
||||||
|
CreateMap<UserFriend, GetFriendDto>()
|
||||||
|
.ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.Friend!.Username))
|
||||||
|
.ForMember(dest => dest.Score, opt => opt.MapFrom(src => src.Friend!.TotalLikes));
|
||||||
|
|
||||||
|
CreateMap<UserFriend, GetFriendRequestDto>()
|
||||||
|
.ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username))
|
||||||
|
.ForMember(dest => dest.Score, opt => opt.MapFrom(src => src.User!.TotalLikes));
|
||||||
|
|
||||||
|
CreateMap<UserGroup, GetUserGroupDto>()
|
||||||
|
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.UserId))
|
||||||
|
.ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username));
|
||||||
|
|
||||||
|
CreateMap<UserGroup, GetGroupDto>()
|
||||||
|
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.GroupId))
|
||||||
|
.ForMember(dest => dest.Label, opt => opt.MapFrom(src => src.Group!.Label));
|
||||||
|
|
||||||
|
CreateMap<Group, GetGroupDetailsDto>()
|
||||||
|
.ForMember(dest => dest.Users, opt => opt.MapFrom(src => src.UserGroups))
|
||||||
|
.ForMember(dest => dest.Messages, opt => opt.MapFrom(src => src.Messages));
|
||||||
|
|
||||||
|
CreateMap<Group, GetGroupDto>();
|
||||||
|
|
||||||
|
CreateMap<Message, GetMessageDto>()
|
||||||
|
.ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username));
|
||||||
|
|
||||||
|
CreateMap<RandomChallenge, GetRandomChallengeDto>();
|
||||||
|
|
||||||
|
CreateMap<Designation, GetDesignationDto>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,473 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260220174541_InitialDatabase")]
|
||||||
|
partial class InitialDatabase
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<int>("StatusId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("StatusId");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Status", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Status", "Status")
|
||||||
|
.WithMany("Groups")
|
||||||
|
.HasForeignKey("StatusId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Status", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,332 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class InitialDatabase : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Achievements",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Label = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Achievements", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Designations",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Label = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Designations", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "RandomChallenges",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Libelle = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Duration = table.Column<int>(type: "int", nullable: false),
|
||||||
|
IsAlreadyPast = table.Column<bool>(type: "bit", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_RandomChallenges", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Status",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Label = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Status", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Users",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
FirstName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||||
|
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||||
|
Username = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||||
|
Email = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||||
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
Password = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: false),
|
||||||
|
Salt = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Score = table.Column<int>(type: "int", nullable: false),
|
||||||
|
TotalWin = table.Column<int>(type: "int", nullable: false),
|
||||||
|
TotalChallenge = table.Column<int>(type: "int", nullable: false),
|
||||||
|
TotalPodium = table.Column<int>(type: "int", nullable: false),
|
||||||
|
TotalBonusChallenge = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Series = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DesignationId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Users", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Users_Designations_DesignationId",
|
||||||
|
column: x => x.DesignationId,
|
||||||
|
principalTable: "Designations",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Groups",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Label = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||||
|
StatusId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Duration = table.Column<int>(type: "int", nullable: false),
|
||||||
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Groups", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Groups_Status_StatusId",
|
||||||
|
column: x => x.StatusId,
|
||||||
|
principalTable: "Status",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UserAchievements",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
UserId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
AchievementId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
IsActive = table.Column<bool>(type: "bit", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UserAchievements", x => new { x.UserId, x.AchievementId });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserAchievements_Achievements_AchievementId",
|
||||||
|
column: x => x.AchievementId,
|
||||||
|
principalTable: "Achievements",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserAchievements_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UserFriends",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
UserId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
FriendId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UserFriends", x => new { x.UserId, x.FriendId });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserFriends_Users_FriendId",
|
||||||
|
column: x => x.FriendId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserFriends_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UserRandomChallenges",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
UserId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
RandomChallengeId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Proof = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UserRandomChallenges", x => new { x.UserId, x.RandomChallengeId });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserRandomChallenges_RandomChallenges_RandomChallengeId",
|
||||||
|
column: x => x.RandomChallengeId,
|
||||||
|
principalTable: "RandomChallenges",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserRandomChallenges_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Messages",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Libelle = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
SendDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
UserId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
GroupId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Messages", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Messages_Groups_GroupId",
|
||||||
|
column: x => x.GroupId,
|
||||||
|
principalTable: "Groups",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Messages_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UserGroups",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
UserId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
GroupId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Proof = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
|
Grade = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
VotedProofId = table.Column<int>(type: "int", nullable: true),
|
||||||
|
Score = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UserGroups", x => new { x.UserId, x.GroupId });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserGroups_Groups_GroupId",
|
||||||
|
column: x => x.GroupId,
|
||||||
|
principalTable: "Groups",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserGroups_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Groups_StatusId",
|
||||||
|
table: "Groups",
|
||||||
|
column: "StatusId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Messages_GroupId",
|
||||||
|
table: "Messages",
|
||||||
|
column: "GroupId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Messages_UserId",
|
||||||
|
table: "Messages",
|
||||||
|
column: "UserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_UserAchievements_AchievementId",
|
||||||
|
table: "UserAchievements",
|
||||||
|
column: "AchievementId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_UserFriends_FriendId",
|
||||||
|
table: "UserFriends",
|
||||||
|
column: "FriendId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_UserGroups_GroupId",
|
||||||
|
table: "UserGroups",
|
||||||
|
column: "GroupId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_UserRandomChallenges_RandomChallengeId",
|
||||||
|
table: "UserRandomChallenges",
|
||||||
|
column: "RandomChallengeId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Users_DesignationId",
|
||||||
|
table: "Users",
|
||||||
|
column: "DesignationId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Messages");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "UserAchievements");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "UserFriends");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "UserGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "UserRandomChallenges");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Achievements");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "RandomChallenges");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Status");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Designations");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+476
@@ -0,0 +1,476 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260221110514_AddedIsAcceptedInUserFriendsEntity")]
|
||||||
|
partial class AddedIsAcceptedInUserFriendsEntity
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<int>("StatusId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("StatusId");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Status", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Status", "Status")
|
||||||
|
.WithMany("Groups")
|
||||||
|
.HasForeignKey("StatusId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Status", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedIsAcceptedInUserFriendsEntity : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsAccepted",
|
||||||
|
table: "UserFriends",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsAccepted",
|
||||||
|
table: "UserFriends");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+480
@@ -0,0 +1,480 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260221125716_AddedDescriptionInAchievementsEntity")]
|
||||||
|
partial class AddedDescriptionInAchievementsEntity
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<int>("StatusId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("StatusId");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Status", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Status", "Status")
|
||||||
|
.WithMany("Groups")
|
||||||
|
.HasForeignKey("StatusId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Status", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedDescriptionInAchievementsEntity : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Description",
|
||||||
|
table: "Achievements",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Description",
|
||||||
|
table: "Achievements");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+445
@@ -0,0 +1,445 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260221131548_AddedIsFinishedInGroupAndDeletedStatus")]
|
||||||
|
partial class AddedIsFinishedInGroupAndDeletedStatus
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedIsFinishedInGroupAndDeletedStatus : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Groups_Status_StatusId",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Status");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Groups_StatusId",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "StatusId",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsFinished",
|
||||||
|
table: "Groups",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsFinished",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "StatusId",
|
||||||
|
table: "Groups",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Status",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Label = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Status", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Groups_StatusId",
|
||||||
|
table: "Groups",
|
||||||
|
column: "StatusId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Groups_Status_StatusId",
|
||||||
|
table: "Groups",
|
||||||
|
column: "StatusId",
|
||||||
|
principalTable: "Status",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+442
@@ -0,0 +1,442 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260221132926_DeletedIsActiveFieldInUserAchievementEntity")]
|
||||||
|
partial class DeletedIsActiveFieldInUserAchievementEntity
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class DeletedIsActiveFieldInUserAchievementEntity : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsActive",
|
||||||
|
table: "UserAchievements");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsActive",
|
||||||
|
table: "UserAchievements",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+440
@@ -0,0 +1,440 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260221161039_EditedDesignationFieldInUserEntity")]
|
||||||
|
partial class EditedDesignationFieldInUserEntity
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class EditedDesignationFieldInUserEntity : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Users_Designations_DesignationId",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "DesignationId",
|
||||||
|
table: "Users",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Users_Designations_DesignationId",
|
||||||
|
table: "Users",
|
||||||
|
column: "DesignationId",
|
||||||
|
principalTable: "Designations",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Users_Designations_DesignationId",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "DesignationId",
|
||||||
|
table: "Users",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Users_Designations_DesignationId",
|
||||||
|
table: "Users",
|
||||||
|
column: "DesignationId",
|
||||||
|
principalTable: "Designations",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+442
@@ -0,0 +1,442 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260222115003_AddedMissingFieldInGroupEntity")]
|
||||||
|
partial class AddedMissingFieldInGroupEntity
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedMissingFieldInGroupEntity : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,442 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260317081620_AddedRestrictionsOnDB")]
|
||||||
|
partial class AddedRestrictionsOnDB
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("GeneratedAt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedRestrictionsOnDB : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Username",
|
||||||
|
table: "Users",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(50)",
|
||||||
|
oldMaxLength: 50);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Users",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(50)",
|
||||||
|
oldMaxLength: 50);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "FirstName",
|
||||||
|
table: "Users",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(50)",
|
||||||
|
oldMaxLength: 50);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "GeneratedAt",
|
||||||
|
table: "RandomChallenges",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Label",
|
||||||
|
table: "Groups",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(100)",
|
||||||
|
oldMaxLength: 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "GeneratedAt",
|
||||||
|
table: "RandomChallenges");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Username",
|
||||||
|
table: "Users",
|
||||||
|
type: "nvarchar(50)",
|
||||||
|
maxLength: 50,
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Users",
|
||||||
|
type: "nvarchar(50)",
|
||||||
|
maxLength: 50,
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "FirstName",
|
||||||
|
table: "Users",
|
||||||
|
type: "nvarchar(50)",
|
||||||
|
maxLength: 50,
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Label",
|
||||||
|
table: "Groups",
|
||||||
|
type: "nvarchar(100)",
|
||||||
|
maxLength: 100,
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+448
@@ -0,0 +1,448 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260323141022_AddedMissingFieldsOnGroup")]
|
||||||
|
partial class AddedMissingFieldsOnGroup
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedVote")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int?>("VoteDuration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("GeneratedAt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedMissingFieldsOnGroup : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "StartedVote",
|
||||||
|
table: "Groups",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "VoteDuration",
|
||||||
|
table: "Groups",
|
||||||
|
type: "int",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "StartedVote",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "VoteDuration",
|
||||||
|
table: "Groups");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,448 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260323143122_FixedErrorInGroup")]
|
||||||
|
partial class FixedErrorInGroup
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedVote")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("VoteDuration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("GeneratedAt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class FixedErrorInGroup : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "VoteDuration",
|
||||||
|
table: "Groups",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "VoteDuration",
|
||||||
|
table: "Groups",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+447
@@ -0,0 +1,447 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260329184454_FixedErrorWithGeneratedAtField")]
|
||||||
|
partial class FixedErrorWithGeneratedAtField
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedVote")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("VoteDuration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("GeneratedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class FixedErrorWithGeneratedAtField : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "GeneratedAt",
|
||||||
|
table: "RandomChallenges",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime2");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "GeneratedAt",
|
||||||
|
table: "RandomChallenges",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime2",
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+451
@@ -0,0 +1,451 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260412140606_AddedTitleForRandomChallenge")]
|
||||||
|
partial class AddedTitleForRandomChallenge
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsFinished")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedVote")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("VoteDuration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Duration")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("GeneratedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalBonusChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalPodium")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalWin")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Score")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("VotedProofId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedTitleForRandomChallenge : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Label",
|
||||||
|
table: "RandomChallenges",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Label",
|
||||||
|
table: "RandomChallenges");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,450 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BeReadyBackend;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BeReadyDbContext))]
|
||||||
|
[Migration("20260421075849_AddedPostEntity")]
|
||||||
|
partial class AddedPostEntity
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.20")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Achievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Designations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Groups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("SendDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Messages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Posts", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Likes")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Posts");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime?>("GeneratedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAlreadyPast")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Libelle")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int?>("DesignationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Password")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(60)
|
||||||
|
.HasColumnType("nvarchar(60)");
|
||||||
|
|
||||||
|
b.Property<string>("Salt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Series")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalChallenge")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TotalLikes")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DesignationId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("AchievementId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "AchievementId");
|
||||||
|
|
||||||
|
b.HasIndex("AchievementId");
|
||||||
|
|
||||||
|
b.ToTable("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FriendId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAccepted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "FriendId");
|
||||||
|
|
||||||
|
b.HasIndex("FriendId");
|
||||||
|
|
||||||
|
b.ToTable("UserFriends");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("GroupId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Grade")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "GroupId");
|
||||||
|
|
||||||
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
|
b.ToTable("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RandomChallengeId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Proof")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RandomChallengeId");
|
||||||
|
|
||||||
|
b.HasIndex("RandomChallengeId");
|
||||||
|
|
||||||
|
b.ToTable("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Message", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Messages")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Posts", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("Posts")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Designation", "Designation")
|
||||||
|
.WithMany("Users")
|
||||||
|
.HasForeignKey("DesignationId");
|
||||||
|
|
||||||
|
b.Navigation("Designation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserAchievement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Achievement", "Achievement")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("AchievementId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserAchievements")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Achievement");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserFriend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "Friend")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("FriendId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserFriends")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Friend");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.Group", "Group")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("GroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserGroups")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.UserRandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BeReadyBackend.Models.RandomChallenge", "RandomChallenge")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("RandomChallengeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("BeReadyBackend.Models.User", "User")
|
||||||
|
.WithMany("UserRandomChallenges")
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("RandomChallenge");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Achievement", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Designation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Users");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.RandomChallenge", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BeReadyBackend.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Messages");
|
||||||
|
|
||||||
|
b.Navigation("Posts");
|
||||||
|
|
||||||
|
b.Navigation("UserAchievements");
|
||||||
|
|
||||||
|
b.Navigation("UserFriends");
|
||||||
|
|
||||||
|
b.Navigation("UserGroups");
|
||||||
|
|
||||||
|
b.Navigation("UserRandomChallenges");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,199 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BeReadyBackend.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddedPostEntity : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Score",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "TotalBonusChallenge",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "TotalPodium",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Proof",
|
||||||
|
table: "UserGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Score",
|
||||||
|
table: "UserGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "VotedProofId",
|
||||||
|
table: "UserGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Duration",
|
||||||
|
table: "RandomChallenges");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Description",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Duration",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsFinished",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "StartedVote",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Title",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "VoteDuration",
|
||||||
|
table: "Groups");
|
||||||
|
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "TotalWin",
|
||||||
|
table: "Users",
|
||||||
|
newName: "TotalLikes");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Posts",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Libelle = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
Likes = table.Column<int>(type: "int", nullable: false),
|
||||||
|
UserId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Posts", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Posts_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Posts_UserId",
|
||||||
|
table: "Posts",
|
||||||
|
column: "UserId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Posts");
|
||||||
|
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "TotalLikes",
|
||||||
|
table: "Users",
|
||||||
|
newName: "TotalWin");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Score",
|
||||||
|
table: "Users",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "TotalBonusChallenge",
|
||||||
|
table: "Users",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "TotalPodium",
|
||||||
|
table: "Users",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Proof",
|
||||||
|
table: "UserGroups",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Score",
|
||||||
|
table: "UserGroups",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "VotedProofId",
|
||||||
|
table: "UserGroups",
|
||||||
|
type: "int",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Duration",
|
||||||
|
table: "RandomChallenges",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Description",
|
||||||
|
table: "Groups",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Duration",
|
||||||
|
table: "Groups",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsFinished",
|
||||||
|
table: "Groups",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "StartedVote",
|
||||||
|
table: "Groups",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Title",
|
||||||
|
table: "Groups",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "VoteDuration",
|
||||||
|
table: "Groups",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user