syntax = "proto2";

package maps_adv.geosmb.telegraphist.proto.notifications_v3;

import "maps_adv/geosmb/telegraphist/proto/v3/common.proto";

message OrderInfo {
    required uint64 id = 1;
    repeated CartOrderItem cart_items = 2;
    required string final_price = 3;
    required uint64 final_count = 4;

    required string created_at = 5;
    optional string comment = 6;
    required Contacts contacts = 7;
}

message Contacts {
    required string name = 1;
    required string phone = 2;
    optional string email = 3;
}

message CartOrderItem {
    required string name = 1;
    optional string description = 2;
    optional string price = 3;
    optional string min_price = 4;
    optional string image = 5;
    required uint32 count = 6;
}

message LandingInfo {
    optional string domain = 1;
    optional string url = 2;
}

message OrderCreatedV3 {
    required uint64 biz_id = 1;
    required string details_link = 2;
    required OrderInfo order = 3;
    required LandingInfo landing = 4;
    required OrgInfo org = 5;
}

message OrgInfo {
    required string cabinet_link = 1; // personal cabinet button
    required string company_link = 2; // url for link on logo
}

message RequestCreated {
    required uint64 biz_id = 1;
    required OrgInfo org = 2;
    required string details_link = 3;
}

message Notification {
    required common_v3.Transport transport = 2;

    oneof notification_details {
        // new request created
        RequestCreated request_created = 10;
        // 11 is reserved
        OrderCreatedV3 cart_order_created = 12;
    }
}
