58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
import BaseService from "@Services/BaseService";
|
|
import { Service } from "typedi";
|
|
|
|
@Service()
|
|
export default class CustomersService extends BaseService {
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* @description : Get all Customers
|
|
* @returns : T
|
|
* @throws {Error} If project cannot be created
|
|
* @param : projectEntity: Partial<ProjectEntity>
|
|
*/
|
|
public async get() {
|
|
// const customer = await this.customersRepository.findOne(uuid);
|
|
// if (!customer) Promise.reject(new Error("Cannot get customer by uuid"));
|
|
return { response: "/api/customers > GET : All customers > Not implemented yet" };
|
|
}
|
|
|
|
/**
|
|
* @description : Create a new customer
|
|
* @returns : T
|
|
* @throws {Error} If project cannot be created
|
|
* @param : projectEntity: Partial<ProjectEntity>
|
|
*/
|
|
public async create() {
|
|
// const project = await this.projectRepository.create(projectEntity);
|
|
// if (!project) Promise.reject(new Error("Cannot create project"));
|
|
return { response: "/api/customers > POST : Create User > Not implemented yet" };
|
|
}
|
|
|
|
/**
|
|
* @description : Create a new customer
|
|
* @returns : T
|
|
* @throws {Error} If project cannot be created
|
|
* @param : projectEntity: Partial<ProjectEntity>
|
|
*/
|
|
public async put() {
|
|
// const project = await this.projectRepository.create(projectEntity);
|
|
// if (!project) Promise.reject(new Error("Cannot create project"));
|
|
return { response: "/api/customers > POST : Create User > Not implemented yet" };
|
|
}
|
|
|
|
/**
|
|
* @description : Get a customer by uid
|
|
* @returns : T
|
|
* @throws {Error} If project cannot be created
|
|
* @param : projectEntity: Partial<ProjectEntity>
|
|
*/
|
|
public async getByUid(uuid: string) {
|
|
// const customer = await this.customersRepository.findOne(uuid);
|
|
// if (!customer) Promise.reject(new Error("Cannot get customer by uuid"));
|
|
return { response: "/api/customers/:uuid > GET : User by uid > Not implemented yet" };
|
|
}
|
|
}
|