Open raguay opened 1 year ago
@raguay https://github.com/maaslalani/invoice/pull/21 CC: @maaslalani
please review when you have few mins
But, it might be better to have them in a database and pull it up that way. Then you don't have to have the full address on every command line. Add it once, parse it in, and store it by the name and reuse by the name later.
or just put to-address and from-address in a json or yaml file and use --import client_name.json
once #24 is straightened out.
Yes, a JSON file would be better. It would then be easy to include address information from different countries (there are different formats). Also, doing batch jobs would be easy if it was in a JSON file already.
I would like to suggest 1 json file that would hold all clients:
{
"axelfoley": {
"First Name": "Axel",
"Last Name": "Foley",
"Address": "Street 123",
"Zip": "90210",
"City": "Beverly Hills",
"State": "California",
"Country": "USA"
},
"johndoe": {
"First Name": "John",
"Last Name": "Doe",
"Address": "Avenue 123",
"Zip": "90210",
"City": "Beverly Hills",
"State": "California",
"Country": "USA"
}
}
And have users just issue invoice generate --client axelfoley
In fact, we could add the 'From' entities in the same file, and the misc settings too.
For my invoices, I'm required to have the address for the organization paying under their name and my address under my companies name. You could use
-toaddress
and-fromaddress
in order to match the other flags.But, it might be better to have them in a database and pull it up that way. Then you don't have to have the full address on every command line. Add it once, parse it in, and store it by the name and reuse by the name later.