more flow
Build and Publish / BuildAndDeployAmd64 (push) Failing after 4s
Build and Publish / BuildAndDeployArm64 (push) Failing after 5s

This commit is contained in:
2026-07-01 12:13:38 +02:00
parent 83986e7a35
commit 4a37cb479c
8 changed files with 85 additions and 9 deletions
+16
View File
@@ -163,6 +163,13 @@ type resetCompleteRequest struct {
Password string `json:"password"`
}
// EmailPreferencesResponse mirrors the UCP email preferences type for the
// customer-facing API.
type EmailPreferencesResponse struct {
OrderEmails *bool `json:"orderEmails,omitempty"`
MarketingEmails *bool `json:"marketingEmails,omitempty"`
}
// CustomerResponse mirrors the UCP customer projection (kept local to avoid an
// import cycle with internal/ucp). The password hash is never included.
type CustomerResponse struct {
@@ -176,6 +183,9 @@ type CustomerResponse struct {
Addresses []AddressResponse `json:"addresses"`
Orders []OrderRef `json:"orders"`
// EmailPreferences carries the customer's current email opt-in/out state.
EmailPreferences *EmailPreferencesResponse `json:"emailPreferences,omitempty"`
// EmailVerified reflects whether the email-verification flow has completed.
EmailVerified bool `json:"emailVerified"`
}
@@ -554,6 +564,12 @@ func grainToCustomer(id string, g *profile.ProfileGrain) CustomerResponse {
for _, o := range g.Orders {
resp.Orders = append(resp.Orders, OrderRef{OrderReference: o.OrderReference, Status: o.Status})
}
if g.EmailPreferences != nil {
resp.EmailPreferences = &EmailPreferencesResponse{
OrderEmails: g.EmailPreferences.OrderEmails,
MarketingEmails: g.EmailPreferences.MarketingEmails,
}
}
return resp
}