fix: payment method & category field names

This commit is contained in:
2026-02-10 00:22:30 +02:00
parent a9d242d9db
commit 1951474387
3 changed files with 10 additions and 10 deletions

View File

@@ -301,11 +301,11 @@ func TestAddCommandWithAllFlags(t *testing.T) {
if receivedBill["payedFor"] != "2,3" { // Alice and Bob
t.Errorf("Wrong payedFor: %s", receivedBill["payedFor"])
}
if receivedBill["categoryid"] != "5" {
t.Errorf("Wrong categoryid: %s", receivedBill["categoryid"])
if receivedBill["categoryId"] != "5" {
t.Errorf("Wrong categoryid: %s", receivedBill["categoryId"])
}
if receivedBill["paymentmodeid"] != "3" {
t.Errorf("Wrong paymentmodeid: %s", receivedBill["paymentmodeid"])
if receivedBill["paymentModeId"] != "3" {
t.Errorf("Wrong paymentmodeid: %s", receivedBill["paymentModeId"])
}
if receivedBill["comment"] != "Team dinner" {
t.Errorf("Wrong comment: %s", receivedBill["comment"])

View File

@@ -359,10 +359,10 @@ func (c *Client) CreateBill(projectID string, bill Bill) error {
data.Set("comment", bill.Comment)
}
if bill.PaymentModeID != 0 {
data.Set("paymentmodeid", strconv.Itoa(bill.PaymentModeID))
data.Set("paymentModeId", strconv.Itoa(bill.PaymentModeID))
}
if bill.CategoryID != 0 {
data.Set("categoryid", strconv.Itoa(bill.CategoryID))
data.Set("categoryId", strconv.Itoa(bill.CategoryID))
}
if bill.OriginalCurrencyID != 0 {
data.Set("original_currency_id", strconv.Itoa(bill.OriginalCurrencyID))

View File

@@ -283,11 +283,11 @@ func TestCreateBill(t *testing.T) {
if r.FormValue("comment") != "" {
t.Errorf("Comment should be empty: %s", r.FormValue("comment"))
}
if r.FormValue("paymentmodeid") != "" {
t.Errorf("paymentmodeid should be empty: %s", r.FormValue("paymentmodeid"))
if r.FormValue("paymentModeId") != "" {
t.Errorf("paymentmodeid should be empty: %s", r.FormValue("paymentModeId"))
}
if r.FormValue("categoryid") != "" {
t.Errorf("categoryid should be empty: %s", r.FormValue("categoryid"))
if r.FormValue("categoryId") != "" {
t.Errorf("categoryid should be empty: %s", r.FormValue("categoryId"))
}
},
},