Skip to content

THD-C/DB_Manager

Repository files navigation

DB_Manager

image

This Python-based microservice facilitates communication with a PostgreSQL database, offering a comprehensive set of CRUD operations. Key features include:

  • ORM with SQLModel: Leverages the SQLModel library for object-relational mapping to interact seamlessly with the database.
  • OpenTelemetry Integration: Implements distributed tracing using OpenTelemetry, sending trace data to Grafana Tempo (host: Tempo, port: 4317), an open-source, high-performance tracing backend.
  • Prometheus Metrics: Exposes Prometheus-compatible metrics on port 8111 for monitoring and observability.
  • RPC Server: Operates a gRPC server on port 50051 for efficient and reliable communication.

Microservice is optimized for scalability and observability, making it ideal for modern, distributed applications.

gRPC Services

User

Method Name Request Type Response Type Description
Authenticate AuthUser AuthResponse Authenticate user
Register RegUser RegResponse Register new user
GetUserDetails ReqGetUserDetails UserDetails Get user details
Update ReqUpdateUser ResultResponse Update user data
Delete ReqDeleteUser ResultResponse Delete user
ChangePassword ChangePass ResultResponse Change user password
GetAllUsers AllUsersRequest UsersList Returns all registered users (used only by admins)

Wallets

Method Name Request Type Response Type Description
CreateWallet Wallet Wallet Create a new wallet for a user.
UpdateWallet Wallet Wallet Update an existing wallet.
DeleteWallet WalletID Wallet Delete a wallet.
GetWallet WalletID Wallet Get a wallet by its ID.
GetUsersWallets UserID WalletList Get all wallets associated with a user.
GetAllWallets Empty WalletList Get all wallets.

Order

Method Name Request Type Response Type Description
CreateOrder OrderDetails OrderDetails Create a new order.
DeleteOrder OrderID OrderDetails Delete an existing order.
GetOrder OrderID OrderDetails Get single order based on Order ID
GetOrders OrderFilter OrderList Get all orders based on filter
GetOrderList UserID OrderList Get all orders based on user ID
UpdateOrder OrderDetails OrderDetails Update an existing order based on order ID.

Payment

Method Name Request Type Response Type Description
CreatePayment PaymentDetails PaymentDetails Create a new payment.
UpdatePayment PaymentDetails PaymentDetails Update an existing payment.
GetPayments UserID PaymentList Get all payments associated with provided User ID
GetPayment PaymentID PaymentDetails Get single payment based on Payment ID
GetUnpaidPayments UnpaidSessions PaymentList Get all unpaid

Transaction

Method Name Request Type Response Type Description
CreateTransaction TransactionDetails TransactionDetails Create a new transaction.
DeleteTransaction TransactionID TransactionDetails Delete an existing transaction
UpdateTransaction TransactionDetails TransactionDetails Update an existing transaction
GetTransaction TransactionID TransactionDetails Get transaction based on transaction ID
GetTransactionList WalletID TransactionList Get transactions list associated with provided wallet ID

About

Serwis obsługujący komunikację aplikacji z bazą SQL

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors