Giter VIP home page Giter VIP logo

gobank's Introduction

Hey, I'm BufferOverflow. 💻

A hobby-developer

『 19y/o 』 『 he/him 』

  • 🤥 I've created my readme with this.

Languages:

java kotlin csharp python typescript

I want to Learn:

c cplusplus rust angular express graphql nestjs

Familiar with:

mysql mariadb

gobank's People

Contributors

scharxi avatar

Watchers

 avatar

gobank's Issues

fix: Updating of TransactionDetails of Transaction

When updating the TransactionDetails of a Transaction by using:

{
    "description": "silly description" 
}

the Tags Column in the database gets overwritten by null, which leads to a problem when getting the transaction with its transaction details.

It should be stay possible to update the details by using:

{
    "description": "silly description", 
    "tags": ["silly tag"]
}

AND

{
    "description": "silly description" 
}

OR

{
    "tags": ["silly tag"]
}

util: write tests for endpoints

Write some tests to check if the endpoints do what they have to do

e.g.

package main_test

import (
	"net/http"
	"net/http/httptest"
	"testing"

	"github.com/golang/mock/gomock"
	"github.com/stretchr/testify/assert"

	"yourpackage/dataservice"
	"yourpackage/restapi"
	"yourpackage/restapi/mocks"
)

func TestGetUser(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	// Mock-Implementierung der Datenzugriffsschicht
	mockDataService := mocks.NewMockDataService(ctrl)
	mockDataService.EXPECT().GetUser(1).Return(&dataservice.User{ID: 1, Name: "John"}, nil)

	// REST-API-Handler initialisieren und den DataService setzen
	apiHandler := restapi.NewAPIHandler()
	apiHandler.SetDataService(mockDataService)

	// HTTP-Request und -Response simulieren
	req, _ := http.NewRequest("GET", "/users/1", nil)
	rec := httptest.NewRecorder()

	// Handler aufrufen
	apiHandler.ServeHTTP(rec, req)

	// Überprüfen der HTTP-Response
	assert.Equal(t, http.StatusOK, rec.Code)
	assert.Equal(t, `{"id":1,"name":"John"}`, rec.Body.String())
}

fix: Getting account by number

When try getting an account by a no existing account number using e.g.:

GET http://localhost:3000/account/?number=123456

the server returns the following json response:

{
    "created_at": "0001-01-01T00:00:00Z"
}

and status 200

Instead it should return an error message and status 400 Bad Request

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.