Ejemplo n.º 1
0
        /******************************************************************************************
        * From domain model to value object
        ******************************************************************************************/
        public ErrorChargesRequestDTO ToRequestDTO(ErrorChargesRequest o)
        {
            var vo = new ErrorChargesRequestDTO();

            ClassCopier.Instance.Copy(o, vo);
            if (o.RequestInfo != null)
            {
                vo.RequestInfo = ToRequestInfoDTO(o.RequestInfo);
            }
            if (o.Routing != null)
            {
                vo.Routing = ToRoutingInfoDTO(o.Routing);
            }
            return(vo);
        }
Ejemplo n.º 2
0
        /******************************************************************************************
        * From value object to domain model
        ******************************************************************************************/
        public ErrorChargesRequest ToRequest(ErrorChargesRequestDTO vo)
        {
            var o = new ErrorChargesRequest();

            ClassCopier.Instance.Copy(vo, o);

            if (vo.RequestInfo != null)
            {
                o.RequestInfo = ToRequestInfo(vo.RequestInfo);
            }
            if (vo.Routing != null)
            {
                o.Routing = ToRoutingInfo(vo.Routing);
            }

            return(o);
        }
Ejemplo n.º 3
0
        public ErrorChargesRequestDTO GetDummyData()
        {
            var now      = DateTime.Now;
            var workflow = new List <RoutingItemDTO>
            {
                new RoutingItemDTO
                {
                    ActualDate     = now,
                    BaseDate       = now,
                    Division       = "Warehouse",
                    DivisionStatus = false,
                    Instruction    = "Fixed the information please!",
                    PlanDate       = now,
                    Response       = "Muke gile...",
                    RoutingStatus  = ERoutingStatus.IN_PROGRESS,
                    SaStatus       = false,
                    Step           = 1
                },
                new RoutingItemDTO
                {
                    ActualDate     = now,
                    BaseDate       = now,
                    Division       = "Sales Admin",
                    DivisionStatus = false,
                    Instruction    = "Fixed the information please!",
                    PlanDate       = now,
                    Response       = "Muke gile juga!",
                    RoutingStatus  = ERoutingStatus.IN_PROGRESS,
                    SaStatus       = false,
                    Step           = 2
                }
            };

            var billings = new List <ContractBillingDTO>
            {
                new ContractBillingDTO
                {
                    Actual    = 10000,
                    Charges   = 20000,
                    Currency  = "USD",
                    Deduction = 4000,
                    PlanDate  = now,
                    SubItem   = "30.1"
                },
                new ContractBillingDTO
                {
                    Actual    = 20000,
                    Charges   = 20000,
                    Currency  = "USD",
                    Deduction = 3400,
                    PlanDate  = now,
                    SubItem   = "30.2"
                }
            };

            var req = new ErrorChargesRequestDTO
            {
                Id          = _indexDao.NewServiceRequestId(),
                RequestInfo = new ErrorChargesRequestInfoDTO
                {
                    Id            = _indexDao.NewRequestInfoId(),
                    Company       = "PT. Klub Malam 1001",
                    Email         = "*****@*****.**",
                    Location      = "Mangga Besar",
                    RequestMemo   = "Tolong agar semua kesalahan charges diganti!",
                    RequestedBy   = "Dadan Germo",
                    RequestedDate = now,
                    RequestedVia  = "Wassap",
                    SnOrIdNumber  = "SN-32432424"
                },
                IssuedBy   = "Sales Admin",
                IssuedDate = DateTime.Now,
                Scenario   = EScenario.ERROR_CHARGES,
                State      = EServiceRequestState.DRAFT,
                Routing    = new ErrorChargesRoutingInfoDTO
                {
                    CreateDate  = now,
                    CurrentStep = 1,
                    RoutingMemo = "Harap segera diselesaikan",
                    Routings    = workflow,
                    SoldToParty = "PT. Klub Malam 1001",
                    Contracts   = new List <ContractWithBillingsDTO>
                    {
                        new ContractWithBillingsDTO
                        {
                            Charges           = 20000,
                            Currency          = "IDR",
                            EndDate           = now,
                            HolderName        = "Dadan Germo",
                            ItemCategory      = "MV4",
                            LineNumber        = "34",
                            Material          = "SIM-23432",
                            MaterialDesc      = "Email Service",
                            MaterialPricing   = "Software",
                            Number            = "234324",
                            PoNumber          = "345345",
                            PriceGroup        = "TMT Price",
                            PurchaseOrder     = "PO234324",
                            Quantity          = 23,
                            ReasonForRjection = "Completion of Contract",
                            StartDate         = now,
                            Unit       = "Kg",
                            WbsElement = "234324",
                            Billings   = billings
                        },
                        new ContractWithBillingsDTO
                        {
                            Charges           = 3242442,
                            Currency          = "USD",
                            EndDate           = now,
                            HolderName        = "Jimmy Jangkrek",
                            ItemCategory      = "MVP4324",
                            LineNumber        = "35",
                            Material          = "SIM-23432",
                            MaterialDesc      = "Phone Service",
                            MaterialPricing   = "Hardware",
                            Number            = "234324",
                            PoNumber          = "345345",
                            PriceGroup        = "TMT Price",
                            PurchaseOrder     = "PO234324",
                            Quantity          = 23,
                            ReasonForRjection = "Completion of Contract",
                            StartDate         = now,
                            Unit       = "Kg",
                            WbsElement = "234324",
                            Billings   = billings
                        },
                    }
                }
            };

            return(req);
        }