Skip to content

Commit

Permalink
Added compliance to snippet dto
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardolopezb committed Jul 14, 2023
1 parent eabfdbe commit 634c42b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ingsis.snippetmanager.domains.snippet.dto

import ingsis.snippetmanager.domains.rule.model.ComplianceState
import ingsis.snippetmanager.domains.snippet.model.Snippet
import ingsis.snippetmanager.domains.test.dto.CreateTestDTO
import ingsis.snippetmanager.domains.test.model.Test
Expand All @@ -11,6 +12,7 @@ class SnippetDTO {
var name: String? = null
var type: String? = null
var content: String? = null
var compliance: ComplianceState? = null
var tests: List<CreateTestDTO>? = null
var ownerId: String? = null
var createdAt: Date? = null
Expand All @@ -29,6 +31,7 @@ class SnippetDTO {
this.tests = tests!!.map { CreateTestDTO(it.description, parseStringToList(it.input!!), parseStringToList(it.output!!), it.snippet!!.id) }
this.ownerId = ownerId
this.createdAt = createdAt
this.compliance = ComplianceState.PENDING
}

constructor(snippet: Snippet){
Expand All @@ -39,6 +42,7 @@ class SnippetDTO {
this.ownerId = snippet.ownerId
this.createdAt = snippet.createdAt
this.id = snippet.id
this.compliance = snippet.compliance
}

private fun parseStringToList(string: String): List<String?> {
Expand Down

0 comments on commit 634c42b

Please sign in to comment.