Skip to content

Commit 96349b7

Browse files
committed
docs(tutorial): 직전 sed 부작용 정정 — 12/13/14의 사용자 정의 DomainErrors 호출 복원 (영/한)
직전 트랙(496ac90)이 사용자 정의 internal static class DomainErrors의 메서드 호출도 출력 prefix와 함께 변환하여 컴파일 불가 코드를 만들었다. 12/13의 학습 패턴 인용과 14의 "Before" 블록을 sed로 복원. 영향: - 12-type-safe-enums (영/한): : Domain.X(args) → : DomainErrors.X(args) - 13-error-code (영/한): return Domain.X(value) → return DomainErrors.X(value) - 14-error-code-fluent (영/한): "Before" 블록 line 108 동일 복원 13/14 학습 진화 흐름(13의 사용자 정의 패턴 → 14에서 framework helper로 단순화)은 다시 일관됨. 14 "After" 블록은 이미 framework helper를 사용 중이라 그대로 유지. 치환 정밀도: - 출력 prefix(예: // Error code: Domain.Email.Empty)는 메서드 호출 패턴(.X() /return .X;)과 구분되어 보존됨 후속(Phase C): part2/part4/part5 등 다른 튜토리얼은 .md ↔ .cs 동기화가 필요하며 본문 재작성 필요. 별도 커밋으로 진행.
1 parent f3cf891 commit 96349b7

6 files changed

Lines changed: 18 additions & 18 deletions

File tree

  • Docs.Site/src/content/docs
    • ko/tutorials/functional-valueobject/part1-valueobject-concepts
    • tutorials/functional-valueobject/part1-valueobject-concepts

Docs.Site/src/content/docs/ko/tutorials/functional-valueobject/part1-valueobject-concepts/12-type-safe-enums/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,17 @@ public sealed class Currency : SmartEnum<Currency, string>
266266
public static Validation<Error, string> Validate(string currencyCode) =>
267267
!string.IsNullOrWhiteSpace(currencyCode)
268268
? ValidateThreeLetters(currencyCode)
269-
: Domain.Empty(currencyCode);
269+
: DomainErrors.Empty(currencyCode);
270270

271271
private static Validation<Error, string> ValidateThreeLetters(string currencyCode) =>
272272
currencyCode.Length == 3 && currencyCode.All(char.IsLetter)
273273
? ValidateSupported(currencyCode)
274-
: Domain.NotThreeLetters(currencyCode);
274+
: DomainErrors.NotThreeLetters(currencyCode);
275275

276276
private static Validation<Error, string> ValidateSupported(string currencyCode) =>
277277
GetAllSupportedCurrencies().Any(c => c.GetCode() == currencyCode)
278278
? currencyCode
279-
: Domain.Unsupported(currencyCode);
279+
: DomainErrors.Unsupported(currencyCode);
280280
}
281281
```
282282

@@ -349,7 +349,7 @@ public sealed class PriceRange : ComparableValueObject
349349
Price minPrice, Price maxPrice) =>
350350
(decimal)minPrice.Amount <= (decimal)maxPrice.Amount
351351
? (minPrice, maxPrice)
352-
: Domain.MinExceedsMax(minPrice, maxPrice);
352+
: DomainErrors.MinExceedsMax(minPrice, maxPrice);
353353

354354
protected override IEnumerable<IComparable> GetComparableEqualityComponents()
355355
{

Docs.Site/src/content/docs/ko/tutorials/functional-valueobject/part1-valueobject-concepts/13-error-code/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public sealed class Denominator : SimpleValueObject<int>, IComparable<Denominato
241241
public static Validation<Error, int> Validate(int value)
242242
{
243243
if (value == 0)
244-
return Domain.Zero(value);
244+
return DomainErrors.Zero(value);
245245

246246
return value;
247247
}
@@ -276,12 +276,12 @@ public sealed class Currency : SmartEnum<Currency, string>, IValueObject
276276

277277
private static Validation<Error, string> ValidateNotEmpty(string currencyCode) =>
278278
string.IsNullOrWhiteSpace(currencyCode)
279-
? Domain.Empty(currencyCode)
279+
? DomainErrors.Empty(currencyCode)
280280
: currencyCode;
281281

282282
private static Validation<Error, string> ValidateFormat(string currencyCode) =>
283283
currencyCode.Length != 3 || !currencyCode.All(char.IsLetter)
284-
? Domain.NotThreeLetters(currencyCode)
284+
? DomainErrors.NotThreeLetters(currencyCode)
285285
: currencyCode.ToUpperInvariant();
286286

287287
// 내부 DomainErrors 클래스 - SmartEnum 특화 에러 정의
@@ -334,7 +334,7 @@ public sealed class PriceRange : ComparableValueObject
334334

335335
private static Validation<Error, (Price MinPrice, Price MaxPrice)> ValidatePriceRange(Price minPrice, Price maxPrice) =>
336336
(decimal)minPrice.Amount > (decimal)maxPrice.Amount
337-
? Domain.MinExceedsMax(minPrice, maxPrice)
337+
? DomainErrors.MinExceedsMax(minPrice, maxPrice)
338338
: (MinPrice: minPrice, MaxPrice: maxPrice);
339339

340340
// 내부 DomainErrors 클래스 - 가격 범위 검증 에러

Docs.Site/src/content/docs/ko/tutorials/functional-valueobject/part1-valueobject-concepts/14-error-code-fluent/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public sealed class Denominator : ComparableSimpleValueObject<int>
105105
public static Validation<Error, int> Validate(int value)
106106
{
107107
if (value == 0)
108-
return Domain.Zero(value);
108+
return DomainErrors.Zero(value);
109109
return value;
110110
}
111111

Docs.Site/src/content/docs/tutorials/functional-valueobject/part1-valueobject-concepts/12-type-safe-enums/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,17 @@ public sealed class Currency : SmartEnum<Currency, string>
266266
public static Validation<Error, string> Validate(string currencyCode) =>
267267
!string.IsNullOrWhiteSpace(currencyCode)
268268
? ValidateThreeLetters(currencyCode)
269-
: Domain.Empty(currencyCode);
269+
: DomainErrors.Empty(currencyCode);
270270

271271
private static Validation<Error, string> ValidateThreeLetters(string currencyCode) =>
272272
currencyCode.Length == 3 && currencyCode.All(char.IsLetter)
273273
? ValidateSupported(currencyCode)
274-
: Domain.NotThreeLetters(currencyCode);
274+
: DomainErrors.NotThreeLetters(currencyCode);
275275

276276
private static Validation<Error, string> ValidateSupported(string currencyCode) =>
277277
GetAllSupportedCurrencies().Any(c => c.GetCode() == currencyCode)
278278
? currencyCode
279-
: Domain.Unsupported(currencyCode);
279+
: DomainErrors.Unsupported(currencyCode);
280280
}
281281
```
282282

@@ -349,7 +349,7 @@ public sealed class PriceRange : ComparableValueObject
349349
Price minPrice, Price maxPrice) =>
350350
(decimal)minPrice.Amount <= (decimal)maxPrice.Amount
351351
? (minPrice, maxPrice)
352-
: Domain.MinExceedsMax(minPrice, maxPrice);
352+
: DomainErrors.MinExceedsMax(minPrice, maxPrice);
353353

354354
protected override IEnumerable<IComparable> GetComparableEqualityComponents()
355355
{

Docs.Site/src/content/docs/tutorials/functional-valueobject/part1-valueobject-concepts/13-error-code/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public sealed class Denominator : SimpleValueObject<int>, IComparable<Denominato
241241
public static Validation<Error, int> Validate(int value)
242242
{
243243
if (value == 0)
244-
return Domain.Zero(value);
244+
return DomainErrors.Zero(value);
245245

246246
return value;
247247
}
@@ -276,12 +276,12 @@ public sealed class Currency : SmartEnum<Currency, string>, IValueObject
276276

277277
private static Validation<Error, string> ValidateNotEmpty(string currencyCode) =>
278278
string.IsNullOrWhiteSpace(currencyCode)
279-
? Domain.Empty(currencyCode)
279+
? DomainErrors.Empty(currencyCode)
280280
: currencyCode;
281281

282282
private static Validation<Error, string> ValidateFormat(string currencyCode) =>
283283
currencyCode.Length != 3 || !currencyCode.All(char.IsLetter)
284-
? Domain.NotThreeLetters(currencyCode)
284+
? DomainErrors.NotThreeLetters(currencyCode)
285285
: currencyCode.ToUpperInvariant();
286286

287287
// Internal DomainErrors class - SmartEnum-specific error definitions
@@ -334,7 +334,7 @@ public sealed class PriceRange : ComparableValueObject
334334

335335
private static Validation<Error, (Price MinPrice, Price MaxPrice)> ValidatePriceRange(Price minPrice, Price maxPrice) =>
336336
(decimal)minPrice.Amount > (decimal)maxPrice.Amount
337-
? Domain.MinExceedsMax(minPrice, maxPrice)
337+
? DomainErrors.MinExceedsMax(minPrice, maxPrice)
338338
: (MinPrice: minPrice, MaxPrice: maxPrice);
339339

340340
// Internal DomainErrors class - price range validation errors

Docs.Site/src/content/docs/tutorials/functional-valueobject/part1-valueobject-concepts/14-error-code-fluent/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public sealed class Denominator : ComparableSimpleValueObject<int>
105105
public static Validation<Error, int> Validate(int value)
106106
{
107107
if (value == 0)
108-
return Domain.Zero(value);
108+
return DomainErrors.Zero(value);
109109
return value;
110110
}
111111

0 commit comments

Comments
 (0)