Closed jofmi closed 11 months ago
I am not sure what this linter error means. Any ideas?
Running golangci-lint ...
/home/runner/work/_temp/reviewdog-P3LjpF/golangci-lint-1.55.0-linux-amd64/golangci-lint run --out-format line-number --tests=false
level=error msg="Running error: context loading failed: failed to load packages: timed out to load packages: context deadline exceeded"
level=error msg="Timeout exceeded: try increasing it by passing --timeout option"
Error: Error: golangci-lint exited with status code: 4
The api/payments/?from=2023-10-22T22:00:00.000Z&to=2023-10-25T22:00:00.000Z&payouts=true
should return something like
[
{
"ID":6,
"Timestamp":"2023-10-25T09:38:53.061924Z",
"Sender":6,
"Receiver":1,
"SenderName":"fl-123",
"ReceiverName":"Cash",
"Amount":1300,
"AuthorizedBy":"test_superuser",
"Order":null,
"OrderEntry":null,
"IsSale":false,
"Payout":null
"PayoutPayments":[
//the payments included in the payout
]
}
]
The
api/payments/?from=2023-10-22T22:00:00.000Z&to=2023-10-25T22:00:00.000Z&payouts=true
should return something like[ { "ID":6, "Timestamp":"2023-10-25T09:38:53.061924Z", "Sender":6, "Receiver":1, "SenderName":"fl-123", "ReceiverName":"Cash", "Amount":1300, "AuthorizedBy":"test_superuser", "Order":null, "OrderEntry":null, "IsSale":false, "Payout":null "PayoutPayments":[ //the payments included in the payout ] } ]
done! I have called it "IsPayoutFor", which i found a bit more intuitive. is that ok?
I would say, the payout site looks like this:
and then we redirect to the page where all payouts are displayed, which is not happening at the moment.
So we don't need a explicit response to the post call.
We can think about to join the item types with their amount and quantity into the payment, but then we need to redefine the type in the frontend for each new item. Currently the the frontend logic is to iterated over all item types and calculate the sum like this:
const sumItemsForOrder = (payment: any, itemID: number) => {
let sum = 0
payment.IsPayoutFor.forEach((payout: Payment) => {
if (payout.Item === itemID) {
if (payout.Receiver === payment.Sender) {
sum += payout.Amount
} else {
sum -= payout.Amount
}
}
})
return `${formatAmount(sum)} €`
}
Type of change
Description
payments/payout/
now takes from and to arguments instead of amount, and will create a payout for all payments within that date range. if you want to to know how much was paid out, you have to call GETpayments/{payoutID}
with the returned ID from the POST call.payments/forpayout/
can be used to see which payments will be paid out for that date rangepayments
has changed. if a vendor ID is passed, the result will now includes payments that the vendor has sent AND received (before it was only sent)Checklist: