Git Product home page Git Product logo

shop-db2's People

Contributors

codacy-badger avatar dependabot[bot] avatar g3n35i5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shop-db2's Issues

Making all updates generic

ATM, most of the resource updates use many lines of code. It should be possible to update a resource by simply calling item(**data).

Deleting verified users

Users should also be able to be deleted, even if they have already been verified and have entries in the database. Before a user can be deleted, his credit must be balanced. This can be done automatically by entering positive or negative credits in a new "Loss/Profit" table. At the same time all references for this user have to be deleted.

Adding system users

System users should be users like "event" or something like this. They shouldn't be able to do purchases by default. Only administrators should be able to use these system users.

Stock system

There should be a possibility to manually enter the inventory of countable products and thus determine how many products have been purchased and how many have been lost (stolen, forgotten to do a purchase, ...).

I propose two new tables for implementation:

  • Stocktaking
  • Stocktakingcollection

Explanation:

"Stocktaking" means the process of determining how many units of a (countable) product are available.
A stocktaking collection is a collection of several "Stocktakings", i.e. the determination of the quantity of several products.

The "Stocktakingcollection" can now be used to determine how many products
have disappeared since the last inventory (or have been added, which is
unlikely).

A profit or loss can now be determined for those products for which the following applies:

  • They must be countable
  • A physical inventory must already exist, since only actual values can be
    determined for the calculation.

The definition of profit and loss is as follows:

  • There is a loss if, for example, 5 products have been purchased since the
    last inventory, but there are 7 fewer products than in the last
    inventory.

  • An optimal result is when the target and actual values are identical.

  • There is a profit if more products are counted than should actually be
    there.

The sum of all profits and losses in a stocktaking collection is then the total profit or loss.

Redundance between api definition and response

When an api user requests a resource, it does not get a user object as expected, but an object wrapping a user object, with the text identifier "user". Not only does this lack a purpose, as the requester already nows what he expects at request-time, but it complicates both your code as well as the code of external projects accessing the api, likely leading to bugs.

return jsonify({'user': user}), 200

This does not only apply to the user info but to all api paths in the file.

return jsonify({'users': convert_minimal(query.all(), fields)}), 200

return jsonify({'favorites': user.favorites}), 200

return jsonify({'deposits': new_deposits}), 200

return jsonify({'refunds': refunds}), 200

return jsonify({'purchases': purchases}), 200

return jsonify({'user': user}), 200

Partially accepted Purchases

When buying multiple products, the system apparently checks the validity for each article separately.
Example: When buying a crate of beer (x30) and "buying" the return value of the crate (Pfand) while not having enough funds to buy the beer (e. g. the account is too close to the - 20€ limit), the system rejects the beer puchase but logs the return fee, resulting in a net gain for the user account without a notification message.

Introduction of products that are not for sale

I want to remove the Payoffs table by handling all purchases of products as replenishment. For this purpose, products that are not sold to end users, such as "coffee beans" or "dishwasher tabs", should also be maintained in the system.

Extension of the maintenance mode

The maintenance mode could, for example, also be used for stocktakings. Administrators may want to be able to access all routes despite the maintenance mode. Another point is that the status, whether shop-db2 is in maintenance mode or not, must be persistently saved. This means that not only the entry in the configuration has to be changed, but also the file. This ensures that shop-db2 is still in the status it was before the restart.

Billing periods

There should be a possibility to summarize all user purchases, deposits, etc. at a time determined by the administrator. Thus, the size of the database and therefore the loading time can be kept within a manageable range.
An example: A user has made 100 purchases in the last quarter with a total amount of 150€. This amount should now be entered as "Billing" and all purchases deleted.

Remove payoff table

Since we have "not-for-sale" products (defined by a "not-for-sale-tag"), we can drop the "payoffs" table. Since this job can't be done automatically with an alembic script, it is necessary to manually migrate the payoff entries to the "replenishmentcollections" (resp. "replenishments") table.

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.