librsigstopup 0.1.0

Super safe library untuk simulasi perhitungan top-up dengan JSON API, verbose logging, dan full trace
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DiscountCalculator;
impl DiscountCalculator {
    pub fn apply(total: Decimal, diskon: Decimal) -> Decimal {
        tracing::debug!(
            event = "apply_discount",
            total = %total,
            diskon = %diskon,
            "Applying discount"
        );
        total + diskon
    }
}