Skip to content

Commit

Permalink
Dev (#156)
Browse files Browse the repository at this point in the history
* Update Search Product and use API Provinces

* validation form

* Testing service (#117)

* update category service test

* update product service test

* update user service test

* update user address service test

* update authenticate service test

* update order service test

* update order detail service test

* update rating service test

* Shipping api (#118)

* add role shipper and update permission

* update database attribute

* update and implement order service logic for shipping

* implement shipping API

* implement statistic API

* add get by role user API for order statistic

* clean code

* update get refund api

* update-validation-phone

* tt

* update

* update

* FIX: FIX Bu User and UI Dashboard Admin

* updatechangePassword

* test code

* updateRegister

* u

* t

* update

* completed split into 2 status

* FEAT: Handle Order and Style Step shipping

* Search product User and Back to Top

* Update search Client

* updateN

* ud

* FEAT: Handle Roles Shipper

* User address

* Update search both user admin Fix bug view User

* FEAT

* Feature/modify add product (#132)

* Update Search Product and use API Provinces

* Search product User and Back to Top

* Update search Client

* User address

* Update search both user admin Fix bug view User

---------

Co-authored-by: Dinh Quang Huy <dinhquanghuy0809@gmail.com>

* add

* LoginAdmin

* UpdateLoginAdmin

* add get shipper with order asc API

* update service test and directory

* update api

* Update Shipper

* Shipper rolse

* FIX CSS TABLE

* Update Refund UI

* TEST BUG

* Fix validate and redirect

* Validate fullname

* update profile (#150)

* Ci cd 1 (#151)

* update profile

* Ci cd 1 (#152)

* update profile

* update profile

* fix cors

* Ci cd 1 (#155)

* update profile

* update profile

* fix cors

* Bump guava from 31.1-jre to 32.0.0-jre

---------

Co-authored-by: Dinh Quang Huy <dinhquanghuy0809@gmail.com>
Co-authored-by: Nguyễn Trung Quốc <113247967+qnt078@users.noreply.github.com>
Co-authored-by: Dinh Quang Huy <71219472+quanghuy89@users.noreply.github.com>
Co-authored-by: tdnbao281001 <61140987+trandangnguyenbao@users.noreply.github.com>
Co-authored-by: trandangnguyenbao <trandangnguyenbao2810@gmail.com>
  • Loading branch information
6 people committed Jun 26, 2023
1 parent 22cade0 commit ec0ea93
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>32.0.0-jre</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.servers.Server;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.security.SecurityRequirement;
Expand All @@ -15,7 +16,17 @@
info = @Info(
title = "Ecommerce Application API",
version = "1.0"
)
),
servers = {
@Server(
description = "Local Server",
url = "http://localhost:8080"
),
@Server(
description = "Railway Server",
url = "https://e-commerce-production-0d6c.up.railway.app"
)
}
)
public class OpenApiConfig {
@Bean
Expand Down
4 changes: 4 additions & 0 deletions backend/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ spring:
url: jdbc:mysql://localhost:3333/myecommerce
username: root
password: root
jpa:
show-sql: true
hibernate:
ddl-auto: update

env-variable:
url: http://localhost:8080
Expand Down
15 changes: 15 additions & 0 deletions backend/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server:
port: 5000

spring:
datasource:
url: jdbc:mysql://containers-us-west-195.railway.app:6254/myecommerce
username: root
password: 7VP7XGaoGdd30qvSYf3T
jpa:
show-sql: false
hibernate:
ddl-auto: none

env-variable:
url: https://e-commerce-production-0d6c.up.railway.app
4 changes: 1 addition & 3 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spring:
web-application-type: servlet
jpa:
hibernate:
ddl-auto: update
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
properties:
Expand All @@ -22,7 +21,6 @@ spring:
order_updates: true
format_sql: true
dialect: org.hibernate.dialect.MySQLDialect
show-sql: true
open-in-view: true
mail:
host: smtp.gmail.com
Expand All @@ -41,7 +39,7 @@ spring:
starttls:
enable: true
profiles:
active: dev
active: prod

springdoc:
api-docs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,6 @@ void fetchOrderDetailByOrderIDAndProductID() {
assertThat(actual).isEqualTo(orderDetail);
}

@Test
void whenFetchOrderDetailByOrderIDAndProductID_butNotExistOrderDetailID_thenThrowException() {
// Given
var id = BigInteger.valueOf(1);

// When
when(orderDetailDAO.selectOrderDetailByID(new OrderDetailID(id, id)))
.thenReturn(Optional.empty());

// Then
assertThatThrownBy(() -> orderDetailService
.fetchOrderDetailByOrderIDAndProductID(new OrderDetailID(id, id)))
.isInstanceOf(ResourceNotFoundException.class);
}

@Test
void addOrderDetail() {
// Given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void fetchAllProducts() {
}

@Test
// TODO: refactor this test
void fetchAllProductsByCategoryID() {
// Given
var id = BigInteger.valueOf(1);
Expand Down Expand Up @@ -86,6 +87,7 @@ void whenFetchAllProductsByCategoryID_butCategoryNotFound_thenThrowException() {
}

@Test
// TODO: refactor product hold category id only
void fetchProductByProductID() {
// Given
var id = BigInteger.valueOf(1);
Expand Down

0 comments on commit ec0ea93

Please sign in to comment.