@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.
@@ -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
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './user';
2
2
  export * from './user-stat';
3
3
  export * from './frontend-user';
4
+ export * from './habit';
package/dist/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./user"), exports);
18
18
  __exportStar(require("./user-stat"), exports);
19
19
  __exportStar(require("./frontend-user"), exports);
20
+ __exportStar(require("./habit"), exports);
@@ -1,17 +1,13 @@
1
- export type StatType = 'Sleep' | 'Diet' | 'Exercise' | 'Calmness' | 'Public speaking' | 'Productivity';
2
- export interface DbUserStat {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hy-capital/api-habit-tracker-types",
3
- "version": "1.0.12",
3
+ "version": "1.0.16",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",
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
@@ -1,3 +1,4 @@
1
1
  export * from './user';
2
2
  export * from './user-stat';
3
- export * from './frontend-user';
3
+ export * from './frontend-user';
4
+ export * from './habit';
package/src/user-stat.ts CHANGED
@@ -1,19 +1,16 @@
1
- export type StatType = 'Sleep' | 'Diet' | 'Exercise' | 'Calmness' | 'Public speaking' | 'Productivity';
1
+ export type StatType =
2
+ 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep';
2
3
 
3
- export interface DbUserStat {
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 UpsertUserStatRequest {
14
- user_id: number;
15
- type: StatType;
16
- initial_score: number;
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
  }