Skip to content

ikk1/moneyApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Control API

This API provides functionalities for expense management, where regular users can perform queries and admins can perform queries and registrations.

Features:

Categories

  • URL: /categories

    • Create categories (requires admin role)
    • Retrieve category by code
    • List all categories

    Payload for creation:

    {
      "name": "Health"
    }

Persons

  • URL: /persons

    • Create persons (requires admin role)
    • Retrieve person by code
    • List all persons
    • Update persons (using PUT and PATCH methods)

    Payload for creation:

    {
      "name": "John Fritzz",
      "address": {
        "address": "Elm Street",
        "addressLine2": null,
        "addressNumber": "223",
        "district": "Suburbia",
        "zipCode": "67890"
      },
      "active": false
    }

Expenses

  • URL: /expenses

    • Create expenses (requires admin role)
    • Retrieve expense by code
    • List all expenses with pagination and filters
      • Filter by description (query parameter: description)
      • Filter by due date range (query parameters: dueDateFrom, dueDateTo, format: yyyy-MM-dd)
    • Delete expense (requires admin role)

    Payload for creation:

    {
      "description": "Lunch time",
      "dueDate": "2024-03-27",
      "paymentDate": "2024-03-27",
      "value": -40.0,
      "notes": "Lunch at McDonald's",
      "type": "EXPENSE",
      "category": {
        "code": 3
      },
      "person": {
        "code": 1
      }
    }

    Note: Type can be either "Revenue" or "Expense"

Users

  • URL: /auth

    • Register method (/register)

    Payload for register:

    {
        "login":"auser",
        "password":"apassword",
        "name":"aname",
        "role": "ADMIN"
    }
    
    • Login method (/login)

    Payload for login:

    {
        "login":"auser",
        "password":"apassword"
    }

Development Stack:

How to Use:

  1. Install Docker and Docker Compose
  2. Clone the repository: git clone [email protected]:ikk1/moneyApi.git and enter on moneyApi folder
  3. Run the command: docker-compose up

Note.: You will need to register a user to perform queries/registrations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published