Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
gabrielrs1 committed Jan 17, 2022
1 parent 54eca03 commit 8339409
Showing 6 changed files with 15 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { CardService } from "../services/Pagarme/CardService";
import { CardService } from "../../services/Pagarme/CardService";

class CardApiController {
class CardController {
async handle(request: Request, response: Response) {
const { card_number, card_holder_name, card_expiration_date, card_cvv, customer_id } = request.body;

@@ -12,10 +12,10 @@ class CardApiController {
card_cvv,
}

const cardApiService = new CardService();
const cardService = new CardService();

try {
const result = await cardApiService.execute(card, customer_id);
const result = await cardService.execute(card, customer_id);

return response.status(200).json(result);
} catch (error) {
@@ -24,4 +24,4 @@ class CardApiController {
}
}

export { CardApiController }
export { CardController }
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Request, Response } from "express";
import { CustomerService } from "../services/Pagarme/CustomerService";
import { CustomerService } from "../../services/Pagarme/CustomerService";

class CustomerApiController {
class CustomerController {
async handle(request: Request, response: Response) {
const data = request.body;

const customerApiService = new CustomerService();
const customerService = new CustomerService();

try {
const result = await customerApiService.execute(data);
const result = await customerService.execute(data);

return response.status(200).json(result);
} catch (error) {
@@ -17,4 +17,4 @@ class CustomerApiController {
}
}

export { CustomerApiController }
export { CustomerController }
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Request, Response } from "express";
import { PlanService } from "../services/Pagarme/PlanService";
import { PlanService } from "../../services/Pagarme/PlanService";

class PlanApiController {
class PlanController {
async handle(request: Request, response: Response) {
const { amount, days, name } = request.body;

const planApiService = new PlanService();
const planService = new PlanService();

try {
const result = await planApiService.create(amount, days, name);
const result = await planService.create(amount, days, name);

return response.status(200).json(result);
} catch (error) {
@@ -17,4 +17,4 @@ class PlanApiController {
}
}

export { PlanApiController }
export { PlanController }
1 change: 0 additions & 1 deletion src/controllers/ProfileController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Request, Response } from "express";
import { CustomerService } from "../services/CustomerService";
import { ProfileService } from "../services/ProfileService";

class ProfileController {
async handle(request: Request, response: Response) {
20 changes: 0 additions & 20 deletions src/controllers/SubscriptionApiController.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/services/ProfileService.ts

This file was deleted.

0 comments on commit 8339409

Please sign in to comment.