Skip to content

Commit

Permalink
feat(JAQPOT-429): update possible values keys (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
alarv authored Nov 22, 2024
1 parent 7ca404a commit 6e0aba1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package org.jaqpot.api.entity

class FeaturePossibleValue(val key: String, val value: String)
class FeaturePossibleValue(val value: String, val description: String)
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import org.jaqpot.api.model.FeaturePossibleValueDto

fun FeaturePossibleValue.toDto(): FeaturePossibleValueDto {
return FeaturePossibleValueDto(
key = this.key,
value = this.value
value = this.value,
description = this.description
)
}

fun FeaturePossibleValueDto.toEntity(): FeaturePossibleValue {
return FeaturePossibleValue(
key = this.key,
value = this.value
value = this.value,
description = this.description
)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPDATE feature
SET possible_values = (REPLACE(possible_values::TEXT, '"value"', '"description"'))::JSONB
WHERE possible_values IS NOT NULL;

UPDATE feature
SET possible_values = (REPLACE(possible_values::TEXT, '"key"', '"value"'))::JSONB
WHERE possible_values IS NOT NULL;
8 changes: 4 additions & 4 deletions src/main/resources/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1757,15 +1757,15 @@ components:
FeaturePossibleValue:
type: object
required:
- key
- value
- description
properties:
key:
type: string
example: "value"
value:
type: string
example: "value"
description:
type: string
example: "my description"
FeatureType:
type: string
enum:
Expand Down

0 comments on commit 6e0aba1

Please sign in to comment.