Self service registration feature/112-selfservice_registration #120

Merged
niggl merged 31 commits from feature/112-selfservice_registration into dev 2021-01-22 14:13:29 +00:00
Showing only changes of commit f8d7544517 - Show all commits

View File

@ -1,4 +1,4 @@
import { IsBoolean, IsInt, IsNotEmpty, IsObject, IsOptional } from 'class-validator';
import { IsBoolean, IsInt, IsObject, IsOptional } from 'class-validator';
import * as uuid from 'uuid';
import { Address } from '../../entities/Address';
import { RunnerOrganisation } from '../../entities/RunnerOrganisation';
@ -26,9 +26,9 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup {
/**
* Is registration enabled for the updated organisation?
*/
@IsNotEmpty()
@IsOptional()
@IsBoolean()
registrationEnabled: boolean;
registrationEnabled?: boolean = false;
/**
* Updates a provided RunnerOrganisation entity based on this.
@ -41,7 +41,7 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup {
else { organisation.address = this.address; }
Address.validate(organisation.address);
if (this.registrationEnabled) {
if (this.registrationEnabled && !organisation.key) {
organisation.key = uuid.v4().toUpperCase();
}
else {