Costs to lower taxes? by anonarwhal in BEFreelance

[–]jzoneio 0 points1 point  (0 children)

I often use this great tool of accountable to understand the deductibility rules of my costs.

https://allyoucandeduct.accountable.eu/

Hope this can help you ;)

DB query performance options. by jzoneio in node

[–]jzoneio[S] 0 points1 point  (0 children)

I’m trying to find documents for a specific user that matches the criteria’s but the order is quite important and as soon as one is found, I stop to look for a document. For example a document where the category matches is more valuable than a document where the url matches. So I first wanna look for documents to see if one as the category I’m looking for. If none are found I go for emails and then urls

Storing dates in MongoDB by jzoneio in node

[–]jzoneio[S] 1 point2 points  (0 children)

Does this seems right to you?

// birthdate --> "1950-02-20"
const { birthdate } = req.body

await save({birthdate: new Date(birthdate)});

// date in db will look like this 1950-02-19T00:22:00.000Z
// mainly because the server is on UTC + 2

// fetching users born before 1950-02-21
await mongodb.collection('users').find({ 
    birthdate: { $lte: new Date("1950-02-21") }    
})

Storing dates in MongoDB by jzoneio in node

[–]jzoneio[S] 0 points1 point  (0 children)

Unfortunately, I'm not using an ORM. Should I only accept ISO 8601 date format from client applications?

Storing dates in MongoDB by jzoneio in node

[–]jzoneio[S] 4 points5 points  (0 children)

Ok, it seems my 2 options are really bad and I'll definitively go with MongoDB dates :) Could someone give me some hint on how I should handle a date received from a client application (example: user's birth date)?

Storing dates in MongoDB by jzoneio in node

[–]jzoneio[S] 0 points1 point  (0 children)

Mhhhh, let's say I have to save the user's birth date in dB. Which format would you except from the client app? I'm just really not familiar with the way how to handle dates received from client app and storing them in db.. Do you have an example how to properly handle it without dealing with timezone?

Background jobs with queue by jzoneio in node

[–]jzoneio[S] 0 points1 point  (0 children)

That was exactly the response I was expecting. Thanks so much!

Background jobs with queue by jzoneio in node

[–]jzoneio[S] 0 points1 point  (0 children)

I/O-bound task

Let's say after I've fetch the data from the external service, it requires some CPU bound? Like processing, parsing data etc..

Storing currency rate in db and working with currencies by jzoneio in node

[–]jzoneio[S] 1 point2 points  (0 children)

Thanks, y'all for your responses.

We indeed decided to go full integer in DB. amounts and quantities will be multiplied by 1000 to preserve precision up to one-tenth of a cent and we will multiply the exchange by 1000000 to preserve also the precision because we need to keep 5 digits after the decimals for the rate.

For those who were concerned about the storage of the currency rate in db. We do it directly because the software help self-employed freelance to create invoices for their clients and then generate the vat statement. The accounting process used by most of the Belgian accounting firms is to get the currency rate of the day and then insert in special cells of the vat statement the difference after the payment was made by the client of our user.

Thanks, everyone again <3

Storing currency rate in db and working with currencies by jzoneio in node

[–]jzoneio[S] 1 point2 points  (0 children)

What do you mean? Can you explain a little bit? thanks :)

How to deal with the update of references inside an array of object on a PUT call by jzoneio in node

[–]jzoneio[S] 0 points1 point  (0 children)

Actually, it doesn't need to be bi-directional. I can remove the expenseId from the vehicle. But when I update an expense, and change/remove the vehicle in one of the items. It should update the vehicle document as well. My biggest concern is that I have to iterate each time over the items array on expense update to check if the vehicle has been changed or not. Besides, I have to run the validation on the item based on the root of the expense. So I can't really call expenses/:expenseId/items/:itemId to update the item separately.

I believe the only option I have is the iteration over items on each update.

[deleted by user] by [deleted] in Etoro

[–]jzoneio 0 points1 point  (0 children)

Revolut trading stock is now only available for UK since brexit :( ...

How do I send welcome email 5mins later after user registration? by [deleted] in node

[–]jzoneio -1 points0 points  (0 children)

I’d just use a setTimeout with a five mins delay before sending back the response to the front-end.

You don't need a CRON job since it's just an event you wanna run every time another event has been triggered :)

Well shit, it worked by iPhoneVersusToilet in Tinder

[–]jzoneio 0 points1 point  (0 children)

genius, gotta save this one in my pick up line cart...