コード例 #1
0
        public InvoiceValidator(ServiceTitanJobModel jobModel, A1ServicesAppDbContext ctx)
        {
            _ctx = ctx;
            var materialValidatorFactory = new TaskMaterialValidatorFactory(_ctx);

            _materialValidatorFactory = materialValidatorFactory;

            Job                = jobModel;
            Invoice            = jobModel.Invoice;
            ValidationState    = new ValidInvoice();
            ServiceItems       = jobModel.Invoice.Items.Where(i => i.Active == true).Where(i => i.Sku.Type == "Service").ToList();
            MaterialItems      = jobModel.Invoice.Items.Where(i => i.Active == true).Where(i => i.Sku.Type == "Material").ToList();
            MaterialValidators = CreateValidators();
        }
コード例 #2
0
ファイル: Startup.cs プロジェクト: moldehoff/A1ServicesApp
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, A1ServicesAppDbContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            //dbContext.EnsureSeedData();

            app.UseHttpsRedirection();
            app.UseMvc();
        }
 public CreateNewJobServiceMaterialLinkCommandHandler(IMapper mapper, A1ServicesAppDbContext ctx)
 {
     _mapper = mapper;
     _ctx    = ctx;
 }
コード例 #4
0
 public InvoiceController(IMediator mediator, A1ServicesAppDbContext ctx)
 {
     _mediator = mediator;
     _ctx      = ctx;
 }
 public FindJobsWithMismatchedJobMaterialsQueryHandler(IMapper mapper, A1ServicesAppDbContext ctx)
 {
     _mapper = mapper;
     _ctx    = ctx;
 }
コード例 #6
0
 public GetAllJobServicesQueryHandler(IMapper mapper, A1ServicesAppDbContext ctx)
 {
     _mapper = mapper;
     _ctx    = ctx;
 }
 public GetJobServiceMaterialLinkByIdQueryHandler(IMapper mapper, A1ServicesAppDbContext ctx)
 {
     _mapper = mapper;
     _ctx    = ctx;
 }
コード例 #8
0
 public GetAllJobMaterialLinksQueryHandler(A1ServicesAppDbContext ctx, IMapper mapper)
 {
     _mapper = mapper;
     _ctx    = ctx;
 }
コード例 #9
0
 public TaskMaterialValidatorFactory(A1ServicesAppDbContext ctx)
 {
     _ctx = ctx;
 }
コード例 #10
0
 public ValidateJobInvoiceCommandHandler(A1ServicesAppDbContext ctx)
 {
     _ctx = ctx;
 }