Skip to content

ER図 - Issue駆動開発 業務委託プラットフォーム

概要

本ドキュメントでは、Issue駆動開発を活用した業務委託プラットフォームのエンティティ関係を定義する。 GitLabとの連携を前提とし、プロジェクト管理・Issue管理・アサイン・レビュー・報酬・予算の各ドメインを網羅する。

ER図(Mermaid)

mermaid
erDiagram
    PROJECT ||--o{ ISSUE : "has"
    PROJECT ||--o{ BUDGET_SNAPSHOT : "tracks"
    PROJECT ||--o{ PROJECT_MEMBER : "has"
    USER ||--o{ PROJECT_MEMBER : "belongs to"
    ISSUE ||--o{ ASSIGNMENT : "assigned via"
    USER ||--o{ ASSIGNMENT : "takes"
    ASSIGNMENT ||--o{ REVIEW : "reviewed by"
    USER ||--o{ REVIEW : "conducts"
    ASSIGNMENT ||--|| REWARD : "earns"

    PROJECT {
        uuid id PK
        string name
        string description
        integer gitlab_project_id UK
        string gitlab_project_url
        decimal budget_limit
        date start_date
        date end_date
        string status
        timestamp created_at
        timestamp updated_at
    }

    USER {
        uuid id PK
        string email UK
        string name
        string role
        integer gitlab_user_id UK
        jsonb skill_set
        boolean is_active
        timestamp created_at
        timestamp updated_at
    }

    PROJECT_MEMBER {
        uuid id PK
        uuid project_id FK
        uuid user_id FK
        string role
        timestamp joined_at
        timestamp created_at
    }

    ISSUE {
        uuid id PK
        uuid project_id FK
        string title
        text description
        integer gitlab_issue_id
        integer gitlab_issue_iid
        string gitlab_issue_url
        decimal reward_amount
        string difficulty
        decimal estimated_hours
        string status
        jsonb required_skills
        timestamp created_at
        timestamp updated_at
    }

    ASSIGNMENT {
        uuid id PK
        uuid issue_id FK
        uuid contractor_id FK
        timestamp started_at
        timestamp deadline
        timestamp completed_at
        string status
        string mr_url
        timestamp created_at
        timestamp updated_at
    }

    REVIEW {
        uuid id PK
        uuid assignment_id FK
        uuid reviewer_id FK
        string result
        text comment
        integer iteration
        timestamp reviewed_at
        timestamp created_at
    }

    REWARD {
        uuid id PK
        uuid assignment_id FK UK
        decimal amount
        string status
        date confirmed_date
        string payment_month
        text note
        timestamp created_at
        timestamp updated_at
    }

    BUDGET_SNAPSHOT {
        uuid id PK
        uuid project_id FK
        string snapshot_month
        decimal budget_limit
        decimal consumed_amount
        decimal pending_amount
        decimal remaining_amount
        decimal consumption_rate
        timestamp created_at
    }

エンティティ概要

エンティティ説明
PROJECTGitLabプロジェクトと1:1で紐付くプロジェクト。予算上限・期間を管理
USERプラットフォーム利用者。PM/レビュワー/業務委託の3ロールを持つ
PROJECT_MEMBERプロジェクトとユーザーの多対多関係を管理。プロジェクト内ロールを保持
ISSUEGitLab Issueと紐付く課題。報酬額・難易度・見積工数を持つ
ASSIGNMENTIssueとContractorの紐付け。着手日・期限・完了日を管理
REVIEWレビュー結果を記録。承認またはFB要求。複数回のイテレーションに対応
REWARD報酬の確定・支払い状態を管理。pending -> confirmed -> paid のライフサイクル
BUDGET_SNAPSHOTプロジェクト予算の月次スナップショット。消化額推移を可視化

ステータス遷移

Project.status

draft -> active -> completed
                -> suspended

Issue.status

open -> assigned -> in_progress -> in_review -> done
                                             -> rejected -> open

Assignment.status

assigned -> in_progress -> submitted -> completed
                                     -> revision_requested -> in_progress
         -> cancelled

Reward.status

pending -> confirmed -> paid