@hy-capital/api-habit-tracker-types 1.0.12 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/habit.d.ts +25 -0
- package/dist/habit.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/user-stat.d.ts +5 -9
- package/package.json +1 -1
- package/src/habit.ts +34 -0
- package/src/index.ts +2 -1
- package/src/user-stat.ts +7 -10
package/dist/habit.d.ts
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
import { StatType } from './user-stat';
|
2
|
+
export type HabitTime = 'Morning' | 'Afternoon' | 'Evening' | 'Anytime';
|
3
|
+
export type HabitDifficulty = 1 | 2 | 3;
|
4
|
+
export interface HabitType {
|
5
|
+
name: string;
|
6
|
+
habitTime: HabitTime;
|
7
|
+
statType: StatType;
|
8
|
+
difficulty: HabitDifficulty;
|
9
|
+
description: string;
|
10
|
+
}
|
11
|
+
export interface BaseHabit {
|
12
|
+
user_id: number;
|
13
|
+
name: string;
|
14
|
+
stat_type: StatType;
|
15
|
+
done_days: string[];
|
16
|
+
start_time: string;
|
17
|
+
habit_time: HabitTime;
|
18
|
+
difficulty: HabitDifficulty;
|
19
|
+
description: string;
|
20
|
+
}
|
21
|
+
export interface DbHabit extends BaseHabit {
|
22
|
+
id: number;
|
23
|
+
created_at: string;
|
24
|
+
updated_at: string;
|
25
|
+
}
|
package/dist/habit.js
ADDED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/user-stat.d.ts
CHANGED
@@ -1,17 +1,13 @@
|
|
1
|
-
export type StatType = '
|
2
|
-
export interface
|
1
|
+
export type StatType = 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep';
|
2
|
+
export interface BaseUserStat {
|
3
3
|
user_id: number;
|
4
4
|
type: StatType;
|
5
5
|
initial_score: number;
|
6
6
|
current_score: number;
|
7
7
|
potential_score: number;
|
8
|
+
}
|
9
|
+
export interface DbUserStat extends BaseUserStat {
|
10
|
+
id: number;
|
8
11
|
created_at: string;
|
9
12
|
updated_at: string;
|
10
13
|
}
|
11
|
-
export interface UpsertUserStatRequest {
|
12
|
-
user_id: number;
|
13
|
-
type: StatType;
|
14
|
-
initial_score: number;
|
15
|
-
current_score: number;
|
16
|
-
potential_score: number;
|
17
|
-
}
|
package/package.json
CHANGED
package/src/habit.ts
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
import {StatType} from './user-stat';
|
2
|
+
|
3
|
+
export type HabitTime = 'Morning' | 'Afternoon' | 'Evening' | 'Anytime';
|
4
|
+
export type HabitDifficulty = 1 | 2 | 3;
|
5
|
+
|
6
|
+
export interface HabitType {
|
7
|
+
name: string;
|
8
|
+
habitTime: HabitTime;
|
9
|
+
statType: StatType;
|
10
|
+
difficulty: HabitDifficulty;
|
11
|
+
description: string;
|
12
|
+
}
|
13
|
+
|
14
|
+
export interface BaseHabit {
|
15
|
+
user_id: number;
|
16
|
+
name: string;
|
17
|
+
stat_type: StatType;
|
18
|
+
done_days: string[];
|
19
|
+
start_time: string;
|
20
|
+
habit_time: HabitTime;
|
21
|
+
difficulty: HabitDifficulty;
|
22
|
+
description: string;
|
23
|
+
// inspo:
|
24
|
+
// after_i_do_something
|
25
|
+
// remind_me_at_time
|
26
|
+
// remind_me_at_location
|
27
|
+
// missed_days (not needed, you can derive it based on done days)
|
28
|
+
}
|
29
|
+
|
30
|
+
export interface DbHabit extends BaseHabit {
|
31
|
+
id: number;
|
32
|
+
created_at: string
|
33
|
+
updated_at: string
|
34
|
+
}
|
package/src/index.ts
CHANGED
package/src/user-stat.ts
CHANGED
@@ -1,19 +1,16 @@
|
|
1
|
-
export type StatType =
|
1
|
+
export type StatType =
|
2
|
+
'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep';
|
2
3
|
|
3
|
-
export interface
|
4
|
+
export interface BaseUserStat {
|
4
5
|
user_id: number;
|
5
6
|
type: StatType;
|
6
7
|
initial_score: number;
|
7
8
|
current_score: number;
|
8
9
|
potential_score: number;
|
9
|
-
created_at: string;
|
10
|
-
updated_at: string;
|
11
10
|
}
|
12
11
|
|
13
|
-
export interface
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
current_score: number;
|
18
|
-
potential_score: number;
|
12
|
+
export interface DbUserStat extends BaseUserStat {
|
13
|
+
id: number;
|
14
|
+
created_at: string;
|
15
|
+
updated_at: string;
|
19
16
|
}
|