from model_utils import Choices


class Statuses:
    UNFINISHED = "0"
    OPEN_PENDING_ACTION = "1"
    OPEN_IN_PROGRESS = "2"
    RESOLVED_IN_PART = "3"
    RESOLVED_IN_FULL = "4"
    DORMANT = "5"
    ARCHIVED = "6"
    UNKNOWN = "7"


ARCHIVED_REASON = Choices(
    ("DUPLICATE", "Duplicate"),
    ("NOT_A_BARRIER", "Not a barrier"),
    ("OTHER", "Other"),
)


STATUSES = Choices(
    ("1", "OPEN_PENDING_ACTION", "Open: Pending action"),
    ("2", "OPEN_IN_PROGRESS", "Open: In progress"),
    ("3", "RESOLVED_IN_PART", "Resolved: In part"),
    ("4", "RESOLVED_IN_FULL", "Resolved: In full"),
    ("5", "DORMANT", "Dormant"),
)


ALL_STATUSES = (
    Choices(
        ("7", "UNKNOWN", "Unknown"),
    )
    + STATUSES
)


STATUSES_HELP_TEXT = Choices(
    (STATUSES.OPEN_PENDING_ACTION, "Barrier is awaiting action"),
    (STATUSES.OPEN_IN_PROGRESS, "Barrier is being worked on"),
    (
        STATUSES.RESOLVED_IN_PART,
        "Barrier impact has been significantly reduced but remains in part",
    ),
    (STATUSES.RESOLVED_IN_FULL, "Barrier has been resolved for all UK companies"),
    (STATUSES.DORMANT, "Barrier is present but not being pursued"),
)


UK_COUNTRY_ID = "80756b9a-5d95-e211-a939-e4115bead28a"


PUBLIC_BARRIER_STATUSES = Choices(
    (0, "UNKNOWN", "To be decided"),
    (10, "INELIGIBLE", "Not allowed"),
    (20, "ELIGIBLE", "Allowed"),
    (30, "READY", "Ready"),
    (40, "PUBLISHED", "Published"),
    (50, "UNPUBLISHED", "Unpublished"),
    (60, "REVIEW_LATER", "Barriers marked as 'review later'"),
)


AWAITING_REVIEW_FROM = Choices(
    (0, "CONTENT", "Content"),
    (10, "CONTENT_AFTER_CHANGES", "Content (edited since last review)"),
    (20, "HM_TRADE_COMMISSION", "HM Trade Commission"),
    (30, "GOVERNMENT_ORGANISATION", "Government organisation"),
)

ACTION_PLAN_TASK_CHOICES = Choices(
    ("NOT_STARTED", "Not started"),
    ("IN_PROGRESS", "In progress"),
    ("COMPLETED", "Completed"),
)

ACTION_PLAN_TASK_TYPE_CHOICES = Choices(
    ("SCOPING_AND_RESEARCH", "Scoping/Research"),
    ("LOBBYING", "Lobbying"),
    ("UNILATERAL_INTERVENTIONS", "Unilateral interventions"),
    ("BILATERAL_ENGAGEMENT", "Bilateral engagement"),
    ("PLURILATERAL_ENGAGEMENT", "Plurilateral engagement"),
    ("MULTILATERAL_ENGAGEMENT", "Multilateral engagement"),
    ("EVENT", "Event"),
    ("WHITEHALL_FUNDING_STREAMS", "Whitehall funding streams"),
    ("RESOLUTION_NOT_LEAD_BY_DIT", "Resolution not lead by DIT"),
    ("OTHER", "Other"),
)

ACTION_PLAN_TASK_CATEGORIES = {
    ACTION_PLAN_TASK_TYPE_CHOICES.SCOPING_AND_RESEARCH: Choices(
        *[
            "Dialogue",
            "Stakeholder mapping",
            "Research",
            "Awareness raising",
            "Comparing with similar barriers",
            "Analysis",
            "Best practise workshops",
            "Investigating possible workarounds",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.LOBBYING: Choices(
        *[
            "Lobbying by officials",
            "Lobbying by ministers",
            "Lobbying by experts",
            "Lobbying by industry",
            "Lobbying with PM office",
            "Lobbying by OGD",
            "Influencing standard-setting bodies",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.UNILATERAL_INTERVENTIONS: Choices(
        *[
            "Technical support to UK",
            "Support to partner country",
            "Export finance",
            "Public consultation",
            "Legislative changes",
            "Harmonise standards",
            "Trade remedies/disputes",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.BILATERAL_ENGAGEMENT: Choices(
        *[
            "Creating and maintaining trade agreements",
            "Buidling partnerships",
            "Market liberalisation forums",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.PLURILATERAL_ENGAGEMENT: Choices(
        *[
            "With the EU",
            "With other forums",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.MULTILATERAL_ENGAGEMENT: Choices(
        *[
            "With OECD",
            "With UN",
            "With WHO",
            "With G20/G7",
            "With WTO",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.EVENT: Choices(
        *[
            "Organised exhibition",
            "Conference",
            "Trade delegation",
            "Roundtable",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.WHITEHALL_FUNDING_STREAMS: Choices(
        *[
            "Prosperity fund",
            "Offical development assistance (ODA)",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.RESOLUTION_NOT_LEAD_BY_DIT: Choices(
        *[
            "Lead by OGDs",
            "Lead by industry",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.OTHER: None,
}

ACTION_PLAN_RAG_STATUS_CHOICES = Choices(
    ("ON_TRACK", "On track"),
    ("RISK_OF_DELAY", "Risk of delay"),
    ("DELAYED", "Delayed"),
)

from model_utils import Choices


class Statuses:
    UNFINISHED = "0"
    OPEN_PENDING_ACTION = "1"
    OPEN_IN_PROGRESS = "2"
    RESOLVED_IN_PART = "3"
    RESOLVED_IN_FULL = "4"
    DORMANT = "5"
    ARCHIVED = "6"
    UNKNOWN = "7"


ARCHIVED_REASON = Choices(
    ("DUPLICATE", "Duplicate"),
    ("NOT_A_BARRIER", "Not a barrier"),
    ("OTHER", "Other"),
)


STATUSES = Choices(
    ("1", "OPEN_PENDING_ACTION", "Open: Pending action"),
    ("2", "OPEN_IN_PROGRESS", "Open: In progress"),
    ("3", "RESOLVED_IN_PART", "Resolved: In part"),
    ("4", "RESOLVED_IN_FULL", "Resolved: In full"),
    ("5", "DORMANT", "Dormant"),
)


ALL_STATUSES = (
    Choices(
        ("7", "UNKNOWN", "Unknown"),
    )
    + STATUSES
)


STATUSES_HELP_TEXT = Choices(
    (STATUSES.OPEN_PENDING_ACTION, "Barrier is awaiting action"),
    (STATUSES.OPEN_IN_PROGRESS, "Barrier is being worked on"),
    (
        STATUSES.RESOLVED_IN_PART,
        "Barrier impact has been significantly reduced but remains in part",
    ),
    (STATUSES.RESOLVED_IN_FULL, "Barrier has been resolved for all UK companies"),
    (STATUSES.DORMANT, "Barrier is present but not being pursued"),
)


UK_COUNTRY_ID = "80756b9a-5d95-e211-a939-e4115bead28a"


PUBLIC_BARRIER_STATUSES = Choices(
    (0, "UNKNOWN", "To be decided"),
    (10, "INELIGIBLE", "Not allowed"),
    (20, "ELIGIBLE", "Allowed"),
    (30, "READY", "Ready"),
    (40, "PUBLISHED", "Published"),
    (50, "UNPUBLISHED", "Unpublished"),
    (60, "REVIEW_LATER", "Barriers marked as 'review later'"),
)


AWAITING_REVIEW_FROM = Choices(
    (0, "CONTENT", "Content"),
    (10, "CONTENT_AFTER_CHANGES", "Content (edited since last review)"),
    (20, "HM_TRADE_COMMISSION", "HM Trade Commission"),
    (30, "GOVERNMENT_ORGANISATION", "Government organisation"),
)

ACTION_PLAN_TASK_CHOICES = Choices(
    ("NOT_STARTED", "Not started"),
    ("IN_PROGRESS", "In progress"),
    ("COMPLETED", "Completed"),
)

ACTION_PLAN_TASK_TYPE_CHOICES = Choices(
    ("SCOPING_AND_RESEARCH", "Scoping/Research"),
    ("LOBBYING", "Lobbying"),
    ("UNILATERAL_INTERVENTIONS", "Unilateral interventions"),
    ("BILATERAL_ENGAGEMENT", "Bilateral engagement"),
    ("PLURILATERAL_ENGAGEMENT", "Plurilateral engagement"),
    ("MULTILATERAL_ENGAGEMENT", "Multilateral engagement"),
    ("EVENT", "Event"),
    ("WHITEHALL_FUNDING_STREAMS", "Whitehall funding streams"),
    ("RESOLUTION_NOT_LEAD_BY_DIT", "Resolution not lead by DIT"),
    ("OTHER", "Other"),
)

ACTION_PLAN_TASK_CATEGORIES = {
    ACTION_PLAN_TASK_TYPE_CHOICES.SCOPING_AND_RESEARCH: Choices(
        *[
            "Dialogue",
            "Stakeholder mapping",
            "Research",
            "Awareness raising",
            "Comparing with similar barriers",
            "Analysis",
            "Best practise workshops",
            "Investigating possible workarounds",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.LOBBYING: Choices(
        *[
            "Lobbying by officials",
            "Lobbying by ministers",
            "Lobbying by experts",
            "Lobbying by industry",
            "Lobbying with PM office",
            "Lobbying by OGD",
            "Influencing standard-setting bodies",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.UNILATERAL_INTERVENTIONS: Choices(
        *[
            "Technical support to UK",
            "Support to partner country",
            "Export finance",
            "Public consultation",
            "Legislative changes",
            "Harmonise standards",
            "Trade remedies/disputes",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.BILATERAL_ENGAGEMENT: Choices(
        *[
            "Creating and maintaining trade agreements",
            "Buidling partnerships",
            "Market liberalisation forums",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.PLURILATERAL_ENGAGEMENT: Choices(
        *[
            "With the EU",
            "With other forums",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.MULTILATERAL_ENGAGEMENT: Choices(
        *[
            "With OECD",
            "With UN",
            "With WHO",
            "With G20/G7",
            "With WTO",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.EVENT: Choices(
        *[
            "Organised exhibition",
            "Conference",
            "Trade delegation",
            "Roundtable",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.WHITEHALL_FUNDING_STREAMS: Choices(
        *[
            "Prosperity fund",
            "Offical development assistance (ODA)",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.RESOLUTION_NOT_LEAD_BY_DIT: Choices(
        *[
            "Lead by OGDs",
            "Lead by industry",
            "Other",
        ]
    ),
    ACTION_PLAN_TASK_TYPE_CHOICES.OTHER: None,
}

ACTION_PLAN_RAG_STATUS_CHOICES = Choices(
    ("ON_TRACK", "On track"),
    ("RISK_OF_DELAY", "Risk of delay"),
    ("DELAYED", "Delayed"),
)
