25 lines
489 B
TypeScript
25 lines
489 B
TypeScript
import {
|
|
IsInt
|
|
} from "class-validator";
|
|
import { Principal } from '../entities/Principal';
|
|
|
|
/**
|
|
* Defines the principal response.
|
|
*/
|
|
export abstract class ResponsePrincipal {
|
|
|
|
/**
|
|
* The principal's id.
|
|
*/
|
|
@IsInt()
|
|
id: number;
|
|
|
|
/**
|
|
* Creates a ResponsePrincipal object from a principal.
|
|
* @param principal The principal the response shall be build for.
|
|
*/
|
|
public constructor(principal: Principal) {
|
|
this.id = principal.id;
|
|
}
|
|
}
|