{
    "model": "\\Ignite\\Program\\Entities\\Demos\\Sale",
    "provides": {
        "offers": {
            "GeneralSales": "Ignite\\Program\\Activity\\Offers\\Demos\\GeneralSales",
            "Q1PromotionSales": "Ignite\\Program\\Activity\\Offers\\Demos\\Q1PromotionSales"
        },
        "rules": {
            "WithinDateBounds": "Ignite\\Program\\Activity\\Rules\\WithinDateBounds",
            "UnitedStatesOnly": "Ignite\\Program\\Activity\\Rules\\UnitedStatesOnly",
            "AmountMultiplier": "Ignite\\Program\\Activity\\Rules\\AmountMultiplier"
        },
        "notifications": {
            "sales.general.submitted": {
                "event": "Ignite\\Activity\\Event\\ActivitySubmissionCreated",
                "listeners": ["Ignite\\Program\\Activity\\Notifications\\SaleSubmitted"]
            },
            "sales.general.approved": {
                "event": "Ignite\\Activity\\Event\\ActivitySubmissionStatusChanged",
                "listener": "Ignite\\Program\\Activity\\Notifications\\SaleApproved"
            },
            "sales.general.declined": {
                "event": "Ignite\\Activity\\Event\\ActivitySubmissionStatusChanged",
                "listener": "Ignite\\Program\\Activity\\Notifications\\SaleDeclined"
            }
        }
    },
    "statuses": {
        "states": {
            "pending": {
                "name": "pending",
                "type": "initial",
                "color": "yellow",
                "icon": "question"
            },
            "declined": {
                "name": "declined",
                "type": "final",
                "color": "red",
                "icon": "minus"
            },
            "approved": {
                "name": "approved",
                "type": "normal",
                "color": "green",
                "icon": "check"
            },
            "cancelled": {
                "name": "cancelled",
                "type": "final",
                "color": "gray",
                "icon": "ban"
            },
            "issued": {
                "name": "issued",
                "type": "final",
                "color": "blue",
                "icon": "dollar"
            }
        },
        "transitions": {
            "pending_to_pending": {
                "from": ["pending"],
                "to": "pending"
            },
            "pending_to_approved": {
                "from": ["pending"],
                "to": "approved"
            },
            "pending_to_declined": {
                "from": ["pending"],
                "to": "declined"
            },
            "approved_to_approved": {
                "from": ["approved"],
                "to": "approved"
            },
            "approved_to_cancelled": {
                "from": ["approved"],
                "to": "cancelled"
            },
            "approved_to_issued": {
                "from": ["approved"],
                "to": "issued"
            }
        }
    },
    "fields": [
        {
            "table": "program_sales",
            "frontend_type": "text",
            "backend_type": "string",
            "label": "Contact Partner Company",
            "label_alias": "Partner",
            "label_show": true,
            "orderable": true,
            "searchable": true,
            "exportable": true,
            "sortable": true,
            "visible": true,
            "name": "company",
            "rules": [
                "required"
            ]
        },
        {
            "table": "program_sales",
            "frontend_type": "text",
            "backend_type": "string",
            "name": "first",
            "label": "Contact First Name",
            "label_show": true,
            "orderable": true,
            "searchable": true,
            "exportable": true,
            "sortable": true,
            "visible": true,
            "rules": [
                "required"
            ]
        },
        {
            "table": "program_sales",
            "frontend_type": "text",
            "backend_type": "string",
            "name": "last",
            "label": "Contact Last Name",
            "label_show": true,
            "orderable": true,
            "searchable": true,
            "exportable": true,
            "sortable": true,
            "visible": true,
            "rules": [
                "required"
            ]
        },
        {
            "table": "program_sales",
            "frontend_type": "email",
            "backend_type": "string",
            "name": "email",
            "label": "Contact Email",
            "label_show": true,
            "orderable": true,
            "searchable": true,
            "exportable": true,
            "sortable": true,
            "visible": true,
            "rules": [
                "required",
                "email"
            ]
        },
        {
            "table": "program_sales",
            "frontend_type": "text",
            "backend_type": "string",
            "name": "sale_id",
            "label": "Sale ID",
            "label_show": true,
            "orderable": true,
            "searchable": true,
            "exportable": true,
            "sortable": true,
            "visible": true,
            "rules": [
                "required"
            ]
        },
        {
            "table": "program_sales",
            "frontend_type": "text",
            "backend_type": "int",
            "name": "amount",
            "label": "Amount",
            "label_show": true,
            "orderable": true,
            "searchable": true,
            "exportable": true,
            "sortable": true,
            "visible": true,
            "rules": [
                "required"
            ]
        },
        {
            "table": "program_sales",
            "frontend_type": "text",
            "backend_type": "string",
            "name": "salesforce_id",
            "label": "Salesforce ID",
            "label_show": true,
            "orderable": true,
            "searchable": true,
            "exportable": true,
            "sortable": true,
            "visible": false,
            "internal": true,
            "rules": [
                "required"
            ]
        }
    ]
}
