amity-golang

command module
v0.0.0-...-e5d75c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2017 License: MIT Imports: 4 Imported by: 0

README

[Amity-Golang]

This is the Amity room allocations system built in golang.

Visit Amity Space Allocation System for more information.

Amity is an Andela facility that has several rooms in it. A room can be either a Living Space or an Office Space. An Office Space can accomodate a maximum of six people and the Living Space can accomodate a maximum of four people at ago.

The Amity Space Allocation allocate people either Livingspace or Officespace.

A room can be allocated ONLY to a staff or a fellow at Andela. Staff cannot be allocated any living spaces. Fellows have a choice to choose a living space or not.

Installation

Clone git clone https://github.com/dmigwi/amity-golang.git

Setup the Environment

  • Create a postgres database
CREATE USER amity WITH PASSWORD "12345";

CREATE DATABASE amity WITH OWNER amity;

GRANT ALL PRIVILEGES ON DATABASE amity To amity;
  • Install the dependencies
glide install
  • Create a .env file in the root folder with following configuration:
export AG_DATABASE=amity
export AG_USER=amity
export AG_PASSWORD=12345

Run the Tests

Chmod +x run_test.sh
./run_test.sh

Run the system

  • Set PATH to create an application:
export PATH=$PATH:$GOPATH/n
  • Install the binaries
go install

Usage

Create Room

Command: amity-golang create_room <room_name> <room_type>

  • Creates rooms in Amity. This command allows one to create a new room

Add Person

Command: amity-golang add_person <First_Name> <Last_Name> <fellow|staff> <office_Name> <livingSpace_Name>

  • Adds a person to the system and allocates the person to the room (s) if they are available.

Reallocate Person

Command: amity-golang reallocate_person <First_Name> <Last_Name> <New_Room_Name>

  • Reallocate the person with person_name to new_room_name.

Print Allocations

Command: amity-golang print_allocations

  • Prints a list of allocations onto the screen.

    Room Details
    =====================
    Capacity : 6
    ID : 31e6c28c-8e55-47b9-a786-803ff29b3c2c
    Name : Narnia
    Type : office
    Occupants -
    =====================

Print Room

Command: amity-golang print_room <room_name>

  • Prints the names of all the people in room_name on the screen.

Print Unallocated People

Command: amity-golang print_unallocated_people

  • Prints a list of unallocated people to the screen. The file name is optional, if its not provided, data is not printed in a file.

@Migwi-Ndung'u 2017

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL