Insert Cash Flow
When you use the insertCashFlow function, the created logs will be inserted into the database only when the number of logs created in the TOTAL
will exceed or be equal to 10.
For this type of logs we have 2 types, Type 1 "Receive" and type 2 "Give"
local details = {
user_id = citizenid, -- Replace 'citizenid' with the actual user ID
type = 'receive', -- Type of transaction, e.g., 'give' / 'receive'
wallet = 5000, -- Amount in the wallet after transaction
bank = 5000, -- Amount in the bank after transaction
time = os.time(), -- Current timestamp of the transaction
amount = 500, -- Amount involved in the transaction
from = 'Job Earning' -- From Context of the cash flow;
}
exports['syn-acp']:insertCashFlow(details)
local details = {
user_id = citizenid, -- Replace 'citizenid' with the actual user ID
type = 'give', -- Type of transaction, e.g., 'give' / 'receive'
wallet = 5000, -- Amount in the wallet after transaction
bank = 5000, -- Amount in the bank after transaction
time = os.time(), -- Current timestamp of the transaction
amount = 70000, -- Amount involved in the transaction
to = 'Showroom' -- Destination or context of the cash flow
}
-- Call the function to insert the cash flow details
exports['syn-acp']:insertCashFlow(details)