aboutsummaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/models')
-rw-r--r--src/models/comment.ts70
-rw-r--r--src/models/identity/friend.ts3
-rw-r--r--src/models/identity/role.ts3
-rw-r--r--src/models/identity/user.ts100
-rw-r--r--src/models/language.ts6
-rw-r--r--src/models/post-comment.ts5
-rw-r--r--src/models/post.ts81
-rw-r--r--src/models/technology.ts6
8 files changed, 274 insertions, 0 deletions
diff --git a/src/models/comment.ts b/src/models/comment.ts
new file mode 100644
index 0000000..0d1755f
--- /dev/null
+++ b/src/models/comment.ts
@@ -0,0 +1,70 @@
+import { Guid } from 'guid-typescript';
+
+export class Comment {
+ private _commentId: Guid;
+ private _postId: Guid;
+ private _issuerFirstName: string;
+ private _issuerLastName: string;
+ private _issuerUsername: string;
+ private _message: string;
+ private _timeCreated: Date;
+
+ constructor(commentId: Guid, postId: Guid, issuerFirstName: string, issuerLastName: string, issuerUsername: string, message: string, timeCreated: Date) {
+ this.commentId = commentId;
+ this.postId = postId;
+ this.issuerFirstName = issuerFirstName;
+ this.issuerLastName = issuerLastName;
+ this.issuerUsername = issuerUsername;
+ this.message = message;
+ this.timeCreated = timeCreated;
+ }
+
+ public get commentId(): Guid {
+ return this._commentId;
+ }
+ public set commentId(v: Guid) {
+ this._commentId = v;
+ }
+
+ public get postId(): Guid {
+ return this._postId;
+ }
+ public set postId(v: Guid) {
+ this._postId = v;
+ }
+
+ public get issuerFirstName(): string {
+ return this._issuerFirstName;
+ }
+ public set issuerFirstName(v: string) {
+ this._issuerFirstName = v;
+ }
+
+ public get issuerLastName(): string {
+ return this._issuerLastName;
+ }
+ public set issuerLastName(v: string) {
+ this._issuerLastName = v;
+ }
+
+ public get issuerUsername(): string {
+ return this._issuerUsername;
+ }
+ public set issuerUsername(v: string) {
+ this._issuerUsername = v;
+ }
+
+ public get message(): string {
+ return this._message;
+ }
+ public set message(v: string) {
+ this._message = v;
+ }
+
+ public get timeCreated(): Date {
+ return this._timeCreated;
+ }
+ public set timeCreated(v: Date) {
+ this._timeCreated = v;
+ }
+}
diff --git a/src/models/identity/friend.ts b/src/models/identity/friend.ts
new file mode 100644
index 0000000..22290cd
--- /dev/null
+++ b/src/models/identity/friend.ts
@@ -0,0 +1,3 @@
+export class Friend {
+ public userName: string;
+}
diff --git a/src/models/identity/role.ts b/src/models/identity/role.ts
new file mode 100644
index 0000000..132b0b0
--- /dev/null
+++ b/src/models/identity/role.ts
@@ -0,0 +1,3 @@
+export class Role {
+ public name: string;
+}
diff --git a/src/models/identity/user.ts b/src/models/identity/user.ts
new file mode 100644
index 0000000..e0038e0
--- /dev/null
+++ b/src/models/identity/user.ts
@@ -0,0 +1,100 @@
+import { Guid } from 'guid-typescript';
+import { Language } from '../language';
+import { Technology } from '../technology';
+import { Friend } from './friend';
+import { Role } from './role';
+
+export class User {
+ private _id : Guid;
+ private _lastName : string;
+ private _firstName : string;
+ private _userName : string;
+ private _email: string;
+ private _profilePictureURL : string;
+ private _languages: Language[];
+ private _technologies: Technology[];
+ private _roles: Role[];
+ private _friends: Friend[];
+
+ constructor(id: Guid, userName: string, firstName: string, lastName: string, email: string, profilePictureURL: string, languages: Language[], technologies: Technology[], roles: Role[], friends: Friend[]) {
+ this.id = id;
+ this.userName = userName;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.email = email;
+ this._profilePictureURL = profilePictureURL;
+ this.languages = languages;
+ this.technologies = technologies;
+ this.roles = roles;
+ }
+
+ public get id(): Guid {
+ return this._id;
+ }
+ public set id(v: Guid) {
+ this._id = v;
+ }
+
+ public get userName(): string {
+ return this._userName;
+ }
+ public set userName(v: string) {
+ this._userName = v;
+ }
+
+ public get firstName(): string {
+ return this._firstName;
+ }
+ public set firstName(v: string) {
+ this._firstName = v;
+ }
+
+ public get lastName(): string {
+ return this._lastName;
+ }
+ public set lastName(v: string) {
+ this._lastName = v;
+ }
+
+ public get email(): string {
+ return this._email;
+ }
+ public set email(v: string) {
+ this._email = v;
+ }
+
+ public get profilePictureURL(): string {
+ return this._profilePictureURL;
+ }
+ public set profilePictureURL(v: string) {
+ this._profilePictureURL = v;
+ }
+
+ public get languages(): Language[] {
+ return this._languages;
+ }
+ public set languages(v: Language[]) {
+ this._languages = v;
+ }
+
+ public get technologies(): Technology[] {
+ return this._technologies;
+ }
+ public set technologies(v: Technology[]) {
+ this._technologies = v;
+ }
+
+ public get roles(): Role[] {
+ return this._roles;
+ }
+ public set roles(v: Role[]) {
+ this._roles = v;
+ }
+
+ public get friends(): Friend[] {
+ return this._friends;
+ }
+ public set friends(v: Friend[]) {
+ this._friends = v;
+ }
+}
diff --git a/src/models/language.ts b/src/models/language.ts
new file mode 100644
index 0000000..e3aa61e
--- /dev/null
+++ b/src/models/language.ts
@@ -0,0 +1,6 @@
+import { Guid } from 'guid-typescript';
+
+export class Language {
+ public id: Guid;
+ public name: string;
+}
diff --git a/src/models/post-comment.ts b/src/models/post-comment.ts
new file mode 100644
index 0000000..5d1e346
--- /dev/null
+++ b/src/models/post-comment.ts
@@ -0,0 +1,5 @@
+import { Guid } from 'guid-typescript';
+
+export class PostComment {
+ public id: Guid;
+}
diff --git a/src/models/post.ts b/src/models/post.ts
new file mode 100644
index 0000000..8e58bea
--- /dev/null
+++ b/src/models/post.ts
@@ -0,0 +1,81 @@
+import { Guid } from 'guid-typescript';
+import { Comment } from './comment';
+import { PostComment } from './post-comment';
+
+export class Post {
+ private _postId: Guid;
+ private _creatorFirstName: string;
+ private _creatorLastName: string;
+ private _creatorUsername: string;
+ private _message: string;
+ private _timeCreated: Date;
+ private _comments: PostComment[];
+ private _fileURLs: string[];
+
+ constructor(postId: Guid, creatorFirstName: string, creatorLastName: string, creatorUsername: string, message: string, timeCreated: Date, comments: PostComment[], fileURLs: string[]) {
+ this.postId = postId;
+ this.creatorFirstName = creatorFirstName;
+ this.creatorLastName = creatorLastName;
+ this.creatorUsername = creatorUsername;
+ this.message = message;
+ this.timeCreated = timeCreated;
+ this.comments = comments;
+ this.fileURLs = fileURLs;
+ }
+
+ public get postId(): Guid {
+ return this._postId;
+ }
+ public set postId(v: Guid) {
+ this._postId = v;
+ }
+
+ public get creatorFirstName(): string {
+ return this._creatorFirstName;
+ }
+ public set creatorFirstName(v: string) {
+ this._creatorFirstName = v;
+ }
+
+ public get creatorLastName(): string {
+ return this._creatorLastName;
+ }
+ public set creatorLastName(v: string) {
+ this._creatorLastName = v;
+ }
+
+ public get creatorUsername(): string {
+ return this._creatorUsername;
+ }
+ public set creatorUsername(v: string) {
+ this._creatorUsername = v;
+ }
+
+ public get message(): string {
+ return this._message;
+ }
+ public set message(v: string) {
+ this._message = v;
+ }
+
+ public get timeCreated(): Date {
+ return this._timeCreated;
+ }
+ public set timeCreated(v: Date) {
+ this._timeCreated = v;
+ }
+
+ public get comments(): PostComment[] {
+ return this._comments;
+ }
+ public set comments(v: PostComment[]) {
+ this._comments = v;
+ }
+
+ public get fileURLs(): string[] {
+ return this._fileURLs;
+ }
+ public set fileURLs(v: string[]) {
+ this._fileURLs = v;
+ }
+}
diff --git a/src/models/technology.ts b/src/models/technology.ts
new file mode 100644
index 0000000..1869d14
--- /dev/null
+++ b/src/models/technology.ts
@@ -0,0 +1,6 @@
+import { Guid } from 'guid-typescript';
+
+export class Technology {
+ public id: Guid;
+ public name: string;
+}