@hy-capital/api-habit-tracker-types 1.0.43 → 1.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,4 @@
1
1
  import { DbUser } from './user';
2
- import { DbUserRating } from './user-rating';
3
2
  export interface FrontendUser {
4
3
  user: DbUser;
5
- user_rating: DbUserRating | null;
6
4
  }
package/dist/habit.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare const allHabitDays: HabitDay[];
7
7
  export declare const habitDateFormat = "DD-MM-YYYY";
8
8
  export declare const habitDayToNumberMappings: Record<HabitDay, number>;
9
9
  export declare const numberToHabitDayMappings: Record<number, HabitDay>;
10
+ export declare const ProgramObjectivesByTopic: Record<TopicType, string[]>;
10
11
  export interface HabitType {
11
12
  name: string;
12
13
  habitTime: HabitTime;
package/dist/habit.js CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.numberToHabitDayMappings = exports.habitDayToNumberMappings = exports.habitDateFormat = exports.allHabitDays = void 0;
3
+ exports.ProgramObjectivesByTopic = exports.numberToHabitDayMappings = exports.habitDayToNumberMappings = exports.habitDateFormat = exports.allHabitDays = void 0;
4
4
  exports.allHabitDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
5
5
  exports.habitDateFormat = 'DD-MM-YYYY';
6
6
  exports.habitDayToNumberMappings = {
7
- 'Monday': 1,
8
- 'Tuesday': 2,
9
- 'Wednesday': 3,
10
- 'Thursday': 4,
11
- 'Friday': 5,
12
- 'Saturday': 6,
13
- 'Sunday': 0
7
+ Monday: 1,
8
+ Tuesday: 2,
9
+ Wednesday: 3,
10
+ Thursday: 4,
11
+ Friday: 5,
12
+ Saturday: 6,
13
+ Sunday: 0
14
14
  };
15
15
  exports.numberToHabitDayMappings = {
16
16
  1: 'Monday',
@@ -21,3 +21,25 @@ exports.numberToHabitDayMappings = {
21
21
  6: 'Saturday',
22
22
  0: 'Sunday'
23
23
  };
24
+ exports.ProgramObjectivesByTopic = {
25
+ Dating: [
26
+ 'Attraction',
27
+ 'Confidence',
28
+ 'Charisma'
29
+ ],
30
+ Sleep: [
31
+ 'Discipline',
32
+ 'Peace',
33
+ 'Energy'
34
+ ],
35
+ Fitness: [
36
+ 'Strength',
37
+ 'Discipline',
38
+ 'Aesthetics'
39
+ ],
40
+ 'Side Hustle': [
41
+ 'Focus',
42
+ 'Marketing',
43
+ 'Revenue'
44
+ ]
45
+ };
@@ -1 +1 @@
1
- export type TopicType = 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep' | 'Custom';
1
+ export type TopicType = 'Side Hustle' | 'Dating' | 'Fitness' | 'Sleep';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hy-capital/api-habit-tracker-types",
3
- "version": "1.0.43",
3
+ "version": "1.0.46",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +1,5 @@
1
1
  import {DbUser} from './user';
2
- import {DbUserRating} from './user-rating';
3
2
 
4
3
  export interface FrontendUser {
5
4
  user: DbUser;
6
- user_rating: DbUserRating | null;
7
5
  }
package/src/habit.ts CHANGED
@@ -9,13 +9,13 @@ export const allHabitDays: HabitDay[] = ['Monday', 'Tuesday', 'Wednesday', 'Thur
9
9
  export const habitDateFormat = 'DD-MM-YYYY';
10
10
 
11
11
  export const habitDayToNumberMappings: Record<HabitDay, number> = {
12
- 'Monday': 1,
13
- 'Tuesday': 2,
14
- 'Wednesday': 3,
15
- 'Thursday': 4,
16
- 'Friday': 5,
17
- 'Saturday': 6,
18
- 'Sunday': 0
12
+ Monday: 1,
13
+ Tuesday: 2,
14
+ Wednesday: 3,
15
+ Thursday: 4,
16
+ Friday: 5,
17
+ Saturday: 6,
18
+ Sunday: 0
19
19
  };
20
20
 
21
21
  export const numberToHabitDayMappings: Record<number, HabitDay> = {
@@ -28,6 +28,29 @@ export const numberToHabitDayMappings: Record<number, HabitDay> = {
28
28
  0: 'Sunday'
29
29
  };
30
30
 
31
+ export const ProgramObjectivesByTopic: Record<TopicType, string[]> = {
32
+ Dating: [
33
+ 'Attraction',
34
+ 'Confidence',
35
+ 'Charisma'
36
+ ],
37
+ Sleep: [
38
+ 'Discipline',
39
+ 'Peace',
40
+ 'Energy'
41
+ ],
42
+ Fitness: [
43
+ 'Strength',
44
+ 'Discipline',
45
+ 'Aesthetics'
46
+ ],
47
+ 'Side Hustle': [
48
+ 'Focus',
49
+ 'Marketing',
50
+ 'Revenue'
51
+ ]
52
+ };
53
+
31
54
  export interface HabitType {
32
55
  name: string;
33
56
  habitTime: HabitTime;
@@ -51,9 +74,9 @@ export interface BaseHabit {
51
74
  remind_me: boolean;
52
75
  remind_me_at_times: RemindMeAtTime[]; // these are shown in FO
53
76
  notifications: Notification[]; // these are Local notification times
54
- frequency: HabitFrequency;
77
+ frequency: HabitFrequency; //TODO: keep only daily
55
78
  habit_days: HabitDay[];
56
- habit_dates: number[];
79
+ habit_dates: number[]; //TODO: remove
57
80
  }
58
81
 
59
82
  export interface RemindMeAtTime {
package/src/user-topic.ts CHANGED
@@ -1,2 +1 @@
1
- export type TopicType =
2
- 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep' | 'Custom';
1
+ export type TopicType = 'Side Hustle' | 'Dating' | 'Fitness' | 'Sleep';
@@ -1,14 +0,0 @@
1
- export interface BaseUserRating {
2
- user_id: number;
3
- initial_rating: number;
4
- current_rating: number;
5
- potential_rating: number;
6
- }
7
- export type InputUserRating = Omit<DbUserRating, 'id' | 'created_at' | 'updated_at'>;
8
- export type CreateUserRatingRequest = BaseUserRating;
9
- export type UpdateUserRatingRequest = Partial<BaseUserRating>;
10
- export interface DbUserRating extends BaseUserRating {
11
- id: number;
12
- created_at: string;
13
- updated_at: string;
14
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- export interface BaseUserRating {
2
- user_id: number;
3
- initial_rating: number;
4
- current_rating: number
5
- potential_rating: number;
6
- }
7
-
8
- export type InputUserRating = Omit<DbUserRating, 'id' | 'created_at' | 'updated_at'>;
9
-
10
- export type CreateUserRatingRequest = BaseUserRating;
11
- export type UpdateUserRatingRequest = Partial<BaseUserRating>;
12
-
13
- export interface DbUserRating extends BaseUserRating {
14
- id: number;
15
- created_at: string;
16
- updated_at: string;
17
- }