Open psisrael opened 10 years ago
To clarify: (4) means "the value of account.balance in the DB for the given claim_number"?
The /account/{id}/payments payload returns some JSON that has an "accountBalance" which is DIFFERENT to the value in account.balance.
Help please!!
I'm confused here - sorry.
http://localhost:8080/scrd/account/2/detail
select id from opm.account where claim_number='919259'
returns a single id of 2
Here's where I'm confused:
select * from opm.account a left outer join opm.payment p on a.claim_number = p.claim_number where a.id=2
, I get 7 rows returnedhttp://localhost:8080/scrd/account/2/payments
, I get a single record returned with id 390select * from opm.payment where id = 390
it returns a row whose claim_number = 944562
There appears to be a disconnect here. Admittedly I'm finger-in-the-airing most of this - however, this does seem a bit odd, no? What am I missing?!
No worries! It is confusing. I'm going to quickly rope in an architect on this one. Please hold tight.
To clarify: (4) means "the value of account.balance in the DB for the given claim_number"? -> yes
The /account/{id}/payments payload returns some JSON that has an "accountBalance" which is DIFFERENT to the value in account.balance -> Afaik, the accountBalance is the balance of the account at the moment of this payment. So what we are actually interested is that account.balance is correct for displaying in front. This is what rsial2 said: please fix the balance to be the sum of all payments with 'approved' status.
When I ask the DB for all payments for this account using select * from opm.account a left outer join opm.payment p on a.claim_number = p.claim_number where a.id=2, I get 7 rows returned
This looks proper.
When I ask for the resource containing this account's Payments (I think that's what this resource is) http://localhost:8080/scrd/account/2/payments, I get a single record returned with id 390
I do not have hands on with latest code, but this should be a mistake here, we need to consider all payments.
Ah - I think I was seeing data anomalies because the VM DB has generated data loaded into it.
Case in hand - I am going on the assumption in the real world that the account_id and claim_number in opm.payment should have some parity (i.e. the account_id in question has that claim_number and the account for that claim_number has that id).
In the VM db, this rule does not hold...
I am also assuming that:
The "Total" value needs to be the total amount of payments in the DB with a status of "approved".
Means: "...DB with an approval_status
of APPROVED" because there is also a payment_status
column which is separate from approval_status
, and it does not contain any candidate values named "approved".
The closest I could find in the payment_status name list was "Posted - Pending".
@stashuk, can you confirm please?
Case in hand - I am going on the assumption in the real world that the account_id and claim_number in opm.payment should have some parity (i.e. the account_id in question has that claim_number and the account for that claim_number has that id).
Not sure whether I understand the formulation completely, but yes, every account has required id/claim number and it is 1 to 1 dependency.
Means: "...DB with an approval_status of APPROVED"
Yes