syntax = "proto2";

package maps_adv.geosmb.clients.loyalty.proto.loyalty;

message Paging {
    required uint32 offset = 1;
    required uint32 limit = 2;
}

message PagingOutput {
    required uint32 total = 1;
    required uint32 offset = 2;
    required uint32 limit = 3;
}

message CouponForReview {
    required string biz_id = 1;
    required string item_id = 2;
    required uint32 revision_id = 3;
    required string title = 4;
    optional string cover_url = 5;
    required string products_description = 6;
    optional string conditions = 7;
}

message CouponsListForReviewRequest {
    optional Paging paging = 1;
}

message CouponsListForReviewResponse {
    repeated CouponForReview coupons_list = 1;
    required PagingOutput paging = 2;
}

enum CouponReviewResolution {
    APPROVED = 1;
    REJECTED = 2;
}

message SubmitCouponsReviewsListRequest {
    message CouponReviewCorrected {
        optional string title = 1;
        optional string cover = 2;
        optional string products_description = 3;
        optional string conditions = 4;
    }

    message CouponReviewResult {
        required string biz_id = 1;
        required string item_id = 2;
        required uint32 revision_id = 3;
        required CouponReviewResolution resolution = 4;
        optional CouponReviewCorrected corrected = 5;
        repeated uint32 reason_codes = 6;
    }

    repeated CouponReviewResult results_list = 1;
}

message ConfirmCouponsSentToModerationRequest {
    message CouponSentToModeration {
        required string biz_id = 1;
        required string item_id = 2;
        required uint32 revision_id = 3;
    }

    repeated CouponSentToModeration coupons_list = 1;
}
