Add jsdoc to all members
- Add jsdoc rule to tslint and fix the new issuespull/4/head
parent
ea8a97beb5
commit
29a1e7bfb3
@ -1,8 +1,10 @@
|
|||||||
import {BaseError} from "./BaseError";
|
import {BaseError} from "./BaseError";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An error that is thrown when a group was not found for a specified id
|
||||||
|
*/
|
||||||
export class GroupNotFoundError extends BaseError {
|
export class GroupNotFoundError extends BaseError {
|
||||||
constructor(groupId: number) {
|
constructor(groupId: number) {
|
||||||
super(`Group ${groupId} not found!`);
|
super(`Group ${groupId} not found!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import dataaccess from "../dataAccess";
|
import dataaccess from "../dataAccess";
|
||||||
import {BaseError} from "./BaseError";
|
import {BaseError} from "./BaseError";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An error that is thrown when a request for a sender, receiver and type was not found
|
||||||
|
*/
|
||||||
export class RequestNotFoundError extends BaseError {
|
export class RequestNotFoundError extends BaseError {
|
||||||
constructor(sender: number, receiver: number, type: dataaccess.RequestType) {
|
constructor(sender: number, receiver: number, type: dataaccess.RequestType) {
|
||||||
super(`Request with sender '${sender}' and receiver '${receiver}' of type '${type}' not found.`);
|
super(`Request with sender '${sender}' and receiver '${receiver}' of type '${type}' not found.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,30 @@
|
|||||||
import * as sqz from "sequelize";
|
import * as sqz from "sequelize";
|
||||||
import {Column, ForeignKey, Model, NotNull, Table, Unique} from "sequelize-typescript";
|
import {Column, Model, NotNull, Table, Unique} from "sequelize-typescript";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents an environmental friendly activity that provides points to level up
|
||||||
|
*/
|
||||||
@Table({underscored: true})
|
@Table({underscored: true})
|
||||||
export class Activity extends Model {
|
export class Activity extends Model {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the Activity
|
||||||
|
*/
|
||||||
@Unique
|
@Unique
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column({type: sqz.STRING(128), allowNull: false, unique: true})
|
@Column({type: sqz.STRING(128), allowNull: false, unique: true})
|
||||||
public name: string;
|
public name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The description of the activity to describe what exactly has to be done
|
||||||
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column({type: sqz.TEXT, allowNull: false})
|
@Column({type: sqz.TEXT, allowNull: false})
|
||||||
public description: string;
|
public description: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The points one can get by completing the activity
|
||||||
|
*/
|
||||||
@Column
|
@Column
|
||||||
public points: number;
|
public points: number;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue