Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/license-header-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
uses: linuxfoundation/lfx-public-workflows/.github/workflows/license-header-check.yml@main
with:
copyright_line: "Copyright The Linux Foundation and each contributor to LFX."
exclude_pattern: "gen"
exclude_pattern: "gen,templates"
46 changes: 34 additions & 12 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The LFX V2 Project Service is a RESTful API service that manages projects within

### Key Technologies

- **Language**: Go 1.23+
- **Language**: Go 1.24+
- **API Framework**: Goa v3 (code generation framework)
- **Messaging**: NATS with JetStream for event-driven architecture
- **Storage**: NATS Key-Value stores (no traditional database)
Expand Down Expand Up @@ -39,11 +39,13 @@ cmd/project-api/ # Presentation Layer (HTTP/NATS entry point)
internal/ # Core business logic
├── domain/ # Domain layer (interfaces, models, errors)
│ └── models/ # Domain entities
├── service/ # Service layer (business logic)
├── infrastructure/ # Infrastructure layer
│ ├── auth/ # JWT authentication
│ └── nats/ # NATS repository implementation
└── middleware/ # HTTP middleware
├── service/ # Service layer (business logic)
│ └── email/ # Email template rendering (one file per email type)
└── infrastructure/ # Infrastructure layer
├── auth/ # JWT authentication
├── log/ # Structured logging helpers (AppendCtx, InitStructureLogConfig)
├── middleware/ # HTTP middleware (auth, request ID, body limit, logger)
└── nats/ # NATS repository and message builder

pkg/ # Shared packages across services
└── constants/ # Shared constants
Expand Down Expand Up @@ -151,23 +153,32 @@ The service uses NATS for:

### API Endpoints and Message Subjects

Complete API endpoint documentation and NATS message handlers are now documented in README.md. Key RPC subjects handled by this service:
Complete API endpoint documentation and NATS message handlers are now documented in README.md.

There are two distinct NATS patterns in this service — both use `QueueSubscribe` but for different purposes:

**Request/reply RPC** (`internal/service/project_handlers.go`): another service sends a request and blocks waiting for a response. The handler calls `msg.Respond(data)` to return data to the caller.

**Event subscriptions** (`internal/service/project_subscriber.go`): the service reacts to events that were already published (including by itself). No caller is waiting — the handler is fire-and-forget and never calls `msg.Respond`.

```go
// Inbound RPC (handled by this service)
"lfx.projects-api.queue" // Queue for projects API operations
// Inbound RPC — request/reply, caller blocks waiting for response
"lfx.projects-api.get_name" // Get project name by UID
"lfx.projects-api.get_slug" // Get project slug by UID
"lfx.projects-api.get_logo" // Get project logo URL by UID
"lfx.projects-api.slug_to_uid" // Convert slug to UID
"lfx.projects-api.get_parent_uid" // Get parent project UID

// Inbound events — fire-and-forget, no reply expected
"lfx.projects-api.project_settings.updated" // Sends role notification emails on member additions

// Outbound events (published by this service)
"lfx.index.project" // Project created/updated/deleted for indexing
"lfx.index.project_settings" // Settings created/updated for indexing
"lfx.projects-api.project_settings.updated" // Settings changed (before/after)
"lfx.projects-api.project_settings.updated" // Settings changed (before/after snapshot)
"lfx.fga-sync.update_access" // Generic FGA access control updates
"lfx.fga-sync.delete_access" // Generic FGA access control deletion
"lfx.email-service.send_email" // Request/reply to email service for role notifications
```

### FGA Sync Message Format
Expand Down Expand Up @@ -256,6 +267,7 @@ func TestEndpoint(t *testing.T) {
| `JWKS_URL` | JWT verification endpoint | - | No |
| `AUDIENCE` | JWT audience | lfx-v2-project-service | No |
| `JWT_AUTH_DISABLED_MOCK_LOCAL_PRINCIPAL` | Mock auth for local dev | - | No |
| `LFX_SELF_SERVE_BASE_URL` | Base URL for project links in notification emails | derived from `LFX_ENVIRONMENT` | No |

## Authorization (OpenFGA)

Expand Down Expand Up @@ -406,15 +418,25 @@ Every data modification publishes NATS messages:
- Index messages for search service
- Access control updates for authorization service

### 3. Request Context
### 3. NATS Event Wire Types (`pkg/events/`)

NATS message payload types that other services consume belong in `pkg/events/`, **not** `internal/`. This lets downstream services (e.g., `lfx-v2-invite-service`) import the canonical struct definitions directly.

- Domain types in `internal/domain/models/` may differ from wire types and can evolve independently.
- Explicit converter functions in `internal/service/converters.go` map from domain → event type before publishing.
- Example: `DomainSettingsToEvent(*models.ProjectSettings) events.ProjectSettings`

**Rule:** if a struct appears in a NATS message payload, it belongs in `pkg/events/`, not `internal/`.

### 4. Request Context

Important context values:

- `request-id`: Unique request identifier
- `authorization`: JWT token from header
- `etag`: ETag value for optimistic concurrency (sent as If-Match header in requests)

### 4. Error Handling
### 5. Error Handling

Domain errors are mapped to HTTP status codes:

Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,21 @@ fmt:
# Check license headers (basic validation - full check runs in CI)
.PHONY: license-check
license-check:
@echo "==> Checking license headers (basic validation)..."
@missing_files=$$(find . -name "*.go" \
-not -path "./api/project/v1/gen/*" \
-not -path "./vendor/*" \
-exec sh -c 'head -10 "$$1" | grep -q "Copyright The Linux Foundation and each contributor to LFX" && head -10 "$$1" | grep -q "SPDX-License-Identifier: MIT" || echo "$$1"' _ {} \;); \
if [ -n "$$missing_files" ]; then \
echo "Files missing required license headers:"; \
echo "$$missing_files"; \
echo "Required headers:"; \
echo " # Copyright The Linux Foundation and each contributor to LFX."; \
echo " # SPDX-License-Identifier: MIT"; \
echo "Note: Full license validation runs in CI"; \
@echo "==> Checking license headers..."
@TRACKED=$$(git ls-files | grep -E '\.(go|html|txt)$$' | grep -v "^api/project/v1/gen/" | grep -v "^internal/service/email/templates/"); \
missing_copyright=$$(echo "$$TRACKED" | xargs grep -rL "Copyright The Linux Foundation and each contributor to LFX" 2>/dev/null || true); \
if [ -n "$$missing_copyright" ]; then \
echo "Files missing copyright header:"; \
echo "$$missing_copyright"; \
exit 1; \
fi; \
missing_spdx=$$(echo "$$TRACKED" | xargs grep -rL "SPDX-License-Identifier: MIT" 2>/dev/null || true); \
if [ -n "$$missing_spdx" ]; then \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
echo "Files missing SPDX identifier:"; \
echo "$$missing_spdx"; \
Comment thread
andrest50 marked this conversation as resolved.
Outdated
exit 1; \
fi
@echo "==> Basic license header check passed"
@echo "==> License header check passed"
Comment thread
andrest50 marked this conversation as resolved.

# Check formatting and linting without modifying files
.PHONY: check
Expand Down
53 changes: 44 additions & 9 deletions cmd/project-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import (

genhttp "github.com/linuxfoundation/lfx-v2-project-service/api/project/v1/gen/http/project_service/server"
genquerysvc "github.com/linuxfoundation/lfx-v2-project-service/api/project/v1/gen/project_service"
"github.com/linuxfoundation/lfx-v2-project-service/internal/domain"
"github.com/linuxfoundation/lfx-v2-project-service/internal/domain/models"
"github.com/linuxfoundation/lfx-v2-project-service/internal/infrastructure/auth"
"github.com/linuxfoundation/lfx-v2-project-service/internal/infrastructure/log"
"github.com/linuxfoundation/lfx-v2-project-service/internal/infrastructure/middleware"
internalnats "github.com/linuxfoundation/lfx-v2-project-service/internal/infrastructure/nats"
"github.com/linuxfoundation/lfx-v2-project-service/internal/log"
"github.com/linuxfoundation/lfx-v2-project-service/internal/middleware"
"github.com/linuxfoundation/lfx-v2-project-service/internal/service"
"github.com/linuxfoundation/lfx-v2-project-service/pkg/constants"
"github.com/linuxfoundation/lfx-v2-project-service/pkg/utils"
Expand Down Expand Up @@ -94,7 +95,8 @@ func main() {

// Generated service initialization.
service := service.NewProjectsService(jwtAuth, service.ServiceConfig{
SkipEtagValidation: env.SkipEtagValidation,
SkipEtagValidation: env.SkipEtagValidation,
LFXSelfServeBaseURL: env.LFXSelfServeBaseURL,
})
svc := NewProjectsAPI(service)

Expand Down Expand Up @@ -156,9 +158,10 @@ func parseFlags(defaultPort string) flags {

// environment are the environment variables for the project service.
type environment struct {
NatsURL string
Port string
SkipEtagValidation bool
NatsURL string
Port string
SkipEtagValidation bool
LFXSelfServeBaseURL string
}

func parseEnv() environment {
Expand All @@ -175,10 +178,22 @@ func parseEnv() environment {
if skipEtagValidationStr == "true" {
skipEtagValidation = true
}
lfxSelfServeBaseURL := os.Getenv("LFX_SELF_SERVE_BASE_URL")
if lfxSelfServeBaseURL == "" {
switch os.Getenv("LFX_ENVIRONMENT") {
case "prod":
lfxSelfServeBaseURL = "https://app.lfx.dev"
case "staging", "stg":
lfxSelfServeBaseURL = "https://staging.app.lfx.dev"
default:
lfxSelfServeBaseURL = "https://dev.app.lfx.dev"
}
Comment thread
andrest50 marked this conversation as resolved.
}
return environment{
NatsURL: natsURL,
Port: port,
SkipEtagValidation: skipEtagValidation,
NatsURL: natsURL,
Port: port,
SkipEtagValidation: skipEtagValidation,
LFXSelfServeBaseURL: lfxSelfServeBaseURL,
}
}

Expand Down Expand Up @@ -422,6 +437,26 @@ func createNatsSubcriptions(ctx context.Context, svc *ProjectsAPI, natsConn *nat
}
}

type eventHandler struct {
subject string
handle func(ctx context.Context, msg domain.Message) error
}
for _, eh := range []eventHandler{
{constants.ProjectSettingsUpdatedSubject, svc.service.HandleProjectSettingsUpdated},
} {
slog.With("subject", eh.subject, "queue", queueName).Debug("subscribing to NATS subject")
_, err := natsConn.QueueSubscribe(eh.subject, queueName, func(msg *nats.Msg) {
natsMsg := &internalnats.NatsMsg{Msg: msg}
if handlerErr := eh.handle(ctx, natsMsg); handlerErr != nil {
slog.WarnContext(ctx, "event handler failed", errKey, handlerErr, "subject", eh.subject)
}
})
if err != nil {
slog.ErrorContext(ctx, "error creating NATS queue subscription", errKey, err)
return err
}
}

return nil
}

Expand Down
7 changes: 2 additions & 5 deletions go.mod
Comment thread
github-license-compliance[bot] marked this conversation as resolved.
Fixed
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ require (
github.com/aws/aws-sdk-go-v2/service/s3 v1.92.0
github.com/go-viper/mapstructure/v2 v2.4.0
github.com/google/uuid v1.6.0
github.com/linuxfoundation/lfx-v2-email-service v0.0.0-20260512222125-bfe795580bd6
github.com/linuxfoundation/lfx-v2-fga-sync v0.2.17
github.com/linuxfoundation/lfx-v2-indexer-service v0.4.14-0.20260109191409-7371e293d8b5
Comment thread
andrest50 marked this conversation as resolved.
Comment thread
andrest50 marked this conversation as resolved.
github.com/nats-io/nats.go v1.47.0
github.com/remychantenay/slog-otel v1.3.4
Expand Down Expand Up @@ -63,23 +65,18 @@ require (
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect
github.com/klauspost/compress v1.18.1 // indirect
github.com/linuxfoundation/lfx-v2-fga-sync v0.2.17 // indirect
github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d // indirect
github.com/nats-io/nkeys v0.4.11 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/openfga/go-sdk v0.7.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rustyoz/Mtransform v0.0.0-20250628105438-00796a985d0a // indirect
github.com/rustyoz/genericlexer v0.0.0-20250522144106-d3cfee480384 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/stretchr/objx v0.5.3 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/mod v0.31.0 // indirect
golang.org/x/net v0.49.0 // indirect
Expand Down
15 changes: 2 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764=
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 h1:MGKhKyiYrvMDZsmLR/+RGffQSXwEkXgfLSA08qDn9AI=
Expand Down Expand Up @@ -81,6 +79,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/linuxfoundation/lfx-v2-email-service v0.0.0-20260512222125-bfe795580bd6 h1:FysNg3z1JLyJushe0iHj7+2Myv3EzE9E3aBXdETYPHQ=
github.com/linuxfoundation/lfx-v2-email-service v0.0.0-20260512222125-bfe795580bd6/go.mod h1:gx+JU/rpQj62C4/GcEYzpZVFuZpcpaHGO14cEj/CGXM=
github.com/linuxfoundation/lfx-v2-fga-sync v0.2.17 h1:ZW2PyrEPB6SmT14qa3qlrcU4rB/eKRumPUOwaoS5or4=
github.com/linuxfoundation/lfx-v2-fga-sync v0.2.17/go.mod h1:075J7/39UbsuLsJCXgVkbpKK1VIuPa7gbyhLsoTBAXo=
github.com/linuxfoundation/lfx-v2-indexer-service v0.4.14-0.20260109191409-7371e293d8b5 h1:Ic06r/3OO4wP2Y2eL9InXEKRSVq2cqbNGBTsdr493YA=
Expand All @@ -95,9 +95,6 @@ github.com/nats-io/nkeys v0.4.11 h1:q44qGV008kYd9W1b1nEBkNzvnWxtRSQ7A8BoqRrcfa0=
github.com/nats-io/nkeys v0.4.11/go.mod h1:szDimtgmfOi9n25JpfIdGw12tZFYXqhGxjhVxsatHVE=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/openfga/go-sdk v0.7.1 h1:ZFFDRoSWAHcbOzPFUWPLUpoIOJZRoQ6KgJp2vyfB82g=
github.com/openfga/go-sdk v0.7.1/go.mod h1:Fu00XYLWkfgmo3PV45EwSOhpaBNcuVMBOdklpKoaazw=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remychantenay/slog-otel v1.3.4 h1:xoM41ayLff2U8zlK5PH31XwD7Lk3W9wKfl4+RcmKom4=
Expand All @@ -110,12 +107,8 @@ github.com/rustyoz/genericlexer v0.0.0-20250522144106-d3cfee480384 h1:jrCaAewj72
github.com/rustyoz/genericlexer v0.0.0-20250522144106-d3cfee480384/go.mod h1:m65JtsVg785EjQvQylesseVucezoQZqJozlPAfjXmbE=
github.com/rustyoz/svg v0.0.0-20250705135709-8b1786137cb3 h1:dFappt+gj/o9cCFfMmXV8Jq+hShQmFlM6Uh2Vd0YlzE=
github.com/rustyoz/svg v0.0.0-20250705135709-8b1786137cb3/go.mod h1:33v4CGNONT4+QIwIt3o1GVdBqTfLCeptHNc0HpZ1N14=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
Expand Down Expand Up @@ -156,12 +149,8 @@ go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZY
go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA=
go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A=
go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
goa.design/goa/v3 v3.22.6 h1:D2qDkAvdpf6ePr2iXKT+Ple5WDrjyes3iOfYD2yCpw0=
goa.design/goa/v3 v3.22.6/go.mod h1:rhssEXxox3+sKnYp18hPNFCz65I4hLWHEtJKewoNJWk=
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
Expand Down
3 changes: 3 additions & 0 deletions internal/domain/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package domain

import (
"context"

emailapi "github.com/linuxfoundation/lfx-v2-email-service/pkg/api"
)

// Message represents a domain message interface
Expand All @@ -24,4 +26,5 @@ type MessageBuilder interface {
SendIndexerMessage(ctx context.Context, subject string, message any, sync bool) error
SendAccessMessage(ctx context.Context, subject string, message any, sync bool) error
SendProjectEventMessage(ctx context.Context, subject string, message any) error
SendEmailRequest(ctx context.Context, req emailapi.SendEmailRequest) error
}
6 changes: 6 additions & 0 deletions internal/domain/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/stretchr/testify/mock"

emailapi "github.com/linuxfoundation/lfx-v2-email-service/pkg/api"
"github.com/linuxfoundation/lfx-v2-project-service/internal/domain/models"
)

Expand Down Expand Up @@ -250,6 +251,11 @@ func (m *MockMessageBuilder) SendProjectEventMessage(ctx context.Context, subjec
return args.Error(0)
}

func (m *MockMessageBuilder) SendEmailRequest(ctx context.Context, req emailapi.SendEmailRequest) error {
args := m.Called(ctx, req)
return args.Error(0)
}

// MockMessage implements Message for testing
type MockMessage struct {
mock.Mock
Expand Down
12 changes: 0 additions & 12 deletions internal/domain/models/message.go

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"log/slog"
"net/http"

"github.com/linuxfoundation/lfx-v2-project-service/internal/log"
"github.com/linuxfoundation/lfx-v2-project-service/internal/infrastructure/log"
"github.com/linuxfoundation/lfx-v2-project-service/pkg/constants"

"github.com/google/uuid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"time"

"github.com/linuxfoundation/lfx-v2-project-service/internal/log"
"github.com/linuxfoundation/lfx-v2-project-service/internal/infrastructure/log"
"github.com/linuxfoundation/lfx-v2-project-service/pkg/constants"
)

Expand Down
Loading
Loading