Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: show user listings total income rented (HOM-143) #57

Merged
merged 3 commits into from
Nov 30, 2024

Conversation

Hoxtygen
Copy link
Owner

@Hoxtygen Hoxtygen commented Nov 30, 2024

What does this PR do?

  • Created data for dashboard analytics

Description of tasks to be completed

  • Create aggregation pipeline for the aggregation of data for analytics
  • Create Service and Controller layers

How can this be manually tested?

  • Clone the repository
  • Open a terminal and cd to the project directories
  • Install dependencies
  • Run the project
  • Register a user by sending a POST request to http://localhost:8080/api/v1/auth/register with the required data.
  • Open your email, copy the verification link, and extract the token from the link
  • Verify your email by sending a GET request to http://localhost:8080/api/v1/auth/verifyEmail?token=${copied_token}
  • Send a POST request to http://localhost:8080/api/v1/auth/login to login
  • Copy the access token from the login response
  • Attach the copied token to the request header and send a GET request to http://localhost:8080/api/v1/listings/listing-statistics
curl --location 'http://localhost:8080/api/v1/listings/listing-statistics' \
--header 'Authorization: Bearer {token}'

// Response
{
    "status": "OK",
    "message": "Statistics data retrieved successfully",
    "data": {
        "total_listings": 5,
        "rented_listings": 1,
        "total_income": 779754.0,
        "income": [
            {
                "months": [
                    {
                        "name": "January",
                        "amount": 0
                    },
                    {
                        "name": "February",
                        "amount": 0
                    },
                    {
                        "name": "March",
                        "amount": 0
                    },
                    {
                        "name": "April",
                        "amount": 0
                    },
                    {
                        "name": "May",
                        "amount": 0
                    },
                    {
                        "name": "June",
                        "amount": 0
                    },
                    {
                        "name": "July",
                        "amount": 779754.0
                    },
                    {
                        "name": "August",
                        "amount": 0
                    },
                    {
                        "name": "September",
                        "amount": 0
                    },
                    {
                        "name": "October",
                        "amount": 0
                    },
                    {
                        "name": "November",
                        "amount": 0
                    },
                    {
                        "name": "December",
                        "amount": 0
                    }
                ],
                "year": 2023
            }
        ],
        "listings": [
            {
                "months": [
                    {
                        "name": "January",
                        "amount": 0
                    },
                    {
                        "name": "February",
                        "amount": 0
                    },
                    {
                        "name": "March",
                        "amount": 0
                    },
                    {
                        "name": "April",
                        "amount": 0
                    },
                    {
                        "name": "May",
                        "amount": 0
                    },
                    {
                        "name": "June",
                        "amount": 0
                    },
                    {
                        "name": "July",
                        "amount": 2
                    },
                    {
                        "name": "August",
                        "amount": 3
                    },
                    {
                        "name": "September",
                        "amount": 0
                    },
                    {
                        "name": "October",
                        "amount": 0
                    },
                    {
                        "name": "November",
                        "amount": 0
                    },
                    {
                        "name": "December",
                        "amount": 0
                    }
                ],
                "year": 2023
            }
        ]
    }
}

What are the relevant jira board stories?

HOM-143

Remove @Valid annotation from service layer method.
This feature gives statistical information about the following
1. total listings
2. rented listings
3.  total income
4. Yearly income broken down by monthly earnins
5. Yearly listings broken down by monthly listing

This gives the agent an overview of their performance.
Copy link
Owner Author

@Hoxtygen Hoxtygen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge PR

@Hoxtygen Hoxtygen merged commit 5899280 into develop Nov 30, 2024
2 checks passed
@Hoxtygen Hoxtygen deleted the feat-show-user-listings-total-income-rented-HOM-143 branch November 30, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant