Skip to content
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

Main branch release #259

Closed
wants to merge 1,066 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1066 commits
Select commit Hold shift + click to select a range
378c04e
feat: added get total price calculators
vianneynara Nov 26, 2024
5003cc3
Added Implementation class of Apriori Service.
ZeroFairy Nov 26, 2024
fab31ca
feat(TransactionRequest): for Midtrans transaction token making
vianneynara Nov 26, 2024
2a11650
feat(TransactionResponse): for handling responses from Midtrans API
vianneynara Nov 26, 2024
961e680
Merge branch 'vianneynara:develop' into feature/apriori-service
ZeroFairy Nov 26, 2024
f8b9a2a
feat(TransactionRequest): added expiry
vianneynara Nov 26, 2024
b1c3794
feat(TransactionResponse): added status code and status message with …
vianneynara Nov 26, 2024
27559bd
feat(MidtransApiService): base create and cancel methods
vianneynara Nov 26, 2024
04e2f29
feat(TransactionResponse): added transaction status field
vianneynara Nov 26, 2024
8e64f73
refactor(TransactionStatus): to use Midtrans's statuses
vianneynara Nov 26, 2024
1891ebf
refactor(TransactionStatus): added full transaction statuses
vianneynara Nov 26, 2024
53cf2b1
refactor(TransactionRequest): use static class on Expiry
vianneynara Nov 26, 2024
40d0fcd
feat(MidtransApiService): fetch transaction status method
vianneynara Nov 26, 2024
827e462
feat(TransactionResponse): additional fields for transaction status
vianneynara Nov 26, 2024
925224c
feat(ApplicationProperties): added midtrans configurations
vianneynara Nov 26, 2024
59d5428
feat(Coordinate): of method and overloaded distance calculator
vianneynara Nov 27, 2024
b081195
feat(MidtransApiServiceImpl): basic implementation of the API calls
vianneynara Nov 27, 2024
4a87448
feat(MidtransTransactionException): custom exceptions for Midtrans AP…
vianneynara Nov 27, 2024
81f4f85
feat(ApplicationProperties): vendor env properties
vianneynara Nov 27, 2024
6ab3ba2
refactor(PurchaseMapper): removed individual lat-long to just use coo…
vianneynara Nov 27, 2024
5b4bb86
feat(PurchasePostDto): added event date, payment type, and delivery o…
vianneynara Nov 27, 2024
e2a07b2
feat(Variant): added getter that returns Variant entity
vianneynara Nov 27, 2024
13170e7
refactor(TransactionDetails): calculate gross amount from delivery fe…
vianneynara Nov 27, 2024
feebbf4
refactor(TransactionService): create method returns Transaction and u…
vianneynara Nov 27, 2024
384dce0
feat(ProductService): added converter to DTo without its variants
vianneynara Nov 27, 2024
1471a73
refactor(Transaction): remove date index and added paymentUrl and mid…
vianneynara Nov 27, 2024
e32ef3b
feat(TransactionStatus): added base "created" status
vianneynara Nov 27, 2024
96b669a
feat(TransactionDto): added payment url
vianneynara Nov 27, 2024
85e8a6f
feat(Purchase): added delivery option, fee, and reorder some fields
vianneynara Nov 27, 2024
898c188
feat(PurchaseDto): added delivery option and fee
vianneynara Nov 27, 2024
4f12667
feat(PurchaseItemDto): added product dto for easier access
vianneynara Nov 27, 2024
7b8574e
refactor(PurchaseItemMapper): rename variantDto to variant
vianneynara Nov 27, 2024
c8c579b
refactor(PurchaseItemPostDto): removed bought price as it will be cal…
vianneynara Nov 27, 2024
5037362
feat(PurchaseItemService): with convert to DTO
vianneynara Nov 27, 2024
c468de4
refactor(PurchaseItemMapper): ignore product
vianneynara Nov 27, 2024
2c2c7a7
refactor(PurchaseItem): fetch Variant eagerly
vianneynara Nov 27, 2024
26d6328
refactor(TransactionDto): reorder fields
vianneynara Nov 27, 2024
b932206
feat(TransactionDto): account id and purchase id
vianneynara Nov 27, 2024
4a7fe9d
refactor(getEmail): methods to filter email and lastname
vianneynara Nov 28, 2024
dbc8ee9
fix(Variant): not displaying the right min quantity
vianneynara Nov 28, 2024
f8e651c
feat(TransactionSpec): transaction filter specification
vianneynara Nov 28, 2024
0d36405
feat(MidtransTransactionException): erroring
vianneynara Nov 28, 2024
d6b7250
refactor(ApplicationProperties): changed BigDecimal to Double on paym…
vianneynara Nov 28, 2024
40535f5
feat(ClosureType): added PREP closure
vianneynara Nov 28, 2024
813268e
refactor(GlobalExceptionsHandler): handle IllegalArgumentException
vianneynara Nov 28, 2024
b1d4abd
feat(ClosedDateService): added save method that accepts a set of clos…
vianneynara Nov 29, 2024
9692190
refactor(MidtransApiServiceImpl): remove retryWhen
vianneynara Nov 29, 2024
67d88ce
refactor(ProductMapper): remove unused method
vianneynara Nov 29, 2024
04c2141
refactor(PurchaseItemMapper): fill the product field sourced variant'…
vianneynara Nov 29, 2024
ba2e422
refactor(PurchasePostDto): changed coordinate's examples to a more pr…
vianneynara Nov 29, 2024
1a8b50d
refactor(PurchaseSpec): renamed withDateBetween params to match context
vianneynara Nov 29, 2024
968bf5f
feat(TransactionService): added 'build' method and pageable getter wi…
vianneynara Nov 29, 2024
41314d7
refactor(TransactionRequest): added delivery fee and payment fee to t…
vianneynara Nov 29, 2024
a3e68ce
refactor(Transaction): rename invoiceId to referenceId
vianneynara Nov 29, 2024
b45a7ae
feat(TransactionPatchDto): proprietary annotations for the DTO class
vianneynara Nov 29, 2024
6e3874b
feat(TransactionRepository): repository for transaction
vianneynara Nov 29, 2024
ab777bd
feat(TransactionResponse): added builder for idk
vianneynara Nov 29, 2024
08af833
feat(TransactionServiceImpl): basic implementation of the transaction…
vianneynara Nov 29, 2024
81aba85
refactor(Purchase): I FORGOT TO MULTIPLY THE PRICE WITH QUANTITY
vianneynara Nov 29, 2024
eba8276
refactor(PurchaseService): changed the return type to entity for 'cre…
vianneynara Nov 29, 2024
c4b65e4
feat(PurchaseServiceImpl): base method implementations of the interface
vianneynara Nov 29, 2024
60f5092
feat(PurchaseRepository): empty interface repository needed for Purchase
vianneynara Nov 29, 2024
187cca7
feat(OrderProcessingController): processing order post method
vianneynara Nov 29, 2024
f5d402c
feat(OrderProcessingService): purchase creation integration
vianneynara Nov 29, 2024
612760e
refactor(OrderProcessingServiceImpl): check previous transactions and…
vianneynara Nov 30, 2024
10439f6
feat(OrderProcessingController): get all orders
vianneynara Nov 30, 2024
760f105
fix(PurchaseSpec): with account spec
vianneynara Nov 30, 2024
7c5f753
refactor(PurchaseServiceImpl): calculate delivery fee only when not p…
vianneynara Nov 30, 2024
6d2adf8
refactor(PurchaseSearchCriteria): of method with vanilla data types
vianneynara Nov 30, 2024
ec0b72c
feat(PurchasePostDto): added delivery fee
vianneynara Nov 30, 2024
53b215c
docs(OrderProcessingController): added security requirement
vianneynara Nov 30, 2024
12f5c24
Merge branch 'develop' into feature/193-purchase-purchaseitem-and-tra…
vianneynara Nov 30, 2024
67e6a60
Merge pull request #204 from vianneynara/feature/193-purchase-purchas…
vianneynara Nov 30, 2024
9834626
refactor(ProductCsvServiceImpl): sets seeded products' availability t…
vianneynara Nov 30, 2024
6cf545a
Merge pull request #209 from vianneynara/feature/208-sets-the-default…
vianneynara Nov 30, 2024
5823c77
refactor: OrderProcessing to Ordering
vianneynara Dec 1, 2024
c877439
fix(OtpVerifyDto): fix regex pattern
vianneynara Dec 1, 2024
693ac89
Merge pull request #211 from vianneynara/hotfix/210-otp-pattern-not-v…
vianneynara Dec 1, 2024
7be3991
refactor(PurchaseServiceImpl): remove unnecessary specification predi…
vianneynara Dec 1, 2024
791ab27
refactor(ClosedDateServiceImpl): remove unnecessary admin checkers
vianneynara Dec 2, 2024
8e982d4
refactor(CustomExceptionsHandler): handle null list of errors
vianneynara Dec 2, 2024
39e88a7
refactor(MidtransApiServiceImpl): fix error handlings
vianneynara Dec 2, 2024
b3cdce1
feat(PurchaseService): getById that returns entity
vianneynara Dec 2, 2024
fa3fa27
refactor(Transaction): eagerly fetch purchase
vianneynara Dec 2, 2024
23035a8
feat(TransactionService): fetch transaction and cancel by id
vianneynara Dec 2, 2024
d53f2ab
ondev(TransactionController): routes that will not even be used
vianneynara Dec 2, 2024
c0be56a
docs(PurchasePostDto): use latest options
vianneynara Dec 2, 2024
6bb740e
refactor(TransactionRequest): remove println
vianneynara Dec 2, 2024
ae97b5b
refactor(ApplicationProperties): added base url for app and api
vianneynara Dec 2, 2024
07a09b8
refactor(MidtransApiServiceImpl): use base url for app and api
vianneynara Dec 2, 2024
9128b2b
feat(OrderingService): cancelling order mechanism
vianneynara Dec 2, 2024
c04ac50
feat(OrderingController): cancelling order route
vianneynara Dec 2, 2024
1141ae0
feat(TransactionService): ownership validation method
vianneynara Dec 2, 2024
36c3849
refactor(TransactionServiceImpl): do not throw not found there
vianneynara Dec 2, 2024
ee49566
Added Apriori Entity for storing the Rule
ZeroFairy Dec 2, 2024
4db44ac
Merge pull request #214 from vianneynara/feature/206-implement-fetch-…
vianneynara Dec 2, 2024
b19d715
Change the naming of column:
ZeroFairy Dec 2, 2024
3b9e6d1
feat(OrderingService): confirm, findall, and find purchase method
vianneynara Dec 2, 2024
a15355a
feat(OrderingServiceImpl): confirm order
vianneynara Dec 2, 2024
a69d824
feat(OrderingServiceImpl): find all, specific purchase, and transacti…
vianneynara Dec 2, 2024
006a2e9
feat(OrderingController): confirm order and find transaction of a pur…
vianneynara Dec 2, 2024
3695fe4
feat(TransactionService): fetchTransaction with entity param
vianneynara Dec 2, 2024
2ec60f4
refactor(TransactionRepository): add pageable parameter
vianneynara Dec 2, 2024
ca20bc6
refactor(TransactionController): enable fetch transaction status
vianneynara Dec 2, 2024
ec47a72
refactor(TransactionController): enable get all transactions
vianneynara Dec 2, 2024
1a2a35b
refactor(ProductMapper): convert from set to sorted list
vianneynara Dec 2, 2024
f7d4db6
Merge pull request #215 from vianneynara/feature/206-implement-fetch-…
vianneynara Dec 2, 2024
c63f44a
fix(OrderingServiceImpl): override access if has admin for cancel method
vianneynara Dec 2, 2024
26ca585
docs(OrderingController): elaborate the function properly
vianneynara Dec 2, 2024
7723da5
conf(SecurityConfig): route access for orders and transaction
vianneynara Dec 2, 2024
a68de2c
Merge pull request #217 from vianneynara/feature/216-adjust-routings-…
vianneynara Dec 2, 2024
fbf218a
Merge pull request #213 from ZeroFairy/feature/apriori-entity
vianneynara Dec 2, 2024
6bc19dc
Merge pull request #203 from ZeroFairy/feature/apriori-service
vianneynara Dec 2, 2024
d2c01d9
refactor: whitespace and change to builder
vianneynara Dec 2, 2024
533b648
Merge pull request #219 from vianneynara/develop
vianneynara Dec 2, 2024
9abfb79
Merge pull request #218 from vianneynara/feature/212-initialize-aprio…
vianneynara Dec 2, 2024
57a98f5
fix the crazy shit
vianneynara Dec 2, 2024
8540e5e
Merge pull request #222 from vianneynara/develop
vianneynara Dec 2, 2024
9e73555
refactor(AprioriServiceImpl): fix whitespaces and unnecessary keywords
vianneynara Dec 2, 2024
07eabf4
refactor(Apriori): stores the id instead of relation
vianneynara Dec 2, 2024
353d92e
feat(AprioriRepository): find apriori by product id
vianneynara Dec 2, 2024
a36fe4e
feat(AprioriServiceImpl): added service annot
vianneynara Dec 2, 2024
2069086
feat(PurchaseService): added apriori needs getter
vianneynara Dec 2, 2024
2945eca
feat(RecommenderService): unify the apriori mechanism and added gener…
vianneynara Dec 2, 2024
a30e2bf
feat(RecommenderController): expose endpoint for triggering apriori c…
vianneynara Dec 2, 2024
caa1f94
feat(TransactionServiceImpl): update purchase status on transaction f…
vianneynara Dec 2, 2024
a8cb759
Merge pull request #224 from vianneynara/feature/223-update-purchase-…
vianneynara Dec 2, 2024
266ab40
Merge pull request #226 from vianneynara/develop
vianneynara Dec 2, 2024
1f5ee8f
Merge remote-tracking branch 'origin/feature/79-initialize-apriori-lo…
vianneynara Dec 2, 2024
bca53ac
refactor(AprioriService): return map of entries instead set of map
vianneynara Dec 2, 2024
5cb04d9
refactor(RecommenderServiceImpl): null-safe recommender object assign…
vianneynara Dec 2, 2024
ef9b778
Merge pull request #227 from vianneynara/feature/79-initialize-aprior…
vianneynara Dec 2, 2024
26cf384
conf(SecurityConfig): restrict user access to POSTing closure
vianneynara Dec 2, 2024
fed559a
refactor(TransactionServiceImpl): handle expired transactions on fetch
vianneynara Dec 2, 2024
2e242aa
Merge pull request #228 from vianneynara/develop
vianneynara Dec 2, 2024
2329b3f
Update README.md
vianneynara Dec 2, 2024
228b278
refactor(ImageStorageServiceImpl): added fallback method to handle co…
vianneynara Dec 3, 2024
2822f23
refactor(MidtransRequest): from TransactionRequest
vianneynara Dec 3, 2024
5d09431
refactor(MidtransResponse): from TransactionResponse
vianneynara Dec 3, 2024
7b2447a
refactor(TransactionServiceImpl): handle fraud transactions and extra…
vianneynara Dec 3, 2024
a2060ad
feat(MidtransNotification): data containing Midtrans notification body
vianneynara Dec 3, 2024
1ac9447
refactor(env): missing configurations and reorder
vianneynara Dec 4, 2024
6cb5afd
feat(ApplicationProperties): added Midtrans merchant id
vianneynara Dec 4, 2024
ce3036b
feat(MidtransWebhookController): notifier endpoint
vianneynara Dec 4, 2024
003d745
feat(MidtransWebhookService): process notification and signature key …
vianneynara Dec 4, 2024
7815967
feat(MidtransWebhookServiceImpl): implement notification processor
vianneynara Dec 4, 2024
e63398f
feat(OrderingService): create and implement change order status and u…
vianneynara Dec 4, 2024
68fa151
docs: fix swagger schema naming
vianneynara Dec 4, 2024
675b385
refactor(OrderingService): change order status param to string instea…
vianneynara Dec 4, 2024
08b8b7c
feat(OrderingController): order status updater endpoints
vianneynara Dec 4, 2024
cd18c74
feat(OrderingController): peek next available statuses
vianneynara Dec 4, 2024
904b852
feat(OrderingService): added available status getter
vianneynara Dec 4, 2024
7ee6074
refactor(Purchase): disable purchase waiting DP and settlement and el…
vianneynara Dec 4, 2024
ecec818
feat(PurchaseService): added available status getter
vianneynara Dec 4, 2024
681e26b
refactor(PurchaseService): limit upgrading to next status on finished…
vianneynara Dec 4, 2024
42d1260
refactor(OrderingService): i forgor to import map
vianneynara Dec 4, 2024
a07d169
docs(OrderingController): improve 403 API responses
vianneynara Dec 4, 2024
286bfb9
refactor(OrderingController): fix DTO returned by getTransaction
vianneynara Dec 4, 2024
59bdd05
feat(OrderingController): get single order endpoint
vianneynara Dec 4, 2024
ca7838c
refactor(CustomExceptionsHandler): use map instead of list for Midtra…
vianneynara Dec 4, 2024
c21e113
refactor(MidtransWebhookService): use proper exception for validating…
vianneynara Dec 4, 2024
14156a2
docs(MidtransNotification): set up simple examples
vianneynara Dec 4, 2024
740ae15
conf(SecurityConfig): added midtrans endpoints access
vianneynara Dec 4, 2024
a7dbdce
feat(MidtransWebhookController): midtrans notification sign-key endpoint
vianneynara Dec 4, 2024
e8b5206
refactor(MidtransWebhookServiceImpl): fix notification processor vali…
vianneynara Dec 4, 2024
7f73c8c
feat(MidtransWebhookService): added notification signature creator
vianneynara Dec 4, 2024
735a9d4
feat(MidtransWebhookServiceImpl): added notification request printer
vianneynara Dec 4, 2024
cab337c
docs(MidtransWebhookService): added reference to midtrans notificatio…
vianneynara Dec 4, 2024
736802d
Merge pull request #231 from vianneynara/feature/207-implement-notifi…
vianneynara Dec 4, 2024
125dcfc
refactor(RecommenderServiceImpl): filter out non-available products
vianneynara Dec 4, 2024
e567cd9
refactor: clean up println-s
vianneynara Dec 4, 2024
42b9a0e
Merge pull request #235 from vianneynara/feature/189-recommender-can-…
vianneynara Dec 4, 2024
9720e8a
refactor: clean whitespaces
vianneynara Dec 5, 2024
d0145d8
feat(AccountCsvRecord): csv record template of account
vianneynara Dec 5, 2024
f47d3d0
feat(AccountCsvService): csv importer using opencsv
vianneynara Dec 5, 2024
01c10a2
refactor(DatabaseBootstrapper): use csv injector instead of hardcoded…
vianneynara Dec 5, 2024
1f0ddd1
feat: account seeder
vianneynara Dec 5, 2024
0d6b8d9
feat(ApplicationProperties): preference whether to seed accounts and …
vianneynara Dec 5, 2024
42a8cef
refactor(DatabaseBootstrapper): inject seeders by preference
vianneynara Dec 5, 2024
53d13de
refactor(ApplicationProperties): prioritize using system environment …
vianneynara Dec 5, 2024
dee2323
test(DatabaseBootstrapperTest): fix constructor change
vianneynara Dec 6, 2024
d294bc8
test(AccountControllerIT): added get all with accounts test
vianneynara Dec 6, 2024
080cb5e
test(ProductControllerIT): create new product to be used for testGetA…
vianneynara Dec 6, 2024
526cbc4
test(ProductControllerIT): testGetAllProducts with an arrange method
vianneynara Dec 6, 2024
03f7a41
test(ProductControllerIT): testGetAllProducts with an arrange method
vianneynara Dec 6, 2024
cdf7983
Merge remote-tracking branch 'origin/feature/232-use-csv-of-accounts-…
vianneynara Dec 6, 2024
3c57de2
test(DatabaseBootstrapperTest): inject products
vianneynara Dec 6, 2024
2b37cb1
Merge pull request #240 from vianneynara/feature/232-use-csv-of-accou…
vianneynara Dec 6, 2024
f0b3b4d
feat(ApplicationProperties): front end base url
vianneynara Dec 6, 2024
de263b7
refactor: fix VENDOR PHONE key
vianneynara Dec 6, 2024
57b2656
feat: whatsapp notification for cancellation, confirming, and confirm…
vianneynara Dec 6, 2024
30881b5
Merge pull request #241 from vianneynara/feature/237-send-notificatio…
vianneynara Dec 6, 2024
a9b8bbc
feat(DatabaseBootstrapper): set the first account during to admin dur…
vianneynara Dec 6, 2024
9117a8e
feat(Transaction): success status enum
vianneynara Dec 6, 2024
0c329ae
feat(Purchase): refunded enum and handle it in isFinished
vianneynara Dec 6, 2024
cb9839f
chore: set seeders to true since database has changed
vianneynara Dec 6, 2024
3784d7e
feat(AccountRepository): find first account in database
vianneynara Dec 6, 2024
27937d8
feat(MidtransApiService): api refund call method
vianneynara Dec 6, 2024
eb7574e
refactor(MidtransWebhookServiceImpl): include success enum as paid tr…
vianneynara Dec 6, 2024
c7294fa
feat(OrderingController): add refund order endpoint
vianneynara Dec 6, 2024
3d6f95d
feat(OrderingService): refund process unifier method
vianneynara Dec 6, 2024
69a2896
feat(TransactionRepository): query to find the latest transaction of …
vianneynara Dec 6, 2024
f8c1b06
feat(TransactionService): method find latest transaction of a purchas…
vianneynara Dec 6, 2024
5a61c9b
whar??? but ok, reset repository for this test
vianneynara Dec 6, 2024
080baf9
Merge pull request #242 from vianneynara/feature/238-add-refund-featu…
vianneynara Dec 6, 2024
e83d17b
refactor(OrderingController): status to statuses
vianneynara Dec 7, 2024
56dcf53
refactor(PurchaseService): criteria with statuses processor
vianneynara Dec 7, 2024
8d0687e
feat(PurchaseSpec): anyOf status specification maker
vianneynara Dec 7, 2024
f6683aa
refactor(PurchaseServiceImpl): use with statuses predicate maker
vianneynara Dec 7, 2024
1a4ce07
refactor(TransactionServiceImpl): use with statuses predicate maker
vianneynara Dec 7, 2024
7e541fe
feat(TransactionSpec): anyOf status specification maker
vianneynara Dec 7, 2024
7ff3935
refactor(TransactionController): status to statuses
vianneynara Dec 7, 2024
188d199
refactor(TransactionController): status to statuses
vianneynara Dec 7, 2024
297a07a
Merge pull request #243 from vianneynara/feature/239-split-status-par…
vianneynara Dec 7, 2024
72dab34
refactor(IndexController): allow base endpoint to access status
vianneynara Dec 7, 2024
7c68eb4
feat: redirect html template
vianneynara Dec 7, 2024
ca78c1b
chore: redirect html background image
vianneynara Dec 7, 2024
a98841e
feat(StaticController): redirect template endpoint
vianneynara Dec 7, 2024
44c31af
feat(WebConfig): add static endpoints for resource and api
vianneynara Dec 7, 2024
12a7df7
refactor(ApplicationProperties): default values for midtrans finish, …
vianneynara Dec 7, 2024
f7b48a6
feat: table for midtrans order information
vianneynara Dec 7, 2024
50e23ce
feat(StaticController): params for midtrans order information
vianneynara Dec 7, 2024
e6cfdae
feat(PurchaseCallbacksPostDto): callbacks request DTO
vianneynara Dec 7, 2024
da2660d
feat(OrderingServiceImpl): added callbacks into midtrans request
vianneynara Dec 7, 2024
1e3a974
feat(MidtransRequest): finish and error callbacks with default value …
vianneynara Dec 7, 2024
3d5011b
Merge pull request #247 from vianneynara/feature/246-add-callbacks-to…
vianneynara Dec 7, 2024
1d5cb1d
refactor: log properly
vianneynara Dec 7, 2024
92cf868
feat: actuator dependency
vianneynara Dec 8, 2024
cdf1b4d
feat: actuator management configuration
vianneynara Dec 8, 2024
7cfb3cf
conf: actuator filter
vianneynara Dec 8, 2024
ad7b327
Merge pull request #249 from vianneynara/feature/248-integrate-spring…
vianneynara Dec 8, 2024
5ac3984
feat: starter spring cache dependency
vianneynara Dec 8, 2024
7a4efb6
feat(KuenyaWZApiApplication): enable caching
vianneynara Dec 8, 2024
62d1e03
feat(ProductServiceImpl): introduce caching to get all products pagin…
vianneynara Dec 8, 2024
916964f
feat(PurchaseServiceImpl): introduce caching to get all purchases of …
vianneynara Dec 8, 2024
9e2d56b
feat: cache names of productsCache,productDto,purchasesCache
vianneynara Dec 8, 2024
788a8f9
Merge pull request #252 from vianneynara/feature/251-add-resource-cac…
vianneynara Dec 8, 2024
f4815b4
feat: caffeine dependency for caching
vianneynara Dec 8, 2024
212ea6a
feat(CacheConfig): caffeine default configuration and overriding prop…
vianneynara Dec 8, 2024
0788d6d
feat(ProductServiceImpl): cache singular product and rename cache val…
vianneynara Dec 8, 2024
5d76c25
feat(ProductServiceImpl): cache modifying product and clear products
vianneynara Dec 8, 2024
8dfaf04
feat(ProductServiceImpl): cache deletions
vianneynara Dec 8, 2024
c9b8715
refactor: caching eviction/put during update
vianneynara Dec 9, 2024
899f670
Merge pull request #254 from vianneynara/feature/253-cache-eviction-a…
vianneynara Dec 9, 2024
9e46454
refactor(PurchaseSpec): compare with object type rather than string
vianneynara Dec 9, 2024
d5587f8
Merge pull request #256 from vianneynara/feature/255-fix-purchase-pay…
vianneynara Dec 9, 2024
203c200
feat(MidtransWebhookController): endpoint for generating body of a no…
vianneynara Dec 9, 2024
2b1be89
feat(MidtransWebhookService): notification body generator method
vianneynara Dec 9, 2024
59f1492
refactor: clean stuff
vianneynara Dec 9, 2024
6dbd27d
Merge pull request #258 from vianneynara/feature/257-midtrans-notific…
vianneynara Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Database Configuration
DB_URL=
DB_USERNAME=
DB_PASSWORD=

# Application Configurations
APP_VERSION=
APP_REPOSITORY_URL=

# Front end links
FRONTEND_BASE_URL=

# Vendor Configuration
VENDOR_INSTAGRAM=
VENDOR_EMAIL=
VENDOR_PHONE=
VENDOR_ADDRESS=
VENDOR_LATITUDE=
VENDOR_LONGITUDE=
VENDOR_PAYMENT_FEE=
VENDOR_FEE_PER_KM=

# Endpoint Authorization
JWT_SECRET=
JWT_ACCESS_EXP_SECONDS=
REFRESH_TOKEN_EXP_DAYS=

# One Time Password Configuration
OTP_PHONE_NUMBER=
OTP_LENGTH=
OTP_EXPIRE_SECONDS=
FONNTE_API_TOKEN=

# Midtrans Configuration
#MIDTRANS_CLIENT_KEY=
MIDTRANS_MERCHANT_ID=
MIDTRANS_SERVER_KEY=
MIDTRANS_BASE_URL_APP=
MIDTRANS_BASE_URL_API=
MIDTRANS_NOTIFICATION_URL=
MIDTRANS_FINISH_URL=
MIDTRANS_UNFINISH_URL=
MIDTRANS_ERROR_URL=
53 changes: 53 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches:
- "develop"
- "main"
- "release/*"
- "feature/*"
- "hotfix/*"
pull_request:
branches:
- "develop"
- "main"
- "release/*"

permissions:
contents: write
deployments: write
security-events: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build and Test with Maven
run: mvn -B verify --file pom.xml
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# IDK: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
if: github.event_name == 'push'
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ target/
!**/src/main/**/target/
!**/src/test/**/target/

### Saved By Program ###
src/main/resources/uploads/*

### STS ###
.apt_generated
.classpath
Expand Down Expand Up @@ -31,3 +34,6 @@ build/

### VS Code ###
.vscode/

### ENVIRONMENT ###
.env
143 changes: 122 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,122 @@
MIT License

Copyright (c) 2024 Nara

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This software is released under CC0 1.0 Universal.
KuenyaWZ and KuenyaWZ API are trademarks of KuenyaWZ.

CC0 1.0 Universal

CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.

For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:

i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.

4. Limitations and Disclaimers.

a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
61 changes: 44 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# WZ Snack And Bites API
# KuenyaWZ API

Spring Boot API for WZ Snack And Bites project.
Spring Boot API for KuenyaWZ project.

## Main Repository

This project is to be implemented for our **[WZ Snack N Bites](https://github.com/vianneynara/wz-snack-n-bites)**
project.
This project is to be implemented for our **[KuenyaWZ](https://github.com/vianneynara/kuenyawz)** site.

## Features/checklist

- [ ] Entities - Controllers - Services - Repositories
- [x] Account
- [ ] Product
- [ ] Variant (subset of Product)
- [ ] Order
- [ ] Order Item (subset of Order)
- [ ] Transaction
- [ ] Likes
- [ ] CustomSchedule
- [ ] Authentication/Authorization
- [ ] Basic
- [ ] JWT
- [x] Product
- [x] Variant (subset of Product)
- [x] Product Images
- [x] Order
- [x] Order Item (subset of Order)
- [x] Transaction
- [ ] ~~Likes~~
- [x] CustomSchedule
- [x] Authentication/Authorization
- [ ] ~~Basic~~
- [x] JWT Authentication

Should be noted that we'll need to implement integration of methods
for the actual website business logic.

## API documentation

Refer to this **[Swagger Documentation](https://app.swaggerhub.com/apis-docs/NaraNarwandaru/wz-snack_and_bites_api/1.0.0)**
Refer to this **[Swagger Documentation](https://app.swaggerhub.com/apis/Nara-ff7/kuenyawz-api/1.0.0#/)**

## Prerequisites

Expand All @@ -40,10 +40,37 @@ Refer to this **[Swagger Documentation](https://app.swaggerhub.com/apis-docs/Nar

- Database: H2 in memory
- Port: 8081
- Base URL: `http://localhost:8081/api/v1`
- Base URL: `http://localhost:8081/api`

## Installing and running application

1. Clone this repository
2. Change directory to the cloned repository
3. Run `mvn spring-boot:run`
3. Run `mvn spring-boot:run`

### Running with specific profile

Make sure the profile requirement is met. For example, to run with postgres profile,
please make sure you have PostgreSQL installed and running with the provided `.ENV`.

1. Add profile to environment variable: `set SPRING_PROFILES_ACTIVE=postgres`
2. Run `mvn spring-boot:run`

## Authenticating

Environment requirements:

|key|description|
|-|-|
|JWT_SECRET|Base 64 secret key|
JWT_ACCESS_EXP_SECONDS|Token availability until expiration (in seconds), default=3600|
REFRESH_TOKEN_EXP_DAYS|Refresh token availability until expiration (in days), default=7|

Authentication process:
1. `POST /api/auth/register` Registration to create new account and retrieve authententication response
2. `POST /api/auth/login` Login to authenticate to an account and retrieve authententication response
3. `GET /api/auth/me` Me to retrieve current access token's user details/account/owner
4. `POST /api/auth/refresh` Refresh to get new access token (JWT token)
5. `POST /api/auth/revoke` Revoke to invalidate a refresh tokenn (used when logging out)

The refresh token is generated using Java's `SecureRandom` and ancoded using Base64.
Loading
Loading