Update Voucher

This commit is contained in:
aditya.siregar
2025-06-06 14:48:09 +07:00
parent b5d6f7ff5b
commit 54144b2eba
7 changed files with 641 additions and 29 deletions
+27 -17
View File
@@ -116,16 +116,24 @@ type InProgressOrderRepository interface {
GetListByPartnerID(ctx mycontext.Context, partnerID int64, limit, offset int) ([]*entity.InProgressOrder, error)
}
type VoucherUndianRepo interface {
GetActiveUndianEvents(ctx context.Context) ([]*entity.UndianEventDB, error)
CreateUndianVouchers(ctx context.Context, vouchers []*entity.UndianVoucherDB) error
GetNextVoucherSequence(ctx mycontext.Context) (int64, error)
GetNextVoucherSequenceBatch(ctx mycontext.Context, count int) (int64, error)
}
type orderSvc struct {
repo Repository
product ProductService
customer CustomerService
transaction TransactionService
crypt CryptService
cfg Config
notification NotificationService
partnerSetting PartnerSettings
inprogressOrder InProgressOrderRepository
repo Repository
product ProductService
customer CustomerService
transaction TransactionService
crypt CryptService
cfg Config
notification NotificationService
partnerSetting PartnerSettings
inprogressOrder InProgressOrderRepository
voucherUndianRepo VoucherUndianRepo
}
func New(
@@ -137,15 +145,17 @@ func New(
cfg Config,
notification NotificationService,
partnerSetting PartnerSettings,
voucherUndianRepo VoucherUndianRepo,
) Service {
return &orderSvc{
repo: repo,
product: product,
customer: customer,
transaction: transaction,
crypt: crypt,
cfg: cfg,
notification: notification,
partnerSetting: partnerSetting,
repo: repo,
product: product,
customer: customer,
transaction: transaction,
crypt: crypt,
cfg: cfg,
notification: notification,
partnerSetting: partnerSetting,
voucherUndianRepo: voucherUndianRepo,
}
}