Skip to content

Design of a Backend API for a ticket system written in Java, applying SOLID, Clean Architecture and Domain-Driven-Design. The framework used in question is Spring Boot, with the Spring Data JPA and Spring Security modules.

License

Notifications You must be signed in to change notification settings

ifspcbt-devspace/tickets-ifsp-api

Repository files navigation

Tickets IFSP

TicketsIFSP/Company

GET Get company by id

GET /v1/company/{id}

Get company information by id

Params

Name Location Type Required Description
id path string yes none

Response Examples

200 Response

{
  "id": "string",
  "name": "string",
  "description": "string",
  "cnpj": "string",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip_code": "string"
  }
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Company found CompanyResponse
404 Not Found Company not found APIErrorResponse

PUT Update company

PUT /v1/company/{id}

Update company information

Body Parameters

{
  "name": "string",
  "description": "string",
  "cnpj": "string"
}

Params

Name Location Type Required Description
id path string yes none
body body UpdateCompanyRequest no none

Response Examples

200 Response

{
  "id": "string",
  "name": "string",
  "description": "string",
  "cnpj": "string",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip_code": "string"
  }
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Company updated successfully CompanyResponse
400 Bad Request Invalid request APIErrorResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse
404 Not Found Company not found APIErrorResponse

DELETE Delete company

DELETE /v1/company/{id}

Delete company by id

Params

Name Location Type Required Description
id path string yes none

Response Examples

204 Response

{}

401 Response

Responses

HTTP Status Code Meaning Description Data schema
204 No Content Company deleted successfully Inline
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse
404 Not Found Company not found APIErrorResponse

Responses Data Schema

POST Create company

POST /v1/company

Create a new company

Body Parameters

{
  "owner_id": "string",
  "name": "string",
  "description": "string",
  "cnpj": "string",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "zip_code": "string"
  }
}

Params

Name Location Type Required Description
body body CreateCompanyRequest no none

Response Examples

201 Response

{}

400 Response

Responses

HTTP Status Code Meaning Description Data schema
201 Created Company created successfully Inline
400 Bad Request Invalid request APIErrorResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse

Responses Data Schema

POST Search companies

POST /v1/company/search

Search companies by name, cnpj, state, city, neighborhood, street, number, complement, zip code, phone, email, website, and contact name

Body Parameters

{
  "filters": [
    {
      "filter_key": "string",
      "value": {},
      "operation": "eq",
      "data_option": "all"
    }
  ],
  "sorts": [
    {
      "sort": "string",
      "direction": "asc"
    }
  ]
}

Params

Name Location Type Required Description
page query integer(int32) no none
perPage query integer(int32) no none
body body AdvancedSearchRequest no none

Response Examples

200 Response

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "cnpj": "string",
      "address": {
        "street": "string",
        "number": "string",
        "complement": "string",
        "neighborhood": "string",
        "city": "string",
        "state": "string",
        "country": "string",
        "zip_code": "string"
      }
    }
  ]
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Companies found PaginationSearchCompanyResponse
400 Bad Request Invalid request APIErrorResponse

TicketsIFSP/Auth

GET Get user by id

GET /v1/auth/{id}

Get user information by id

Params

Name Location Type Required Description
id path string yes none

Response Examples

200 Response

{
  "id": "string",
  "name": "string",
  "email": "string",
  "username": "string",
  "role": {
    "code": 0,
    "description": "string"
  },
  "birth_date": "string",
  "document_initials": "string",
  "phone_number_initials": "string",
  "company_id": "string"
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK User found successfully UserResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse
404 Not Found User not found APIErrorResponse

PUT Update user

PUT /v1/auth/{id}

Update user information

Body Parameters

{
  "name": "string",
  "bio": "string",
  "birth_date": "string",
  "document": "string"
}

Params

Name Location Type Required Description
id path string yes none
body body UpdateUserRequest no none

Response Examples

200 Response

{
  "id": "string",
  "name": "string",
  "email": "string",
  "username": "string",
  "role": {
    "code": 0,
    "description": "string"
  },
  "birth_date": "string",
  "document_initials": "string",
  "phone_number_initials": "string",
  "company_id": "string"
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK User updated successfully UserResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse
404 Not Found User not found APIErrorResponse

POST Register user

POST /v1/auth/register

Register a new user

Body Parameters

{
  "name": "string",
  "email": "string",
  "username": "string",
  "password": "string",
  "birth_date": "string",
  "document": "string",
  "phone_number": "string"
}

Params

Name Location Type Required Description
body body RegisterRequest no none

Response Examples

201 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
201 Created User registered successfully Inline
400 Bad Request Invalid request APIErrorResponse

Responses Data Schema

POST Forgot password

POST /v1/auth/recovery/{login}

Send recovery request to user

Params

Name Location Type Required Description
login path string yes none

Response Examples

204 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
204 No Content Recovery request sent successfully Inline
400 Bad Request Invalid login APIErrorResponse

Responses Data Schema

POST Change password

POST /v1/auth/recovery/change

Change user password

Body Parameters

{
  "token": "string",
  "password": "string"
}

Params

Name Location Type Required Description
body body RecoveryRequest no none

Response Examples

204 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
204 No Content Password changed successfully Inline
400 Bad Request Invalid request APIErrorResponse

Responses Data Schema

POST Login

POST /v1/auth/login

Authenticate user

Body Parameters

{
  "login": "string",
  "password": "string"
}

Params

Name Location Type Required Description
body body LoginRequest no none

Response Examples

200 Response

{
  "token": "string",
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "username": "string",
    "role": {
      "code": 0,
      "description": "string"
    },
    "birth_date": "string",
    "document_initials": "string",
    "phone_number_initials": "string",
    "company_id": "string"
  }
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK User logged in successfully LoginResponse
401 Unauthorized Invalid credentials APIErrorResponse

POST Activate user

POST /v1/auth/activate/{token}

Activate user account

Params

Name Location Type Required Description
token path string yes none

Response Examples

204 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
204 No Content User activated successfully Inline
400 Bad Request Invalid token APIErrorResponse

Responses Data Schema

TicketsIFSP/Event

POST Create event

POST /v1/event

Create a new event

Body Parameters

{
  "company_id": "string",
  "name": "string",
  "description": "string",
  "init_date": "2019-08-24",
  "end_date": "2019-08-24",
  "configuration": {
    "property1": "string",
    "property2": "string"
  }
}

Params

Name Location Type Required Description
body body CreateEventRequest no none

Response Examples

201 Response

{}

400 Response

Responses

HTTP Status Code Meaning Description Data schema
201 Created Event created successfully Inline
400 Bad Request Invalid request APIErrorResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse

Responses Data Schema

GET Get ticket sale by event id

GET /v1/event/{id}/ticketSale

Get ticket sale by event id

Params

Name Location Type Required Description
id path string yes none

Response Examples

200 Response

Responses

HTTP Status Code Meaning Description Data schema
200 OK Ticket Sale list PaginationTicketSaleResponse
400 Bad Request Invalid request APIErrorResponse

POST Create ticket sale

POST /v1/event/{id}/ticketSale

Create a new ticket sale

Body Parameters

{
  "name": "string",
  "description": "string",
  "price": 0,
  "entries": 0,
  "active": true
}

Params

Name Location Type Required Description
id path string yes none
body body CreateTicketSaleRequest no none

Response Examples

201 Response

{}

400 Response

Responses

HTTP Status Code Meaning Description Data schema
201 Created Ticket Sale created successfully Inline
400 Bad Request Invalid request APIErrorResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse

Responses Data Schema

GET Obter thumbnail

GET /v1/event/{id}/thumbnail

Obter thumbnail do evento.

Params

Name Location Type Required Description
id path string yes none

Response Examples

200 Response

Responses

HTTP Status Code Meaning Description Data schema
200 OK Thumbnail found Inline
400 Bad Request Invalid id APIErrorResponse
401 Unauthorized Unauthorized APIErrorResponse
404 Not Found Thumbnail not found APIErrorResponse

Responses Data Schema

POST Upload thumbnail

POST /v1/event/{id}/thumbnail

Upload thumbnail do evento.

Body Parameters

file: ""

Params

Name Location Type Required Description
id path string yes none
fileName query string yes none
body body object no none
» file body string(binary) yes none

Response Examples

202 Response

Responses

HTTP Status Code Meaning Description Data schema
202 Accepted Thumbnail uploaded Inline
400 Bad Request Invalid id APIErrorResponse
401 Unauthorized Unauthorized APIErrorResponse
404 Not Found Event not found APIErrorResponse

Responses Data Schema

DELETE Deletar thumbnail

DELETE /v1/event/{id}/thumbnail

Deletar thumbnail do evento.

Params

Name Location Type Required Description
id path string yes none

Response Examples

204 Response

Responses

HTTP Status Code Meaning Description Data schema
204 No Content Thumbnail deleted Inline
400 Bad Request Invalid id APIErrorResponse
401 Unauthorized Unauthorized APIErrorResponse
404 Not Found Thumbnail not found APIErrorResponse

Responses Data Schema

POST Search events

POST /v1/event/search

Search events by name, date, location, or category

Body Parameters

{
  "filters": [
    {
      "filter_key": "string",
      "value": {},
      "operation": "eq",
      "data_option": "all"
    }
  ],
  "sorts": [
    {
      "sort": "string",
      "direction": "asc"
    }
  ]
}

Params

Name Location Type Required Description
page query integer(int32) no none
perPage query integer(int32) no none
body body AdvancedSearchRequest no none

Response Examples

200 Response

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "company_id": "string",
      "init_date": "2019-08-24",
      "end_date": "2019-08-24",
      "status": "SCHEDULED",
      "address": {
        "street": "string",
        "number": "string",
        "complement": "string",
        "neighborhood": "string",
        "city": "string",
        "state": "string",
        "country": "string",
        "zip_code": "string"
      },
      "configuration": {
        "property1": "string",
        "property2": "string"
      }
    }
  ]
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Events retrieved successfully PaginationSearchEventResponse
400 Bad Request Invalid request APIErrorResponse

GET Get event by id

GET /v1/event/{id}

Get event information by id

Params

Name Location Type Required Description
id path string yes none

Response Examples

200 Response

{
  "id": "string",
  "name": "string",
  "description": "string",
  "company_id": "string",
  "init_date": "2019-08-24",
  "end_date": "2019-08-24",
  "status": "SCHEDULED",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip_code": "string"
  },
  "configuration": {
    "property1": "string",
    "property2": "string"
  }
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Event found successfully EventResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse
404 Not Found Event not found APIErrorResponse

TicketsIFSP/Enrollment

POST Create enrollment

POST /v1/enrollment

Create a new enrollment

Body Parameters

{
  "event_id": "string",
  "name": "string",
  "email": "string",
  "document": "string",
  "birth_date": "2019-08-24",
  "ticket_sale_id": "string",
  "ticket_id": "string"
}

Params

Name Location Type Required Description
body body CreateEnrollmentRequest no none

Response Examples

Enrollment created successfully

"3266a228-d496-4841-b31c-195d1a3e9ee5"

400 Response

{
  "message": "string",
  "status": 0,
  "errors": [
    {
      "message": "string"
    }
  ]
}

Responses

HTTP Status Code Meaning Description Data schema
201 Created Enrollment created successfully string
400 Bad Request Invalid request APIErrorResponse

POST Payment

POST /v1/enrollment/webhook

Receive payment webhook

Body Parameters

{
  "data": {
    "id": "string"
  },
  "date_created": "2019-08-24T14:15:22Z",
  "action": "string"
}

Params

Name Location Type Required Description
body body CreatePaymentRequest no none

Response Examples

201 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
201 Created Webhook received successfully Inline
400 Bad Request Invalid request APIErrorResponse

Responses Data Schema

POST Create or update enrollment

POST /v1/enrollment/upsert

Create or update an enrollment

Body Parameters

{
  "event_id": "string",
  "name": "string",
  "email": "string",
  "document": "string",
  "birth_date": "2019-08-24",
  "ticket_sale_id": "string"
}

Params

Name Location Type Required Description
body body CreateUpsertEnrollmentRequest no none

Response Examples

201 Response

400 Response

{
  "message": "string",
  "status": 0,
  "errors": [
    {
      "message": "string"
    }
  ]
}

Responses

HTTP Status Code Meaning Description Data schema
201 Created Upsert enrollment created successfully string
400 Bad Request Invalid request APIErrorResponse

GET List enrollments

GET /v1/enrollment/list

List enrollments by user

Response Examples

200 Response

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "user_id": "string",
      "event_id": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "status": "WAITING_CONFIRMATION",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Enrollments retrieved successfully PaginationEnrollmentResponse
400 Bad Request Invalid request APIErrorResponse

TicketsIFSP/Ticket

PATCH Check ticket

PATCH /v1/ticket/{id}/check

Check ticket by id

Params

Name Location Type Required Description
id path string yes none

Response Examples

202 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
202 Accepted Ticket checked successfully Inline
400 Bad Request Invalid request APIErrorResponse
404 Not Found Ticket not found APIErrorResponse

Responses Data Schema

GET Get ticket by id

GET /v1/ticket/{id}

Get ticket information by id

Params

Name Location Type Required Description
id path string yes none

Response Examples

200 Response

{
  "id": "string",
  "user_id": "string",
  "document": "string",
  "event_id": "string",
  "description": "string",
  "valid_in": "2019-08-24",
  "expired_in": "2019-08-24",
  "status": "AVAILABLE",
  "code": "string",
  "last_time_consumed": "2019-08-24T14:15:22Z"
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Ticket found successfully TicketResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse
404 Not Found Ticket not found APIErrorResponse

GET Search tickets by user

GET /v1/ticket/search/user/{id}

Search tickets by user id

Params

Name Location Type Required Description
id path string yes none
page query integer(int32) no none
perPage query integer(int32) no none
terms query string no none

Response Examples

200 Response

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "user_id": "string",
      "document": "string",
      "event_id": "string",
      "description": "string",
      "valid_in": "2019-08-24",
      "expired_in": "2019-08-24",
      "status": "AVAILABLE",
      "code": "string",
      "last_time_consumed": "2019-08-24T14:15:22Z"
    }
  ]
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Tickets retrieved successfully PaginationTicketResponse
401 Unauthorized Invalid credentials APIErrorResponse
403 Forbidden Access denied APIErrorResponse
404 Not Found Tickets not found APIErrorResponse

TicketsIFSP/Cep

GET Get address by cep

GET /v1/cep/{cep}

Get address information by brazilian zip code

Params

Name Location Type Required Description
cep path string yes none

Response Examples

200 Response

{
  "cep": "string",
  "street": "string",
  "neighborhood": "string",
  "city": "string",
  "state": "string"
}

Responses

HTTP Status Code Meaning Description Data schema
200 OK Cep found ZipCodeResponse
404 Not Found Cep not found APIErrorResponse

Data Schema

AddressResponse

{
  "street": "string",
  "number": "string",
  "complement": "string",
  "neighborhood": "string",
  "city": "string",
  "state": "string",
  "country": "string",
  "zip_code": "string"
}

Attribute

Name Type Required Restrictions Title Description
street string false none none
number string false none none
complement string false none none
neighborhood string false none none
city string false none none
state string false none none
country string false none none
zip_code string false none none

CompanyResponse

{
  "id": "string",
  "name": "string",
  "description": "string",
  "cnpj": "string",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip_code": "string"
  }
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
name string false none none
description string false none none
cnpj string false none none
address AddressResponse false none none

APIError

{
  "message": "string"
}

Attribute

Name Type Required Restrictions Title Description
message string false none none

APIErrorResponse

{
  "message": "string",
  "status": 0,
  "errors": [
    {
      "message": "string"
    }
  ]
}

Attribute

Name Type Required Restrictions Title Description
message string false none none
status integer(int32) false none none
errors [APIError] false none none

UpdateCompanyRequest

{
  "name": "string",
  "description": "string",
  "cnpj": "string"
}

Attribute

Name Type Required Restrictions Title Description
name string false none none
description string false none none
cnpj string false none none

RoleResponse

{
  "code": 0,
  "description": "string"
}

Attribute

Name Type Required Restrictions Title Description
code integer(int32) false none none
description string false none none

UserResponse

{
  "id": "string",
  "name": "string",
  "email": "string",
  "username": "string",
  "role": {
    "code": 0,
    "description": "string"
  },
  "birth_date": "string",
  "document_initials": "string",
  "phone_number_initials": "string",
  "company_id": "string"
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
name string false none none
email string false none none
username string false none none
role RoleResponse false none none
birth_date string false none none
document_initials string false none none
phone_number_initials string false none none
company_id string false none none

UpdateUserRequest

{
  "name": "string",
  "bio": "string",
  "birth_date": "string",
  "document": "string"
}

Attribute

Name Type Required Restrictions Title Description
name string false none none
bio string false none none
birth_date string false none none
document string false none none

CreateEventRequest

{
  "company_id": "string",
  "name": "string",
  "description": "string",
  "init_date": "2019-08-24",
  "end_date": "2019-08-24",
  "configuration": {
    "property1": "string",
    "property2": "string"
  }
}

Attribute

Name Type Required Restrictions Title Description
company_id string false none none
name string false none none
description string false none none
init_date string(date) false none none
end_date string(date) false none none
configuration object false none none
» additionalProperties string false none none

CreateTicketSaleRequest

{
  "name": "string",
  "description": "string",
  "price": 0,
  "entries": 0,
  "active": true
}

Attribute

Name Type Required Restrictions Title Description
name string false none none
description string false none none
price number false none none
entries integer(int32) false none none
active boolean false none none

AdvancedSearchRequest

{
  "filters": [
    {
      "filter_key": "string",
      "value": {},
      "operation": "eq",
      "data_option": "all"
    }
  ],
  "sorts": [
    {
      "sort": "string",
      "direction": "asc"
    }
  ]
}

Attribute

Name Type Required Restrictions Title Description
filters [SearchFilterRequest] false none The filters to be used in the search
sorts [SortSearchRequest] false none The sorts to be used in the search

SortSearchRequest

{
  "sort": "string",
  "direction": "asc"
}

The sorts to be used in the search

Attribute

Name Type Required Restrictions Title Description
sort string false none The field to sort the results by
direction string false none The direction to sort the results by

Enum

Name Value
direction asc
direction desc

SearchFilterRequest

{
  "filter_key": "string",
  "value": {},
  "operation": "eq",
  "data_option": "all"
}

The filters to be used in the search

Attribute

Name Type Required Restrictions Title Description
filter_key string false none The key to search for
value object false none The value to search for
operation string false none The comparison used to search for the term
data_option string false none The option used to combine the search criteria

Enum

Name Value
operation eq
operation ne
operation gt
operation ge
operation lt
operation le
operation cn
operation ic
operation bw
operation ib
operation ew
operation ie
operation nc
operation bn
operation en
operation nu
operation nn
data_option all
data_option any

PaginationSearchEventResponse

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "company_id": "string",
      "init_date": "2019-08-24",
      "end_date": "2019-08-24",
      "status": "SCHEDULED",
      "address": {
        "street": "string",
        "number": "string",
        "complement": "string",
        "neighborhood": "string",
        "city": "string",
        "state": "string",
        "country": "string",
        "zip_code": "string"
      },
      "configuration": {
        "property1": "string",
        "property2": "string"
      }
    }
  ]
}

Attribute

Name Type Required Restrictions Title Description
currentPage integer(int32) false none none
perPage integer(int32) false none none
total integer(int64) false none none
items [SearchEventResponse] false none none

SearchEventResponse

{
  "id": "string",
  "name": "string",
  "description": "string",
  "company_id": "string",
  "init_date": "2019-08-24",
  "end_date": "2019-08-24",
  "status": "SCHEDULED",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip_code": "string"
  },
  "configuration": {
    "property1": "string",
    "property2": "string"
  }
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
name string false none none
description string false none none
company_id string false none none
init_date string(date) false none none
end_date string(date) false none none
status string false none none
address AddressResponse false none none
configuration object false none none
» additionalProperties string false none none

Enum

Name Value
status SCHEDULED
status PUBLISHED
status OPENED
status IN_PROGRESS
status CANCELED
status FINISHED

CreateEnrollmentRequest

{
  "event_id": "string",
  "name": "string",
  "email": "string",
  "document": "string",
  "birth_date": "2019-08-24",
  "ticket_sale_id": "string",
  "ticket_id": "string"
}

Attribute

Name Type Required Restrictions Title Description
event_id string false none none
name string false none none
email string false none none
document string false none none
birth_date string(date) false none none
ticket_sale_id string false none none
ticket_id string false none none

CreatePaymentRequest

{
  "data": {
    "id": "string"
  },
  "date_created": "2019-08-24T14:15:22Z",
  "action": "string"
}

Attribute

Name Type Required Restrictions Title Description
data DataModel false none none
date_created string(date-time) false none none
action string false none none

DataModel

{
  "id": "string"
}

Attribute

Name Type Required Restrictions Title Description
id string false none none

CreateUpsertEnrollmentRequest

{
  "event_id": "string",
  "name": "string",
  "email": "string",
  "document": "string",
  "birth_date": "2019-08-24",
  "ticket_sale_id": "string"
}

Attribute

Name Type Required Restrictions Title Description
event_id string false none none
name string false none none
email string false none none
document string false none none
birth_date string(date) false none none
ticket_sale_id string false none none

CreateAddressRequest

{
  "street": "string",
  "number": "string",
  "complement": "string",
  "neighborhood": "string",
  "city": "string",
  "state": "string",
  "zip_code": "string"
}

Attribute

Name Type Required Restrictions Title Description
street string false none none
number string false none none
complement string false none none
neighborhood string false none none
city string false none none
state string false none none
zip_code string false none none

CreateCompanyRequest

{
  "owner_id": "string",
  "name": "string",
  "description": "string",
  "cnpj": "string",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "zip_code": "string"
  }
}

Attribute

Name Type Required Restrictions Title Description
owner_id string false none none
name string false none none
description string false none none
cnpj string false none none
address CreateAddressRequest false none none

PaginationSearchCompanyResponse

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "cnpj": "string",
      "address": {
        "street": "string",
        "number": "string",
        "complement": "string",
        "neighborhood": "string",
        "city": "string",
        "state": "string",
        "country": "string",
        "zip_code": "string"
      }
    }
  ]
}

Attribute

Name Type Required Restrictions Title Description
currentPage integer(int32) false none none
perPage integer(int32) false none none
total integer(int64) false none none
items [SearchCompanyResponse] false none none

SearchCompanyResponse

{
  "id": "string",
  "name": "string",
  "description": "string",
  "cnpj": "string",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip_code": "string"
  }
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
name string false none none
description string false none none
cnpj string false none none
address AddressResponse false none none

RegisterRequest

{
  "name": "string",
  "email": "string",
  "username": "string",
  "password": "string",
  "birth_date": "string",
  "document": "string",
  "phone_number": "string"
}

Attribute

Name Type Required Restrictions Title Description
name string false none none
email string false none none
username string false none none
password string false none none
birth_date string false none none
document string false none none
phone_number string false none none

RecoveryRequest

{
  "token": "string",
  "password": "string"
}

Attribute

Name Type Required Restrictions Title Description
token string false none none
password string false none none

LoginResponse

{
  "token": "string",
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "username": "string",
    "role": {
      "code": 0,
      "description": "string"
    },
    "birth_date": "string",
    "document_initials": "string",
    "phone_number_initials": "string",
    "company_id": "string"
  }
}

Attribute

Name Type Required Restrictions Title Description
token string false none none
user UserResponse false none none

LoginRequest

{
  "login": "string",
  "password": "string"
}

Attribute

Name Type Required Restrictions Title Description
login string false none none
password string false none none

TicketResponse

{
  "id": "string",
  "user_id": "string",
  "document": "string",
  "event_id": "string",
  "description": "string",
  "valid_in": "2019-08-24",
  "expired_in": "2019-08-24",
  "status": "AVAILABLE",
  "code": "string",
  "last_time_consumed": "2019-08-24T14:15:22Z"
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
user_id string false none none
document string false none none
event_id string false none none
description string false none none
valid_in string(date) false none none
expired_in string(date) false none none
status string false none none
code string false none none
last_time_consumed string(date-time) false none none

Enum

Name Value
status AVAILABLE
status CONSUMED
status EXPIRED
status CANCELED

EventResponse

{
  "id": "string",
  "name": "string",
  "description": "string",
  "company_id": "string",
  "init_date": "2019-08-24",
  "end_date": "2019-08-24",
  "status": "SCHEDULED",
  "address": {
    "street": "string",
    "number": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip_code": "string"
  },
  "configuration": {
    "property1": "string",
    "property2": "string"
  }
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
name string false none none
description string false none none
company_id string false none none
init_date string(date) false none none
end_date string(date) false none none
status string false none none
address AddressResponse false none none
configuration object false none none
» additionalProperties string false none none

Enum

Name Value
status SCHEDULED
status PUBLISHED
status OPENED
status IN_PROGRESS
status CANCELED
status FINISHED

PaginationTicketSaleResponse

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "event_id": "string",
      "name": "string",
      "description": "string",
      "price": 0,
      "entries": 0,
      "active": true
    }
  ]
}

Attribute

Name Type Required Restrictions Title Description
currentPage integer(int32) false none none
perPage integer(int32) false none none
total integer(int64) false none none
items [TicketSaleResponse] false none none

TicketSaleResponse

{
  "id": "string",
  "event_id": "string",
  "name": "string",
  "description": "string",
  "price": 0,
  "entries": 0,
  "active": true
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
event_id string false none none
name string false none none
description string false none none
price number false none none
entries integer(int32) false none none
active boolean false none none

PaginationTicketResponse

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "user_id": "string",
      "document": "string",
      "event_id": "string",
      "description": "string",
      "valid_in": "2019-08-24",
      "expired_in": "2019-08-24",
      "status": "AVAILABLE",
      "code": "string",
      "last_time_consumed": "2019-08-24T14:15:22Z"
    }
  ]
}

Attribute

Name Type Required Restrictions Title Description
currentPage integer(int32) false none none
perPage integer(int32) false none none
total integer(int64) false none none
items [TicketResponse] false none none

EnrollmentResponse

{
  "id": "string",
  "user_id": "string",
  "event_id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "status": "WAITING_CONFIRMATION",
  "updated_at": "2019-08-24T14:15:22Z"
}

Attribute

Name Type Required Restrictions Title Description
id string false none none
user_id string false none none
event_id string false none none
created_at string(date-time) false none none
status string false none none
updated_at string(date-time) false none none

Enum

Name Value
status WAITING_CONFIRMATION
status CONFIRMED
status DENIED

PaginationEnrollmentResponse

{
  "currentPage": 0,
  "perPage": 0,
  "total": 0,
  "items": [
    {
      "id": "string",
      "user_id": "string",
      "event_id": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "status": "WAITING_CONFIRMATION",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}

Attribute

Name Type Required Restrictions Title Description
currentPage integer(int32) false none none
perPage integer(int32) false none none
total integer(int64) false none none
items [EnrollmentResponse] false none none

ZipCodeResponse

{
  "cep": "string",
  "street": "string",
  "neighborhood": "string",
  "city": "string",
  "state": "string"
}

Attribute

Name Type Required Restrictions Title Description
cep string false none none
street string false none none
neighborhood string false none none
city string false none none
state string false none none

About

Design of a Backend API for a ticket system written in Java, applying SOLID, Clean Architecture and Domain-Driven-Design. The framework used in question is Spring Boot, with the Spring Data JPA and Spring Security modules.

Topics

Resources

License

Stars

Watchers

Forks

Languages