Migrate authorize{ actions, actionType, reducer} to TS & make factory service for interfaces #15
This commit is contained in:
7
app/domain/authorize/index.ts
Normal file
7
app/domain/authorize/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { LoginUser } from "./loginResult";
|
||||
import { RegisterUserResult } from "./registerUserResult";
|
||||
|
||||
export {
|
||||
LoginUser,
|
||||
RegisterUserResult
|
||||
}
|
||||
25
app/domain/authorize/loginResult.ts
Normal file
25
app/domain/authorize/loginResult.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { BaseDomain } from "domain/common";
|
||||
|
||||
export class LoginUser extends BaseDomain{
|
||||
|
||||
constructor(uid: string){
|
||||
super();
|
||||
|
||||
this._uid = uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* User identifier
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof LoginUser
|
||||
*/
|
||||
|
||||
private _uid : string;
|
||||
public get uid() : string {
|
||||
return this._uid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
23
app/domain/authorize/registerUserResult.ts
Normal file
23
app/domain/authorize/registerUserResult.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { BaseDomain } from "domain/common";
|
||||
|
||||
export class RegisterUserResult extends BaseDomain{
|
||||
|
||||
constructor(uid: string){
|
||||
super();
|
||||
|
||||
this._uid = uid;
|
||||
}
|
||||
/**
|
||||
* User identifier
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof LoginUser
|
||||
*/
|
||||
|
||||
private _uid : string;
|
||||
public get uid() : string {
|
||||
return this._uid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
app/domain/common/baseDomain.ts
Normal file
4
app/domain/common/baseDomain.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
export class BaseDomain{
|
||||
|
||||
}
|
||||
7
app/domain/common/index.ts
Normal file
7
app/domain/common/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { SocialError } from "./socialError";
|
||||
import { BaseDomain } from "./baseDomain";
|
||||
|
||||
export {
|
||||
SocialError,
|
||||
BaseDomain
|
||||
}
|
||||
45
app/domain/common/socialError.ts
Normal file
45
app/domain/common/socialError.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
export class SocialError{
|
||||
|
||||
constructor(code: string, description: string){
|
||||
this._code = code;
|
||||
this._description = description;
|
||||
this._isError = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Error code
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SocialError
|
||||
*/
|
||||
private _code : string;
|
||||
public get code() : string {
|
||||
return this._code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Error description
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SocialError
|
||||
*/
|
||||
|
||||
private _description : string;
|
||||
public get description() : string {
|
||||
return this._description;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If is error {true} if not {false}
|
||||
*
|
||||
* @type {Boolean}
|
||||
* @memberof SocialError
|
||||
*/
|
||||
|
||||
private _isError : Boolean;
|
||||
public get isError() : Boolean {
|
||||
return this._isError;
|
||||
}
|
||||
|
||||
}
|
||||
5
app/domain/users/index.ts
Normal file
5
app/domain/users/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import User from './user';
|
||||
|
||||
export {
|
||||
User
|
||||
}
|
||||
30
app/domain/users/user.ts
Normal file
30
app/domain/users/user.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { BaseDomain } from "domain/common";
|
||||
|
||||
class User extends BaseDomain {
|
||||
/**
|
||||
* Email of the user
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof User
|
||||
*/
|
||||
public email: string;
|
||||
|
||||
/**
|
||||
* Password of the user
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof User
|
||||
*/
|
||||
public password: string;
|
||||
|
||||
/**
|
||||
* User identifier
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof User
|
||||
*/
|
||||
public userId: string;
|
||||
|
||||
}
|
||||
|
||||
export default User;
|
||||
Reference in New Issue
Block a user