예제 #1
0
        public virtual HttpStatusCodeResult CargoIsCustomsCleared(long id)
        {
            var data = _awbs.Get(id).First();

            if (data.GTD.IsNullOrWhiteSpace())
            {
                throw new InvalidLogicException("GTD must be definded to set the CargoIsCustomsCleared state");
            }

            _awbStateManager.SetState(id, _config.CargoIsCustomsClearedStateId);

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }
예제 #2
0
        public void ProcessGtd(AirWaybillData data, string newGtd)
        {
            if (!IsReadyForCargoAtCustomsStateId(data.GTD, newGtd))
            {
                return;
            }

            // todo: 1. check order of states and return if current state is supper than CargoAtCustomsStateId (257)
            if (data.StateId == _stateConfig.CargoIsCustomsClearedStateId)
            {
                return;
            }

            _stateManager.SetState(data.Id, _stateConfig.CargoAtCustomsStateId);
        }