latest work #20
@ -8,5 +8,5 @@ export default {
|
||||
username: process.env.DB_USER,
|
||||
password: process.env.DB_PASSWORD,
|
||||
database: process.env.DB_NAME,
|
||||
entities: ["src/models/*.ts"]
|
||||
entities: ["src/models/entities/*.ts"]
|
||||
};
|
||||
|
@ -2,9 +2,9 @@ import { JsonController, Param, Body, Get, Post, Put, Delete, OnUndefined } from
|
||||
import { getConnectionManager, Repository } from 'typeorm';
|
||||
import { EntityFromBody } from 'typeorm-routing-controllers-extensions';
|
||||
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
|
||||
import { Runner } from '../models/Runner';
|
||||
import { Runner } from '../models/entities/Runner';
|
||||
import { RunnerGroupNeededError, RunnerGroupNotFoundError, RunnerIdsNotMatchingError, RunnerNotFoundError, RunnerOnlyOneGroupAllowedError } from '../errors/RunnerErrors';
|
||||
import { CreateRunner } from '../models/CreateRunner';
|
||||
import { CreateRunner } from '../models/creation/CreateRunner';
|
||||
|
||||
|
||||
@JsonController('/runners')
|
||||
|
@ -2,10 +2,10 @@ import { JsonController, Param, Body, Get, Post, Put, Delete, OnUndefined } from
|
||||
import { getConnectionManager, Repository } from 'typeorm';
|
||||
import { EntityFromBody } from 'typeorm-routing-controllers-extensions';
|
||||
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
|
||||
import { RunnerOrganisation } from '../models/RunnerOrganisation';
|
||||
import { RunnerOrganisation } from '../models/entities/RunnerOrganisation';
|
||||
import { RunnerOrganisationIdsNotMatchingError, RunnerOrganisationNotFoundError } from '../errors/RunnerOrganisationErrors';
|
||||
import { CreateRunnerOrganisation } from '../models/CreateRunnerOrganisation';
|
||||
import { RunnerGroup } from '../models/RunnerGroup';
|
||||
import { CreateRunnerOrganisation } from '../models/creation/CreateRunnerOrganisation';
|
||||
import { RunnerGroup } from '../models/entities/RunnerGroup';
|
||||
|
||||
|
||||
@JsonController('/organisations')
|
||||
|
@ -2,10 +2,10 @@ import { JsonController, Param, Body, Get, Post, Put, Delete, NotFoundError, OnU
|
||||
import { getConnectionManager, Repository } from 'typeorm';
|
||||
import { EntityFromBody } from 'typeorm-routing-controllers-extensions';
|
||||
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
|
||||
import { Track } from '../models/Track';
|
||||
import { Track } from '../models/entities/Track';
|
||||
import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator';
|
||||
import { TrackIdsNotMatchingError, TrackNotFoundError } from "../errors/TrackErrors";
|
||||
import { CreateTrack } from '../models/CreateTrack';
|
||||
import { CreateTrack } from '../models/creation/CreateTrack';
|
||||
|
||||
@JsonController('/tracks')
|
||||
//@Authorized("TRACKS:read")
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsPositive, IsString } from 'class-validator';
|
||||
import { Runner } from '../models/Runner';
|
||||
import { Runner } from '../entities/Runner';
|
||||
import { getConnectionManager, Repository } from 'typeorm';
|
||||
import { group } from 'console';
|
||||
import { RunnerOnlyOneGroupAllowedError, RunnerGroupNeededError, RunnerGroupNotFoundError } from '../errors/RunnerErrors';
|
||||
import { RunnerOrganisation } from './RunnerOrganisation';
|
||||
import { RunnerTeam } from './RunnerTeam';
|
||||
import { RunnerGroup } from './RunnerGroup';
|
||||
import { RunnerOnlyOneGroupAllowedError, RunnerGroupNeededError, RunnerGroupNotFoundError } from '../../errors/RunnerErrors';
|
||||
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
|
||||
import { RunnerTeam } from '../entities/RunnerTeam';
|
||||
import { RunnerGroup } from '../entities/RunnerGroup';
|
||||
import { Address } from 'cluster';
|
||||
|
||||
export class CreateRunner {
|
@ -1,5 +1,5 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { RunnerOrganisation } from './RunnerOrganisation';
|
||||
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
|
||||
|
||||
export class CreateRunnerOrganisation {
|
||||
@IsString()
|
@ -1,5 +1,5 @@
|
||||
import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator';
|
||||
import { Track } from './Track';
|
||||
import { Track } from '../entities/Track';
|
||||
|
||||
export class CreateTrack {
|
||||
/**
|
@ -1,6 +1,7 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from "typeorm";
|
||||
import {
|
||||
IsBoolean,
|
||||
IsEAN,
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
@ -32,12 +33,12 @@ export class RunnerCard {
|
||||
/**
|
||||
* The card's code.
|
||||
* This has to be able to being converted to something barcode compatible.
|
||||
* Probably gonna be autogenerated.
|
||||
* could theoretically be autogenerated
|
||||
*/
|
||||
@Column()
|
||||
@IsEAN()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
//TODO: Generate this
|
||||
code: string;
|
||||
|
||||
/**
|
@ -43,4 +43,12 @@ export abstract class Scan {
|
||||
@Column()
|
||||
@IsBoolean()
|
||||
valid: boolean = true;
|
||||
|
||||
/**
|
||||
* seconds since last scan
|
||||
*/
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
secondsSinceLastScan: number;
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { Entity, Column, OneToMany, ManyToOne, PrimaryGeneratedColumn, Generated, Unique, JoinTable, ManyToMany } from "typeorm";
|
||||
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, isUUID, } from "class-validator";
|
||||
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString, isUUID, } from "class-validator";
|
||||
import { UserGroup } from './UserGroup';
|
||||
import { Permission } from './Permission';
|
||||
import { UserAction } from './UserAction';
|
||||
@ -31,6 +31,13 @@ export class User {
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* user phone
|
||||
*/
|
||||
@IsPhoneNumber("ZZ")
|
||||
@IsOptional()
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* username
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user