{"openapi":"3.0.0","paths":{"/":{"get":{"operationId":"AppController_getHello","parameters":[],"responses":{"200":{"description":""}}}},"/tables/{orgId}":{"post":{"operationId":"TablesController_createCustomTable","summary":"Create a custom table for an organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTableDto"}}}},"responses":{"201":{"description":"Custom table created successfully"}},"tags":["Custom Tables"]},"get":{"operationId":"TablesController_listTables","summary":"List tables","description":"Lists all tables for the given organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Tables listed successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}},"tags":["Custom Tables"]}},"/tables/{orgId}/{tableName}/schema":{"get":{"operationId":"TablesController_getTableSchema","summary":"Get schema for a custom table","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}},{"name":"tableName","required":true,"in":"path","description":"Name of the table","schema":{"type":"string"}}],"responses":{"200":{"description":"Table schema retrieved successfully"}},"tags":["Custom Tables"]}},"/tables/{orgId}/{tableName}":{"delete":{"operationId":"TablesController_dropTable","summary":"Drop custom table","description":"Drops a custom table for the given organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}},{"name":"tableName","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Custom Tables"]}},"/tables/{orgId}/{tableName}/data":{"put":{"operationId":"TablesController_bulkInsertData","summary":"Bulk insert data into a custom table","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}},{"name":"tableName","required":true,"in":"path","description":"Name of the table","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"responses":{"200":{"description":"Data inserted successfully"}},"tags":["Custom Tables"]},"get":{"operationId":"TablesController_getTableData","summary":"Get data from a custom table with pagination","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}},{"name":"tableName","required":true,"in":"path","description":"Name of the table","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of records to return","schema":{"type":"number"}},{"name":"offset","required":false,"in":"query","description":"Number of records to skip","schema":{"type":"number"}}],"responses":{"200":{"description":"Table data retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["Custom Tables"]}},"/tables/{orgId}/{tableName}/data/{id}":{"patch":{"operationId":"TablesController_updateTableData","summary":"Update data in a custom table","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}},{"name":"tableName","required":true,"in":"path","description":"Name of the table","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"ID of the record to update","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Data to update in the record"}}}},"responses":{"200":{"description":"Data updated successfully"}},"tags":["Custom Tables"]}},"/rules/{orgId}":{"get":{"operationId":"RulesController_getRules","summary":"Get all rules for an organization","description":"Retrieves all rules associated with the specified organization ID","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"example":"org-123","type":"string"}}],"responses":{"200":{"description":"List of rules successfully retrieved","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDto"}}}}},"404":{"description":"Organization not found"}},"tags":["Rules"]},"post":{"operationId":"RulesController_registerRule","summary":"Register new rule","description":"Creates a new rule for the specified organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"example":"org-123","type":"string"}}],"requestBody":{"required":true,"description":"Rule configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDto"}}}},"responses":{"201":{"description":"Rule successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Invalid rule configuration"}},"tags":["Rules"]}},"/rules/{orgId}/{ruleId}":{"put":{"operationId":"RulesController_updateRule","summary":"Update existing rule","description":"Updates an existing rule for the specified organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"example":"org-123","type":"string"}},{"name":"ruleId","required":true,"in":"path","description":"Rule ID","schema":{"example":"rule-123","type":"string"}}],"requestBody":{"required":true,"description":"Updated rule configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDto"}}}},"responses":{"200":{"description":"Rule successfully updated"}},"tags":["Rules"]},"get":{"operationId":"RulesController_getRuleById","summary":"Get specific rule by ID","description":"Retrieves a specific rule by its ID for the given organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"example":"org-123","type":"string"}},{"name":"ruleId","required":true,"in":"path","description":"Rule ID","schema":{"example":"rule-123","type":"string"}}],"responses":{"200":{"description":"Rule successfully retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDto"}}}}},"tags":["Rules"]},"delete":{"operationId":"RulesController_deleteRule","summary":"Delete a rule","description":"Deletes a specific rule for the given organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"example":"org-123","type":"string"}},{"name":"ruleId","required":true,"in":"path","description":"Rule ID","schema":{"example":"rule-123","type":"string"}}],"responses":{"200":{"description":"Rule successfully deleted"},"404":{"description":"Rule not found"}},"tags":["Rules"]}},"/rules/{orgId}/{ruleId}/sql-preview":{"post":{"operationId":"RulesController_previewEvaluationSql","summary":"Preview final evaluation SQL","description":"Builds the final evaluation-time SQL for each evaluation in the specified rule. Optionally filter for a single evaluation by name.","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"example":"org-123","type":"string"}},{"name":"ruleId","required":true,"in":"path","description":"Rule ID","schema":{"example":"rule-123","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationSqlPreviewRequestDto"}}}},"responses":{"200":{"description":"SQL previews successfully generated"}},"tags":["Rules"]}},"/fields/{orgId}":{"post":{"operationId":"FieldsController_registerCustomField","summary":"Register a custom field","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldDto"}}}},"responses":{"201":{"description":"Custom field registered successfully"}},"tags":["Custom Fields"]},"get":{"operationId":"FieldsController_listFields","summary":"List custom fields","description":"Retrieves all custom fields for the given organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Custom fields retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldDto"}}}}}},"tags":["Custom Fields"]}},"/fields/{orgId}/{fieldName}":{"get":{"operationId":"FieldsController_getField","summary":"Get custom field","description":"Retrieves a specific custom field by name for the given organization","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}},{"name":"fieldName","required":true,"in":"path","description":"Field name","schema":{"type":"string"}}],"responses":{"200":{"description":"Custom field retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldDto"}}}}},"tags":["Custom Fields"]}},"/transaction/{orgId}":{"post":{"operationId":"TransactionsController_saveTransaction","summary":"Process a transaction with optional rule filtering","parameters":[{"name":"orgId","required":true,"in":"path","description":"Organization ID","schema":{"type":"string"}},{"name":"ruleIds","required":true,"in":"query","schema":{"type":"string"}},{"name":"ruleIds[]","required":false,"in":"query","description":"Comma-separated list of rule IDs to apply","schema":{"example":"rule1,rule2,rule3"}}],"requestBody":{"required":true,"description":"Transaction data to process","content":{"application/json":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Transaction processed successfully"}},"tags":["Transactions"]}}},"info":{"title":"Loci API","description":"Well..., what can I say?","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"ColumnDefinitionDto":{"type":"object","properties":{"name":{"type":"string","description":"Column name","example":"user_id"},"columnType":{"type":"string","description":"Column data type","example":"INTEGER"}},"required":["name","columnType"]},"CreateTableDto":{"type":"object","properties":{"tableName":{"type":"string","description":"Table name","example":"users"},"tableType":{"type":"string","description":"Table type declaration","example":"entity_state","enum":["entity_state","event_stream","reference_list"]},"columns":{"description":"Table columns","example":[{"name":"user_id","columnType":"INTEGER"},{"name":"username","columnType":"TEXT"}],"type":"array","items":{"$ref":"#/components/schemas/ColumnDefinitionDto"}}},"required":["tableName","tableType","columns"]},"EvaluationDto":{"type":"object","properties":{"name":{"type":"string","description":"Name of the evaluation"},"operations":{"description":"Operations to be performed","items":{"type":"array"},"type":"array"},"weight":{"type":"number","description":"Weight of the evaluation"},"description":{"type":"string","description":"Description of the evaluation"}},"required":["name","operations","weight","description"]},"ActionDto":{"type":"object","properties":{"type":{"type":"string","description":"Type of action to be performed","example":"notification"},"description":{"type":"string","description":"Detailed description of the action","example":"Send email notification to admin"}},"required":["type","description"]},"RuleDto":{"type":"object","properties":{"name":{"type":"string","description":"Name of the rule","example":"High Value Transaction Rule"},"description":{"type":"string","description":"Detailed description of the rule","example":"Identifies and processes high value transactions"},"threshold":{"type":"number","description":"Threshold value for rule activation","example":0.75},"useAi":{"type":"boolean","description":"Flag to enable AI-powered evaluation","example":true},"active":{"type":"boolean","description":"Flag to indicate if the rule is currently active","example":true},"evaluations":{"description":"List of evaluations to be performed","type":"array","items":{"$ref":"#/components/schemas/EvaluationDto"}},"actions":{"description":"List of actions to be taken when rule is triggered","type":"array","items":{"$ref":"#/components/schemas/ActionDto"}}},"required":["name","description","threshold","useAi","active","evaluations","actions"]},"ApiResponse":{"type":"object","properties":{}},"EvaluationSqlPreviewRequestDto":{"type":"object","properties":{"entityId":{"type":"string","description":"Entity ID used for scoping SQL generation"},"transaction":{"type":"object","description":"Current transaction object that would be evaluated"},"evaluationName":{"type":"string","description":"Optional evaluation name to filter preview to a single evaluation"}},"required":["entityId","transaction"]},"CustomFieldDto":{"type":"object","properties":{"name":{"type":"string"},"fieldType":{"type":"string","enum":["Text","Integer","Float","Boolean","Date","Timestamp"]}},"required":["name","fieldType"]}}}}