import gleam/dynamic/decode.{type Decoder} import gleam/time/timestamp.{type Timestamp} import spacetraders_sdk/internal/time pub type ShipFuelConsumed { ShipFuelConsumed(amount: Int, timestamp: Timestamp) } pub fn decoder() -> Decoder(ShipFuelConsumed) { use amount <- decode.field("amount", decode.int) use timestamp <- decode.field("timestamp", time.rfc3339_timestamp_decoder()) decode.success(ShipFuelConsumed(amount:, timestamp:)) }