Skip to content

Latest commit

 

History

History
120 lines (90 loc) · 1.36 KB

API.md

File metadata and controls

120 lines (90 loc) · 1.36 KB

API Documentation

Database

Página inicial da aplicação

Credits: https://prisma-erd.simonknott.de/


Enums

enum Type {
  CREATOR_SALE
  AFFILIATE_SALE
  COMMISSION_PAID
  COMMISSION_RECEIVED
}

Routes

Transaction Route

transaction.upload (mutation)

  • Input

    • transactionFile: String // Base64 (Motivo explicado aqui)
  • Output

[{
  id: number
  type: Type
  amount: string
  date: Date
  productId: number
  sellerId: number
}]

transaction.getAll (query)

  • Output
[{
  id: number
  type: Type
  amount: string
  date: Date
  productId: number
  sellerId: number
}]

Status Route

status.getAnalytics (query)

  • Output
{
  products: number
  sellers: number
  transactions: number
}

Product Route

product.getAll (query)

  • Output
[{
  id: number
  name: string
  sellerId: number
  creator: {
    id: number
    name: string
  }
}]

product.getTransactionsOfProducts (query)

  • Input

    • productId: Number
  • Output

{
  id: number
  name: string
  sellerId: number
  Transaction: [{
    id: number
    type: Type
    amount: string
    date: Date
    productId: number
    sellerId: number
    seller: {
      id: number
      name: string
    }
  }]
}