Skip to content

Commit

Permalink
Merge pull request #1963 from GSA-TTS/sambodeme/fix_prior_references_…
Browse files Browse the repository at this point in the history
…validations

Sambodeme/fix prior references validations
  • Loading branch information
jadudm authored Aug 31, 2023
2 parents 0d0c126 + 3ea6a86 commit 754127a
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@
"prior_references": "2022-033",
"reference_number": "2023-001"
}
},
{
"program": {
"award_reference": "AWARD-0003",
"compliance_requirement": "BC"
},
"questioned_costs": "Y",
"significant_deficiency": "N",
"other_matters": "Y",
"other_findings": "N",
"modified_opinion": "N",
"material_weakness": "Y",
"findings": {
"is_valid": "N",
"repeat_prior_reference": "N",
"prior_references": "N/A",
"reference_number": "2023-001"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"compliance_requirement": "E",
"reference_number": "2023-001",
"repeat_prior_reference": "N",
"prior_references": "N/A",
"is_valid": "Y",
"questioned_costs": "N",
"significant_deficiency": "N",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,39 +257,67 @@
"properties": {
"findings": {
"additionalProperties": false,
"allOf": [
"oneOf": [
{
"if": {
"properties": {
"repeat_prior_reference": {
"const": "Y",
"type": "string"
"allOf": [
{
"if": {
"properties": {
"repeat_prior_reference": {
"const": "Y"
}
}
},
"then": {
"properties": {
"prior_references": {
"description": "Prior references",
"pattern": "^20[1-9][0-9]-[0-9]{3}(,\\s*20[1-9][0-9]-[0-9]{3})*$",
"title": "PriorReferences",
"type": "string"
}
}
}
},
{
"not": {
"properties": {
"repeat_prior_reference": {
"const": "N"
}
}
}
}
},
"then": {
"required": [
"prior_references"
]
}
]
},
{
"if": {
"properties": {
"repeat_prior_reference": {
"const": "N",
"type": "string"
"allOf": [
{
"if": {
"properties": {
"repeat_prior_reference": {
"const": "N"
}
}
},
"then": {
"properties": {
"prior_references": {
"const": "N/A"
}
}
}
}
},
"then": {
"properties": {
"prior_references": {
"const": "N/A",
"type": "string"
},
{
"not": {
"properties": {
"repeat_prior_reference": {
"const": "Y"
}
}
}
}
}
]
}
],
"properties": {
Expand Down Expand Up @@ -319,6 +347,7 @@
},
"required": [
"reference_number",
"prior_references",
"repeat_prior_reference"
],
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local Sheets = import '../excel/libs/Sheets.libsonnet';
local Additional = import 'FederalAwardsAuditFindings.validation.libsonnet';
local Types = Base.Types;
local Validations = Additional.Validations;
local Func = import '../base/Functions.libsonnet';

local Meta = Types.object {
additionalProperties: false,
Expand Down Expand Up @@ -41,9 +42,10 @@ local Parts = {
},
required: [
'reference_number',
'prior_references',
'repeat_prior_reference',
],
allOf: Validations.PriorReferences,
oneOf: Validations.PriorReferences,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,34 +230,61 @@ local Validations = {
],
PriorReferences: [
{
'if': {
properties: {
repeat_prior_reference: Base.Types.string {
const: Base.Const.Y,
},
allOf: [
{
"if": {
properties: {
repeat_prior_reference: {
const: Base.Const.Y
}
}
},
"then": {
properties: {
"prior_references": Base.Compound.PriorReferences
}
}
},
},
'then': {
required:['prior_references']
},
{
not: {
properties: {
repeat_prior_reference: {
const: Base.Const.N
}
}
}
}
]
},
{
'if': {
properties: {
repeat_prior_reference: Base.Types.string {
const: Base.Const.N,
},
allOf: [
{
"if": {
properties: {
repeat_prior_reference: {
const: Base.Const.N
}
}
},
"then": {
properties: {
prior_references: {
const: Base.Const.NA
}
}
}
},
},
'then': {
properties: {
// required:['prior_references'],
prior_references: Base.Types.string {
const: Base.Const.NA
},
},
},
},
{
not: {
properties: {
repeat_prior_reference: {
const: Base.Const.Y
}
}
}
}
]
}
],
};

Expand Down

0 comments on commit 754127a

Please sign in to comment.