-
Notifications
You must be signed in to change notification settings - Fork 70
/
login-activity.model.ts
58 lines (50 loc) · 1023 Bytes
/
login-activity.model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import {model, property} from '@loopback/repository';
import {CoreEntity} from '@sourceloop/core';
import {LoginType} from '../enums/login-type.enum';
@model({
description: `This is to maintain the daily login activity.`,
name: 'login_activity',
})
export class LoginActivity extends CoreEntity<LoginActivity> {
@property({
type: 'string',
id: true,
})
id?: string;
@property({
type: 'string',
name: 'actor',
})
actor: string;
@property({
type: 'string',
name: 'tenant_id',
})
tenantId?: string;
@property({
type: 'date',
default: () => new Date(),
name: 'login_time',
})
loginTime: Date;
@property({
type: 'string', //encrypted
name: 'token_payload',
})
tokenPayload?: string;
@property({
type: 'string',
name: 'login_type',
})
loginType: LoginType;
@property({
type: 'string',
name: 'device_info',
})
deviceInfo: string;
@property({
type: 'string',
name: 'ip_address',
})
ipAddress: string;
}