@dgpholdings/greatoak-shared 1.0.30 → 1.0.31

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,4 +1,4 @@
1
- import { TRecord } from "./TApiRecord";
1
+ import { TExerciseRecord, TRecord } from "./TApiRecord";
2
2
  export type TBodyPart = "Chest" | "Core" | "Shoulders" | "Back" | "Bicep" | "Tricep" | "Fore arm" | "Legs" | "Cardio" | "Grip";
3
3
  export declare enum EBodyParts {
4
4
  "pectoralis-major" = "Pectoralis upper",
@@ -57,4 +57,5 @@ export type TApiGetOneExerciseReq = {
57
57
  };
58
58
  export type TApiGetOneExerciseRes = TExercise & {
59
59
  isActive: boolean;
60
+ records: TExerciseRecord<TRecord["type"]>;
60
61
  };
@@ -1,6 +1,4 @@
1
1
  export type TRecord = {
2
- id: string;
3
- } & ({
4
2
  type: "weight-reps";
5
3
  kg: string;
6
4
  reps: string;
@@ -11,7 +9,7 @@ export type TRecord = {
11
9
  } | {
12
10
  type: "reps-only";
13
11
  reps: string;
14
- });
12
+ };
15
13
  export type TRecordForm = TRecord & {
16
14
  isDone: boolean;
17
15
  };
@@ -24,3 +22,21 @@ export type TRecordWeight = Extract<TRecord, {
24
22
  export type TRecordBodyWeight = Extract<TRecord, {
25
23
  type: "reps-only";
26
24
  }>;
25
+ export type TExerciseRecord<T extends TRecord["type"]> = {
26
+ exerciseId: string;
27
+ userId: string;
28
+ recordType: T;
29
+ records: {
30
+ date: Date;
31
+ records: Omit<Extract<TRecord, {
32
+ type: T;
33
+ }>, "type">[];
34
+ }[];
35
+ };
36
+ export type TApiExerciseRecordUpdateReq = {
37
+ exerciseId: string;
38
+ records: TRecord[];
39
+ };
40
+ export type TApiExerciseRecordUpdateRes = {
41
+ status: 201 | 400;
42
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgpholdings/greatoak-shared",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "Shared TypeScript types and utilities for @dgpholdings projects",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",