mirror of
https://github.com/movie-web/backend.git
synced 2025-09-13 18:13:26 +00:00
namespacing
This commit is contained in:
@@ -12,6 +12,9 @@ export class User {
|
||||
@PrimaryKey({ name: 'id', type: 'uuid' })
|
||||
id: string = randomUUID();
|
||||
|
||||
@Property({ name: 'namespace' })
|
||||
namespace!: string;
|
||||
|
||||
@Property({ type: 'date' })
|
||||
createdAt: Date = new Date();
|
||||
|
||||
@@ -30,6 +33,7 @@ export class User {
|
||||
|
||||
export interface UserDTO {
|
||||
id: string;
|
||||
namespace: string;
|
||||
name: string;
|
||||
roles: string[];
|
||||
createdAt: string;
|
||||
@@ -43,6 +47,7 @@ export interface UserDTO {
|
||||
export function formatUser(user: User): UserDTO {
|
||||
return {
|
||||
id: user.id,
|
||||
namespace: user.namespace,
|
||||
name: user.name,
|
||||
roles: user.roles,
|
||||
createdAt: user.createdAt.toISOString(),
|
||||
|
Reference in New Issue
Block a user