Skip to content

Commit

Permalink
Merge pull request #100 from uatisdeproblem/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
uatisdeproblem authored Feb 11, 2024
2 parents 4297420 + 7df8163 commit ff6f620
Show file tree
Hide file tree
Showing 12 changed files with 3,103 additions and 3,623 deletions.
24 changes: 12 additions & 12 deletions back-end/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions back-end/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.3.0",
"version": "3.3.1",
"name": "back-end",
"scripts": {
"lint": "eslint --ext .ts",
Expand All @@ -14,7 +14,7 @@
"date-fns": "^2.30.0",
"idea-aws": "^4.2.1",
"idea-html2pdf": "^2.2.5",
"idea-toolbox": "^7.0.1",
"idea-toolbox": "^7.0.3",
"jsonwebtoken": "^9.0.2",
"xml2js": "^0.6.2"
},
Expand Down
11 changes: 8 additions & 3 deletions back-end/src/handlers/eventSpots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ class EventSpotsRC extends ResourceController {
throw new RCError('User not found');
}

if (!this.user.permissions.isAdmin && !this.user.permissions.isCountryLeader) throw new RCError('Unauthorized');
if (
!this.user.permissions.isAdmin &&
!this.user.permissions.canManageRegistrations &&
!this.user.permissions.isCountryLeader
)
throw new RCError('Unauthorized');

if (!this.resourceId) return;

Expand All @@ -66,7 +71,7 @@ class EventSpotsRC extends ResourceController {
throw new RCError('Spot not found');
}

if (!this.user.permissions.isAdmin && this.spot.sectionCountry !== this.user.sectionCountry)
if (!this.user.permissions.canManageRegistrations && this.spot.sectionCountry !== this.user.sectionCountry)
throw new RCError('Unauthorized');
}

Expand Down Expand Up @@ -208,7 +213,7 @@ class EventSpotsRC extends ResourceController {
}
}
private async confirmPayment(): Promise<void> {
if (!this.user.permissions.isAdmin) throw new RCError('Unauthorized');
if (!this.user.permissions.canManageRegistrations) throw new RCError('Unauthorized');

if (this.spot.paymentConfirmedAt) return;

Expand Down
8 changes: 1 addition & 7 deletions back-end/src/handlers/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,11 @@ class UsersRC extends ResourceController {
private async generateUserInvoice(): Promise<SignedURL> {
if (!this.reqUser.registrationAt || !this.reqUser.spot) return;

const filename = `${this.reqUser.spot.spotId}_invoice`;
const filename = `${this.reqUser.spot.spotId}_invoice.pdf`;

const bucket = S3_BUCKET_MEDIA;
const key = S3_DOWNLOADS_FOLDER + `/invoices/${filename}`;

const objectExists = await s3.doesObjectExist({
bucket,
key
});
if (objectExists) return await s3.signedURLGet(S3_BUCKET_MEDIA, key);

const htmlBody = (await s3.getObject({
bucket: S3_BUCKET_MEDIA,
key: S3_ASSETS_FOLDER.concat('/payment-invoice.hbs'),
Expand Down
2 changes: 1 addition & 1 deletion back-end/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.3

info:
title: EGM API
version: 3.3.0
version: 3.3.1
contact:
name: EGM Technical Lead
email: [email protected]
Expand Down
161 changes: 31 additions & 130 deletions front-end/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"newProjectRoot": "projects",
"projects": {
"app": {
"projectType": "application",
"schematics": {
"@ionic/angular-toolkit:page": { "styleext": "scss", "standalone": true }
},
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
Expand All @@ -18,28 +20,21 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
{ "glob": "**/*", "input": "src/assets", "output": "assets" },
{ "glob": "**/*.svg", "input": "node_modules/ionicons/dist/ionicons/svg", "output": "./svg" }
],
"styles": ["src/theme/variables.scss", "src/global.scss"],
"scripts": [],
"aot": false,
"aot": true,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"buildOptimizer": true,
"sourceMap": { "scripts": true, "styles": false, "hidden": false, "vendor": false },
"namedChunks": true,
"optimization": { "styles": { "inlineCritical": false } },
"allowedCommonJsDependencies": [
"buffer",
"idea-toolbox",
"isomorphic-unfetch",
"localforage",
Expand All @@ -50,123 +45,31 @@
},
"configurations": {
"production": {
"budgets": [
{ "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" },
{ "type": "anyComponentStyle", "maximumWarning": "2kb", "maximumError": "4kb" }
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
{ "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" }
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
"outputHashing": "all"
},
"ci": {
"progress": false
}
}
"development": { "optimization": false, "extractLicenses": false, "sourceMap": true, "namedChunks": true },
"ci": { "progress": false }
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [],
"scripts": [],
"assets": [
{
"glob": "favicon.ico",
"input": "src/",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
}
]
"production": { "buildTarget": "app:build:production" },
"development": { "buildTarget": "app:build:development" }
},
"configurations": {
"ci": {
"progress": false,
"watch": false
}
}
"defaultConfiguration": "development"
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"devServerTarget": "app:serve:production"
},
"ci": {
"devServerTarget": "app:serve:ci"
}
}
},
"ionic-cordova-build": {
"builder": "@ionic/angular-toolkit:cordova-build",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
}
}
},
"ionic-cordova-serve": {
"builder": "@ionic/angular-toolkit:cordova-serve",
"options": {
"cordovaBuildTarget": "app:ionic-cordova-build",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"cordovaBuildTarget": "app:ionic-cordova-build:production",
"devServerTarget": "app:serve:production"
}
}
"options": { "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] }
}
}
}
Expand All @@ -175,11 +78,9 @@
"schematicCollections": ["@ionic/angular-toolkit"]
},
"schematics": {
"@ionic/angular-toolkit:component": {
"styleext": "scss"
},
"@ionic/angular-toolkit:page": {
"styleext": "scss"
}
"@ionic/angular-toolkit:component": { "styleext": "scss" },
"@ionic/angular-toolkit:page": { "styleext": "scss" },
"@angular-eslint/schematics:application": { "setParserOptionsProject": true },
"@angular-eslint/schematics:library": { "setParserOptionsProject": true }
}
}
}
Loading

0 comments on commit ff6f620

Please sign in to comment.