-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload Inventory By Vendor #48
Conversation
add feature Create Inventory By Vendor on inventory controller add findyById on seller repository Create UploadInventoryRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check request perubahan dan check conflict
src/main/java/com/unsri/ecommerce/infrastructure/repository/SellerRepository.java
Outdated
Show resolved
Hide resolved
src/main/java/com/unsri/ecommerce/presentation/controllers/InventoryController.java
Outdated
Show resolved
Hide resolved
CreateInventory command = new CreateInventory(inventoryRepository); | ||
return command.execute(Optional.ofNullable(item)); | ||
command.execute(Optional.of(inventory)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buat pengecekan jika proses sudah berhasil atau tidak
command.execute(Optional.of(inventory)); | ||
BaseResponse baseResponse= new BaseResponse<>(); | ||
|
||
baseResponse.setMessage("Create Inventory Successfully"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pesan sukses dibuat berdasarkan pengecekan jika proses sudah berhasil
...java/com/unsri/ecommerce/application/behaviours/inventory/commands/CreateInventoryTests.java
Outdated
Show resolved
Hide resolved
tolong isi
|
add feature Create Inventory By Vendor on inventory controller Create UploadInventoryRequest add cascade on Inventory for fk_inventory_id add annotation Column on PhotoInventory for fk_inventory_id add javax.validation depedency on pom.xml delete findById on SellerRepository add annotation @notempty and @positive on UploadInventoryRequest for productName and price
Create unit test add feature Create Inventory By Vendor on inventory controller Create UploadInventoryRequest add cascade on Inventory for fk_inventory_id add annotation Column on PhotoInventory for fk_inventory_id add javax.validation depedency on pom.xml delete findById on SellerRepository add annotation @notempty and @positive on UploadInventoryRequest for productName and price merge from dev
add depedency spring validation
@@ -21,7 +24,7 @@ | |||
@Column(name = "fk_seller_id") | |||
private Integer fkSellerId; | |||
|
|||
@OneToMany(targetEntity = PhotoInventory.class) | |||
@OneToMany(targetEntity = PhotoInventory.class, cascade = CascadeType.ALL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CascadeType.ALL digunakan untuk apa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cascade type all ini sebenernya bukan bagian dari fitur create inventory tapi cascade type all ini digunakan untuk menghapus/update seluruh data dengan id yang kita pilih
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bisa kasih contoh? @aditiyars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contohnya pada satu seller bisa memiliki banyak(lebih dari satu) foto untuk satu seller, kalo gak pake cascade bakal munculin transient exception (TransientObjectException occurs when you save an object which references another object that is transient (meaning it has the "default" identifier value, frequently null) and then flush the Session.)
closing and get the main implementation for refactoring purpose |
Create Unit test
add feature Create Inventory By Vendor on inventory controller
add findyById on seller repository
Create UploadInventoryRequest
close #36