Skip to content

Commit

Permalink
Rename schemas directory
Browse files Browse the repository at this point in the history
  • Loading branch information
muratabur committed Jan 13, 2025
1 parent 59bed4b commit b1418c4
Show file tree
Hide file tree
Showing 22 changed files with 105 additions and 105 deletions.
22 changes: 11 additions & 11 deletions random_fire_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@


fire_schemas = [
"v1-dev/account.json",
"v1-dev/curve.json",
"v1-dev/customer.json",
"v1-dev/derivative.json",
"v1-dev/derivative_cash_flow.json",
"v1-dev/guarantor.json",
"v1-dev/issuer.json",
"v1-dev/loan.json",
"v1-dev/loan_transaction.json",
"v1-dev/security.json",
"schemas/account.json",
"schemas/curve.json",
"schemas/customer.json",
"schemas/derivative.json",
"schemas/derivative_cash_flow.json",
"schemas/guarantor.json",
"schemas/issuer.json",
"schemas/loan.json",
"schemas/loan_transaction.json",
"schemas/security.json",
]
WRITE_PATH = ""
fake = Faker()
Expand Down Expand Up @@ -114,7 +114,7 @@ def include_embedded_schema_properties(schema):
try:
for i in range(len(schema["allOf"])):
inherited_schema = schema["allOf"][i]["$ref"].split("/")[-1]
f = open("v1-dev/" + inherited_schema, "r")
f = open("schemas/" + inherited_schema, "r")
inherited_schema = json.load(f)
schema["properties"] = dict(
schema["properties"].items() + inherited_schema["properties"].items()
Expand Down
22 changes: 11 additions & 11 deletions schemas/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"monetary": true
},
"accounting_treatment":{
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/accounting_treatment"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/accounting_treatment"
},
"accrued_interest": {
"description": "The accrued interest since the last payment date and due at the next payment date. Monetary type represented as a naturally positive integer number of cents/pence.",
Expand All @@ -32,7 +32,7 @@
"monetary": true
},
"asset_liability": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/asset_liability"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/asset_liability"
},
"balance": {
"description": "The contractual balance on the date and in the currency given. Monetary type represented as a naturally positive integer number of cents/pence.",
Expand Down Expand Up @@ -89,7 +89,7 @@
]
},
"ccf": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/ccf"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/ccf"
},
"cost_center_code": {
"description": "The organizational unit or sub-unit to which costs/profits are booked.",
Expand All @@ -102,23 +102,23 @@
},
"country_code": {
"description": "Two-letter country code for account location/jurisdiction. In accordance with ISO 3166-1.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/country_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/country_code"
},
"cr_approach": {
"description": "Specifies the approved credit risk rwa calculation approach to be applied to the exposure.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/cr_approach"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/cr_approach"
},
"currency_code": {
"description": "Actual currency of the Account in accordance with ISO 4217 standards. It should be consistent with balance, accrued_interest, guarantee_amount and other monetary amounts.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"customer_id": {
"description": "The unique identifier used by the financial institution to identify the customer that owns the account.",
"type": "string"
},
"day_count_convention": {
"description": "The standardised methodology for calculating the number of days between two dates. It is used to calculate the amount of accrued interest or the present value.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/day_count_convention"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/day_count_convention"
},
"encumbrance_amount": {
"description": "The amount of the account that is encumbered by potential future commitments or legal liabilities. Monetary type represented as a naturally positive integer number of cents/pence.",
Expand Down Expand Up @@ -213,10 +213,10 @@
"format": "date-time"
},
"impairment_status": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/impairment_status"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/impairment_status"
},
"impairment_type": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/impairment_type"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/impairment_type"
},
"insolvency_rank": {
"description": "The insolvency ranking as per the national legal framework of the reporting institution.",
Expand Down Expand Up @@ -470,7 +470,7 @@
"enum": ["combined", "fixed", "preferential", "tracker", "variable"]
},
"regulatory_book": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/regulatory_book"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/regulatory_book"
},
"reporting_entity_name": {
"description": "The name of the reporting legal entity for display purposes.",
Expand All @@ -482,7 +482,7 @@
},
"risk_country_code": {
"description": "Two-letter country code describing where the risk for the account resides. In accordance with ISO 3166-1",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/country_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/country_code"
},
"risk_weight_std": {
"description": "The standardised approach risk weight represented as a decimal/float such that 1.5% is 0.015.",
Expand Down
2 changes: 1 addition & 1 deletion schemas/adjustment.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"currency_code": {
"description": "The currency of the contribution_amount in accordance with ISO 4217 standards.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"page": {
"description": "The page of the report that this adjustment relates to.",
Expand Down
4 changes: 2 additions & 2 deletions schemas/agreement.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"base_currency_code": {
"description": "Currency in accordance with ISO 4217. It should be consistent with minimum transfer amount and threshold.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"country_code": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/country_code",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/country_code",
"description": "The country code for the governing law of the agreement. Two-letter country code as defined according to ISO 3166-1."
},
"credit_support_type": {
Expand Down
22 changes: 11 additions & 11 deletions schemas/batch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"minItems": 1,
"items": {
"anyOf": [
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/account.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/collateral.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/customer.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/derivative.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/derivative_cash_flow.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/exchange_rate.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/guarantor.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/issuer.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/loan.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/loan_transaction.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/security.json#" }
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/account.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/collateral.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/customer.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/derivative.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/derivative_cash_flow.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/exchange_rate.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/guarantor.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/issuer.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/loan.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/loan_transaction.json#" },
{ "$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/security.json#" }
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions schemas/collateral.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"minimum": 0
},
"currency_code": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"encumbrance_amount": {
"description": "The amount of the collateral that is encumbered by potential future commitments or legal liabilities. Monetary type represented as a naturally positive integer number of cents/pence.",
Expand Down Expand Up @@ -66,7 +66,7 @@
"monetary": true
},
"regulatory_book": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/regulatory_book"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/regulatory_book"
},
"security_id": {
"description": "The unique identifier used by the financial institution to identify the security representing collateral.",
Expand Down
2 changes: 1 addition & 1 deletion schemas/curve.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"currency_code": {
"description": "The currency reference code in accordance with ISO 4217 standards.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"name": {
"description": "The internal name of the curve.",
Expand Down
2 changes: 1 addition & 1 deletion schemas/customer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Data schema to define a customer or legal entity related to a financial product or transaction.",
"type": "object",
"allOf": [{
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/entity.json"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/entity.json"
}],
"properties": {
"annual_debit_turnover": {
Expand Down
22 changes: 11 additions & 11 deletions schemas/derivative.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
"format": "date-time"
},
"accounting_treatment": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/accounting_treatment"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/accounting_treatment"
},
"accrued_interest": {
"description": "The accrued interest since the last payment date and due at the next payment date. Monetary type represented as a naturally positive integer number of cents/pence.",
"type": "integer",
"monetary": true
},
"asset_class": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/asset_class"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/asset_class"
},
"asset_liability": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/asset_liability"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/asset_liability"
},
"balance": {
"description": "Outstanding amount including accrued interest. Monetary type represented as a naturally positive integer number of cents/pence.",
Expand Down Expand Up @@ -70,19 +70,19 @@
},
"country_code": {
"description": "Two-letter country code for derivative location/jurisdiction. In accordance with ISO 3166-1.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/country_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/country_code"
},
"cr_approach": {
"description": "Specifies the approved credit risk rwa calculation approach to be applied to the exposure.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/cr_approach"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/cr_approach"
},
"csa_id": {
"description": "The unique identifier of the credit support annex for this derivative",
"type": "string"
},
"currency_code": {
"description": "Actual currency of the underlying reference index, security or asset for the derivative in accordance with ISO 4217 standards. It should be consistent with balance, accrued_interest, guarantee_amount and other monetary amounts.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"customer_id": {
"description": "The unique identifier used by the financial institution to identify the customer for this product.",
Expand Down Expand Up @@ -123,7 +123,7 @@
"monetary": true
},
"impairment_status": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/impairment_status"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/impairment_status"
},
"implied_vol": {
"description": "Options: implied volatility used to compute mtm and greeks.",
Expand Down Expand Up @@ -177,7 +177,7 @@
"maximum": 1.0
},
"mic_code": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/mic_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/mic_code"
},
"mna_id": {
"description": "The unique identifier of the Master Netting Agreement for this derivative",
Expand Down Expand Up @@ -271,7 +271,7 @@
"type": "number"
},
"regulatory_book": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/regulatory_book"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/regulatory_book"
},
"reporting_entity_name": {
"description": "The name of the reporting legal entity for display purposes.",
Expand All @@ -287,7 +287,7 @@
},
"risk_country_code": {
"description": "Two-letter country code describing where the risk for the derivative product resides. In accordance with ISO 3166-1",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/country_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/country_code"
},
"risk_weight_irb": {
"description": "The internal risk weight represented as a decimal/float such that 1.5% is 0.015.",
Expand Down Expand Up @@ -363,7 +363,7 @@
},
"underlying_currency_code": {
"description": "Currency of the underlying which should be in line with ISO 4217 standards.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"underlying_derivative_id": {
"description": "The unique identifier used by the financial institution to identify the underlying reference derivative for this derivative.",
Expand Down
8 changes: 4 additions & 4 deletions schemas/derivative_cash_flow.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"monetary": true
},
"asset_class": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/asset_class"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/asset_class"
},
"asset_liability": {
"description": "A derivative cash flow exchange that results in a net positive value after the transaction is an asset on the firm's balance sheet. A derivative cash flow exchange that results in a net negative value after the transaction is a liability on the firm's balance sheet.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/asset_liability"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/asset_liability"
},
"balance": {
"description": "The contractual balance due on the payment date in the currency given. Monetary type represented as a naturally positive integer number of cents/pence.",
Expand All @@ -36,7 +36,7 @@
},
"currency_code": {
"description": "Actual currency of the security in accordance with ISO 4217 standards. It should be consistent with balance, accrued_interest, guarantee_amount and other monetary amounts.",
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/currency_code"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/currency_code"
},
"customer_id": {
"description": "Counterparty to the cash flow",
Expand Down Expand Up @@ -97,7 +97,7 @@
]
},
"regulatory_book": {
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/v1-dev/common.json#/regulatory_book"
"$ref": "https://raw.githubusercontent.com/SuadeLabs/fire/master/schemas/common.json#/regulatory_book"
},
"reporting_entity_name": {
"description": "The name of the reporting legal entity for display purposes.",
Expand Down
Loading

0 comments on commit b1418c4

Please sign in to comment.