Skip to content

antonch1989/testwork

Repository files navigation

testwork

Answers the questions in "Test work backend" part.

There is a little test sample (PatientControllerTest). This is functional test making request to /patient/ page and expecting to receive 200 status code.

Most of the times I used FOSUserBundle for registration and authentication. It's pretty good when standard registration is required, it's also pretty easy to customize. I have experience in creating Symfony based authentication mechanism from scratch also.

Answers to "OUR QUESTIONS PART"

How would you build a reference?

I would rely on doctrine ORM in this. After describing of the entity it's easy to generate sql migration using DoctrineMigrationsBundle

For the doctor entity I would use doctrine ManyToMany. In database layer it would be a separate table having columns id, patient_id, doctor_id

For invoice I assume that each invoice should have patient_id (The person who has to pay for services). So in Patient doctrine entity we have OneToMany relation with Invoice entity to get collection of invoices and in Invoice entity we have ManyToOne relation to get single Patient entity (owner of this Invoice). In database it will be table of invoices with patient_id column in it

How to set up application

Here we have pretty standard symfony based application. I use Vagrant for development, so please install it. Ansible (tool for provision) should also be installed

Once you've installed Vargrant and Ansible please clone project to which ever directory you like. After that call command "vagrant up" in your terminal

It will take a while for the first time, because vagrant will donwload box and run Ansible

It work fine with Ubuntu 14.04, Vagrant 1.8.6, ansible 2.3.0.0

Install composer dependencies. To achieve this please run "composer install"

Ssh to your box using command "vagrant ssh"

Being inside vagrant box run "php bin/console doctrine:migrations:migrate" to run migrations

Being inside vagrant box run "php bin/console doctrine:fixtures:load" to load fixture data

Application is ready for usage and available in browser by http://192.168.33.10 . Routes are defined via annotations inside PatientController

About

Test work for CRM project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published