Giter VIP home page Giter VIP logo

corpsystem-fastapi's Introduction

CODIGO UML

@startuml

!define Mapped(x) entity x
!define mapped_column(x) field x
!define back_populates(x) {back_populates x}

package "Models" {

  class User {
    password: Mapped[str]
    email: Mapped[str]
    username: Mapped[str]
    role: Mapped[UserRoles]
    is_active: Mapped[bool]

    sales: Mapped[List["Sale"]] # 1-n
    purchases: Mapped[List["Purchase"]] # 1-n
  }

  class Product {
    name: Mapped[str]
    description: Mapped[str]

    inventory: Mapped[List["Inventory"]] # 1-n
    sales_items: Mapped[List["SaleItem"]] # 1-n
    purchases: Mapped[List["Purchase"]] # 1-n
  }

  class Sale {
    seller_id: Mapped[UUID]

    seller: Mapped[User] # n-1
    items: Mapped[List["SaleItem"]] # 1-n
  }

  class SaleItem {
    sale_id: Mapped[UUID]
    product_id: Mapped[UUID]
    quantity: Mapped[int]
    unit_price: Mapped[float]
    total_price: Mapped[float]

    sale: Mapped[Sale] # n-1
    product: Mapped[Product] # n-1
  }

  class Purchase {
    buyer_id: Mapped[UUID]
    product_id: Mapped[UUID]
    quantity: Mapped[int]
    unit_price: Mapped[float]
    total_price: Mapped[float]

    buyer: Mapped[User] # n-1
    product: Mapped[Product] # n-1
  }

  class Inventory {
    product_id: Mapped[UUID]
    quantity: Mapped[int]
    unit_price: Mapped[float]

    product: Mapped[Product] # n-1
  }

  User "1" <--> "n" Sale : sales
  User "1" <--> "n" Purchase : purchases
  Product "1" <--> "n" Inventory : inventory
  Product "1" <--> "n" SaleItem : sales_items
  Product "1" <--> "n" Purchase : purchases
  Sale "1" <--> "n" SaleItem : items
}

@enduml

corpsystem-fastapi's People

Contributors

gabszs 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.