Gophermart - #1
Merged
Merged
Conversation
Added Withdrawal struct (immutable event: UserID, OrderNumber, Amount, ProcessedAt).
Added Luhn algorithm implementation for order number validation.
Added UserID value object.
Added Points value object.
Added OrderNumber value object with Luhn validation.
Added domain value object errors.
Changed comments in entity package from Russian to English.
Added domain service for loyalty balance operations (ApplyAccrual, Withdraw).
Added domain service to create withdrawal records.
Added concise comment describing the type.
Added concise comments for type and methods; removed implementation note from Version.
Added concise comments; removed API/DB mapping details.
Added concise comment describing the type.
Added concise comment describing the service role.
Added concise comment describing the service role.
Added concise comments for type and Create method.
Added concise comment; removed storage details.
Added concise comments for type and methods.
Added concise error description.
Added RegisterInput and LoginInput for use case input.
Added ErrNotFound, ErrAlreadyExists, ErrConflict, ErrInvalidCredentials.
Added port for password hashing and verification.
Added port for auth token issue and validation.
Added UseCase[In,Out] interface for interactors.
Added port for user persistence (Create, FindByID, FindByLogin).
Added LoginUser interactor.
Added RegisterUser interactor.
Added in-memory UserRepository for dev and tests.
Added BCrypt implementation of PasswordHasher.
Added JWT implementation of TokenProvider.
Moved user creation logic from UserService into entity constructor
Moved order creation logic from OrderService into entity constructor
Moved withdrawal creation logic from WithdrawalService into entity constructor
Replaced UserService and BalanceService deps with entity.NewUser
Removed service dependencies from constructor calls
Replaced OrderService dep with entity.NewOrder
Removed service dependencies from constructor calls
Replaced WithdrawalService dep with entity.NewWithdrawal
Removed service dependencies from constructor calls
Added streaming method returning iter.Seq2 for lazy order fetching
Added StreamByStatuses mock method
Added iter.Seq2-based streaming query with cursor iteration
Added configurable worker pool size for accrual processing
Replaced sequential loop with streaming iter.Seq2 and errgroup workers
Replaced ListByStatuses mocks with StreamByStatuses and ordersIter helper
Required for errgroup in accrual processing
Replaced positional params with WithXxx options and validation
Switched NewUseCaseFactory call to WithXxx option functions
Switched NewUseCaseFactory call to WithXxx option functions
Replaced by entity constructors NewUser, NewOrder, NewWithdrawal
Replaced RetryConfig struct with RetryOption functions and pluggable BackoffFunc/RetriableFunc
Added DoWithRetry convenience method for repositories
Replaced package-level DoWithRetry calls with transactor method
Replaced package-level DoWithRetry calls with transactor method
Replaced package-level DoWithRetry calls with transactor method
Replaced package-level DoWithRetry calls with transactor method
Switched to WithMaxRetries and WithExponentialBackoff
Replaced RetryConfig with WithMaxRetries option
Switched NewTransactor to WithMaxRetries and WithExponentialBackoff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Реализована часть системы лояльности GopherMart на Go по принципам Clean Architecture.
Функциональность
Архитектура (Clean Architecture)
Тестирование