object models.TransactionCategory
{
  "type": "object",
  "properties": {
    "amount": {
      "type": "number",
      "description": "The monetary value of a transaction. This is always a positive value."
    },
    "bank_id": {
      "type": "string",
      "description": "The name of the bank that is originating the transaction. For credit cards, this is the issuing bank."
    },
    "user_id": {
      "type": "string",
      "description": "A unique identifier for the user within the bank or institution."
    },
    "currency": {
      "type": "string",
      "description": "Currency enum based on ISO 4217. Eg: BRL, USD, MXN."
    },
    "account_id": {
      "type": "string",
      "description": "A unique identifier for the account within the bank or institution."
    },
    "description": {
      "type": "string",
      "description": "The raw text description of the transaction (do not clean or transform this).\nIt usually includes some information about the payment method, processor,\nmerchant, and in cases of transfer might include CNPJ or other reference numbers.\nSome examples:\n   - Pag*Mariaivaneidede\n   - Ifd*Puro Acai Beira Ma\n   - TED BCO 1 AGE 4598  CTA 291412  - RETIRADA EM C/C"
    },
    "account_type": {
      "type": "string",
      "description": "One of the following: checking, saving, credit card or investment."
    },
    "location_city": {
      "type": "string",
      "description": "The city in which the transaction happened. e.g. São Paulo, Mexico City, San Francisco."
    },
    "location_state": {
      "type": "string",
      "description": "The state in which the transaction happened. Eg: SP, CA."
    },
    "transaction_id": {
      "type": "string",
      "description": "A unique identifier for each transaction to identify the transaction within your bank or institution."
    },
    "location_country": {
      "type": "string",
      "description": "The country in which the transaction happened in ISO 3166-1 alpha-3 format. e.g. BRA (for transaction in Brazil), ESP (for transaction in Spain)."
    },
    "transaction_flow": {
      "type": "string",
      "description": "One of the following options: outflow (for spending) or inflow (for earning)."
    },
    "category_metadata": {
      "$ref": "#/components/schemas/models.CategoryMetadata"
    },
    "transaction_datetime": {
      "type": "string",
      "description": "Time when the transaction was performed."
    },
    "transaction_metadata": {
      "$ref": "#/components/schemas/models.TransactionMetadata"
    }
  },
  "x-konfig-properties": {
    "category_metadata": {
      "description": "Predicted category and the confidence of the prediction"
    },
    "transaction_metadata": {
      "description": "A map used to store additional context about a transaction that might be useful for cleaning and understanding."
    }
  }
}
object models.TransactionEnrichmentResponse
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "description": "Date of transaction"
    },
    "amount": {
      "type": "number",
      "description": "Amount of transaction"
    },
    "category": {
      "type": "string",
      "description": "Category enum of transaction"
    },
    "currency": {
      "type": "string",
      "description": "Transaction currency"
    },
    "description": {
      "type": "string",
      "description": "Transaction description"
    },
    "category_name": {
      "type": "string",
      "description": "Category human-readable name of transaction"
    },
    "merchant_info": {
      "$ref": "#/components/schemas/models.MerchantInfo"
    },
    "transaction_id": {
      "type": "string",
      "description": "Unique transaction id"
    },
    "transfer_metadata": {
      "$ref": "#/components/schemas/models.TransferMetadata"
    },
    "transaction_status": {
      "type": "string",
      "description": "Transaction status"
    },
    "current_installment": {
      "type": "integer",
      "description": "Current installment. If 0, it is not an installment"
    },
    "transaction_location": {
      "$ref": "#/components/schemas/models.Location"
    },
    "installment_start_date": {
      "type": "string",
      "description": "First installment date, that is, the purchase date"
    },
    "number_of_installments": {
      "type": "integer",
      "description": "Number of installments"
    },
    "total_installed_amount": {
      "type": "number",
      "description": "Sum of amounts for all installments"
    }
  },
  "x-konfig-properties": {
    "merchant_info": {
      "description": "Contains metadata about the merchant, if available."
    },
    "transfer_metadata": {
      "description": "Contains metadata about the payment method, the sender, and the receiver."
    },
    "transaction_location": {
      "description": "Location where the transaction happened"
    }
  }
}
object models.TransactionEnrichmentStatisticsResponse
{
  "type": "object",
  "required": [
    "transaction_count",
    "user_reach"
  ],
  "properties": {
    "user_reach": {
      "type": "integer",
      "example": 1000,
      "description": "Number of distinct users in the module"
    },
    "transaction_count": {
      "type": "integer",
      "example": 10000,
      "description": "Number of transactions in the module"
    }
  },
  "description": "General statistics for a given transaction enrichment module"
}
object models.TransactionEnrichmentUser
{
  "type": "object",
  "required": [
    "first_transaction_date",
    "last_transaction_date",
    "user_id"
  ],
  "properties": {
    "user_id": {
      "type": "string",
      "example": "123456",
      "description": "Unique user identifier"
    },
    "last_transaction_date": {
      "type": "string",
      "example": "2020-01-01T00:00:00Z",
      "description": "Date for last transaction registered for a given user."
    },
    "first_transaction_date": {
      "type": "string",
      "example": "2020-01-01T00:00:00Z",
      "description": "Date for first transaction registered for a given user."
    }
  }
}
object models.TransactionEnrichmentUsersResponse
{
  "type": "object",
  "required": [
    "pagination_metadata",
    "users"
  ],
  "properties": {
    "users": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/models.TransactionEnrichmentUser"
      },
      "description": "List of users related to the transactions"
    },
    "pagination_metadata": {
      "$ref": "#/components/schemas/models.PaginationMetadata"
    }
  },
  "description": "Page of users of a given module",
  "x-konfig-properties": {
    "pagination_metadata": {
      "description": "Pagination metadata needed to know the next call"
    }
  }
}
object models.TransactionMetadata
{
  "type": "object",
  "properties": {
    "mcc": {
      "type": "integer",
      "description": "MCC code for the merchant."
    },
    "account_balance": {
      "type": "number",
      "description": "Current account balance after this transaction."
    },
    "location_latitude": {
      "type": "number",
      "description": "A number between [“-90.0”, “90.0”] indicating the latitude of the location where the transaction happened."
    },
    "location_longitude": {
      "type": "number",
      "description": "A number between [“-180.0”, “180.0”] indicating the longitude of the location where the transaction happened."
    },
    "transaction_status": {
      "type": "string",
      "description": "Example: “Approved”, “Pending”, “Rejected”, “Rejected - Fraud”, …"
    },
    "current_installment": {
      "type": "integer",
      "description": "What installment this payment corresponds to."
    },
    "transfer_sender_name": {
      "type": "string",
      "description": "The name of the entity sending the money. e.g. “João da Silva”, “Padaria São João”."
    },
    "number_of_installments": {
      "type": "integer",
      "description": "How many installments will this purchase be payed off in."
    },
    "transfer_receiver_name": {
      "type": "string",
      "description": "The name of the entity receiving the money. e.g. “João da Silva”, “Padaria São João”."
    },
    "transfer_payment_method": {
      "type": "string",
      "description": "The method used for the transfer. Eg: “DOC”, “TED”, “PIX”"
    },
    "transfer_reference_number": {
      "type": "string",
      "description": "A control number used to uniquely identify a transfer."
    },
    "transfer_sender_document_name": {
      "type": "string",
      "description": "The name of the document used by the sender to issue the transfer. e.g. “CPF”, “CNPJ”."
    },
    "transfer_receiver_document_name": {
      "type": "string",
      "description": "The name of the document that identifies the entity receiving the transfer. e.g. “CPF”, “CNPJ”."
    },
    "transfer_sender_document_number": {
      "type": "string",
      "description": "A document number identifying the sender of the transfer (e.g. CPF, CNPJ)."
    },
    "transfer_receiver_document_number": {
      "type": "string",
      "description": "A document number identifying the receiver of the transfer (e.g. CPF, CNPJ)."
    }
  }
}
object models.TransferMetadata
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "description": "Transfer inferred reason"
    },
    "sender": {
      "$ref": "#/components/schemas/models.TransferParty"
    },
    "receiver": {
      "$ref": "#/components/schemas/models.TransferParty"
    },
    "payment_method": {
      "type": "string",
      "description": "Transfer payment method"
    },
    "reference_number": {
      "type": "string",
      "description": "Transfer reference number"
    }
  },
  "description": "Metadata related to the money transfer and involved parties",
  "x-konfig-properties": {
    "sender": {
      "description": "Transfer party that sends the money"
    },
    "receiver": {
      "description": "Transfer party that receives the money"
    }
  }
}
object models.TransferParty
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Party name"
    },
    "branch_number": {
      "type": "string",
      "description": "Party branch number"
    },
    "document_name": {
      "type": "string",
      "description": "Party document name"
    },
    "account_number": {
      "type": "string",
      "description": "Party account number"
    },
    "routing_number": {
      "type": "string",
      "description": "Party routing number"
    },
    "document_number": {
      "type": "string",
      "description": "Party document number"
    },
    "routing_number_ISPB": {
      "type": "string",
      "description": "Party ISPB routing number"
    }
  },
  "description": "Attributes related to the sender or receiver of a given transaction"
}
object models.UserCashflowHistoryResponse
{
  "type": "object",
  "required": [
    "user_id",
    "windows"
  ],
  "properties": {
    "user_id": {
      "type": "string",
      "example": "123456",
      "description": "User identifier"
    },
    "windows": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/models.CashflowWindowStatistics"
      },
      "description": "Windows with calculated flows"
    }
  },
  "description": "Historic of cashflows for a given user"
}
object models.UserCashflowPerCategoryResponse
{
  "type": "object",
  "properties": {
    "user_id": {
      "type": "string",
      "description": "User identifier"
    },
    "inflow_categories": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/models.TopLevelCategoryCashflow"
      },
      "description": "Inflow discriminated by category"
    },
    "outflow_categories": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/models.TopLevelCategoryCashflow"
      },
      "description": "Outflow discriminated by category"
    }
  }
}
object models.UserMetadata
{
  "type": "object",
  "required": [
    "user_id"
  ],
  "properties": {
    "user_id": {
      "type": "string",
      "description": "UserID is the unique identifier for the user"
    }
  }
}
object models.UserPersonaScore
{
  "type": "object",
  "required": [
    "persona_id",
    "persona_name"
  ],
  "properties": {
    "persona_id": {
      "type": "string",
      "example": "1",
      "description": "Unique identifier for the persona"
    },
    "persona_name": {
      "type": "string",
      "example": "Young Professional",
      "description": "Name of the persona"
    },
    "persona_score": {
      "type": "number",
      "example": 0.5,
      "description": "Relevance score of user in this persona. In range `[0,1]`"
    }
  },
  "description": "User associated with a given persona"
}
object models.UserPersonasResponse
{
  "type": "object",
  "required": [
    "persona_scores",
    "user_id"
  ],
  "properties": {
    "user_id": {
      "type": "string",
      "example": "1",
      "description": "Unique identifier for the user"
    },
    "persona_scores": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/models.UserPersonaScore"
      },
      "description": "Ranked list of personas for this user"
    }
  },
  "description": "Response of personas linked to a given user"
}
object models.UserScore
{
  "type": "object",
  "required": [
    "score",
    "user_id"
  ],
  "properties": {
    "score": {
      "type": "number",
      "description": "Model inference score for the user"
    },
    "user_id": {
      "type": "string",
      "description": "UserID is the unique identifier for the user"
    }
  }
}
object models.UserTransactionsResponse
{
  "type": "object",
  "required": [
    "enriched_transactions",
    "pagination_metadata",
    "user_id"
  ],
  "properties": {
    "user_id": {
      "type": "string",
      "example": "123456",
      "description": "User identifier"
    },
    "pagination_metadata": {
      "$ref": "#/components/schemas/models.PaginationMetadata"
    },
    "enriched_transactions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/models.TransactionEnrichmentResponse"
      },
      "description": "List of enriched transactions"
    }
  },
  "description": "Historic of enriched transactions of a given user",
  "x-konfig-properties": {
    "pagination_metadata": {
      "description": "Pagination metadata needed to know the next call"
    }
  }
}
object models.UserTransactionsStatisticsResponse
{
  "type": "object",
  "required": [
    "transaction_count"
  ],
  "properties": {
    "transaction_count": {
      "type": "integer",
      "example": 100,
      "description": "Number of transactions"
    },
    "median_transaction_value": {
      "type": "number",
      "example": 100,
      "description": "Median transaction value"
    },
    "average_transaction_value": {
      "type": "number",
      "example": 100,
      "description": "Average transaction value"
    }
  },
  "description": "Transaction statistics for a given user"
}