paginated all data

This commit is contained in:
Azeez Muibi
2025-04-21 23:40:15 +01:00
parent 678aab5200
commit 90b54d86a4
11 changed files with 582 additions and 348 deletions
+9
View File
@@ -17,14 +17,23 @@
{
"url": "http://localhost:4300"
},
{
"url": "http://localhost:4700"
},
{
"url": "http://www.simbrellang.net:4300"
},
{
"url": "http://www.simbrellang.net:4700"
},
{
"url": "http://www.simbrellang.net:14700"
},
{
"url" : "http://10.10.11.17:4300"
},
{
"url" : "http://10.10.11.17:4700"
}
],
"tags": [
+143 -120
View File
@@ -1,124 +1,147 @@
{
"get": {
"tags": [
"Loans"
],
"summary": "Get all loans with optional filtering",
"description": "Retrieve loans with various filter options including customer ID, account ID, status, etc.",
"operationId": "getLoans",
"parameters": [
{
"name": "customer_id",
"in": "query",
"description": "Filter by customer ID",
"required": false,
"schema": {
"type": "string"
},
"example": "CUST123"
},
{
"name": "account_id",
"in": "query",
"description": "Filter by account ID",
"required": false,
"schema": {
"type": "string"
},
"example": "ACC456"
},
{
"name": "status",
"in": "query",
"description": "Filter by loan status",
"required": false,
"schema": {
"type": "string"
},
"example": "active"
},
{
"name": "offer_id",
"in": "query",
"description": "Filter by offer ID",
"required": false,
"schema": {
"type": "string"
},
"example": "OFFER789"
},
{
"name": "product_id",
"in": "query",
"description": "Filter by product ID",
"required": false,
"schema": {
"type": "string"
},
"example": "PROD101"
},
{
"name": "start_date",
"in": "query",
"description": "Filter by start date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-01-01T00:00:00Z"
},
{
"name": "end_date",
"in": "query",
"description": "Filter by end date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-12-31T23:59:59Z"
},
{
"name": "due_before",
"in": "query",
"description": "Filter loans due before this date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-12-31T23:59:59Z"
},
{
"name": "due_after",
"in": "query",
"description": "Filter loans due after this date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-01-01T00:00:00Z"
}
],
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "../schemas/LoansResponse.json"
}
}
}
},
"400": {
"description": "Invalid request"
},
"500": {
"description": "Internal server error"
"get": {
"tags": ["Loans"],
"summary": "Get all loans with optional filtering",
"description": "Retrieve loans with various filter options including customer ID, account ID, status, etc.",
"operationId": "getLoans",
"parameters": [
{
"name": "customer_id",
"in": "query",
"description": "Filter by customer ID",
"required": false,
"schema": {
"type": "string"
},
"example": "CUST123"
},
{
"name": "account_id",
"in": "query",
"description": "Filter by account ID",
"required": false,
"schema": {
"type": "string"
},
"example": "ACC456"
},
{
"name": "status",
"in": "query",
"description": "Filter by loan status",
"required": false,
"schema": {
"type": "string"
},
"example": "active"
},
{
"name": "offer_id",
"in": "query",
"description": "Filter by offer ID",
"required": false,
"schema": {
"type": "string"
},
"example": "OFFER789"
},
{
"name": "product_id",
"in": "query",
"description": "Filter by product ID",
"required": false,
"schema": {
"type": "string"
},
"example": "PROD101"
},
{
"name": "start_date",
"in": "query",
"description": "Filter by start date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-01-01T00:00:00Z"
},
{
"name": "end_date",
"in": "query",
"description": "Filter by end date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-12-31T23:59:59Z"
},
{
"name": "due_before",
"in": "query",
"description": "Filter loans due before this date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-12-31T23:59:59Z"
},
{
"name": "due_after",
"in": "query",
"description": "Filter loans due after this date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-01-01T00:00:00Z"
},
{
"name": "page",
"in": "query",
"description": "Page number for pagination",
"required": false,
"schema": {
"type": "integer",
"default": 1,
"minimum": 1
},
"example": 1
},
{
"name": "limit",
"in": "query",
"description": "Number of items per page (max 100)",
"required": false,
"schema": {
"type": "integer",
"default": 20,
"minimum": 1,
"maximum": 100
},
"example": 20
}
],
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "../schemas/LoansResponse.json"
}
}
}
},
"400": {
"description": "Invalid request"
},
"500": {
"description": "Internal server error"
}
}
}
}
}
+101 -78
View File
@@ -1,82 +1,105 @@
{
"get": {
"tags": [
"Transactions"
],
"summary": "Get all transactions with optional filtering",
"description": "Retrieve transactions with various filter options including account ID, type, channel, etc.",
"operationId": "getTransactions",
"parameters": [
{
"name": "account_id",
"in": "query",
"description": "Filter by account ID",
"required": false,
"schema": {
"type": "string"
},
"example": "ACC456"
},
{
"name": "type",
"in": "query",
"description": "Filter by transaction type",
"required": false,
"schema": {
"type": "string"
},
"example": "PAYMENT"
},
{
"name": "channel",
"in": "query",
"description": "Filter by channel",
"required": false,
"schema": {
"type": "string"
},
"example": "MOBILE"
},
{
"name": "start_date",
"in": "query",
"description": "Filter by start date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-01-01T00:00:00Z"
},
{
"name": "end_date",
"in": "query",
"description": "Filter by end date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-12-31T23:59:59Z"
}
],
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "../schemas/TransactionsResponse.json"
}
}
}
},
"400": {
"description": "Invalid request"
},
"500": {
"description": "Internal server error"
"get": {
"tags": ["Transactions"],
"summary": "Get all transactions with optional filtering",
"description": "Retrieve transactions with various filter options including account ID, type, channel, etc.",
"operationId": "getTransactions",
"parameters": [
{
"name": "account_id",
"in": "query",
"description": "Filter by account ID",
"required": false,
"schema": {
"type": "string"
},
"example": "ACC456"
},
{
"name": "type",
"in": "query",
"description": "Filter by transaction type",
"required": false,
"schema": {
"type": "string"
},
"example": "PAYMENT"
},
{
"name": "channel",
"in": "query",
"description": "Filter by channel",
"required": false,
"schema": {
"type": "string"
},
"example": "MOBILE"
},
{
"name": "start_date",
"in": "query",
"description": "Filter by start date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-01-01T00:00:00Z"
},
{
"name": "end_date",
"in": "query",
"description": "Filter by end date (ISO format)",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2023-12-31T23:59:59Z"
},
{
"name": "page",
"in": "query",
"description": "Page number for pagination",
"required": false,
"schema": {
"type": "integer",
"default": 1,
"minimum": 1
},
"example": 1
},
{
"name": "limit",
"in": "query",
"description": "Number of items per page (max 100)",
"required": false,
"schema": {
"type": "integer",
"default": 20,
"minimum": 1,
"maximum": 100
},
"example": 20
}
],
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "../schemas/TransactionsResponse.json"
}
}
}
},
"400": {
"description": "Invalid request"
},
"500": {
"description": "Internal server error"
}
}
}
}
}
+102 -73
View File
@@ -1,79 +1,108 @@
{
"type": "object",
"properties": {
"loans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"customer_id": {
"type": "string",
"example": "CUST123"
},
"account_id": {
"type": "string",
"example": "ACC456"
},
"offer_id": {
"type": "string",
"example": "OFFER789"
},
"initial_loan_amount": {
"type": "number",
"format": "float",
"example": 10000.0
},
"current_loan_amount": {
"type": "number",
"format": "float",
"example": 8500.0
},
"status": {
"type": "string",
"example": "active"
},
"product_id": {
"type": "string",
"example": "PROD101"
},
"default_penalty_fee": {
"type": "number",
"format": "float",
"example": 500.0
},
"continuous_fee": {
"type": "number",
"format": "float",
"example": 50.0
},
"due_date": {
"type": "string",
"format": "date-time",
"example": "2023-12-31T23:59:59Z"
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-15T10:30:00Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-20T14:45:00Z"
}
}
}
},
"count": {
"type": "object",
"properties": {
"loans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"customer_id": {
"type": "string",
"example": "CUST123"
},
"account_id": {
"type": "string",
"example": "ACC456"
},
"offer_id": {
"type": "string",
"example": "OFFER789"
},
"initial_loan_amount": {
"type": "number",
"format": "float",
"example": 10000.0
},
"current_loan_amount": {
"type": "number",
"format": "float",
"example": 8500.0
},
"status": {
"type": "string",
"example": "active"
},
"product_id": {
"type": "string",
"example": "PROD101"
},
"default_penalty_fee": {
"type": "number",
"format": "float",
"example": 500.0
},
"continuous_fee": {
"type": "number",
"format": "float",
"example": 50.0
},
"due_date": {
"type": "string",
"format": "date-time",
"example": "2023-12-31T23:59:59Z"
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-15T10:30:00Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-20T14:45:00Z"
}
}
}
},
"xml": {
"name": "LoansResponse"
"count": {
"type": "integer",
"example": 1
},
"pagination": {
"type": "object",
"properties": {
"total_count": {
"type": "integer",
"example": 100
},
"total_pages": {
"type": "integer",
"example": 5
},
"current_page": {
"type": "integer",
"example": 1
},
"limit": {
"type": "integer",
"example": 20
},
"has_next": {
"type": "boolean",
"example": true
},
"has_prev": {
"type": "boolean",
"example": false
}
}
}
}
},
"xml": {
"name": "LoansResponse"
}
}
+73 -44
View File
@@ -1,50 +1,79 @@
{
"type": "object",
"properties": {
"transactions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"transaction_id": {
"type": "string",
"example": "TRX123456"
},
"account_id": {
"type": "string",
"example": "ACC456"
},
"type": {
"type": "string",
"example": "PAYMENT"
},
"channel": {
"type": "string",
"example": "MOBILE"
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-15T10:30:00Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-15T10:30:00Z"
}
}
}
},
"count": {
"type": "object",
"properties": {
"transactions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"transaction_id": {
"type": "string",
"example": "TRX123456"
},
"account_id": {
"type": "string",
"example": "ACC456"
},
"type": {
"type": "string",
"example": "PAYMENT"
},
"channel": {
"type": "string",
"example": "MOBILE"
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-15T10:30:00Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2023-01-15T10:30:00Z"
}
}
}
},
"xml": {
"name": "TransactionsResponse"
"count": {
"type": "integer",
"example": 1
},
"pagination": {
"type": "object",
"properties": {
"total_count": {
"type": "integer",
"example": 100
},
"total_pages": {
"type": "integer",
"example": 5
},
"current_page": {
"type": "integer",
"example": 1
},
"limit": {
"type": "integer",
"example": 20
},
"has_next": {
"type": "boolean",
"example": true
},
"has_prev": {
"type": "boolean",
"example": false
}
}
}
}
},
"xml": {
"name": "TransactionsResponse"
}
}