32 lines
757 B
TypeScript
32 lines
757 B
TypeScript
import { SecureNoteType } from "../../enums/secureNoteType";
|
|
import { SecureNote as SecureNoteDomain } from "../domain/secure-note";
|
|
import { SecureNoteView } from "../view/secure-note.view";
|
|
|
|
export class SecureNoteExport {
|
|
static template(): SecureNoteExport {
|
|
const req = new SecureNoteExport();
|
|
req.type = SecureNoteType.Generic;
|
|
return req;
|
|
}
|
|
|
|
static toView(req: SecureNoteExport, view = new SecureNoteView()) {
|
|
view.type = req.type;
|
|
return view;
|
|
}
|
|
|
|
static toDomain(req: SecureNoteExport, view = new SecureNoteDomain()) {
|
|
view.type = req.type;
|
|
return view;
|
|
}
|
|
|
|
type: SecureNoteType;
|
|
|
|
constructor(o?: SecureNoteView | SecureNoteDomain) {
|
|
if (o == null) {
|
|
return;
|
|
}
|
|
|
|
this.type = o.type;
|
|
}
|
|
}
|