Fetch a single credit entry by its ID.
fn get_credit(env: soroban_sdk::Env, credit_id: u64) -> CreditEntry
Record a new credit (utang) extended by a store to a customer.
The store_owner must sign the transaction. Returns the auto-generated
credit_id for this entry.
TODO: add customer wallet support in future version (needed for USDC settlement)
fn create_credit(
env: soroban_sdk::Env,
store_owner: soroban_sdk::Address,
store_id: soroban_sdk::String,
customer_id: soroban_sdk::String,
amount: i128,
due_date: u64,
) -> u64
Record a payment proof against an existing credit.
The original store_owner who created the credit must sign.
This is a ledger-only operation — it tracks the payment on-chain
without moving any tokens.
Returns true when the credit is fully settled, false otherwise.
TODO: add USDC transfer_from once customer wallet approval flow exists
fn record_payment(env: soroban_sdk::Env, credit_id: u64, amount: i128) -> bool
Get the total outstanding balance for a customer across all their credits.
Returns 0 if the customer has no credits on record.
fn get_customer_balance(
env: soroban_sdk::Env,
customer_id: soroban_sdk::String,
) -> i128