feat(router): Added amount conversion function in core for connector module (#4710)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
This commit is contained in:
Sahkal Poddar
2024-05-30 19:21:33 +05:30
committed by GitHub
parent f7e99e1eda
commit 08eefdba4a
30 changed files with 577 additions and 150 deletions

View File

@ -11,6 +11,7 @@ use crate::types::MinorUnit;
pub type CustomResult<T, E> = error_stack::Result<T, E>;
/// Parsing Errors
#[allow(missing_docs)] // Only to prevent warnings about struct fields not being documented
#[derive(Debug, thiserror::Error)]
pub enum ParsingError {
///Failed to parse enum
@ -34,6 +35,21 @@ pub enum ParsingError {
/// Failed to parse phone number
#[error("Failed to parse phone number")]
PhoneNumberParsingError,
/// Failed to parse Float value for converting to decimal points
#[error("Failed to parse Float value for converting to decimal points")]
FloatToDecimalConversionFailure,
/// Failed to parse Decimal value for i64 value conversion
#[error("Failed to parse Decimal value for i64 value conversion")]
DecimalToI64ConversionFailure,
/// Failed to parse string value for f64 value conversion
#[error("Failed to parse string value for f64 value conversion")]
StringToFloatConversionFailure,
/// Failed to parse i64 value for f64 value conversion
#[error("Failed to parse i64 value for f64 value conversion")]
I64ToDecimalConversionFailure,
/// Failed to parse String value to Decimal value conversion because `error`
#[error("Failed to parse String value to Decimal value conversion because {error}")]
StringToDecimalConversionFailure { error: String },
}
/// Validation errors.