Giter VIP home page Giter VIP logo

tenant-management's Introduction

Hi! I'm Dalvin "DJ" Matthews

Linkedin: dalvinmatthews GitHub DalvinCodes

⚡ Technologies

Talk to me about:

  • Platform Engineering
  • Refactoring Monolithic Applications into Scalable Microservices
  • API Development in GO and Java
  • Securing APIs
  • Data Structures and Algorithms in GO, Java, or Python

What I'm interested in:

  • Bringing Software Development to light in under-served and under-represented communities
  • Developing SaaS Applications
  • Space and Quantum Physics
  • Machine Learning

tenant-management's People

Contributors

dalvincodes avatar dalvinmatthews avatar dependabot[bot] avatar renovate[bot] avatar

tenant-management's Issues

Implement "Update Tenant Subscription" function in the service layer.

Description: As a developer, I want to implement the "Update Tenant Subscription" function in the service layer, so that I can update subscription details for a specific tenant.

Acceptance Criteria:

A new "Update Tenant Subscription" function is implemented in the service layer.
The function takes input parameters such as tenant ID and updated subscription details.
The function updates the subscription details in the appropriate database.
The function returns a success message and/or an error message to the controller layer.
Unit tests are written and passing for the "Update Tenant Subscription" function.

Implement UpdateCompanyDetails function in Tenant Repository

Acceptance Criteria:

  • The UpdateCompanyDetails function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID and company update data.
  • The function updates the company details for a specific tenant ID in the MongoDB tenant collection.
  • The function returns a success message and/or an error message.

Description:
As a developer, I want to implement the UpdateCompanyDetails function in the TenantRepository interface, so that I can update the company details for a specific tenant ID in the MongoDB tenant collection.

Enable Secret and Environment Variable Injection in CI/CD Pipeline

Acceptance Criteria:

  • The CI/CD pipeline uses GitHub Actions for automated builds and deployments.
  • The original application.yaml file is removed from the repository to ensure security.
  • The application.yaml file, containing sensitive configurations, is stored as a secret in GitHub Secrets.
  • The application.yaml file is base64 encoded and stored securely as a secret.
  • The injected application.yaml file is used by the application during runtime.
  • The application.yaml file is injected into the repository's source code directory at "./infrastructure/config" during the CI/CD pipeline run.

Description: 

As a developer, I want to enable Secret and Environment Variable Injection in the CI/CD pipeline to securely manage sensitive configuration data. To achieve this, I will store the application.yaml file, containing sensitive information, as a secret in GitHub Secrets. The application.yaml file will be base64 encoded before being stored as a secret to ensure its security. During the CI/CD pipeline run, the application.yaml file will be injected into the repository's source code directory at "./infrastructure/config" so that the application can access and use the configuration during runtime. 

### Tasks
- [x] Base64 encode the application.yaml file
- [x] Store the base64-encoded application.yaml file as a secret in GitHub Secrets
- [x] Configure the CI/CD pipeline to inject the secret as an application.yaml file
- [x] Validate that the injected application.yaml file is being used by the application during runtime

Implement "Update Tenant" function in the service layer.

Description: As a developer, I want to implement the "Update Tenant" function in the service layer, so that I can update existing tenant information.

Acceptance Criteria:

A new "Update Tenant" function is implemented in the service layer.
The function takes input parameters such as tenant ID and updated information.
The function updates the tenant information in the appropriate database.
The function returns the updated tenant and/or an error message to the controller layer.
Unit tests are written and passing for the "Update Tenant" function.x≈

Implement GetByID function in Tenant Repository

Acceptance Criteria:

  • The GetByID function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID.
  • The function retrieves the tenant data for a specific tenant ID from the MongoDB tenant collection.
  • The function returns the tenant data and/or an error message.

Description:
As a developer, I want to implement the GetByID function in the TenantRepository interface, so that I can retrieve the tenant data for a specific tenant ID from the MongoDB tenant collection.

Implement "Update Tenant Fields" function in the service layer.

Description: As a developer, I want to implement the "Update Tenant Fields" function in the service layer, so that I can update any field(s) for a specific tenant.

Acceptance Criteria:

A new "Update Tenant Fields" function is implemented in the service layer.
The function takes input parameters such as tenant ID and a map of fields to update.
The function updates the specified field(s) in the appropriate database.
The function returns the updated tenant and/or an error message to the controller layer.
If the tenant does not exist in the database, the function should return an appropriate error message.
If no fields are provided to update, the function should return the existing tenant without making any updates.
Unit tests are written and passing for the "Update Tenant Fields" function.

Implement "Create Tenant" function in the service layer.

Description: As a developer, I want to implement the "Create Tenant" function in the service layer, so that I can create new tenants in the system.

Acceptance Criteria:

A new "Create Tenant" function is implemented in the service layer.
The function takes input parameters such as tenant information.
The function stores the new tenant information in the appropriate database.
The function returns the newly created tenant and/or an error message to the controller layer.
Unit tests are written and passing for the "Create Tenant" function.

Set Up Golang Environment

Description: As a developer, I want to set up the development environment for Golang, including installing the necessary tools and packages, so that I can develop the Tenant Management API using Golang.

Acceptance Criteria:

Golang is installed on the developer's machine.
The necessary packages and libraries are installed.

Create Tenant Repository Interface

Acceptance Criteria:

  • A new Golang file is created and named "tenant_repository.go".
  • The file contains code to define the TenantRepository interface with the given functions.
  • The interface is implemented in a separate file.

Description:
As a developer, I want to create a TenantRepository interface that defines the required functions for interacting with the tenant collection in the MongoDB database. The interface should be defined in a separate file and implemented in a different file.

Initialize Golang Project

Description: As a developer, I want to initialize a new Golang project in the repository and add the necessary files and directories, so that I can start writing the code for the Tenant Management API.

Acceptance Criteria:

A new Golang project is initialized in the repository.
The necessary files and directories are added, including "main.go", "controllers", "models", "routes", etc.
The project can be built and run without errors.

Define the Tenant-Management Microservice/App Service Layer interface

Acceptance Criteria

  • The Tenant-Management Microservice/App Service Layer interface is defined with the necessary functions to manage tenants.
  • The interface includes functions for creating, retrieving, updating, and deleting tenants.
  • The interface includes functions for retrieving tenant subscription details, company details, payment details, and other relevant information.
  • The function signatures in the interface include appropriate input parameters and return types.
  • The interface is designed to be flexible and scalable, accommodating future enhancements and requirements.
  • Proper error handling mechanisms, such as returning error codes or using custom error types, are implemented in the interface functions.
  • The interface documentation is updated to provide detailed descriptions of each function and their usage.

Description

As a developer, I want to define the Tenant-Management Microservice/App Service Layer interface to establish a clear contract for managing tenants within the application. This interface will serve as a communication layer between the business logic layer and the underlying data layer.

To achieve this, we need to define the necessary functions in the interface to handle core tenant management operations. These functions should include creating, retrieving, updating, and deleting tenants, as well as retrieving various tenant-related information such as subscription details, company details, and payment details.

The function signatures in the interface should be designed with appropriate input parameters and return types that align with the requirements of the application. This will ensure consistency and ease of use when invoking these functions from other layers of the application.

To enhance the usability and maintainability of the interface, proper error handling mechanisms should be implemented in the interface functions. This can include returning error codes or using custom error types to provide detailed information about any encountered errors.

Additionally, the interface should be designed with flexibility and scalability in mind, allowing for future enhancements and requirements to be easily incorporated without breaking existing functionality.

Finally, the documentation for the interface should be updated to provide comprehensive descriptions of each function and their intended usage. This will assist developers in understanding the purpose and expected behavior of each function, promoting efficient development and integration with the Tenant-Management Microservice/App Service Layer.

Implement "Delete Tenant" function in the service layer.

Description: As a developer, I want to implement the "Delete Tenant" function in the service layer, so that I can delete tenants from the system.

Acceptance Criteria:

A new "Delete Tenant" function is implemented in the service layer.
The function takes input parameters such as tenant ID.
The function deletes the tenant information from the appropriate database.
The function returns a success message and/or an error message to the controller layer.
Unit tests are written and passing for the "Delete Tenant" function.

Implement GetTenants function in MongoDB to retrieve a slice of tenants based on a given filter

Acceptance Criteria

  • The GetTenants function is implemented in the MongoDB repository for the Tenant entity.
  • The function takes input parameters such as the context and a filter map containing search criteria.
  • The function performs a query operation in the MongoDB tenant collection based on the provided filter.
  • The function retrieves a slice of tenants that match the filter criteria.
  • The retrieved slice of tenants is returned as a response and/or an error message.
  • The function handles any errors that may occur during the query operation, such as connection failures or invalid filter parameters.
  • Proper testing is conducted to validate the functionality and reliability of the GetTenants function.
  • Documentation is updated to include the details of the GetTenants function and its usage.

Description

As a developer, I want to implement the GetTenants function in MongoDB to retrieve a slice of tenants based on a given filter. This function will provide the ability to fetch multiple tenants that match specific search criteria, such as tenant ID, name, or other attributes.

To accomplish this, the GetTenants function will be added to the MongoDB repository for the Tenant entity. It will take input parameters including the context and a filter map that contains the search criteria. The function will perform a query operation in the MongoDB tenant collection using the provided filter.

The query operation will retrieve a slice of tenants that match the filter criteria. The retrieved slice of tenants will be returned as a response and/or an error message, allowing the caller to access the desired tenant information or handle any encountered errors appropriately.

During implementation, it is important to handle potential errors that may occur during the query operation, such as connection failures or invalid filter parameters. Error handling mechanisms should be implemented to provide meaningful error messages and ensure graceful handling of exceptions.

Thorough testing should be conducted to validate the functionality and reliability of the GetTenants function. This includes testing with different filter scenarios to ensure accurate retrieval of the desired slice of tenants.

Lastly, the documentation should be updated to include the details of the GetTenants function and provide guidance on its usage. This will assist other developers in understanding the purpose and proper usage of the function when interacting with the MongoDB repository for tenant data.

Implement "Get Tenant Subscription" function in the service layer.

Description: As a developer, I want to implement the "Get Tenant Subscription" function in the service layer, so that I can retrieve subscription details for a specific tenant.

Acceptance Criteria:

A new "Get Tenant Subscription" function is implemented in the service layer.
The function takes input parameters such as tenant ID.
The function retrieves the subscription details from the appropriate database.
The function returns the subscription details and/or an error message to the controller layer.
Unit tests are written and passing for the "Get Tenant Subscription" function.

Implement "Update Tenant Company" function in the service layer.

Description: As a developer, I want to implement the "Update Tenant Company" function in the service layer, so that I can update company details for a specific tenant.

Acceptance Criteria:

A new "Update Tenant Company" function is implemented in the service layer.
The function takes input parameters such as tenant ID and updated company details.
The function updates the company details in the appropriate database.
The function returns a success message and/or an error message to the controller layer.
Unit tests are written and passing for the "Update Tenant Company" function.

Implement GetPaymentDetails function in Tenant Repository

Acceptance Criteria:

  • The GetPaymentDetails function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID.
  • The function retrieves the payment details for a specific tenant ID from the MongoDB tenant collection.
  • The function returns the payment details and/or an error message.

Description:
As a developer, I want to implement the GetPaymentDetails function in the TenantRepository interface, so that I can retrieve the payment details for a specific tenant ID from the MongoDB tenant collection. This will allow the application to access and display important payment information for each tenant, such as payment method, billing address, and transaction history.

Add Gitignore File

Description: As a developer, I want to add a .gitignore file to the repository to exclude unnecessary files and directories from version control, so that I can avoid cluttering the repository with files that do not need to be tracked.

Acceptance Criteria:

A .gitignore file is added to the repository.
The .gitignore file includes entries for files and directories that should be excluded from version control, such as build artifacts and temporary files.

Implement "Get Tenant by ID" function in the service layer.

Description: As a developer, I want to implement the "Get Tenant by ID" function in the service layer, so that I can retrieve tenant information from the system based on tenant ID.

Acceptance Criteria:

A new "Get Tenant by ID" function is implemented in the service layer.
The function takes input parameters such as tenant ID.
The function retrieves the tenant information from the appropriate database.
The function returns the retrieved tenant and/or an error message to the controller layer.
Unit tests are written and passing for the "Get Tenant by ID" function.

Implement Delete function in Tenant Repository

Acceptance Criteria:

  • The Delete function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID.
  • The function deletes the tenant record for a specific tenant ID from the MongoDB tenant collection.
  • The function returns a success message and/or an error message.

Description:
As a developer, I want to implement the Delete function in the TenantRepository interface, so that I can delete the tenant record for a specific tenant ID from the MongoDB

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update module github.com/testcontainers/testcontainers-go to v0.31.0
  • chore(deps): update actions/setup-go action to v5
  • chore(deps): update docker/build-push-action action to v6
  • fix(deps): update module github.com/brianvoe/gofakeit/v6 to v7
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • golang 1.20.5-alpine3.17
github-actions
.github/workflows/deploy-image.yaml
  • actions/checkout v3
  • docker/setup-buildx-action v2
  • docker/login-action v2
  • docker/build-push-action v4
.github/workflows/main.yaml
  • actions/checkout v3
  • timheuer/base64-to-file v1.2
  • actions/setup-go v4.0.1
  • reviewdog/action-golangci-lint v2
gomod
go.mod
  • go 1.20
  • github.com/brianvoe/gofakeit/v6 v6.22.0
  • github.com/hebecoding/digital-dash-commons v0.0.0-20230609031200-4e45f5a9770f@4e45f5a9770f
  • github.com/pkg/errors v0.9.1
  • github.com/spf13/viper v1.16.0
  • github.com/stretchr/testify v1.8.4
  • github.com/testcontainers/testcontainers-go v0.20.1
  • go.mongodb.org/mongo-driver v1.12.0
  • golang.org/x/net v0.11.0

  • Check this box to trigger a request for Renovate to run again on this repository

Implement GetSubscriptionDetails function in Tenant Repository

Acceptance Criteria:

  • The GetSubscriptionDetails function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID.
  • The function retrieves the subscription details for a specific tenant ID from the MongoDB tenant collection.
  • The function returns the subscription details and/or an error message.

Description:
As a developer, I want to implement the GetSubscriptionDetails function in the TenantRepository interface, so that I can retrieve the subscription details for a specific tenant ID from the MongoDB tenant collection.

Implement UpdateFields function in Tenant Repository

Acceptance Criteria:

  • The UpdateFields function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID and fieldsToUpdate map.
  • The function updates the specified fields for a specific tenant ID in the MongoDB tenant collection.
  • The function returns a success message and/or an error message.

Description:
As a developer, I want to implement the UpdateFields function in the TenantRepository interface, so that I can update the specified fields for a specific tenant ID in the MongoDB tenant collection.

Create New Repository

Description: As a developer, I want to create a new repository on GitHub, so that I can store the code for the Tenant Management API and collaborate with other team members.

Acceptance Criteria:

A new repository is created on GitHub.
The repository is named "tenant-management-api".
The repository is set to private.
The developer has permission to access and modify the repository.

Set Up Project Directory Structure

Description: As a developer, I want to set up the project directory structure for the Tenant Management API, including the main.go file, a directory for controllers, a directory for models, and a directory for routes, so that I can organize the code and files in a logical manner.

Acceptance Criteria:

The project directory structure is created.
The main.go file is added to the root directory.
A directory for controllers is added to the root directory.
A directory for models is added to the root directory.
A directory for routes is added to the root directory.

Implement "Get Tenant Company" function in the service layer.

Description: As a developer, I want to implement the "Get Tenant Company" function in the service layer, so that I can retrieve company details for a specific tenant.

Acceptance Criteria:

A new "Get Tenant Company" function is implemented in the service layer.
The function takes input parameters such as tenant ID.
The function retrieves the company details from the appropriate database.
The function returns the company details and/or an error message to the controller layer.
Unit tests are written and passing for the "Get Tenant Company" function.

Implement SearchTenant function in MongoDB to search for a tenant based on a given filter

Acceptance Criteria

  • The SearchTenant function is implemented in the MongoDB repository for the Tenant entity.
  • The function takes input parameters such as the context and a filter map containing search criteria.
  • The function performs a search operation in the MongoDB tenant collection based on the provided filter.
  • The search results are returned as a pointer to a Tenant entity and/or an error message.
  • The function handles any errors that may occur during the search operation, such as connection failures or invalid filter parameters.
  • Proper testing is conducted to validate the functionality and reliability of the SearchTenant function.
  • Documentation is updated to include the details of the SearchTenant function and its usage.

Description

As a developer, I want to implement the SearchTenant function in MongoDB to enable searching for a tenant based on a given filter. This function will provide flexibility in retrieving tenant information based on various search criteria, such as tenant ID, name, or other specific attributes.

To accomplish this, the SearchTenant function will be added to the MongoDB repository for the Tenant entity. It will take input parameters including the context and a filter map that contains the search criteria. The function will perform a search operation in the MongoDB tenant collection using the provided filter.

The search results will be returned as a pointer to a Tenant entity and/or an error message, allowing the caller to access the retrieved tenant information or handle any encountered errors appropriately.

During implementation, it is important to handle potential errors that may occur during the search operation, such as connection failures or invalid filter parameters. Error handling mechanisms should be implemented to provide meaningful error messages and ensure graceful handling of exceptions.

Thorough testing should be conducted to validate the functionality and reliability of the SearchTenant function. This includes testing with different filter scenarios to ensure accurate retrieval of the desired tenant data.

Lastly, the documentation should be updated to include the details of the SearchTenant function and provide guidance on its usage. This will assist other developers in understanding the purpose and proper usage of the function when interacting with the MongoDB repository for tenant data.

Implement "Update Tenant Payment Details" function in the service layer.

Description: As a developer, I want to implement the "Update Tenant Payment Details" function in the service layer, so that I can update payment details for a specific tenant.

Acceptance Criteria:

A new "Update Tenant Payment Details" function is implemented in the service layer.
The function takes input parameters such as tenant ID and updated payment details.
The function updates the payment details in the appropriate database.
The function returns a success message and/or an error message to the controller layer.
Unit tests are written and passing for the "Update Tenant Payment Details" function.

Implement Update function in Tenant Repository

Acceptance Criteria:

  • The Update function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID and update data.
  • The function updates the tenant data for a specific tenant ID in the MongoDB tenant collection.
  • The function returns a success message and/or an error message.

Description:
As a developer, I want to implement the Update function in the TenantRepository interface, so that I can update the tenant data for a specific tenant ID in the MongoDB tenant collection.

Implement Create function in Tenant Repository

Acceptance Criteria:

  • The Create function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant data.
  • The function adds a new tenant record to the MongoDB tenant collection.
  • The function returns a success message and/or an error message.

Description:
As a developer, I want to implement the Create function in the TenantRepository interface, so that I can add a new tenant record to the MongoDB tenant collection.

Implement UpdateSubscriptionDetails function in Tenant Repository

Acceptance Criteria:

  • The UpdateSubscriptionDetails function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID and subscription update data.
  • The function updates the subscription details for a specific tenant ID in the MongoDB tenant collection.
  • The function returns a success message and/or an error message.

Description:
As a developer, I want to implement the UpdateSubscriptionDetails function in the TenantRepository interface, so that I can update the subscription details for a specific tenant ID in the MongoDB tenant collection.

Implement GetCompanyDetails function in Tenant Repository

Acceptance Criteria:

  • The GetCompanyDetails function is implemented in the TenantRepository interface.
  • The function takes input parameters such as tenant ID.
  • The function retrieves the company details for a specific tenant ID from the MongoDB tenant collection.
  • The function returns the company details and/or an error message.

Description:
As a developer, I want to implement the GetCompanyDetails function in the TenantRepository interface, so that I can retrieve the company details for a specific tenant ID from the MongoDB tenant collection.

Set Up Continuous Integration

Description: As a developer, I want to set up a continuous integration (CI) system, such as Travis CI or CircleCI, to automate the build and testing process, so that I can catch errors and bugs early in the development process.

Acceptance Criteria:

A CI system, such as Travis CI or CircleCI, is set up for the repository.
The CI system is configured to automatically build and test the project on each push to the main branch.
The build and test results are reported to the team via email or a chat channel.

Implement GetAll function in Tenant Repository

Acceptance Criteria:

  • The GetAll function is implemented in the TenantRepository interface.
  • The function retrieves all tenant data from the MongoDB tenant collection.
  • The function returns an array of tenant data and/or an error message.

Description:
As a developer, I want to implement the GetAll function in the TenantRepository interface, so that I can retrieve all tenant data from the MongoDB tenant collection.

[FIX] Tenant Management API - Fix the Update Function in Tenant Management API to Preserve Existing Field Values During MongoDB $set Operation

Description: As a developer, I want to fix the Update function in the Tenant Management API to address the issue where sending a struct to the function results in setting the document field values as nil, empty, or default during the MongoDB $set operation. This behavior leads to unintended updates where existing field values are overwritten.

To resolve this issue, modifications need to be made to the Update function. When updating a tenant with a struct, the function should ensure that value fields are preserved during the $set operation. This means that if a field in the struct is not provided or has a nil, empty, or default value, the existing value in the MongoDB document should be preserved instead of being updated to the nil, empty, or default value.

It is important to handle partial updates properly, ensuring that only the specified fields are updated while preserving the existing values for other fields. This will prevent unintended data loss or undesired changes in the tenant records.

Thorough testing should be conducted to validate the functionality and reliability of the fixed Update function. The tests should cover various scenarios, including full updates and partial updates, to ensure that the preservation of existing field values during the $set operation is working as expected.

Finally, the documentation should be updated to include the details of the fixed Update function and provide guidance on how to properly update tenant fields while preserving existing values. This will assist other developers in understanding the updated behavior and using the Update function effectively in the Tenant Management API.

[Tenant-Management] Implement TestContainers

Summary: Implement TestContainers for Golang in Tenant Management API

Acceptance Criteria:

  • The TestContainers framework is integrated into the Tenant Management API project for Golang.
  • Docker is used as the containerization technology to manage test dependencies.
  • The TestContainers library is used to define and manage Docker containers for running integration tests.
  • The necessary dependencies for running tests, such as databases or other external services, are containerized using TestContainers.
  • Integration tests are implemented using TestContainers to ensure reliable and repeatable testing of the Tenant Management API.
  • The TestContainers setup includes proper configuration and management of container lifecycles.
  • Thorough testing is conducted to validate the functionality and reliability of the TestContainers integration.
  • Documentation is updated to include the details of the TestContainers integration and provide guidance on running tests with TestContainers.

Description:
As a developer, I want to implement TestContainers for Golang in the Tenant Management API project to facilitate reliable and repeatable integration testing. The TestContainers framework allows us to define and manage Docker containers for running our integration tests, ensuring that our tests have the necessary dependencies in a controlled environment.

To accomplish this, we will integrate the TestContainers framework into our Golang project for the Tenant Management API. Docker will be used as the containerization technology to manage the test dependencies. The TestContainers library will be leveraged to define and manage the Docker containers required for running integration tests.

We will containerize the necessary dependencies, such as databases or other external services, using TestContainers. This ensures that our integration tests have consistent and isolated environments, improving the reliability and stability of our testing process.

The TestContainers setup will include proper configuration and management of container lifecycles. Containers will be started before running the integration tests and stopped after the tests have completed, ensuring efficient resource utilization.

Thorough testing will be conducted to validate the functionality and reliability of the TestContainers integration. Integration tests using TestContainers will be implemented to cover various scenarios and edge cases, ensuring comprehensive test coverage for the Tenant Management API.

Documentation will be updated to include the details of the TestContainers integration and provide guidance on running tests with TestContainers. This will assist other developers in understanding the TestContainers setup and enable them to run tests effectively in their local development environments or in a continuous integration (CI) environment.

Implement "List Tenants" function in the service layer.

Description: As a developer, I want to implement the "List Tenants" function in the service layer, so that I can retrieve a list of all tenants in the system.

Acceptance Criteria:

A new "List Tenants" function is implemented in the service layer.
The function retrieves a list of all tenants from the appropriate database.
The function returns the list of tenants and/or an error message to the controller layer.
Unit tests are written and passing for the "List Tenants" function.

Set up database connection pool

Acceptance Criteria:

A new Golang file is created and named "database.go".
The file sets up a database connection pool with appropriate parameters.
The file returns a successful database connection and/or an error message.

Description:
As a developer, I want to set up a database connection pool in Golang, so that I can establish and manage connections to the appropriate database.

Implement "Get Tenant Payment Details" function in the service layer.

Description: As a developer, I want to implement the "Get Tenant Payment Details" function in the service layer, so that I can retrieve payment details for a specific tenant.

Acceptance Criteria:

A new "Get Tenant Payment Details" function is implemented in the service layer.
The function takes input parameters such as tenant ID.
The function retrieves the payment details from the appropriate database.
The function returns the payment details and/or an error message to the controller layer.
Unit tests are written and passing for the "Get Tenant Payment Details" function.

Add support for storing multiple TenantPaymentDetails in the database

Acceptance Criteria:

  • The database schema is updated to support storing a slice of TenantPaymentDetails for each tenant.
  • The TenantPaymentDetails struct is modified to include the necessary fields for card information such as card number, expiration date, and cardholder name.
  • The repository interface and implementation are updated to handle the new storage and retrieval of multiple TenantPaymentDetails.

Description:
As a developer, I want to add support for storing multiple TenantPaymentDetails in the database so that tenants can utilize more than one card for their payments. Currently, the system only supports storing a single TenantPaymentDetails per tenant, which limits the flexibility and options for tenants to manage their payment methods.

To achieve this, the database schema needs to be updated to accommodate a slice of TenantPaymentDetails for each tenant. The TenantPaymentDetails struct should be modified to include the necessary fields for card information, such as card number, expiration date, and cardholder name. The repository interface and implementation should be updated to handle the new storage and retrieval of multiple TenantPaymentDetails.

Create Tenant collection in database

Acceptance Criteria:

  • A new Golang file is created and named "tenant_collection.go".
  • The file contains code to create a new "tenant" collection in the MongoDB database.
  • The collection has appropriate fields and data types to store tenant data.

Description:
As a developer, I want to create a new "tenant" collection in the appropriate MongoDB database, so that I can store and manage tenant data. The collection should have appropriate fields and data types to accurately represent tenant data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.