Building Microservices API in Go - Assignment Solution: Enhance GetAllCustomers API

Building Microservices API in Go - Assignment Solution: Enhance GetAllCustomers API

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial covers the enhancement of an existing API to retrieve customers by their status. It begins with an introduction to the assignment and the objective of enhancing the API. The tutorial then explains starting from the domain and enhancing the 'find all' method to handle status as a string for flexibility. The implementation is done in the Customerrepositorydb, where the logic for handling empty and specific status values is detailed. The service side logic is discussed, focusing on transforming status from active/inactive to codes. Finally, the tutorial concludes with testing the code and a brief mention of future refactoring using SQL X.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of enhancing the existing API in the assignment?

To delete inactive customers

To update customer addresses

To add new customer fields

To retrieve customers by their status

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the Customerrepositorydb implementation, what happens if the status is an empty string?

Only inactive customers are returned

All customers are returned

Only active customers are returned

No customers are returned

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is the status value passed from the handler to the service?

As an integer

As a boolean

As a float

As a string

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What transformation is performed on the status values in the service?

From numbers to strings

From strings to numbers

From booleans to strings

From floats to integers

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the role of the service in handling status values?

To store status values

To transform status values

To delete status values

To ignore status values

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the expected result when no status parameter is sent in the request?

Only inactive customers are retrieved

No customers are retrieved

Only active customers are retrieved

All customers are retrieved

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which library is mentioned for future code refactoring?

SQL A

SQL Y

SQL X

SQL Z