Skip to content

mfkessai/codetest-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codetest

<<< English version below >>>

課題

テストがパスするようにアプリケーションを実装してください。

アプリケーションはDocker Compose上のコンテナとして実行されるように構成してください。

テストはGoにより実装されており、以下のコマンドで実行が可能です。

go test

テストコード(main_test.go)を変更する以外はどのような手段を使っても構いません。制限時間もありません。

サンプルとしてmain.goを配置していますが、使用言語の制約も無いため、Go以外の言語で実装しても構いません。

プロジェクト概要

ユーザーごとに「取引(Transaction)」(金額と商品説明からなる情報)を登録することができるサービスです。

ユーザーごとに登録可能な取引の金額累計に上限(1000)があり、それを超えて登録しようとすると特定のレスポンスステータスを返してエラーになる仕様です。

RDBMSとしてMySQLを使う想定でdbディレクトリ以下にスキーマを置いています。

開発

docker compose upでダミーのアプリケーションコンテナとスキーマが反映されたMySQLを起動できます。

評価

評価観点の9割はテストがパスしているかどうかになります。

その他についてどのように工夫していただいても構いませんが、評価には影響しないため、必要十分な実装を目指すことを推奨しています。

提出方法

課題に対する実装を含んだ状態でリポジトリ全体をZIP形式でまとめ、所定のアップロードフォームでアップロードしてください。


Task

Implement the application such that the tests pass.

It should be implemented so that it runs when Docker Compose is executed.

Tests are implemented in Go and can be run with this command:

go test

You are free to use any method you want, as long as you do not edit the test code (main_test.go). Please discuss the submission deadline with your recruiter.

We have put a main.go file in place as a sample, but you may use any language you want.

Project outline

Create a service that allows the registration of "transactions", consisting of an amount of money and a product description each.

There is a per-user limit of 1000 for the total transaction amount that may be registered. If registering a specific transaction would surpass the limit for that user, a certain response status (HTTP 402: payment required) should be returned, resulting in an error.

A database scheme has been placed in the db directory, under the assumption that MySQL will be used as the RDBMS.

Development

You can start a dummy application container and a MySQL DB using the schema definition by running docker compose up.

Evaluation

90% of the evaluation depends on whether the tests pass.

Other than that, you may implement other improvements if you wish, but as these will not affect the evaluation, we recommend focusing on an implementation that passes the tests first.

Submission method

Please compress the repository, including your implemented solution, into a ZIP file and submit it via the upload form.

About

codetest-docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •