소스 검색

Add default prefix for Metronome customer

Mauricio Araujo 2 년 전
부모
커밋
bfa2391caa
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      internal/billing/metronome.go

+ 6 - 1
internal/billing/metronome.go

@@ -43,8 +43,13 @@ func (m MetronomeClient) createCustomer(ctx context.Context, orgName string, pro
 	path := "customers"
 	projIDStr := strconv.FormatUint(uint64(projectID), 10)
 
+	prefix := "Project"
+	if orgName != "" {
+		prefix = orgName
+	}
+
 	customer := types.Customer{
-		Name: fmt.Sprintf("%s - %s", orgName, projectName),
+		Name: fmt.Sprintf("%s - %s", prefix, projectName),
 		Aliases: []string{
 			projIDStr,
 		},