Added backend interfaces
This commit is contained in:
parent
e6da94ad0e
commit
05fd255a51
|
@ -1,9 +1,32 @@
|
||||||
interface Session {
|
declare namespace FG {
|
||||||
expires: Date;
|
interface Event {
|
||||||
token: string;
|
id: number;
|
||||||
lifetime: number;
|
begin: Date;
|
||||||
browser: string;
|
end?: Date;
|
||||||
platform: string;
|
description: string;
|
||||||
|
kind: EventKind;
|
||||||
|
slots: Array<EventSlot>;
|
||||||
|
}
|
||||||
|
interface EventKind {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
interface EventSlot {
|
||||||
|
id: number;
|
||||||
|
start: Date;
|
||||||
|
end?: any;
|
||||||
|
slots: Array<any>;
|
||||||
|
}
|
||||||
|
interface Job {
|
||||||
|
userid: string;
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
type JobKind = string;
|
||||||
|
interface JobSlot {
|
||||||
|
id: number;
|
||||||
|
needed_persons: number;
|
||||||
|
kind: JobKind;
|
||||||
|
jobs: Array<Job>;
|
||||||
}
|
}
|
||||||
interface User {
|
interface User {
|
||||||
userid: string;
|
userid: string;
|
||||||
|
@ -13,8 +36,16 @@ interface User {
|
||||||
mail: string;
|
mail: string;
|
||||||
roles: Array<Role>;
|
roles: Array<Role>;
|
||||||
}
|
}
|
||||||
|
interface Session {
|
||||||
|
expires: Date;
|
||||||
|
token: string;
|
||||||
|
lifetime: number;
|
||||||
|
browser: string;
|
||||||
|
platform: string;
|
||||||
|
}
|
||||||
type Permission = string;
|
type Permission = string;
|
||||||
interface Role {
|
interface Role {
|
||||||
name: string;
|
name: string;
|
||||||
permissions: Array<Permission>;
|
permissions: Array<Permission>;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ export interface UserStateInterface extends LoginResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LoginResponse {
|
export interface LoginResponse {
|
||||||
user: User;
|
user: FG.User;
|
||||||
session: Session;
|
session: FG.Session;
|
||||||
}
|
}
|
||||||
|
|
||||||
const state: UserStateInterface = {
|
const state: UserStateInterface = {
|
||||||
|
@ -35,10 +35,10 @@ const state: UserStateInterface = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations: MutationTree<UserStateInterface> = {
|
const mutations: MutationTree<UserStateInterface> = {
|
||||||
setUser (state, data: User) {
|
setUser (state, data: FG.User) {
|
||||||
state.user = data;
|
state.user = data;
|
||||||
},
|
},
|
||||||
setSession (state, data: Session) {
|
setSession (state, data: FG.Session) {
|
||||||
state.session = data;
|
state.session = data;
|
||||||
},
|
},
|
||||||
setLoginLoading (state, data: boolean) {
|
setLoginLoading (state, data: boolean) {
|
||||||
|
|
Loading…
Reference in New Issue