Skip to content

Latest commit

 

History

History
77 lines (73 loc) · 2.17 KB

README.md

File metadata and controls

77 lines (73 loc) · 2.17 KB

Wallet System Expense Management API

Table of Contents

Introduction

This repository contains the source code of small wallet system.

Sequence diagrams

Create Expense

sequenceDiagram
    actor Donald
    Donald->>+ExpenseAPI: POST Expense/Create
    ExpenseAPI->>+IExpenseManager: CreateAsync(ExpenseCreation)
    IExpenseManager->>+IUserManager: FindByIdAsync(int)
    IUserManager->>+IUserRepository: FindAsync(UserQuerry)
    IUserRepository-->>-IUserManager: 
    IUserManager-->>-IExpenseManager: 
    IExpenseManager->>+IExpenseRepository: FindAsync(UserQuerry)
    IExpenseRepository-->>-IExpenseManager: 
    IExpenseManager->>+IExpenseRulesValidator: Validate(ExpenseValidationRequest)
    loop IExpenseRulesValidator to IExpenseRuleCheck
    IExpenseRulesValidator->>+IExpenseRuleCheck: Check(ExpenseValidationRequest)
    IExpenseRuleCheck-->>-IExpenseRulesValidator: 
    end
    IExpenseRulesValidator-->>-IExpenseManager: 
    IExpenseManager->>+IExpenseRepository: AddAsync(ExpenseCreation)
    IExpenseRepository-->>-IExpenseManager: 
    IExpenseManager-->>-ExpenseAPI: 
    ExpenseAPI-->>-Donald:  
Loading

Search Expense

sequenceDiagram
    actor Donald
    Donald->>+ExpenseAPI: GET Expense/Search
    ExpenseAPI->>+IExpenseManager: FindAsync(ExpenseQuery)
    IExpenseManager->>+IExpenseRepository: FindAsync(ExpenseQuery)
    IExpenseRepository-->>-IExpenseManager: 
    IExpenseManager-->>-ExpenseAPI: 
    ExpenseAPI-->>-Donald : 
Loading

Entity Relationship Diagram

erDiagram
    User{
        int Id PK
        string FirstName
        string LastName
        int CurrencyId FK
    }
    User }o--|| Currency: has
    User ||--o{ Expense: has    
    Currency{
        int Id PK
        string Code
        string Name
        string Symbol
    } 
    Expense }o--|| ExpenseType : is
    Expense {
        int Id PK
        datetime2 DateTime
        string Description
        int TypeId FK
        int UserId FK
        decimal Amount
    }
    ExpenseType {
        int Id PK
        string Label
    }
Loading