Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update schemas from CI pipeline [skip ci] #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions json_schemas/bulkVendorCoupon.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ira-rebates.labworks.org/schemas/bulkVendorCoupon",
"type": "object",
"properties": {
"coupons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"vendor_coupon_id": {
"type": "string",
"maxLength": 15
},
"upgrade_type": {
"type": "string"
},
"vendor_percent_cost_limit": {
"type": "integer",
"minimum": 20,
"maximum": 100
},
"state": {
"type": "string"
},
"coupon_expiration_date_time": {
"type": "string",
"format": "date-time"
},
"discount_value": {
"type": "number",
"minimum": 0,
"maximum": 14000.0,
"multipleOf": 0.01
}
},
"required": [
"vendor_coupon_id",
"upgrade_type",
"vendor_percent_cost_limit",
"state",
"coupon_expiration_date_time",
"discount_value"
]
},
"minItems": 1
}
},
"required": [
"coupons"
]
}
68 changes: 59 additions & 9 deletions json_schemas/definitions.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,14 @@
"$comment": "The date format follows RFC 3339, section 5.6: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6:~:text=Timestamps%20%20%20%20%20%20%20July%202002-,5.6,-.%20Internet%20Date/Time.",
"pattern": "^\\d{4}-\\d{2}-\\d{2}"
},
"num_occupied_units": {
"$anchor": "num_occupied_units",
"type": "integer",
"title": "Num occupied units",
"minimum": 0,
"maximum": 1000,
"description": "This is the number of occupied units in a multifamily building. "
},
"num_units": {
"$anchor": "num_units",
"type": "integer",
Expand All @@ -506,7 +514,28 @@
"title": "Num units meeting income bucket",
"minimum": 1,
"maximum": 1000,
"description": "This is the number of units in a multifamily building for which the household income falls within the income range represented by *mf_income_bucket* or is lower."
"description": "This is the number of occupied units in a multifamily building for which the household income falls within the income range represented by *mf_income_bucket* or is lower."
},
"original_component_details": {
"$anchor": "original_component_details",
"type": "json",
"title": "original component details",
"description": "This object describes the details of the component being replaced. The required fields depend on the upgrade_type and are fully described at https://github.com/pnnl/IRA-Rebates-API/blob/main/json_schemas/electricEligibleRebatesPayload.schema.json."
},
"percent_cost_limit": {
"type": "integer",
"readOnly": true,
"$anchor": "percent_cost_limit",
"description": "This integer is either 50 or 100 (for electrification) or 50 or 80 (for homes), depending on the income_bucket. It is the percent of project cost that can be covered by the rebate. The actual rebate amount allowed is *min(reservation_amount, percent_cost_limit x project_cost / 100)*.",
"title": "Percent cost limit",
"$comment": "This is a read-only field, automatically populated by the API in the response."
},
"vendor_percent_cost_limit": {
"type": "integer",
"$anchor": "percent_cost_limit",
"description": "This integer is either 50 or 100 (for electrification) or 50 or 80 (for homes), depending on the income_bucket. It is the percent of project cost that can be covered by the rebate. The actual rebate amount allowed is *min(reservation_amount, percent_cost_limit x project_cost / 100)*.",
"title": "Percent cost limit",
"$comment": "This is a read-only field, automatically populated by the API in the response."
},
"portfolio_id": {
"$anchor": "portfolio_id",
Expand Down Expand Up @@ -611,14 +640,19 @@
"$anchor": "rebate_type",
"description": "The HOMES rebates have two distinct options for determining savings and rebate amounts, MODELED vs MEASURED."
},
"redemption_type": {
"$anchor": "redemption_type",
"enum": [
"COMPLETION",
"POINT_OF_PURCHASE"
],
"title": "Redemption type",
"description": "Set this to COMPLETION for the final redemption associated with a reservation. This generally corresponds to when installation is complete. Set this to POINT_OF_PURCHASE in all other situations."
"remaining_reservation_amount": {
"type": "number",
"readOnly": true,
"$anchor": "remaining_reservation_amount",
"description": "This is the maximum rebate amount. The rebate amount is also limited to a percentage of the project cost which is given by the *percent_cost_limit* field. Thus, the rebate amount is the smaller of the *reservation_amount* and the percent of the project cost, given by *percent_cost_limit*.",
"title": "Remaining reservation amount",
"$comment": "This is a read-only field, automatically populated by the API in the response."
},
"redemption_notes": {
"type": "string",
"readOnly": true,
"description": "This will be an array of strings explaining how the rebate_amount was calculated.",
"$comment": "This is a read-only field, automatically populated by the API in the response."
},
"reservation_amount": {
"$anchor": "reservation_amount",
Expand All @@ -628,6 +662,16 @@
"title": "Reservation amount",
"description": "This is the maximum rebate amount."
},
"reservation_amount_note": {
"type": "string",
"readOnly": true,
"description": "This is an array of strings explaining how the reservation amount was determined.",
"$comment": "This is a read-only field, automatically populated by the API in the response."
},
"reservation_expiration_date_time": {
"type": "date-time",
"description": "If the reservation is not redeemed by this date, the reservation will be automatically canceled."
},
"safety_checks_good_potential_issues_na": {
"$anchor": "safety_checks_good_potential_issues_na",
"enum": [
Expand Down Expand Up @@ -720,6 +764,12 @@
"maxLength": 14,
"description": "The universal product code (UPC) for the product being purchased."
},
"upgrade_component_details": {
"$anchor": "upgrade_component_details",
"type": "json",
"title": "Upgrade component details",
"description": "This is a JSON object containing the upgrade information specific to the upgrade being installed. The form of these objects will follow the Data and Tools Guide Appendix https://www.energy.gov/scep/articles/ira-home-energy-rebates-data-and-tools-requirements-guide and will be fully documented here in the next release version."
},
"upgrade_type": {
"$anchor": "upgrade_type",
"title": "Upgrade type",
Expand Down
13 changes: 13 additions & 0 deletions json_schemas/electricBulkReportingPayload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"mf_num_bedrooms": {
"$ref": "/schemas/definitions#mf_num_bedrooms"
},
"num_occupied_units": {
"$ref": "/schemas/definitions#num_occupied_units"
},
"num_units": {
"$ref": "/schemas/definitions#num_units"
},
Expand Down Expand Up @@ -247,6 +250,11 @@
"mf_building_income_bucket"
]
},
{
"required": [
"num_occupied_units"
]
},
{
"required": [
"num_units_meeting_income_bucket"
Expand Down Expand Up @@ -285,6 +293,11 @@
"num_units"
]
},
{
"required": [
"num_occupied_units"
]
},
{
"required": [
"num_units_meeting_income_bucket"
Expand Down
56 changes: 54 additions & 2 deletions json_schemas/electricEligibleRebatesPayload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"mf_building_income_bucket": {
"$ref": "/schemas/definitions#electric_mf_building_income_bucket"
},
"num_occupied_units": {
"$ref": "/schemas/definitions#num_occupied_units"
},
"num_units": {
"$ref": "/schemas/definitions#num_units"
},
Expand Down Expand Up @@ -80,6 +83,7 @@
"then": {
"required": [
"mf_building_income_bucket",
"project_id",
"num_units",
"num_units_meeting_income_bucket",
"unit_name_or_number"
Expand All @@ -100,7 +104,26 @@
"dwelling_unit_income_bucket",
"num_units",
"unit_name_or_number"
]
],
"not": {
"anyOf": [
{
"required": [
"mf_building_income_bucket"
]
},
{
"required": [
"num_occupied_units"
]
},
{
"required": [
"num_units_meeting_income_bucket"
]
}
]
}
}
},
{
Expand All @@ -119,7 +142,36 @@
"then": {
"required": [
"dwelling_unit_income_bucket"
]
],
"not": {
"anyOf": [
{
"required": [
"mf_building_income_bucket"
]
},
{
"required": [
"num_occupied_units"
]
},
{
"required": [
"num_units"
]
},
{
"required": [
"num_units_meeting_income_bucket"
]
},
{
"required": [
"unit_name_or_number"
]
}
]
}
}
}
]
Expand Down
13 changes: 13 additions & 0 deletions json_schemas/electricReservationsPayload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"mf_num_bedrooms": {
"$ref": "/schemas/definitions#mf_num_bedrooms"
},
"num_occupied_units": {
"$ref": "/schemas/definitions#num_occupied_units"
},
"num_units": {
"$ref": "/schemas/definitions#num_units"
},
Expand Down Expand Up @@ -173,6 +176,11 @@
"mf_building_income_bucket"
]
},
{
"required": [
"num_occupied_units"
]
},
{
"required": [
"num_units_meeting_income_bucket"
Expand Down Expand Up @@ -206,6 +214,11 @@
"mf_building_income_bucket"
]
},
{
"required": [
"num_occupied_units"
]
},
{
"required": [
"num_units"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ira-rebates.labworks.org/schemas/electrificationVendorCouponRedemption",
"$ref": "/schemas/electrificationProductRedemptionDeletion"
"type": "object",
"properties": {
"vendor_coupon_id": {
"type": "string"
},
"vendor_id": {
"type": "string"
},
"deletion_reason": {
"type": "string"
}
},
"required": [
"vendor_coupon_id",
"vendor_id",
"deletion_reason"
],
"additionalProperties": false
}
32 changes: 28 additions & 4 deletions json_schemas/homesBulkReportingPayload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
"modeled_pre_retrofit_energy_usage_kwh_equivalent": {
"$ref": "/schemas/definitions#modeled_pre_retrofit_energy_usage_kwh_equivalent"
},
"num_occupied_units": {
"$ref": "/schemas/definitions#num_occupied_units"
},
"num_units": {
"$ref": "/schemas/definitions#num_units"
},
Expand Down Expand Up @@ -250,11 +253,27 @@
"then": {
"required": [
"dwelling_unit_income_bucket",
"mf_building_income_bucket",
"num_units",
"num_units_meeting_income_bucket",
"unit_name_or_number"
]
],
"not": {
"anyOf": [
{
"required": [
"mf_building_income_bucket"
]
},
{
"required": [
"num_units_meeting_income_bucket"
]
},
{
"required": [
"num_occupied_units"
]
}
]
}
}
},
{
Expand Down Expand Up @@ -312,6 +331,11 @@
"mf_building_income_bucket"
]
},
{
"required": [
"num_occupied_units"
]
},
{
"required": [
"num_units"
Expand Down
Loading