Skip to content

Commit

Permalink
refactor: organize modules into infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoCamargo31 committed Nov 2, 2023
1 parent 386e783 commit ae70df8
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Sequelize } from 'sequelize-typescript'
import { CustomerModel } from '../database/sequelize/model/customer-model'
import CustomerRepository from './customer-repository'
import { Customer } from '../../domain/customer/entity/customer'
import { Address } from '../../domain/customer/value-object/address'
import { CustomerModel } from './customer-model'
import { Customer } from '../../../../domain/customer/entity/customer'
import { Address } from '../../../../domain/customer/value-object/address'

describe('Customer repository test', () => {
let sequelize: Sequelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Customer } from '../../domain/customer/entity/customer'
import { CustomerRepositoryInterface } from '../../domain/customer/repository/customer-repository.interface'
import { Address } from '../../domain/customer/value-object/address'
import { CustomerModel } from '../database/sequelize/model/customer-model'
import { Customer } from '../../../../domain/customer/entity/customer'
import { CustomerRepositoryInterface } from '../../../../domain/customer/repository/customer-repository.interface'
import { Address } from '../../../../domain/customer/value-object/address'
import { CustomerModel } from './customer-model'

export default class CustomerRepository implements CustomerRepositoryInterface {
async create (entity: Customer): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BelongsTo, Column, ForeignKey, Model, PrimaryKey, Table } from 'sequelize-typescript'
import { ProductModel } from './product-model'
import { OrderModel } from './order-model'
import { ProductModel } from '../../../product/repository/sequelize/product-model'

@Table({
tableName: 'order_items',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BelongsTo, Column, ForeignKey, HasMany, Model, PrimaryKey, Table } from 'sequelize-typescript'
import { CustomerModel } from './customer-model'
import { OrderItemModel } from './order-item-model'
import { CustomerModel } from '../../../customer/repository/sequelize/customer-model'

@Table({
tableName: 'orders',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Sequelize } from 'sequelize-typescript'
import { CustomerModel } from '../database/sequelize/model/customer-model'
import CustomerRepository from './customer-repository'
import { Customer } from '../../domain/customer/entity/customer'
import { OrderModel } from '../database/sequelize/model/order-model'
import { OrderItemModel } from '../database/sequelize/model/order-item-model'
import { ProductModel } from '../database/sequelize/model/product-model'
import { ProductRepository } from './product-repository'
import { OrderItem } from '../../domain/checkout/entity/order-item'
import { Order } from '../../domain/checkout/entity/order'
import OrderRepository from './order-repository'
import { Address } from '../../domain/customer/value-object/address'
import { Product } from '../../domain/product/entity/product'
import { Customer } from '../../../../domain/customer/entity/customer'
import { Address } from '../../../../domain/customer/value-object/address'
import { Product } from '../../../../domain/product/entity/product'
import { CustomerModel } from '../../../customer/repository/sequelize/customer-model'
import { OrderModel } from './order-model'
import { OrderItemModel } from './order-item-model'
import { ProductRepository } from '../../../product/repository/sequelize/product-repository'
import { OrderItem } from '../../../../domain/checkout/entity/order-item'
import { Order } from '../../../../domain/checkout/entity/order'
import CustomerRepository from '../../../customer/repository/sequelize/customer-repository'
import { ProductModel } from '../../../product/repository/sequelize/product-model'

const makeCustomer = (id: string, name: string): Customer => {
const customer = new Customer(id, name)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Order } from '../../domain/checkout/entity/order'
import { OrderItem } from '../../domain/checkout/entity/order-item'
import { OrderRepositoryInterface } from '../../domain/checkout/repository/order-repository.interface'
import { OrderItemModel } from '../database/sequelize/model/order-item-model'
import { OrderModel } from '../database/sequelize/model/order-model'
import { Order } from '../../../../domain/checkout/entity/order'
import { OrderItem } from '../../../../domain/checkout/entity/order-item'
import { OrderRepositoryInterface } from '../../../../domain/checkout/repository/order-repository.interface'
import { OrderItemModel } from './order-item-model'
import { OrderModel } from './order-model'

export default class OrderRepository implements OrderRepositoryInterface {
async create (entity: Order): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Sequelize } from 'sequelize-typescript'
import { ProductModel } from '../database/sequelize/model/product-model'
import { ProductRepository } from './product-repository'
import { Product } from '../../domain/product/entity/product'
import { ProductModel } from './product-model'
import { Product } from '../../../../domain/product/entity/product'

describe('Product repository test', () => {
let sequelize: Sequelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Product } from '../../domain/product/entity/product'
import { ProductRepositoryInterface } from '../../domain/product/repository/product-repository.interface'
import { ProductModel } from '../database/sequelize/model/product-model'
import { Product } from '../../../../domain/product/entity/product'
import { ProductRepositoryInterface } from '../../../../domain/product/repository/product-repository.interface'
import { ProductModel } from './product-model'

export class ProductRepository implements ProductRepositoryInterface {
async create (entity: Product): Promise<void> {
Expand Down

0 comments on commit ae70df8

Please sign in to comment.