Coder Social home page Coder Social logo

php_laravel_cheque_api's Introduction

Cheque API

Общая информация

Предметная область: подсчет чеков
Суть проекта: подсчитать чеки и распределить товары в чеке по нескольким участникам.

Используемые библиотеки

  • в основе MVC фреймворк Laravel
  • MediaLibrary - для облегчения работы с загрузкой файлов
  • SanCtum - для облегчения работы с авторизацией

Сниппет кода для подсчета долей:

php $positions = Position::where('cheque_id', $cheque->id)->get(); $transactions = []; foreach ($positions as $position) { $partitions = Partition::where('position_id', $position->id)->get(); foreach ($partitions as $partition) { $user = User::where('id', $partition->user_id)->first(); $amt = $position->sum / count($partitions); if (!array_key_exists($user->id, $transactions)) { $transactions[$user->id] = $amt; } else { $transactions[$user->id] += $amt; } } }

Требования

  • Функциональные требования
    БД должна хранить:

    • список чеков
    • список позиций
    • список расчетов
    • список транзакций
    • список пользователей


    Сервер должен:

    • давать возможность загружать в него таблицы с чеками
    • выгружать подсчитанные доли

  • Нефункциональные требования

    • взаимодействие с БД
    • работа с csv-документами
    • поддержка объемных csv-документов
    • система авторизации
    • доступ к просмотру всеми авторизованными пользователями

Архитектура согласно нотации С4

alt text alt text alt text

Диаграмма последовательности (sequence diagram)

alt text

php_laravel_cheque_api's People

Contributors

sergstas avatar

Watchers

 avatar

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.