@@ -1085,6 +1085,14 @@ impl BillPayments {
10851085 Ok ( ( ) )
10861086 }
10871087
1088+ /// @notice Archive paid bills with `paid_at < before_timestamp`.
1089+ /// @dev Permissionless maintenance operation. Caller must authenticate, but does not need to
1090+ /// own each archived bill. Only paid bills with a historical payment timestamp are moved from
1091+ /// active storage into archival storage.
1092+ /// @param caller Authenticated caller executing archive maintenance.
1093+ /// @param before_timestamp Exclusive upper bound for `paid_at`.
1094+ /// @return Number of bills archived in this call.
1095+ /// @security Unpaid bills are never archived; owner data is preserved on archived records.
10881096 pub fn archive_paid_bills (
10891097 env : Env ,
10901098 caller : Address ,
@@ -1216,6 +1224,12 @@ impl BillPayments {
12161224 Ok ( ( ) )
12171225 }
12181226
1227+ /// @notice Permanently delete archived bills with `archived_at < before_timestamp`.
1228+ /// @dev Permissionless maintenance operation for archive compaction.
1229+ /// @param caller Authenticated caller executing cleanup.
1230+ /// @param before_timestamp Exclusive upper bound for `archived_at`.
1231+ /// @return Number of archived records removed.
1232+ /// @security Only archived data is touched; active bills are unaffected.
12191233 pub fn bulk_cleanup_bills (
12201234 env : Env ,
12211235 caller : Address ,
@@ -1258,25 +1272,16 @@ impl BillPayments {
12581272 Ok ( deleted_count)
12591273 }
12601274
1261- /// Pay multiple bills in a single batch .
1275+ /// @notice Pay multiple bills in one call .
12621276 ///
1263- /// # Semantics: Partial Success
1264- /// This function implements deterministic partial result reporting. If a bill in the batch
1265- /// is invalid (e.g., not found, unauthorized, or already paid), it will be skipped,
1266- /// and an error event will be emitted. Other valid bills in the same batch will still be processed.
1277+ /// @dev Partial-success semantics are deterministic: invalid bill IDs are skipped and reported,
1278+ /// while valid IDs continue processing.
12671279 ///
1268- /// # Arguments
1269- /// * `env` - The Soroban environment
1270- /// * `caller` - Address of the bill owner (must authorize)
1271- /// * `bill_ids` - Vector of bill IDs to pay
1272- ///
1273- /// # Returns
1274- /// The number of successfully paid bills.
1275- ///
1276- /// # Events
1277- /// - `paid`: Emitted for each successful payment.
1278- /// - `bill_pay_failed`: Emitted for each failed payment with (bill_id, error_code).
1279- /// - `batch_pay_summary`: Emitted at the end with (success_count, failure_count).
1280+ /// @param caller Authenticated owner attempting the batch payment.
1281+ /// @param bill_ids Candidate bill IDs to process.
1282+ /// @return Number of successfully paid bills.
1283+ /// @security Cross-owner payments are rejected per item; oversized batches are rejected
1284+ /// before iteration.
12801285 pub fn batch_pay_bills ( env : Env , caller : Address , bill_ids : Vec < u32 > ) -> Result < u32 , Error > {
12811286 caller. require_auth ( ) ;
12821287 Self :: require_not_paused ( & env, pause_functions:: PAY_BILL ) ?;
0 commit comments