@@ -583,13 +583,15 @@ pub fn invoice_state_changed(
583583 Some ( InvoiceStatus :: Refunded ) => symbol_short ! ( "refunded" ) ,
584584 Some ( InvoiceStatus :: Expired ) => symbol_short ! ( "expired" ) ,
585585 Some ( InvoiceStatus :: Cancelled ) => symbol_short ! ( "cancld" ) ,
586+ Some ( InvoiceStatus :: Disputed ) => symbol_short ! ( "disputed" ) ,
586587 } ;
587588 let to_sym = match to_status {
588589 InvoiceStatus :: Pending => symbol_short ! ( "pending" ) ,
589590 InvoiceStatus :: Released => symbol_short ! ( "released" ) ,
590591 InvoiceStatus :: Refunded => symbol_short ! ( "refunded" ) ,
591592 InvoiceStatus :: Expired => symbol_short ! ( "expired" ) ,
592593 InvoiceStatus :: Cancelled => symbol_short ! ( "cancld" ) ,
594+ InvoiceStatus :: Disputed => symbol_short ! ( "disputed" ) ,
593595 } ;
594596 env. events ( ) . publish (
595597 ( symbol_short ! ( "split" ) , symbol_short ! ( "st_chg" ) , invoice_id) ,
@@ -826,6 +828,8 @@ pub fn dispute_resolved(env: &Env, invoice_id: u64, admin: &Address, outcome: &D
826828 let outcome_sym = match outcome {
827829 DisputeOutcome :: Approved => symbol_short ! ( "approved" ) ,
828830 DisputeOutcome :: Refunded => symbol_short ! ( "refunded" ) ,
831+ DisputeOutcome :: Release => symbol_short ! ( "release" ) ,
832+ DisputeOutcome :: Refund => symbol_short ! ( "refund" ) ,
829833 } ;
830834 env. events ( ) . publish (
831835 (
@@ -1225,10 +1229,10 @@ pub fn recipient_address_rotated(
12251229 env. events ( ) . publish (
12261230 (
12271231 symbol_short ! ( "split" ) ,
1228- symbol_short ! ( "adm_appr ") ,
1229- action_hash . clone ( ) ,
1232+ soroban_sdk :: Symbol :: new ( env , "RecipientAddressRotated ") ,
1233+ invoice_id ,
12301234 ) ,
1231- ( approver . clone ( ) , approval_count , env . ledger ( ) . sequence ( ) ) ,
1235+ ( old_address . clone ( ) , new_address . clone ( ) ) ,
12321236 ) ;
12331237}
12341238
@@ -1287,10 +1291,70 @@ pub fn invoice_from_template(env: &Env, invoice_id: u64, creator: &Address, temp
12871291 ( creator. clone ( ) , template_id, env. ledger ( ) . sequence ( ) ) ,
12881292 ) ;
12891293}
1290- soroban_sdk:: Symbol :: new ( env, "RecipientAddressRotated" ) ,
1294+
1295+ /// Emitted when a co-creator is added to an invoice.
1296+ /// Topics: (split, co_creatr_add, invoice_id)
1297+ /// Data: (creator, co_creator, ledger)
1298+ pub fn co_creator_added ( env : & Env , invoice_id : u64 , creator : & Address , co_creator : & Address ) {
1299+ env. events ( ) . publish (
1300+ (
1301+ symbol_short ! ( "split" ) ,
1302+ symbol_short ! ( "co_c_add" ) ,
12911303 invoice_id,
12921304 ) ,
1293- ( old_address. clone ( ) , new_address. clone ( ) ) ,
1305+ ( creator. clone ( ) , co_creator. clone ( ) , env. ledger ( ) . sequence ( ) ) ,
1306+ ) ;
1307+ }
1308+
1309+ /// Emitted when a co-creator is removed from an invoice.
1310+ /// Topics: (split, co_creatr_rem, invoice_id)
1311+ /// Data: (creator, co_creator, ledger)
1312+ pub fn co_creator_removed ( env : & Env , invoice_id : u64 , creator : & Address , co_creator : & Address ) {
1313+ env. events ( ) . publish (
1314+ (
1315+ symbol_short ! ( "split" ) ,
1316+ symbol_short ! ( "co_c_rem" ) ,
1317+ invoice_id,
1318+ ) ,
1319+ ( creator. clone ( ) , co_creator. clone ( ) , env. ledger ( ) . sequence ( ) ) ,
1320+ ) ;
1321+ }
1322+
1323+ /// Emitted when a payer hits the global spending cap for the current ledger window.
1324+ /// Topics: (split, pay_spend_lim, payer)
1325+ /// Data: (window_total, cap, ledger)
1326+ pub fn payer_spend_limit_reached (
1327+ env : & Env ,
1328+ payer : & Address ,
1329+ window_total : i128 ,
1330+ cap : i128 ,
1331+ ) {
1332+ env. events ( ) . publish (
1333+ (
1334+ symbol_short ! ( "split" ) ,
1335+ symbol_short ! ( "pay_sp_lim" ) ,
1336+ payer. clone ( ) ,
1337+ ) ,
1338+ ( window_total, cap, env. ledger ( ) . sequence ( ) ) ,
1339+ ) ;
1340+ }
1341+
1342+ /// Issue #XXX: Emitted when a contributor raises an invoice dispute.
1343+ /// Topics: (split, inv_disp_rsd, invoice_id)
1344+ /// Data: (disputer, reason_hash, ledger)
1345+ pub fn invoice_dispute_raised (
1346+ env : & Env ,
1347+ invoice_id : u64 ,
1348+ disputer : & Address ,
1349+ reason_hash : & BytesN < 32 > ,
1350+ ) {
1351+ env. events ( ) . publish (
1352+ (
1353+ symbol_short ! ( "split" ) ,
1354+ symbol_short ! ( "inv_d_rsd" ) ,
1355+ invoice_id,
1356+ ) ,
1357+ ( disputer. clone ( ) , reason_hash. clone ( ) , env. ledger ( ) . sequence ( ) ) ,
12941358 ) ;
12951359}
12961360
0 commit comments