Skip to content

Ticket Purchase Web Service with Service-Oriented Backend Architecture

Notifications You must be signed in to change notification settings

CS601-F18/project-4-pontakornp

Repository files navigation

Ticket Purchase Web Service with Service-Oriented Backend Architecture

Overview

The architecture of the service will be as follows:

architecture

Web Front End - The web front end will implement an external web service API for the application and will support APIs for the following operations:

  1. Get a list of all events
  2. Create a new event
  3. Get details about a specific event
  4. Purchase tickets for an event
  5. Create a user
  6. See a user's information, including details of all events for which the user has purchased tickets
  7. Transfer tickets from one user to another

Event Service - The event service will manage the list of events and the number of tickets sold and available for each. When a ticket is purchased it is the responsibility of the Event Service to notify the User Service of the user's purchase. The API will support the following operations:

  1. Create a new event
  2. Get a list of all events
  3. Get details about a specific event
  4. Purchase tickets for an event, updating the user's ticket list

User Service - The user service will manage the user account information, including the events for which a user has purchased tickets. The API will support the following operations:

  1. Create a new user
  2. Get user details
  3. Add a new ticket for a user
  4. Transfer tickets from one user to another

API

Front End Service

GET /events

Responses:

CodeDescription
200Event Details
[
	{
		"eventid": 0, 
		"eventname": "string", 
		"userid": 0,		
		"avail": 0, 
		"purchased": 0
	} 
]
	
400No events found
POST /events/create

Body:

{
	"userid": 0,
	"eventname": "string",
	"numtickets": 0
}

Responses:

CodeDescription
200Event created
{
	"eventid": 0
}	
400Event unsuccessfully created
GET /events/{eventid}

Responses:

CodeDescription
200Event Details
{
	"eventid": 0, 
	"eventname": "string", 
	"userid": 0,		
	"avail": 0, 
	"purchased": 0
}
400Event not found
POST /events/{eventid}/purchase/{userid} Body:
{
	"tickets": 0
}

Responses:

CodeDescription
200Tickets purchased
400Tickets could not be purchased
POST /users/create

Body:

{
	"username": "string"
}

Responses:

CodeDescription
200User created
{
	"userid": 0
}	
400User could not be created
GET /users/{userid}

Responses:

CodeDescription
200User Details
{
	"userid": 0,
	"username": "string",
	"tickets": [
		{
			"eventid": 0, 
			"eventname": "string", 
			"userid": 0,		
			"avail": 0, 
			"purchased": 0
		}
	]	
}
400User not found
POST /users/{userid}/tickets/transfer

Body:

{
	"eventid": 0,
	"tickets": 0,
	"targetuser": 0
}

Responses:

CodeDescription
200Event tickets transferred
400Tickets could not be transferred

Event Service

POST /create

Body:

{
	"userid": 0,
	"eventname": "string",
	"numtickets": 0
}

Responses:

CodeDescription
200Event created
{
	"eventid": 0
}	
400Event unsuccessfully created
GET /list

Responses:

CodeDescription
200List of events
[
	{
		"eventid": 0, 
		"eventname": "string", 
		"userid": 0,		
		"avail": 0, 
		"purchased": 0
	}
]	
GET /{eventid}

Responses:

CodeDescription
200Event details
{
	"eventid": 0, 
	"eventname": "string", 
	"userid": 0,		
	"avail": 0, 
	"purchased": 0
}
400Event not found
POST /purchase/{eventid}

Body:

{
	"userid": 0,
	"eventid": 0,
	"tickets": 0
}

Responses:

CodeDescription
200Event tickets purchased
400Tickets could not be purchased

User Service

POST /create

Body:

{
	"username": "string"
}

Responses:

CodeDescription
200User created
{
	"userid": 0
}	
400User unsuccessfully created
GET /{userid}

Responses:

CodeDescription
200User details
{
	"userid": 0,
	"username": "string",
	"tickets": [
		{
			"eventid": 0
		}
	]
}
400User not found
POST /{userid}/tickets/add

Body:

{
	"eventid": 0,
	"tickets": 0
}

Responses:

CodeDescription
200Event tickets added
400Tickets could not be added
POST /{userid}/tickets/transfer

Body:

{
	"eventid": 0,
	"tickets": 0,
	"targetuser": 0
}

Responses:

CodeDescription
200Event tickets transfered
400Tickets could not be transfered

About

Ticket Purchase Web Service with Service-Oriented Backend Architecture

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages