syntax = "proto3";

option go_package = "github.com/tech/sendico/pkg/generated/gmessaging";

// SiteRequestEvent is published when a visitor submits a request through the
// public website (demo, contact, or callback).
message SiteRequestEvent {
    // RequestType classifies the kind of site request.
    enum RequestType {
        REQUEST_TYPE_UNSPECIFIED = 0;
        REQUEST_TYPE_DEMO = 1;
        REQUEST_TYPE_CONTACT = 2;
        REQUEST_TYPE_CALL = 3;
    }

    // type identifies which kind of request was submitted.
    RequestType type = 1;

    oneof payload {
        // demo is the payload for a product demo request.
        SiteDemoRequest demo = 2;
        // contact is the payload for a general contact inquiry.
        SiteContactRequest contact = 3;
        // call is the payload for a callback request.
        SiteCallRequest call = 4;
    }
}

// SiteDemoRequest carries details for a product demo request.
message SiteDemoRequest {
    string name = 1;
    string organization_name = 2;
    string phone = 3;
    string work_email = 4;
    string payout_volume = 5;
    string comment = 6;
}

// SiteContactRequest carries details for a general contact inquiry.
message SiteContactRequest {
    string name = 1;
    string email = 2;
    string phone = 3;
    string company = 4;
    string topic = 5;
    string message = 6;
}

// SiteCallRequest carries details for a callback request.
message SiteCallRequest {
    string name = 1;
    string phone = 2;
    string email = 3;
    string company = 4;
    string preferred_time = 5;
    string message = 6;
}
