Revert "feat(loyalty): EnakPoint & EnakCoin" (#32)

This reverts merge commit 645da30, returning main to f0ff59f.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
efrilm
2026-09-30 15:16:15 +07:00
co-authored by Claude Opus 5.5
parent 645da3048e
commit 4e24f9bbb0
195 changed files with 2179 additions and 20060 deletions
@@ -1,58 +0,0 @@
package service
import (
"context"
"errors"
"github.com/google/uuid"
"apskel-pos-be/internal/constants"
"apskel-pos-be/internal/contract"
"apskel-pos-be/internal/processor"
"apskel-pos-be/internal/repository"
)
// CustomerDeviceService registers the customer app's devices for push notifications.
type CustomerDeviceService interface {
Register(ctx context.Context, customerID uuid.UUID, req *contract.RegisterCustomerDeviceRequest) *contract.Response
Unregister(ctx context.Context, customerID uuid.UUID, deviceID string) *contract.Response
}
type CustomerDeviceServiceImpl struct {
devices *processor.CustomerDeviceProcessor
}
func NewCustomerDeviceService(devices *processor.CustomerDeviceProcessor) *CustomerDeviceServiceImpl {
return &CustomerDeviceServiceImpl{devices: devices}
}
func (s *CustomerDeviceServiceImpl) Register(ctx context.Context, customerID uuid.UUID, req *contract.RegisterCustomerDeviceRequest) *contract.Response {
err := s.devices.Register(ctx, repository.CustomerDevice{
CustomerID: customerID,
DeviceID: req.DeviceID,
FCMToken: req.FCMToken,
Platform: req.Platform,
AppVersion: req.AppVersion,
})
if err != nil {
return customerDeviceErrorResponse(err)
}
return contract.BuildSuccessResponse(map[string]interface{}{"device_id": req.DeviceID})
}
func (s *CustomerDeviceServiceImpl) Unregister(ctx context.Context, customerID uuid.UUID, deviceID string) *contract.Response {
if err := s.devices.Unregister(ctx, customerID, deviceID); err != nil {
return customerDeviceErrorResponse(err)
}
return contract.BuildSuccessResponse(map[string]interface{}{"device_id": deviceID})
}
func customerDeviceErrorResponse(err error) *contract.Response {
code := constants.InternalServerErrorCode
if errors.Is(err, processor.ErrInvalidCustomerDevice) {
code = constants.ValidationErrorCode
}
return contract.BuildErrorResponse([]*contract.ResponseError{
contract.NewResponseError(code, constants.RequestEntity, err.Error()),
})
}