send the billing code along with the query
This commit is contained in:
10
Yavsc.Abstract/Billing/BillingCodes.cs
Normal file
10
Yavsc.Abstract/Billing/BillingCodes.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public static class BillingCodes
|
||||
{
|
||||
public const string Rdv = "Rdv";
|
||||
public const string MBrush = "MBrush";
|
||||
|
||||
public const string Brush = "Brush";
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
namespace Yavsc.Billing
|
||||
{
|
||||
public interface IBillable {
|
||||
string BillingCode { get; set; }
|
||||
string GetDescription ();
|
||||
List<IBillItem> GetBillItems();
|
||||
long Id { get; set; }
|
||||
|
@ -2,15 +2,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Models.Relationship;
|
||||
public class ClientProviderInfo
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Avatar { get; set; }
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
public string EMail { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public Location BillingAddress { get; set; }
|
||||
public ILocation BillingAddress { get; set; }
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
CONFIG=Release
|
||||
VERSION=1.0.5-rc5
|
||||
VERSION=1.0.5-rc6
|
||||
PRJNAME=Yavsc.Abstract
|
||||
PKGFILENAME=$(PRJNAME).$(VERSION).nupkg
|
||||
DESTPATH=.
|
||||
|
@ -3,12 +3,11 @@ using System;
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
using Models.Messaging;
|
||||
using Models.Relationship;
|
||||
|
||||
public class RdvQueryProviderInfo
|
||||
{
|
||||
public ClientProviderInfo Client { get; set; }
|
||||
public Location Location { get; set; }
|
||||
public ILocation Location { get; set; }
|
||||
|
||||
public long Id { get; set; }
|
||||
|
||||
@ -18,6 +17,7 @@ namespace Yavsc.Models
|
||||
public string Reason { get; set; }
|
||||
|
||||
public string ActivityCode { get; set; }
|
||||
public string BillingCode { get; set; }
|
||||
}
|
||||
|
||||
}
|
BIN
Yavsc.Abstract/Yavsc.Abstract.1.0.5-rc6.nupkg
Normal file
BIN
Yavsc.Abstract/Yavsc.Abstract.1.0.5-rc6.nupkg
Normal file
Binary file not shown.
@ -53,7 +53,8 @@ namespace Yavsc.Controllers
|
||||
Id = c.Id,
|
||||
Previsional = c.Previsional,
|
||||
Reason = c.Reason,
|
||||
ActivityCode = c.ActivityCode
|
||||
ActivityCode = c.ActivityCode,
|
||||
BillingCode = c.BillingCode
|
||||
}).
|
||||
OrderBy(c=>c.Id).
|
||||
Take(25);
|
||||
|
@ -15,7 +15,7 @@ namespace Yavsc.ApiControllers
|
||||
dbContext = context;
|
||||
}
|
||||
|
||||
[HttpGet,Route("Profiles/{actCode}")]
|
||||
[HttpGet,Route("profiles/{actCode}")]
|
||||
IEnumerable<PerformerProfile> Profiles (string actCode)
|
||||
{
|
||||
return dbContext.ListPerformers(actCode);
|
||||
|
@ -91,7 +91,7 @@ namespace Yavsc.Controllers
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult Create(string id, string activityCode)
|
||||
public IActionResult Create(string id, string activityCode, string billingCode)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(id))
|
||||
throw new InvalidOperationException(
|
||||
@ -117,7 +117,8 @@ namespace Yavsc.Controllers
|
||||
PerformerId = pro.PerformerId,
|
||||
ClientId = userid,
|
||||
Client = user,
|
||||
ActivityCode = activityCode
|
||||
ActivityCode = activityCode,
|
||||
BillingCode = billingCode
|
||||
});
|
||||
}
|
||||
|
||||
@ -126,7 +127,7 @@ namespace Yavsc.Controllers
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(RdvQuery command)
|
||||
{
|
||||
|
||||
// TODO validate BillingCode value
|
||||
var uid = User.GetUserId();
|
||||
var prid = command.PerformerId;
|
||||
if (string.IsNullOrWhiteSpace(uid)
|
||||
|
@ -24,7 +24,8 @@ namespace Yavsc.Helpers
|
||||
EventDate = query.EventDate,
|
||||
Location = query.Location,
|
||||
Id = query.Id,
|
||||
ActivityCode = query.ActivityCode
|
||||
ActivityCode = query.ActivityCode,
|
||||
BillingCode = query.BillingCode
|
||||
};
|
||||
|
||||
return yaev;
|
||||
@ -65,7 +66,8 @@ namespace Yavsc.Helpers
|
||||
Location = query.Location,
|
||||
Id = query.Id,
|
||||
Reason = "Commande groupée!",
|
||||
ActivityCode = query.ActivityCode
|
||||
ActivityCode = query.ActivityCode,
|
||||
BillingCode = query.BillingCode
|
||||
};
|
||||
return yaev;
|
||||
}
|
||||
|
@ -5,9 +5,14 @@ CONFIGURATION=Release
|
||||
ASPNET_LOG_LEVEL=info #warn
|
||||
HOSTING=localhost
|
||||
HOSTADMIN=root
|
||||
FRMWRK=dnx451
|
||||
BINTARGET=Yavsc.dll
|
||||
BINTARGETPATH=bin/$(CONFIGURATION)/$(FRMWRK)/$(BINTARGET)
|
||||
|
||||
all: $(BINTARGETPATH)
|
||||
|
||||
all: bin/$(CONFIGURATION)
|
||||
$(BINTARGETPATH):
|
||||
dnu build
|
||||
|
||||
deploy: clean pushInPre pushInProd
|
||||
|
||||
|
@ -97,5 +97,10 @@ namespace Yavsc.Models.Billing
|
||||
[ForeignKey("PaymentId"), Display(Name = "Acquittement de la facture")]
|
||||
public virtual PayPalPayment Regularisation { get; set; }
|
||||
|
||||
[Required]
|
||||
public string BillingCode
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,12 +46,6 @@ namespace Yavsc.Services
|
||||
throw new NotImplementedException("No GCM reg ids");
|
||||
var msg = new MessageWithPayload<Event>()
|
||||
{
|
||||
notification = new Notification()
|
||||
{
|
||||
title = ev.Topic+" "+ev.Sender,
|
||||
body = ev.CreateBody(),
|
||||
icon = "icon"
|
||||
},
|
||||
data = ev,
|
||||
registration_ids = regids.ToArray()
|
||||
};
|
||||
|
@ -10,6 +10,7 @@ namespace Yavsc
|
||||
using Microsoft.Data.Entity;
|
||||
using Models;
|
||||
using Yavsc.Billing;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
@ -76,7 +77,7 @@ mais n'implemente pas l'interface IQueryable<ISpecializationSettings>
|
||||
}
|
||||
}
|
||||
|
||||
RegisterBilling<HairCutQuery>("Brush", new Func<ApplicationDbContext,long,IBillable>
|
||||
RegisterBilling<HairCutQuery>(BillingCodes.Brush, new Func<ApplicationDbContext,long,IBillable>
|
||||
( ( db, id) =>
|
||||
{
|
||||
var query = db.HairCutQueries.Include(q=>q.Prestation).Include(q=>q.Regularisation).Single(q=>q.Id == id) ;
|
||||
@ -84,9 +85,9 @@ mais n'implemente pas l'interface IQueryable<ISpecializationSettings>
|
||||
return query;
|
||||
})) ;
|
||||
|
||||
RegisterBilling<HairMultiCutQuery>("MBrush",new Func<ApplicationDbContext,long,IBillable>
|
||||
RegisterBilling<HairMultiCutQuery>(BillingCodes.MBrush,new Func<ApplicationDbContext,long,IBillable>
|
||||
( (db, id) => db.HairMultiCutQueries.Include(q=>q.Regularisation).Single(q=>q.Id == id)));
|
||||
RegisterBilling<RdvQuery>("Rdv", new Func<ApplicationDbContext,long,IBillable>
|
||||
RegisterBilling<RdvQuery>(BillingCodes.Rdv, new Func<ApplicationDbContext,long,IBillable>
|
||||
( (db, id) => db.RdvQueries.Include(q=>q.Regularisation).Single(q=>q.Id == id)));
|
||||
}
|
||||
public static System.Reflection.Assembly OnYavscResourceResolve(object sender, ResolveEventArgs ev)
|
||||
|
@ -180,6 +180,7 @@
|
||||
<span asp-validation-for="Reason" class="text-danger"></span>
|
||||
@Html.HiddenFor(model=>model.Location.Latitude)
|
||||
@Html.HiddenFor(model=>model.Location.Longitude)
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -195,6 +196,7 @@
|
||||
@Html.HiddenFor(model=>model.ClientId)
|
||||
@Html.HiddenFor(model=>model.PerformerId)
|
||||
@Html.HiddenFor(model=>model.ActivityCode)
|
||||
@Html.HiddenFor(model=>model.BillingCode)
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
@Html.DisplayFor(m=>profile)
|
||||
<form action="~/Command/Create" >
|
||||
<input type="hidden" name="id" value="@profile.PerformerId" />
|
||||
<input type="hidden" name="billingCode" value="Profiles" />
|
||||
<input type="hidden" name="activityCode" value="@ViewBag.Activity.Code" />
|
||||
<input type="submit" class="btn btn-success" value="@SR["Proposer un rendez-vous à"] @profile.Performer.UserName"/>
|
||||
</form>
|
||||
|
@ -113,8 +113,7 @@
|
||||
"Microsoft.AspNet.OWin": "1.0.0-rc1-final",
|
||||
"System.Json": "4.0.20126.16343",
|
||||
"Yavsc.Abstract": {
|
||||
"type": "build",
|
||||
"version": "1.0.5"
|
||||
"type": "build"
|
||||
},
|
||||
"Extensions.AspNet.Authentication.Instagram": "1.0.0-t150809211713",
|
||||
"Microsoft.AspNet.Http.Extensions": "1.0.0-rc1-final",
|
||||
@ -166,4 +165,4 @@
|
||||
"postpublish": "echo after publish"
|
||||
},
|
||||
"embed": "Views/**/*.cshtml"
|
||||
}
|
||||
}
|
||||
|
@ -11437,7 +11437,7 @@
|
||||
"Microsoft.AspNet.Mvc.Formatters.Json >= 6.0.0-rc1-final",
|
||||
"Microsoft.AspNet.OWin >= 1.0.0-rc1-final",
|
||||
"System.Json >= 4.0.20126.16343",
|
||||
"Yavsc.Abstract >= 1.0.5",
|
||||
"Yavsc.Abstract ",
|
||||
"Extensions.AspNet.Authentication.Instagram >= 1.0.0-t150809211713",
|
||||
"Microsoft.AspNet.Http.Extensions >= 1.0.0-rc1-final",
|
||||
"Microsoft.DiaSymReader.Native >= 1.5.0",
|
||||
|
Reference in New Issue
Block a user