@@ -95,26 +95,26 @@ export class RiseUpClient {
9595
9696 /** Transaction write operations. */
9797 transactions = {
98- classify : ( transactionId : string , expense : string , applyTo : "single" | "all" = "all" ) =>
99- this . http . post ( "/api/enrichment-update/save-enrichment" , { transactionId, expense, applyTo } ) ,
98+ classify : ( transactionId : string , businessName : string , expense : string , applyTo : "single" | "all" = "all" ) =>
99+ this . http . postText ( "/api/enrichment-update/save-enrichment" , { transactionId, businessName , expense, applyTo } ) ,
100100
101- rename : ( transactionId : string , displayName : string , applyTo : "single" | "all" = "single" ) =>
102- this . http . post ( "/api/enrichment-update/save-enrichment" , { transactionId, displayName , applyTo } ) ,
101+ rename : ( transactionId : string , businessName : string , expense : string , applyTo : "single" | "all" = "single" ) =>
102+ this . http . postText ( "/api/enrichment-update/save-enrichment" , { transactionId, businessName , expense , applyTo } ) ,
103103
104104 comment : ( transactionId : string , comment : string ) =>
105- this . http . post ( "/api/enrichment-update/save-comments" , { transactionId, comment } ) ,
105+ this . http . postText ( "/api/enrichment-update/save-comments" , { transactionId, comment } ) ,
106106
107107 exclude : ( transactionId : string ) =>
108- this . http . post ( "/api/investigator/answers/budget-category" , { transactionId, budgetCategory : "excluded" } ) ,
108+ this . http . postText ( "/api/investigator/answers/budget-category" , { transactionId, budgetCategory : "excluded" } ) ,
109109
110110 include : ( transactionId : string ) =>
111- this . http . post ( "/api/investigator/answers/unexclude-transaction" , { transactionId } ) ,
111+ this . http . postText ( "/api/investigator/answers/unexclude-transaction" , { transactionId } ) ,
112112
113113 setBudgetType : ( transactionId : string , budgetCategory : "fixed" | "variable" ) =>
114- this . http . post ( "/api/investigator/answers/budget-category" , { transactionId, budgetCategory } ) ,
114+ this . http . postText ( "/api/investigator/answers/budget-category" , { transactionId, budgetCategory } ) ,
115115
116116 merge : ( transactionId : string , input : string = "approved" ) =>
117- this . http . post ( "/api/investigator/answers/merge" , { papasMergeInput : [ { transactionId, input } ] } ) ,
117+ this . http . postText ( "/api/investigator/answers/merge" , { papasMergeInput : [ { transactionId, input } ] } ) ,
118118
119119 adjustPrediction : ( payload : {
120120 envelopeId : string ;
@@ -124,7 +124,7 @@ export class RiseUpClient {
124124 isPermanent ?: boolean ;
125125 monthsAhead ?: number ;
126126 } ) =>
127- this . http . post ( "/api/prediction-update/update-amount" , {
127+ this . http . postText ( "/api/prediction-update/update-amount" , {
128128 ...payload ,
129129 isPermanent : payload . isPermanent ?? true ,
130130 monthsAhead : payload . monthsAhead ?? 1 ,
@@ -147,11 +147,19 @@ export class RiseUpClient {
147147
148148 /**
149149 * Fetch budgets starting from a given date.
150+ *
151+ * The RiseUp API has a +1 month offset: requesting "2026-03" returns
152+ * budgetDate "2026-02". We compensate here so callers get the month
153+ * they actually asked for.
154+ *
150155 * @param date e.g. "2026-03"
151156 * @param count number of months to fetch (default 1)
152157 */
153158 async getBudgets ( date : string , count = 1 ) : Promise < Budget [ ] > {
154- return this . http . getJson < Budget [ ] > ( `/api/budget/${ date } /${ count } ` ) ;
159+ const [ year , month ] = date . split ( "-" ) . map ( Number ) ;
160+ const adjusted = new Date ( year , month , 1 ) ; // month is already 1-based, so this adds +1
161+ const apiDate = `${ adjusted . getFullYear ( ) } -${ String ( adjusted . getMonth ( ) + 1 ) . padStart ( 2 , "0" ) } ` ;
162+ return this . http . getJson < Budget [ ] > ( `/api/budget/${ apiDate } /${ count } ` ) ;
155163 }
156164
157165 /** Get the oldest budget date the user has (e.g. "2025-06"). */
0 commit comments