You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: delete_project.go
    path of file: ./repos/dotenx/ao-api/services/projectService
    
    the code of the file until where you have to start completion: package projectService

import (
	"context"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/acm"
	"github.com/aws/aws-sdk-go/service/cloudfront"
	"github.com/aws/aws-sdk-go/service/route53"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/dotenx/dotenx/ao-api/config"
	"github.com/dotenx/dotenx/ao-api/services/crudService"
	"github.com/dotenx/dotenx/ao-api/services/databaseService"
	"github.com/dotenx/dotenx/ao-api/services/uibuilderService"
	"github.com/sirupsen/logrus"
)

/*
DeleteProject deletes a project and all its associated resources:
	If the project has domain:
		If the project has an external domain:
			1. Deletes the CloudFront distribution if it exists
			
    
func (ps *projectService) DeleteProject(accountId, projectTag string, ubService uibuilderService.UIbuilderService, dbService databaseService.DatabaseService, cService crudService.CrudService) error {

	/// Delete the resources first

	// Get the project domain to understand if the UI pages are published and if yes, where

	_, err := ps.GetProjectDomain(accountId, projectTag)
	hasDomain := true
	if err != nil {
		if err.Error() == "project_domain not found" {
			hasDomain = false
		} else {
			return err
		}
	}

	if !config.Configs.App.RunLocally && hasDomain {
		// Delete the project domain and its dependencies
		err = ps.DeleteProjectDomain(accountId, projectTag, ubService)
		if err != nil && err.Error() != "entity not found" {
			logrus.Error(err.Error())
			return err
		}
	}

	// Delete the uploaded files
	// TODO: After implementing the necessary changes in the objecstore implement this
	// NOTE: We don't drop the database here and we will do it with a scheduled job.
	// TODO: Implement a scheduled job that finds the list of databases that don't have a database and drops them (hint: utils.GetDbInstance())
	// CAVEAT: If the user deletes a project and creates a new one with the same name, the database will be used if it happens before the scheduled job runs

	// todo: delete the uploaded files with a scheduled job

	/// Delete the records from the database

	// Delete all the pipelines of the project
	project, err := ps.GetProjectByTag(projectTag)
	if err != nil {
		logrus.Error(err.Error())
		return err
	}

	err = cService.DeleteAllPipelines(accountId, project.Name)
	if err != nil {
		logrus.Error(err.Error())
		return err
	}

	// Delete all the UI pages from the database
	err = ubService.DeleteAllPages(accountId, projectTag)
	if err != nil {
		if err.Error() != "entity not found" {
			logrus.Error(err.Error())
			return err
		}
	}

	if project.HasDatabase {
		// Drop database of project
		err = dbService.DeleteDatabase(accountId, project.Name)
		if err != nil {
			logrus.Error(err.Error())
			return err
		}
		// Delete corresponding database user
		err = dbService.DeleteDatabaseUser(accountId, project.Name)
		if err != nil {
			logrus.Error(err.Error())
			return err
		}
	}

	err = ps.Store.DeleteProjectByTag(context.Background(), projectTag)
	if err != nil {
		logrus.Error(err.Error())
	}
	return err
}