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