var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { JsonClassType, JsonProperty } from "jackson-js";
import _ from "lodash";
export const COMMAND_MESSAGE_REQUEST_CHANGE_ORDER_ITEM_STATUS = "change-order-item-request";
export class ChangeOrderItemStatusRequest {
}
__decorate([
    JsonProperty()
], ChangeOrderItemStatusRequest.prototype, "orderId", void 0);
__decorate([
    JsonProperty()
], ChangeOrderItemStatusRequest.prototype, "orderItemId", void 0);
__decorate([
    JsonProperty()
], ChangeOrderItemStatusRequest.prototype, "status", void 0);
__decorate([
    JsonProperty(),
    JsonClassType({ type: () => [Date] })
], ChangeOrderItemStatusRequest.prototype, "date", void 0);
export class ChangeOrderItemStatusRequests {
    constructor(tenant) {
        this.tenant = tenant;
        this.requests = [];
    }
    getUniqueOrderIds() {
        return _.chain(this.requests)
            .uniqBy("orderId")
            .map((r) => (r.orderId))
            .value();
    }
    getUniqueOrderItemIds() {
        return _.chain(this.requests)
            .uniqBy("orderItemId")
            .map((r) => (r.orderItemId))
            .value();
    }
}
__decorate([
    JsonProperty()
], ChangeOrderItemStatusRequests.prototype, "tenant", void 0);
__decorate([
    JsonProperty(),
    JsonClassType({ type: () => [Array, [ChangeOrderItemStatusRequest]] })
], ChangeOrderItemStatusRequests.prototype, "requests", void 0);
//# sourceMappingURL=change_order_item_status.js.map