Skip to content

Commit

Permalink
additional fields in the Unit and VariableCategory classes to support…
Browse files Browse the repository at this point in the history
… enhanced functionality.

Took 48 seconds
  • Loading branch information
mikepsinn committed Nov 18, 2024
1 parent b49dd82 commit 043b47b
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 58 deletions.
2 changes: 1 addition & 1 deletion types/models/GlobalVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ export class GlobalVariable {
}

export type VariableCombinationOperationEnum = "MEAN" | "SUM"
export type VariableFillingTypeEnum = "none" | "zero-filling" | "value-filling"
export type VariableFillingTypeEnum = "none" | "zero" | "value"
export type VariableVariableCategoryNameEnum =
| "Activity"
| "Books"
Expand Down
4 changes: 2 additions & 2 deletions types/models/TagVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,8 +1365,8 @@ export class TagVariable {
export type TagVariableCombinationOperationEnum = "MEAN" | "SUM"
export type TagVariableFillingTypeEnum =
| "none"
| "zero-filling"
| "value-filling"
| "zero"
| "value"
export type TagVariableVariableCategoryNameEnum =
| "Activity"
| "Books"
Expand Down
165 changes: 118 additions & 47 deletions types/models/Unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import { ConversionStep } from "../models/ConversionStep"
import { UnitCategory } from "../models/UnitCategory"
import { VariableCombinationOperationEnum, VariableFillingTypeEnum } from "./GlobalVariable"

export class Unit {
/**
Expand All @@ -23,54 +24,88 @@ export class Unit {
*/
"advanced"?: number
/**
* Unit category
* Unit category name
*/
"category": UnitCategoryEnum
"categoryName": string
/**
* Ex: 6
* Unit category ID
*/
"categoryId"?: number
"unitCategoryId": number
/**
* Ex: Miscellany
* How measurements should be combined
*/
"categoryName"?: string
combinationOperation?: VariableCombinationOperationEnum | null
/**
* Conversion steps list
*/
"conversionSteps": Array<ConversionStep>
/**
* Ex: 29
* How missing values should be handled
*/
"id"?: number
"fillingType": VariableFillingTypeEnum
/**
* Ex: https://static.quantimo.do/img/medical/png/pill.png
* Value to use when filling missing data
*/
"image"?: string
"fillingValue": number | null
/**
* Ex: 0
* Hint text for input
*/
"manualTracking"?: number
"hint"?: string | null
/**
* The maximum allowed value for measurements. While you can record a value above this maximum, it will be excluded from the correlation analysis.
* Unit ID
*/
"maximumAllowedValue"?: number
"id": number
/**
* Ex: 4
* Icon image URL
*/
"maximumValue": number
"image"?: string
/**
* The minimum allowed value for measurements. While you can record a value below this minimum, it will be excluded from the correlation analysis.
* Whether unit can be tracked manually
*/
"minimumAllowedValue"?: number
"manualTracking": number
/**
* Ex: 0
* Maximum allowed value
*/
"minimumValue"?: number
"maximumValue": number | null
/**
* Minimum allowed value
*/
"minimumValue": number | null
/**
* Unit name
*/
"name": string
"unitCategory": UnitCategory
/**
* Measurement scale type
*/
"scale"?: "ratio" | "interval" | "ordinal"
/**
* Unit suffix
*/
"suffix"?: string | null
/**
* Alternative names for the unit
*/
"synonyms"?: string[]
/**
* Font Awesome icon name
*/
"fontAwesome"?: string | null
/**
* Input type for form fields
*/
"inputType"?: string | null
/**
* Maximum daily value allowed
*/
"maximumDailyValue"?: number | null
/**
* Default value
*/
"defaultValue"?: number | null

"add"?: number | null
"multiply"?: number | null

static readonly discriminator: string | undefined = undefined

Expand All @@ -93,29 +128,41 @@ export class Unit {
format: "",
},
{
name: "category",
baseName: "category",
type: "UnitCategoryEnum",
name: "categoryName",
baseName: "categoryName",
type: "string",
format: "",
},
{
name: "categoryId",
baseName: "categoryId",
name: "unitCategoryId",
baseName: "unitCategoryId",
type: "number",
format: "",
},
{
name: "categoryName",
baseName: "categoryName",
type: "string",
format: "",
},
{
name: "conversionSteps",
baseName: "conversionSteps",
type: "Array<ConversionStep>",
format: "",
},
{
name: "fillingType",
baseName: "fillingType",
type: "VariableFillingTypeEnum",
format: "",
},
{
name: "fillingValue",
baseName: "fillingValue",
type: "number",
format: "",
},
{
name: "hint",
baseName: "hint",
type: "string",
format: "",
},
{
name: "id",
baseName: "id",
Expand All @@ -134,24 +181,12 @@ export class Unit {
type: "number",
format: "",
},
{
name: "maximumAllowedValue",
baseName: "maximumAllowedValue",
type: "number",
format: "double",
},
{
name: "maximumValue",
baseName: "maximumValue",
type: "number",
format: "",
},
{
name: "minimumAllowedValue",
baseName: "minimumAllowedValue",
type: "number",
format: "double",
},
{
name: "minimumValue",
baseName: "minimumValue",
Expand All @@ -165,9 +200,45 @@ export class Unit {
format: "",
},
{
name: "unitCategory",
baseName: "unitCategory",
type: "UnitCategory",
name: "scale",
baseName: "scale",
type: "string",
format: "",
},
{
name: "suffix",
baseName: "suffix",
type: "string",
format: "",
},
{
name: "synonyms",
baseName: "synonyms",
type: "Array<string>",
format: "",
},
{
name: "fontAwesome",
baseName: "fontAwesome",
type: "string",
format: "",
},
{
name: "inputType",
baseName: "inputType",
type: "string",
format: "",
},
{
name: "maximumDailyValue",
baseName: "maximumDailyValue",
type: "number",
format: "",
},
{
name: "defaultValue",
baseName: "defaultValue",
type: "number",
format: "",
},
]
Expand Down
4 changes: 2 additions & 2 deletions types/models/UserVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1522,8 +1522,8 @@ export class UserVariable {
export type UserVariableCombinationOperationEnum = "MEAN" | "SUM"
export type UserVariableFillingTypeEnum =
| "none"
| "zero-filling"
| "value-filling"
| "zero"
| "value"
export type UserVariableVariableCategoryNameEnum =
| "Activity"
| "Books"
Expand Down
Loading

0 comments on commit 043b47b

Please sign in to comment.