Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Document
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
mashplace
backend
Document
Commits
7272e00b
Commit
7272e00b
authored
1 year ago
by
DmitriiPetrov
Browse files
Options
Downloads
Patches
Plain Diff
MP-1378 Document Expiry email not sending for RGI, HEI cart & remote sale purchases
parent
c411aa35
Branches
Branches containing commit
Tags
b0.37.3
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.golangci.yml
+4
-0
4 additions, 0 deletions
.golangci.yml
cmd/mashroom-document/main.go
+6
-6
6 additions, 6 deletions
cmd/mashroom-document/main.go
internal/service/notification.go
+11
-6
11 additions, 6 deletions
internal/service/notification.go
with
21 additions
and
12 deletions
.golangci.yml
+
4
−
0
View file @
7272e00b
...
...
@@ -84,3 +84,7 @@ issues:
-
text
:
"
GetTypes?
is
deprecated:
Do
not
use."
linters
:
-
staticcheck
-
text
:
"
fieldalignment:
struct
with
\\
d+
pointer
bytes
could
be
\\
d+"
linters
:
-
govet
This diff is collapsed.
Click to expand it.
cmd/mashroom-document/main.go
+
6
−
6
View file @
7272e00b
...
...
@@ -19,9 +19,9 @@ import (
document
"gitlab.mashplace.com/mashplace/backend/document/api"
"gitlab.mashplace.com/mashplace/backend/document/internal/model"
"gitlab.mashplace.com/mashplace/backend/document/internal/model/mongo"
"gitlab.mashplace.com/mashplace/backend/document/internal/model/mongo/migrations/data/d1v0000"
"gitlab.mashplace.com/mashplace/backend/document/internal/model/mongo/migrations/data/d1v0001"
"gitlab.mashplace.com/mashplace/backend/document/internal/model/mongo/migrations/data/d1v0003"
//
"gitlab.mashplace.com/mashplace/backend/document/internal/model/mongo/migrations/data/d1v0001"
"gitlab.mashplace.com/mashplace/backend/document/internal/service"
"gitlab.mashplace.com/mashplace/backend/document/internal/storage/filesystem"
documentExpire
"gitlab.mashplace.com/mashplace/backend/document/internal/task/document/expire"
...
...
@@ -130,9 +130,9 @@ func main() {
repository
.
MigrateData
(
ctx
,
backoff
.
WithContext
(
backoff
.
NewConstantBackOff
(
time
.
Minute
),
ctx
),
d1v0003
.
Migration
(
envInvoiceService
),
d1v0000
.
Migration
(
storage
),
d1v0001
.
Migration
(),
//
d1v0003.Migration(envInvoiceService),
//
d1v0000.Migration(storage),
//
d1v0001.Migration(),
)
}()
...
...
This diff is collapsed.
Click to expand it.
internal/service/notification.go
+
11
−
6
View file @
7272e00b
...
...
@@ -17,7 +17,6 @@ import (
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/timestamppb"
logger
"gitlab.mashplace.com/mashplace/backend/common/generic/log"
"gitlab.mashplace.com/mashplace/backend/document/internal/model"
)
...
...
@@ -27,12 +26,12 @@ func (srv *serviceImpl) ScheduleExpiringDocumentsNotification() {
for
{
select
{
case
<-
ctx
.
Done
()
:
log
ger
.
Error
(
ctx
.
Err
())
log
.
Error
(
ctx
.
Err
())
default
:
go
func
()
{
err
:=
srv
.
notifyAboutExpiringDocuments
(
ctx
)
if
err
!=
nil
{
log
ger
.
Error
(
err
)
log
.
Error
(
err
)
}
}()
time
.
Sleep
(
6
*
time
.
Hour
)
...
...
@@ -80,6 +79,7 @@ func (srv *serviceImpl) notifyAboutExpiringDocumentsInDays(ctx context.Context,
}
d
.
ExpirationNotification
.
LastNotificationDate
=
time
.
Now
()
.
UTC
()
.
Truncate
(
24
*
time
.
Hour
)
err
=
srv
.
config
.
Repository
.
DocumentUpdate
(
ctx
,
d
)
if
err
!=
nil
{
log
.
WithError
(
err
)
.
Info
(
"LastNotificationDate field update error"
)
...
...
@@ -139,14 +139,19 @@ func (srv *serviceImpl) exportCloseOpportunity(ctx context.Context, d *model.Doc
service
:=
extrResp
.
GetService
()
var
(
invResp
*
invoice
.
ProductGetResponse
extrasResp
*
extras
.
GetResponse
)
if
service
==
nil
&&
d
.
ProductID
!=
""
{
prod
Resp
,
err
:
=
srv
.
config
.
Connections
.
Invoice
.
ProductGet
(
ctx
,
&
invoice
.
ProductGetRequest
{
Id
:
d
.
ProductID
})
inv
Resp
,
err
=
srv
.
config
.
Connections
.
Invoice
.
ProductGet
(
ctx
,
&
invoice
.
ProductGetRequest
{
Id
:
d
.
ProductID
})
if
err
!=
nil
&&
errors
.
Is
(
err
,
grpcerr
.
NotFound
)
{
return
err
}
extrasResp
,
err
:
=
srv
.
config
.
Connections
.
Extras
.
Get
(
ctx
,
&
extras
.
GetRequest
{
Id
:
prod
Resp
.
GetProduct
()
.
ServiceId
,
extrasResp
,
err
=
srv
.
config
.
Connections
.
Extras
.
Get
(
ctx
,
&
extras
.
GetRequest
{
Id
:
inv
Resp
.
GetProduct
()
.
ServiceId
,
})
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment