diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d4c058..86cb2edd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Backend #### New features +* **(main)** : Suppression du fichier client-infos.json pour la version minimum requise. Remplacé par des variables d'environnement * **(cards)** : Suppression du microservice cards au profit de 2 microservices séparés **card** et **card-eu** * **(card)** : Nouveau microservice de gestion de la carte dématérialisée de l'établissement * **(card-eu)** : Nouveau microservice de gestion de la carte européenne étudiante diff --git a/dev/user-backend-nest/main/.env.dist b/dev/user-backend-nest/main/.env.dist index 0a86d5ff..ecc4f493 100644 --- a/dev/user-backend-nest/main/.env.dist +++ b/dev/user-backend-nest/main/.env.dist @@ -2,6 +2,10 @@ API_GATEWAY_SERVER_PORT=3000 API_GATEWAY_SERVER_HOST=127.0.0.1 API_GATEWAY_CORS_ORIGIN=http://localhost:8100,https://localhost,capacitor://localhost +APP_UPDATE_STORE_VERSION=1.0.0 +APP_UPDATE_MIN_VERSION_REQUIRED=1.0.0 +APP_UPDATE_PLAY_STORE_URL=https://play.google.com/store/apps/details?id=org.monUniversite.monApplication +APP_UPDATE_APP_STORE_URL=https://apps.apple.com/fr/app/monUniversite/idxxxxxxxxx AUTH_SERVICE_NATS_SERVERS=nats://localhost:4222 AUTH_SERVICE_JWT_SECRET= diff --git a/dev/user-backend-nest/main/.gitignore b/dev/user-backend-nest/main/.gitignore index 7cddbbee..472010b4 100644 --- a/dev/user-backend-nest/main/.gitignore +++ b/dev/user-backend-nest/main/.gitignore @@ -33,5 +33,3 @@ lerna-debug.log* !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json - -src/client-infos.json diff --git a/dev/user-backend-nest/main/src/app.controller.ts b/dev/user-backend-nest/main/src/app.controller.ts index a6d11a49..525a1ca0 100644 --- a/dev/user-backend-nest/main/src/app.controller.ts +++ b/dev/user-backend-nest/main/src/app.controller.ts @@ -56,14 +56,15 @@ import { ClientProxy } from '@nestjs/microservices'; import { AuthGuard } from '@nestjs/passport'; import { concatMap, map } from 'rxjs'; import * as infosJsonData from './infos.json'; -import * as clientInfosJson from './client-infos.json'; import { ErrorsInterceptor } from './interceptors/errors.interceptor'; import { AuthorizationHelper } from './security/authorization.helper'; +import { ConfigService } from '@nestjs/config'; @UseInterceptors(new ErrorsInterceptor()) @Controller() export class AppController { constructor( + private configService: ConfigService, @Inject('FEATURES_SERVICE') private featuresClient: ClientProxy, @Inject('AUTH_SERVICE') private authClient: ClientProxy, @Inject('MAP_SERVICE') private mapClient: ClientProxy, @@ -783,7 +784,14 @@ export class AppController { @Get('/app-update-infos') appUpdateInfos() { - return clientInfosJson; + return { + storeVersion: this.configService.get('APP_UPDATE_STORE_VERSION'), + minVersionRequired: this.configService.get( + 'APP_UPDATE_MIN_VERSION_REQUIRED', + ), + playStoreUrl: this.configService.get('APP_UPDATE_PLAY_STORE_URL'), + appStoreUrl: this.configService.get('APP_UPDATE_APP_STORE_URL'), + }; } @Get('/health') diff --git a/dev/user-backend-nest/main/src/client-infos.json.dist b/dev/user-backend-nest/main/src/client-infos.json.dist deleted file mode 100644 index e46e8f5e..00000000 --- a/dev/user-backend-nest/main/src/client-infos.json.dist +++ /dev/null @@ -1,6 +0,0 @@ -{ - "storeVersion": "1.1.0", - "minVersionRequired": "1.0.0", - "playStoreUrl": "https://play.google.com/store/apps/details?id=org.monUniversite.monApplication", - "appStoreUrl": "https://apps.apple.com/fr/app/monUniversite/idxxxxxxxxx" -}