Giter Club home page Giter Club logo

async-arch's Introduction

Проект по курсу Асинхронная архитектура


Описание событий

Mutation

- actor: popug
  data: name, roles, status [active, deactivated]  
  command: user.create
  event: user.created

- actor: popug 
  data: name, roles, status  [activate, deactivated]
  command: user.update
  event: user.updated
  comment: пользователя нельзя удалить, можно только деактивировать

- actor: popug
  data: title, description, status [in progress, done]
  command: task.create
  event: task.created

- actor: popug, event.user.updated, event.task.created
  data:
  command: task.assign
  event: task.assigned

- actor: popug
  data: id, title, assign
  command: task.update
  event: task.updated

- actor: task.updated
  data: id, assign, status
  command: task.update
  event: task.done

- actor: task.updated
  data: id, assign, status
  command: billing.task.done, billing.task.assign
  event:

- actor: schedule
  data:
  command: billing.close
  event: billing.closed
  comment: подситывается баланс за день и формируется начальный баланс следующего дня

- actor: billing.closed
  data: balance
  command: billing.open
  event:

- actor: billing.closed
  data: balance
  command: send.report
  event:
  comment: отправляет отчет руководство по итогам каждого дня

- actor: billing.closed
  data: balance
  command: send.audit
  event:
  comment: аудит-лог

Event-command chains

[user.created, user.updated] -> task.assign

task.updated -> [billing.task.done, billing.task.assigned]

billing.closed -> [send.audit, send.report]

Event context

- id: user.created
  type: CUD
  producer: auth
  consumer: tasks, accounting
  data: id, name, roles

- id: user.updated
  type: CUD
  producer: auth
  consumer: tasks
  data: id, name, roles, status

- id: task.updated
  type: business
  producer: task
  consumer: accounting
  data: id, title, assign, isDone

- id: billing.closed
  type: business
  producer: accounting
  consumer: accounting (может быть отдельный сервис с отчетами)

Query

- id: tasks
  data: tasks list

- id: balance by popug
  data: balance

- id: audit log
  data: tasks id, tasks title

- id: total balance
  data: total, popug with negative balance count

- id: top task
  data: id, title, total

Corner cases

Для точного подсчета задач в дне tasks посылает событие об окончании регистрации задач в отчетном периоде и номер последней задачи.

Accounting ждет получения задачи с указанным ID. И после её обработки генерирует отчеты и закрывает отчетный период.

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.