Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database and raffling system #4

Closed
wants to merge 37 commits into from
Closed

Database and raffling system #4

wants to merge 37 commits into from

Conversation

tonytins
Copy link
Owner

@tonytins tonytins commented Apr 9, 2019

Finally, I'll be replacing the current file method with a database. The goal is to have a user profile, customers and submissions in a singular database. This allows for better data manipulation that would not otherwise be possible under the current system. A good use of the database is the raffling system, suggested as part of #1, and will be the first to make use of the new architecture. The .art* files will stay for use in importing and exporting of data.

This is something that I've been planning since Art Manager's inception. I've been researching the best ORM for the best and found that Diesel is the best and often de-facto choice for the job.

- Added customer, order and payment info to YCH option
- Renamed to Art Manager
- Redid README
- Fixed hyperlink in README
- Renamed the contact field to username in order to avoid conflicts with customer.
- Explained the YCH usage a bit more clearer, hopefully.
- YCH option will now properly write a JSON file based on the arguments sent.
- Usage information was moved to it's own markdown file in order to free up space.
- New JSON-based file formats, amy and amc, for YCH and Commissions, respectfully.
- New Commission function. It's similar to YCH but lacks the slot option. However, it hasn't been added as a subcommand yet until I move the configuration to clap's config file.
- Changed license from MIT to GPL v3
- Redid usage page a little
- New commission subcommand that works similar to the YCH one but lacks the slot parameter.
- Added price field, named "cost", to the YCH and Commission formats. I had to rename customer to buyer in order to avoid conflicts.
- New date field added. Art Manager will generate a new local date and time for each submission.
- Updated usage page to reflect changes.
- New Travis CI config for daily testing.
- Ignore all .am* files
- All parameters are now required in the code.
- Updated README to match reflect changes and build status
Merge subcommands to cutdown on repetitives and any inefficiency.
- Turned argument names and error messages into global constants to make it easier to refrector and trim down the repetitiveness. They're used for certain long names when the length is at or below 5 letters.
- Updated usage page to match latest changes
- Bumped version up from 0.1 to 0.2
- Renamed ast module to models
- About will now show the Cargo version instead.
- Moved all Clap options to a config file in order to free space, now that I figured out that I really derped in figuring out why it didn't work before.
- When using --help, the author, about, and version is now grabbed from the Cargo config file.
- The debug flag, when combined with YCH, Commission and soon Request flags, will print outputs to the screen. This is to save on the number of writes made to the disk but may be turned into a feature when I switch to a proper database.
Up until now, Art Manager required you to use the ych or comm subcommands to log the varies types of art. While this is okay for the user, it is inefficient and repetitive to implement because YCH and Commissions are similar in function and share the same options. Now you only need to pass the --ych or --comm to get the same outcome you did before.

## Additional developer improvements

- Turned the argument names and error messages in the code into global constants to make it easier to refactoring and trim down the repetitiveness.
- Clap options are no longer hard-coded and have been moved to it's own respective config file, cli.yml, in order to free up space. The author, about, and version is now grabbed from the Cargo config file as well.
- --debug flag will print the output to the screen in order to save on writes. Printing to the screen may become an actual feature when I switch it over to a database.
- Request feature now be accessed.
- Request, Commission and YCH flags now conflict with each other.
- Argument changes: "order" is now "art", as in the art's name, "pay" is now payment", and "cost" is now "price."
- Moved global constants to it's own module, tstr, "Terminal Strings".
- New arguments include "reference" and "description", these names were shortned to "ref" and "desc", respectfully. Reference is used for YCHs while description is used for Commissions and Requests.
- Added the raffle subcommand. It'll crash if you use all but --help.
- Bumped version up from 0.2 to 0.2.5, due to the amount of changes made to the format and program itself.
- Added CONTRIBUTORS files.
- Reverted back to using subcommands again now that everything was moved to config file.
- Client is now customer.
- Username is now contact.
- Customer, contact, payment and tickets options are now abbreviated.
- Debug flag is now global.
- Try testing on Rust 1.13
- Updated usage page
- Request & Commissions are now flags since they share a lot of the same data. YCH is now a subcommand that now carries the Raffle subcommand. Due to this new arrangement, all current optional arguments are now global including the one in the YCH subcommand, so it can be accessed by the Raffle.
- Bumped the 1.31 build test to 1.32, due to the previous failure.
- artm compiled successfully on Rust 1.32 and will be the minimum requirement, for the time being.
- Moved to-do to it's own page
- Fixed an oversight of --payment not being global.
- Added build status for Beta and Stable branches.
- Made requirements section with developer prerequisites and supported platforms
- All required and optional values can now be changed using the builder pattern. This dramatically reduces the amount of code and boilerplate required while still accomplishing the same thing.
- YCH, Commission and Request flags have been moved to the --cat option. This is optional now. Leaving it blank will have it fallback to Unknown.
- Secure ID option generates a v5 UUID.
- YCH, Commission, and Request subcommands, flags or values are no longer required! Finally. The program assumes what you want based on the options selected. For example, if --payment and --slot isn't used then it assumes you're referring to a Request. This doesn't effect Raffle system.
- --art was renamed to --name and has been made global for use with the Raffle subcommand. However, --cust renames the same.
- The default ID is temporarily left blank. However, Secure ID and Raffle methods now generate one based on Sha256. Even if both are present, the former will be disabled in favor of the latter's.
- Bumped version to 0.3
- Debug detection in write_file() was changed so it only needs to if it's true and write to a file if it's false.
- Removed UUID v5
- Removed undeeded comments
- New debug value and method in the builder pattern that replaces it's use in write_file(). This is ignored entirely by serializer.
- Changelog.md, sitll needs some work thoguh.
- New submissions and file creations are now logged.
- Removed a few unused code
Okay. Big slew of changes but it works, for the most part.

- The current .artm[ycr] formats has been redone as .art[ycr]. The older format was based on three independent implementations that all did very similar things but lacked room for change. This worked as a proof-as-concept but left no room to grow. This new format merges all three by making every field optional and won't show up, if left empty, with the exception of name, version, date and Id.
- Submissions and file creations are now logged.
- YCH, Commission, and Request subcommands, flags or values are no longer required! Finally. The program assumes what you want based on the options selected - as it should be, imo. For example, if --payment and --slot isn't used then it assumes you're referring to a Request. Raffle remains it's own subcommand with different arguments.
- --art was renamed to --name and has been made global for use with the raffe subcommand. However, --cust renames the same.
- Secure ID and Raffle methods now generate their own respective IDs based on Sha256.
- Path option, WIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant