Code Monkey home page Code Monkey logo

pefcl's Introduction

pefcl's People

Contributors

antonstjernquist avatar dazepelin avatar dependabot[bot] avatar giroudmathias avatar itschip avatar liamdormon avatar mkeefeus avatar oldarorn avatar proff001 avatar qalle-git avatar samshanks1 avatar teidova avatar xelementzx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pefcl's Issues

Bug: PEFCL App Accounts Page/Transfer Page

When creating a new personal/shared account, the phone app does not reflect this app on the ACCOUNTS & TRANSFER page. It also does not update when your personal account goes down

The phone app is increadible! just needs to be synced on accounts page! I am sure this is on the list already.

To Reproduce

Steps to reproduce the behavior:

  1. Go to bank create a new account
  2. Click on NPWD Pefcl bank app
  3. Click on ACCOUNTS tab
  4. See error

Absolutely insane quality on the script!

After reflying this seems to sync, however it is not always synced. seems to be more of an issue on the actual creation of the accounts not syncing. once you do a transfer between them or refly on your first account, they are all synced again. However on creation of actual account this does not update in the phone.

Additionally you are required to modify a shared account to see if someone else has deposited funds into them. Then it will sync.

[Feature Request] Freeze all acounts of a player

Is your feature request related to a problem? Please describe.
Freeze all accounts of a player.

Describe the solution you'd like
Allow a specific job, and rank to freeze a players accounts, so the court system can freeze accounts, if a person tryes to dodge the court cases, and got dept to the society.

Bug: SHARED ACCOUNT

Hey when a player connect and a have job account i got this error.
This blocks the appearance of the job account in the bank panel, it would reappear after creating a new account
image

Bug: "Invalid amount" when creating an invoice

Hello,

When I want to create an invoice, regardless of the type of "amount" and its amount, the "Invalid amount" error on the customer side is then visible in the F8.

SERVER : createInvoice
CLIENT : createInvoiceForNearestPlayer

@GiroudMathias do you have a solution?

Thanks :)

Bug: UI doesn't update

Describe the issue

After switching character in ESX Legacy the bank UI does not update to show the new users details. You can still manage the old character's accounts.

Expected behavior

The UI should show the new character's details.

To Reproduce

Steps to reproduce the behavior:

Switch character and open the UI at a bank.

Needed information (please complete the following information):

  • Client Version:: [Release]
  • Template Version: [v1.0.10] -- Latest release on pefcl.

Additional context
I have loaded/unloaded the character correctly with the ESX-bridge but it still does not work. The pefcl-app in npwd does however update correctly. Maybe something wrong with unload export?

Bug: NUI not oppening

Describe the issue

When you go to a bank or ATM and you interact with it with qtarget, NUI doesn't show, only the cursor.

(Fresh install with pefcl)

Expected behavior

NUI oppening and letting interact with the script

To Reproduce

Steps to reproduce the behavior:

  1. Go to an ATM or Bank and interact with it

Needed information (please complete the following information):

  • Client Version:: Beta/Canary
  • Template Version: 1.0.0

Bug: account wont be removed if you switch / leave the job

Describe the issue
account wont be removed if you switch / leave the job in qb-core

A clear and concise description of what the bug is.
when i join a job Eg: Police it does give a an account on my phone and my bank for the police but when i leave and join EMS i still have the police account on my bank but with that i do get the EMS account, when i leave both of the job i still have them on me

Expected behavior
the account should be removed when you are not on the spefic job Like
if you are in police job you should have police managment account
and when you are on EMS, you should only get the EMS bank account, only if you are higher ups on both or any jobs or gangs like level 4 or any thing other

To Reproduce

Steps to reproduce the behavior:

  1. join police Job in qbcore
  2. again after that join ems job on qbcore
  3. See error on your phone or bank

If applicable, add a screenshot or a video to help explain your problem.

Needed information (please complete the following information):

ESX Salary Integration

ESX Integration is not fully supported. Our salary system is run through es_extended and modifications must be made to get this to work. I will post a not working snippet for an example. There are other aspects of ESX that are not compatible with Pefcl also.

Describe the solution you'd like
More clear snippets & documentation on integration with ESX or full ESX integration. QB seems to get all the support with Pefcl.

Non-working Example Salary Snippet:

function self.addAccountMoney(accountName, money, reason)
    if not tonumber(money) then
        print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId))
        return
    end
    if money > 0 then
        local account, index = self.getAccount(accountName)
        if account then
            if accountName == 'bank' then
                exports.pefcl:addBankBalance(self.playerId, {
                    amount = ESX.Math.Round(money),
                    message = reason and tostring(reason) or 'Untilted'
                })
                return
            end

            money = account.round and ESX.Math.Round(money) or money
            self.accounts[index].money += money

            self.triggerEvent('esx:setAccountMoney', account)
        else
            print(('[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId))
        end
    else
        print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId))
    end
end
function self.removeAccountMoney(accountName, money, reason)
    if not tonumber(money) then
        print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId))
        return
    end
    if money > 0 then
        local account, index = self.getAccount(accountName)

        if account then
            if accountName == 'bank' then
                exports.pefcl:removeBankBalance(self.playerId, {
                    amount = ESX.Math.Round(money),
                    message = reason and tostring(reason) or 'Untilted'
                })
                return
            end

            money = account.round and ESX.Math.Round(money) or money
            self.accounts[index].money -= money

            self.triggerEvent('esx:setAccountMoney', account)
        else
            print(('[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId))
        end
    else
        print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId))
    end
end

Bug: 'owner' role is not enough to manage the account

Describe the issue
Looks like owner role is not enough to withdraw money from account, to add people to accounts, this is sad
it also require to be the creator of the account.

Expected behavior

When you are owner but not creator of an account, you are not able to add more people, and you are not able to withdraw money.

To Reproduce

Steps to reproduce the behavior:

  1. Create an account and set ownerIdentifier to anything (I tried with a job name as string)
  2. Give you an access to this account using addUserToUniqueAccount export
  3. Ask to a friend to join your server, and try to add it to the account = it wont work
  4. Try to withdraw money from this account = it wont work

Additional context
We should be able to withdraw and manage people when having owner role.
'contributor' should only let people see the account amount, see peoples who have access, and deposit money (imo)

[Documentation/Feature Request] Manipulating company accounts

Is your feature request related to a problem? Please describe.
I think the documentation needs some more clarity on how to manipulate company accounts, ex. how to withdraw money from a company account, this might be needed in scripts, ex. car dealer where you got a restocking fee you have to pay.

Describe the solution you'd like
Either integrate a way to achive this or document the feature if it's there.

[Question] Billing and company accounts

Tryed to figure this one out.

Let's say the police hands over a ticket for speeding, how to a ensure the money goes in to the police account, and not the players account?

And in general for other accounts how would this work, and be done ?

Bug: Error: Unexpected token ]

Describe the issue

Hey, i turn up my server after i installed this new update, and this happened. ↓↓

Sorry, that i didn't make full template i'm lazy.

Media
image

Needed information (please complete the following information):

  • Client Version:: [Pre-Release Build (32547a0)]
  • Template Version: [version 1.0.0 idk]

Wierd error

Hi i have sometimes a wierd error, the script start normaly but after X minutes/hours script broke and i have this error
image
image

Bug: External transfers resulting in timeout

Describe the issue

Getting a timeout when trying to transfer to an external account, been debugging and it gets to getAccountFromExternalAccount but isn't able to retrieve the account. Can't figure out why it can't find any accounts from the extenal_accounts table. I've checked the database and the account is listed in there so drawing blanks :/

Expected behavior

Should successfully retrieve the account from the external_accounts table and be able to link that up with the account in question and successfully transfer the specified amount.

To Reproduce

Steps to reproduce the behavior:

  1. Open bank/phone app
  2. Navigate to transfer page
  3. Select account to transfer from
  4. Select external account to transfer to
  5. Enter amount to transfer
  6. Click transfer and after a lengthy time it will timeout and show an unsuccessful response to the player

Needed information (please complete the following information):

  • Client Version: Canary
  • Template Version: 1.0.0

Additional context

While testing this, it has become apparent that when it runs through the process and eventually times out, nobody on the server is able to make any interaction with PEFCL while it tries to process the event and result in a timeout. This causes problems especially on larger servers where many players are trying to complete actions at the same time and facing longer load times and unresponsiveness due to one players action that results in a timeout.

fee

when deposit money into a bank to have a small fee

Locale keys missing

If it's in english, it needs to be localized

Bank Transactions:
image
(minutes ago + withdrew)

Bank invoices:
image

Bug: Second Account is not shown in UI / Need Relog

Create a separate/ Second Account is not shown up after close and reopen until you Relog into Game

I create a second Account as shared type, then it will show up.
If i switch to a submenu and click on accounts, or close an open Account-Menu the second Account is not shown.
Its registered in Database Correctly.
After Relogging into Game, the Account is shown...

Expected
If you create second oder Multi Accounts, they should shown correctly without Relog of course.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Bank'
  2. Open the Menu ''
  3. Create another Account
  4. Switch to Deposit Money
  5. Click on Accounts again
  6. See "Bug" Account is gone
  7. RELOG into Game and Account is shown

Needed information (please complete the following information):

  • Client Version:: [Release]
  • Artifacts Version: [5848-Latest Artifacts] Don't know?
  • System: Windows
  • Databank: MariaDB
  • Framework: ESX 1.8.5 latest offficial release
  • Dependencies and integration installed: yes
  • pefcl-version: [Pre-Release Build (172430f) 1.0.10

Additional context

  • Using: oxmysql - ox_ib - npwd - ox_inventory - qtarget

Use Vite and no top-level imports

Is your feature request related to a problem? Please describe.
Webpack is slow af compared to Vite and its bundle size is so huge whereas Vite bundles and compresses it by default. On top of that, it's even slower if you use top-level imports especially for mui

Describe the solution you'd like
Convert Webpack to Vite for faster build time, and convert all component imports from mui/material/** to path imports

Describe alternatives you've considered
NA

External Banking App for Phones

Hey, I have written a banking app for my phone through which you should make transactions in your banking script. I have managed that the transactions arrive in the accounts. The only problem I'm encountering is that the account balance is not updated in the UI, Even though it has changed in the database. I understand that it's because your script only updates when actions happen through the UI and doesn't randomly request values from the database every time it opens.

Is there any way to update the invidual accounts via a trigger or is there an export with which you can directly use the functions from Pefcl for a transfer?

esx scoiety

pefcl doesnt sync with esx_scoiety
so the job account balance on the phone app and in the banks is different to the jobs actual funds

id like for it to sync with each other

If applicable, add a screenshot or a video to help explain your problem.

Needed information (please complete the following information):

  • Client Version:: [e.g. Canary or Release]
  • Template Version: [e.g. 3486] Don't know?Check the version in your package.json

Bug: Remove Cash Works Incorrectly

V: 1.0.10
Framework: none (standalone)

Issue: All exports seems to work fine, but included RemoveCash export in my code for players to buy stuff didn't work.
So, I created a simple command in the server file of the script to test an export:

RegisterCommand("remcash", function(source, args, rawCommand)
    local player = source
    local amount = tonumber(args[1])

    if amount ~= nil then 
        print("Taking from player: "..player.." | Amount: "..amount)
        exports.pefcl:removeCash(player, amount)
    end
end)

Arguments:
/remcash 1000

Console after running the command: (silly debug option)
[script:test-script] Taking from player: 1 | Amount: 1000
[script:pefcl] [PEFCL] [cash] [debug]: Taking undefined from undefined

Transaction fee

It would be nice to have a configurable transaction fee.

  • Percentage
  • Fixed sum

Emit new event on balance update

When the balance is updated for a specific account, emit an event with the update balance and broadcast this to related player.

Preferable this should be done on the DB level

[Enhancement] Logging

I think one of the functionalities pefcl really is missing is data logging to a remote service such as https://www.datadoghq.com/ or https://grafana.com/oss/loki/. Of course people would really want discord logging but my opinion is that discord isn't a place to have any logs. Previously mentioned services both are supported by good other resources which would allow us using the resource to combine data logging with inventories or other resources. There are LUA libraries available to trigger data logging to these services as well. Of course it can be also some other platform which allows cost effective way to visualize your money flow on your server.

[Feature] Unique Accounts

Make it so you can't delete unique accounts or when you create a unique account you can choose if it can be deleted or not
Not sure if its feasible or not

Bug: Unable to get user when framework integration is enabled

Unable to get players when framework integration enabled

When you enable framework integration Userservice.getUser doesn't get user sources anymore. This will happen on playerjoin or when you restart the resource. usersBySource doesn't contain players sources. This will prevent of course further server side exports triggering.

With usersBySource im referring to src\server\services\user\user.service.ts function getUser where it's looking for the players from usersBySource.

Problem seems to be existing on other servers this problem was reported also by other discord community member.

image

What I understand the structure the initial design is not to push sources from some framework?

Start account money don't work

I use the last realease of pefcl and when new player join, his account is create but with a balance of 0$.
In config.json i have request an amount...
image

Bug: Deletings cards not possible

Describe the issue

After blocking created cards its not possible to delete them in the bank UI.

Expected behavior

Disabling card -> Deleting it

To Reproduce

Steps to reproduce the behavior:

  1. Create card
  2. Disable card
  3. Try to delete it

addBankBalanceByIdentifier not fully working

When using addBankBalanceByIdentifier, it doesn't seem to update the bank UI. I can see the money go up in the database and even the phone app shows it.

Bank:
pwfKERG
Bank App:
tvn1mzD
Database:
cWO6siN

add credit cards and add atm animation when you access the atm

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Bug: Can move when UI is displayed

Describe the issue

Can move when UI is displayed (with controller)
Can withdraw or deposit while moving far away the bank or the ATM.

Expected behavior

Restrict withdraw and deposit to bank zone

To Reproduce

Steps to reproduce the behavior:

  1. Go to on any bank
  2. Press E
  3. Move with controller and go far away the bank marker with the UI displayed
  4. Withdraw or deposit money
  • Client Version:: Canary
  • Template Version: [e.g. 3486] 1.0.0

Bug: Syncing shared accounts

Describe the issue

Theres a huge issue with shared accounts. If a player uses a shared account and a contributor opens the bank UI it shows the wrong data.

Expected behavior

If someone uses a shared account it should sync properly with every contributor.

To Reproduce

Steps to reproduce the behavior:

  1. Create shared account with Player1 and Player2
  2. Player1 uses account
  3. Player2 opens bank to check on the shared account
  4. UI of Player2 is completely wrong until one action is taken, since thats when it syncs.

Withdraw Panel shows Playercash

When you want to withdraw cash from the panel it shows the current player cash. But for withdrawing it would be better to have the total balance displaying

Default Accounts

Would be nice to have default accounts that do not have a specified owner. This can be used for stuff like PD, EMS, DOJ and businesses with changing owners IE mechanic shops.

  • People will be able to bill to the specified account
  • Accounts defined in config.json
  • Owners can either be defined in config.json or an export upon opening that checks if you can access it which they add to their bridge resource.
    • Something like canAccessAccount(accountName) this will allow people to check jobs against the account name. Could also allow the possibility to return which access level they get

[Feature]Cards

Add Card System for ATM use

  • Cards associated with shared/societies
  • Personal cards
    goal is that we can borrow a card to someone and if he knows the pin he can go to the atm access card's accoutn

Copy Bank Identifier

Would be nice to either have a copy button or be able to highlight/select the bank identifier on the card as right now you have to type it out if you want to send it to someone

UI still doesnt update

UI doesnt reload when switching characters in ESX Legacy, can still manage prev character

Expected behavior

Should update to display new char's details

To Reproduce

Steps to reproduce the behavior:
Switch char in ESX Legacy

Media
image
image
image

Needed information (please complete the following information):

  • Client Version:: [Beta]
  • Template Version: [latest unstable-main] Don't know?Check the version in your package.json

Additional context
Correct in DB but not ingame

Bug: pefcl not working

[ script:pefcl-esx] SCRIPT ERROR: @pefcl-esx/server.lua:73: attempt to index a nil value (global 'ESX')
[ script:pefcl-esx] > ref (@pefcl-esx/server.lua:73)
[ script:pefcl-esx] > AccountService.createInitialAccount (@pefcl/src/dist/server.js:108150)
[ script:pefcl-esx] > processTicksAndRejections (node:internal/process/task_queues:96)
[ script:pefcl] SCRIPT ERROR in promise (unhandled rejection): Error: An error occurred while calling export getBank of resource pefcl-esx - see above for details
[ script:pefcl] > AccountService.createInitialAccount (@pefcl/src/dist/server.js:108150)
[ script:pefcl] > processTicksAndRejections (node:internal/process/task_queues:96)
[ script:pefcl]
[ script:pefcl] [PEFCL] [events] [silly]: netPromise > pefcl:getAccounts > RequestObj
[ script:pefcl] [PEFCL] [events] [silly]: { source: 1, data: null }
[ script:pefcl] [PEFCL] [accounts] [debug]: Retrieving accounts
[ script:pefcl] [PEFCL] [events] [silly]: Response Promise Event pefcl:getAccounts:712a8017-b3fd-4df7-998e-c0e438d20394 (15.8302ms), Data >>
[ script:pefcl] [PEFCL] [events] [silly]: { status: 'ok', data: [] }

Application on the phone and translation

Hello in the Polish translation there are more characters than in English and in the app on the phone unfortunately the inscription home is broken

Bez tytułu

And I don’t have a translation of when the transactions were made on the bank account.

sss

I’m the person who did the translation, and I changed a few things that I just couldn’t see, but I didn’t notice how I did the translation.

Bug: Wrong locale

Describe the issue

The key DATE_FORMAT in fr language return DATE_FORMAT instead of DD/MM/YYYY that cause weird translation

Expected behavior

return DD/MM/YYYY instead of DATE_FORMAT

To Reproduce

Steps to reproduce the behavior:

  1. Select fr at general.language in config.json
  2. Build project
  3. Check last transactions

Media

image

Needed information (please complete the following information):

  • Client Version:: [Canary]
  • Template Version: [1.0.0]

Bug: Recepient list is not showing correctly in phone app

A bug with fetching? recepient list in NPWD

Running on ESX, NPWD latest version, pefcl release.

When I try to create recepient in NPWD, it will create in DB (bank shows it) but the app will not display any account other than my personal one.

To Reproduce

  1. Open NPWD
  2. Click Bank - Transfer
  3. Select To Account
  4. Add external
  5. not stonks, cannot choose external account I just added

Bug: Duplicating money [crucial]

Description
A bug, that allows you to withdraw money "for free"
Cause
When player loses connection to internet with ATM ui open, he will be able to spam withdrawal multiple times before it goes black (non-clickable). Disabling the option is good solution, but it is not quick enough / reliable to prevent players from clicking it atleast once, thus getting free money.
Temp solution
Make max money withdrawal to low money, so they can dupe max 5K or so.
Desired outcome
Do not let them dupe money, lol.

add to docs

add the debug types to documentation, and what reports. thx

Bug: setBankBalance export doesn't update bank UI

Describe the issue

Using the exports.pefcl:setBankBalance export, I can see that the account balance is updated in the pefcl_accounts database table however when opening the bank UI the old balance is still displayed. I have confirmed that exports.pefcl:addBankBalance and exports.pefcl:removeBankBalance works correctly so it is just the "set" which isn't working.

This only seems to affect the main bank UI as I can see the balance is updated when checking the NPWD PEFCL app.

Expected behavior

Using the set export, it should update the account balance and correctly display that when opening the bank UI. So far it updates the balance but doesn't reflect the change on the UI.

To Reproduce

Steps to reproduce the behavior:

  1. Call the exports.pefcl:setBankBalance to update the players account (in my case this is being used in qb-pefcl QBCore:Server:OnMoneyChange event)
  2. Check pefcl_accounts database table to make sure the balance was set to the value provided
  3. Open bank UI and see that the balance is the same as it was prior to running the export

Media

https://streamable.com/avx05a

Needed information (please complete the following information):

  • Client Version: Canary
  • Template Version: 1.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.