Skip to content

feat: add User domain layer / Userドメイン層の追加 - #489

Merged
zigzagdev merged 5 commits into
feat/user_registerfrom
feat/user_domain
Jun 27, 2026
Merged

feat: add User domain layer / Userドメイン層の追加#489
zigzagdev merged 5 commits into
feat/user_registerfrom
feat/user_domain

Conversation

@zigzagdev

@zigzagdev zigzagdev commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Content

  • Add AgeRange enum representing user age bracket categories
  • Add Subscription value object with SubscriptionTier enum and active/expired/free state logic
  • Add UserEntity value object aggregating user identity and subscription
  • Add SubscriptionFactory and UserEntityFactory for constructing domain objects from raw data

Changes

File Description
AgeRange.php Backed enum for age range (teens / 20s–60+)
Subscription/SubscriptionTier.php Backed enum for subscription tier (free / premium)
Subscription/Subscription.php Value object with isActive(), isExpired(), isFree()
UserEntity.php Immutable value object holding user identity + subscription
Factory/SubscriptionFactory.php Builds Subscription from raw array, handles string→DateTimeImmutable cast
Factory/UserEntityFactory.php Builds UserEntity from raw array via SubscriptionFactory

概要

内容

  • AgeRange enum — ユーザーの年齢帯を表す列挙型
  • Subscription 値オブジェクト — SubscriptionTier enumとisActive()/isExpired()/isFree()のサブスクリプション状態ロジック
  • UserEntity 値オブジェクト — ユーザーの識別情報とサブスクリプションを集約
  • SubscriptionFactory / UserEntityFactory — 生データからドメインオブジェクトを構築するファクトリ

変更内容

ファイル 説明
AgeRange.php 年齢帯のバック付きenum(teens / 20s〜60+)
Subscription/SubscriptionTier.php サブスクリプションティアのバック付きenum(free / premium)
Subscription/Subscription.php isActive()isExpired()isFree()を持つ値オブジェクト
UserEntity.php ユーザー識別情報とサブスクリプションを保持するimmutableな値オブジェクト
Factory/SubscriptionFactory.php 生配列からSubscriptionを生成(文字列→DateTimeImmutableのキャスト含む)
Factory/UserEntityFactory.php SubscriptionFactoryを介して生配列からUserEntityを生成

@zigzagdev zigzagdev changed the title feat: add User domain layer feat: add User domain layer / Userドメイン層の追加 Jun 27, 2026
@zigzagdev zigzagdev self-assigned this Jun 27, 2026
@zigzagdev zigzagdev linked an issue Jun 27, 2026 that may be closed by this pull request
2 tasks

@zigzagdev zigzagdev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@zigzagdev
zigzagdev changed the base branch from main to feat/user_register June 27, 2026 13:12
@zigzagdev zigzagdev removed a link to an issue Jun 27, 2026
2 tasks
@zigzagdev zigzagdev linked an issue Jun 27, 2026 that may be closed by this pull request
2 tasks
@zigzagdev
zigzagdev merged commit 30cdf74 into feat/user_register Jun 27, 2026
25 checks passed
@zigzagdev
zigzagdev deleted the feat/user_domain branch June 27, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Migration and Model

1 participant