DOMAIN MODEL · CODE EVIDENCE
定期契約と請求のドメインモデル
実装から読み取った業務上の概念と関係。図から全体を掴み、概念カードからコードの根拠を確認できます。
概念とコードの根拠
条件に一致する概念がありません。
Invoice
Invoice請求書の識別子と円単位の金額を持ち、請求対象の契約を単一プロパティとして参照する。
invoiceId: stringbilling/invoice.ts:5–5
public readonly invoiceId: string,amountYen: numberbilling/invoice.ts:7–7
public readonly amountYen: number,
コードの根拠
billing/invoice.ts:3–9
export class Invoice {
constructor(
public readonly invoiceId: string,
public readonly subscription: Subscription,
public readonly amountYen: number,
) {}
}Customer
Customer顧客の識別子と表示名を保持する。識別子の読み取り専用指定はあるが、業務上の同一性の判定規則は宣言されていない。
customerId: stringsubscriptions/model.ts:4–4
constructor(public readonly customerId: string, public displayName: string) {}displayName: stringsubscriptions/model.ts:4–4
constructor(public readonly customerId: string, public displayName: string) {}
コードの根拠
subscriptions/model.ts:3–5
export class Customer {
constructor(public readonly customerId: string, public displayName: string) {}
}Plan
Plan月次または年次のプランを示す文字列の選択型。
- 記載なし
コードの根拠
subscriptions/model.ts:1–1
export type Plan = "monthly" | "annual";Subscription
Subscription契約の識別子を持ち、契約対象の顧客とプランを必須の単一プロパティとして参照する。
subscriptionId: stringsubscriptions/model.ts:9–9
public readonly subscriptionId: string,
コードの根拠
subscriptions/model.ts:7–13
export class Subscription {
constructor(
public readonly subscriptionId: string,
public readonly customer: Customer,
public readonly plan: Plan,
) {}
}関係と根拠
- Invoice → Subscription:subscription association / 不明 → 1
billing/invoice.ts:6–6
public readonly subscription: Subscription, - Subscription → Customer:customer association / 不明 → 1
subscriptions/model.ts:10–10
public readonly customer: Customer, - Subscription → Plan:plan association / 不明 → 1
subscriptions/model.ts:11–11
public readonly plan: Plan,
確認事項
- Customer・Subscription・InvoiceにはEntityやValueObjectの基底型・注釈がないためconceptとした。業務上の同一性や値の同値性は未確認。
- 必須の単一プロパティから参照先の多重度を1とした。顧客ごとの契約数・契約ごとの請求書数・プランごとの契約数はコードから決まらない。
- readonlyは再代入の制約であり、参照先の生成・削除や寿命の所有を示すものではない。関係はassociationとした。
- 領域は宣言元ディレクトリに基づく配置単位であり、業務上の境界としての妥当性は未確認。
未読のコード
- 未読のコードなし
走査時の除外対象
.git .skill-runs