un positionnement de paramètre workflow des pros
This commit is contained in:
17
Yavsc/Models/Access/BlackList.cs
Normal file
17
Yavsc/Models/Access/BlackList.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public class BlackListed: IBlackListed
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -1,194 +1,215 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authentication.OAuth;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models.Auth;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Booking;
|
||||
using Yavsc.Models.OAuth;
|
||||
using Yavsc.Models.Workflow;
|
||||
using Yavsc.Models.Identity;
|
||||
using Yavsc.Models.Market;
|
||||
using Yavsc.Model;
|
||||
using Yavsc.Model.Chat;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
// Customize the ASP.NET Identity model and override the defaults if needed.
|
||||
// For example, you can rename the ASP.NET Identity table names and more.
|
||||
// Add your customizations after calling base.OnModelCreating(builder);
|
||||
builder.Entity<Contact>().HasKey(x => new { x.OwnerId, x.UserId });
|
||||
builder.Entity<BookQuery>().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<Blog>().Property(x=>x.Posted).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<GoogleCloudMobileDeclaration>().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<PostTag>().HasKey(x=>new { x.PostId, x.TagId});
|
||||
builder.Entity<ApplicationUser>().HasMany<Connection>( c=>c.Connections );
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseNpgsql(Startup.ConnectionString);
|
||||
}
|
||||
|
||||
public DbSet<Client> Applications { get; set; }
|
||||
|
||||
public DbSet<RefreshToken> RefreshTokens { get; set; }
|
||||
/// <summary>
|
||||
/// Activities referenced on this site
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Activity> Activities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Users posts
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Blog> Blogspot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skills propulsed by this site
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Skill> SiteSkills { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Circle members
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<CircleMember> CircleMembers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Commands, from an user, to a performer
|
||||
/// (A performer is an user who's actived a main activity
|
||||
/// on his profile).
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<BookQuery> Commands { get; set; }
|
||||
/// <summary>
|
||||
/// Special commands, talking about
|
||||
/// a given place and date.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<BookQuery> BookQueries { get; set; }
|
||||
public DbSet<PerformerProfile> Performers { get; set; }
|
||||
public DbSet<Estimate> Estimates { get; set; }
|
||||
public DbSet<AccountBalance> BankStatus { get; set; }
|
||||
public DbSet<BalanceImpact> BankBook { get; set; }
|
||||
public DbSet<Location> Map { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Google Calendar offline
|
||||
/// open auth tokens
|
||||
/// </summary>
|
||||
/// <returns>tokens</returns>
|
||||
public DbSet<OAuth2Tokens> Tokens { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// References all declared external GCM devices
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<GoogleCloudMobileDeclaration> GCMDevices { get; set; }
|
||||
|
||||
public DbSet<Service> Services { get; set; }
|
||||
public DbSet<Product> Products { get; set; }
|
||||
public Task ClearTokensAsync()
|
||||
{
|
||||
Tokens.RemoveRange(this.Tokens);
|
||||
SaveChanges();
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task DeleteTokensAsync(string email)
|
||||
{
|
||||
if (string.IsNullOrEmpty(email))
|
||||
{
|
||||
throw new ArgumentException("email MUST have a value");
|
||||
}
|
||||
|
||||
var item = this.Tokens.FirstOrDefault(x => x.UserId == email);
|
||||
if (item != null)
|
||||
{
|
||||
Tokens.Remove(item);
|
||||
SaveChanges();
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task<OAuth2Tokens> GetTokensAsync(string googleUserId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(googleUserId))
|
||||
{
|
||||
throw new ArgumentException("email MUST have a value");
|
||||
}
|
||||
|
||||
using (var context = new ApplicationDbContext())
|
||||
{
|
||||
var item = this.Tokens.FirstOrDefault(x => x.UserId == googleUserId);
|
||||
return Task.FromResult(item);
|
||||
}
|
||||
}
|
||||
|
||||
public Task StoreTokenAsync(string googleUserId, OAuthTokenResponse value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(googleUserId))
|
||||
{
|
||||
throw new ArgumentException("googleUserId MUST have a value");
|
||||
}
|
||||
|
||||
var item = this.Tokens.SingleOrDefaultAsync(x => x.UserId == googleUserId).Result;
|
||||
if (item == null)
|
||||
{
|
||||
Tokens.Add(new OAuth2Tokens
|
||||
{
|
||||
TokenType = "Bearer", // FIXME why value.TokenType would be null?
|
||||
AccessToken = value.AccessToken,
|
||||
RefreshToken = value.RefreshToken,
|
||||
Expiration = DateTime.Now.AddSeconds(int.Parse(value.ExpiresIn)),
|
||||
UserId = googleUserId
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
item.AccessToken = value.AccessToken;
|
||||
item.Expiration = DateTime.Now.AddMinutes(int.Parse(value.ExpiresIn));
|
||||
if (value.RefreshToken != null)
|
||||
item.RefreshToken = value.RefreshToken;
|
||||
Tokens.Update(item);
|
||||
}
|
||||
SaveChanges();
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
Client FindApplication(string clientId)
|
||||
{
|
||||
return Applications.FirstOrDefault(
|
||||
app=>app.Id == clientId);
|
||||
}
|
||||
|
||||
public DbSet<ExceptionSIREN> ExceptionsSIREN { get; set; }
|
||||
|
||||
public DbSet<Location> Locations { get; set; }
|
||||
|
||||
public DbSet<Tag> Tags { get; set; }
|
||||
|
||||
public DbSet<PostTag> TagsDomain { get; set; }
|
||||
|
||||
public DbSet<EstimateTemplate> EstimateTemplates { get; set; }
|
||||
|
||||
public DbSet<Contact> Contacts { get; set; }
|
||||
|
||||
public DbSet<ClientProviderInfo> ClientProviderInfo { get; set; }
|
||||
|
||||
public DbSet<Connection> Connections { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authentication.OAuth;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
using Auth;
|
||||
using Billing;
|
||||
using Booking;
|
||||
using OAuth;
|
||||
using Workflow;
|
||||
using Identity;
|
||||
using Market;
|
||||
using Chat;
|
||||
using Messaging;
|
||||
using Access;
|
||||
using Yavsc.Models.Booking.Profiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
// Customize the ASP.NET Identity model and override the defaults if needed.
|
||||
// For example, you can rename the ASP.NET Identity table names and more.
|
||||
// Add your customizations after calling base.OnModelCreating(builder);
|
||||
builder.Entity<Contact>().HasKey(x => new { x.OwnerId, x.UserId });
|
||||
builder.Entity<BookQuery>().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<Blog>().Property(x=>x.Posted).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<GoogleCloudMobileDeclaration>().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<PostTag>().HasKey(x=>new { x.PostId, x.TagId});
|
||||
builder.Entity<ApplicationUser>().HasMany<Connection>( c=>c.Connections );
|
||||
builder.Entity<UserActivity>().HasKey(u=> new { u.DoesCode, u.UserId});
|
||||
builder.Entity<Instrumentation>().HasKey(u=> new { u.InstrumentId, u.UserId});
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseNpgsql(Startup.ConnectionString);
|
||||
}
|
||||
|
||||
public DbSet<Client> Applications { get; set; }
|
||||
|
||||
public DbSet<RefreshToken> RefreshTokens { get; set; }
|
||||
/// <summary>
|
||||
/// Activities referenced on this site
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Activity> Activities { get; set; }
|
||||
public DbSet<UserActivity> UserActivities { get; set; }
|
||||
/// <summary>
|
||||
/// Users posts
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Blog> Blogspot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skills propulsed by this site
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Skill> SiteSkills { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Circle members
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<CircleMember> CircleMembers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Commands, from an user, to a performer
|
||||
/// (A performer is an user who's actived a main activity
|
||||
/// on his profile).
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<BookQuery> Commands { get; set; }
|
||||
/// <summary>
|
||||
/// Special commands, talking about
|
||||
/// a given place and date.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<BookQuery> BookQueries { get; set; }
|
||||
public DbSet<PerformerProfile> Performers { get; set; }
|
||||
public DbSet<Estimate> Estimates { get; set; }
|
||||
public DbSet<AccountBalance> BankStatus { get; set; }
|
||||
public DbSet<BalanceImpact> BankBook { get; set; }
|
||||
public DbSet<Location> Map { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Google Calendar offline
|
||||
/// open auth tokens
|
||||
/// </summary>
|
||||
/// <returns>tokens</returns>
|
||||
public DbSet<OAuth2Tokens> Tokens { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// References all declared external GCM devices
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<GoogleCloudMobileDeclaration> GCMDevices { get; set; }
|
||||
|
||||
public DbSet<Service> Services { get; set; }
|
||||
public DbSet<Product> Products { get; set; }
|
||||
public Task ClearTokensAsync()
|
||||
{
|
||||
Tokens.RemoveRange(this.Tokens);
|
||||
SaveChanges();
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task DeleteTokensAsync(string email)
|
||||
{
|
||||
if (string.IsNullOrEmpty(email))
|
||||
{
|
||||
throw new ArgumentException("email MUST have a value");
|
||||
}
|
||||
|
||||
var item = this.Tokens.FirstOrDefault(x => x.UserId == email);
|
||||
if (item != null)
|
||||
{
|
||||
Tokens.Remove(item);
|
||||
SaveChanges();
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task<OAuth2Tokens> GetTokensAsync(string googleUserId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(googleUserId))
|
||||
{
|
||||
throw new ArgumentException("email MUST have a value");
|
||||
}
|
||||
|
||||
using (var context = new ApplicationDbContext())
|
||||
{
|
||||
var item = this.Tokens.FirstOrDefault(x => x.UserId == googleUserId);
|
||||
return Task.FromResult(item);
|
||||
}
|
||||
}
|
||||
|
||||
public Task StoreTokenAsync(string googleUserId, OAuthTokenResponse value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(googleUserId))
|
||||
{
|
||||
throw new ArgumentException("googleUserId MUST have a value");
|
||||
}
|
||||
|
||||
var item = this.Tokens.SingleOrDefaultAsync(x => x.UserId == googleUserId).Result;
|
||||
if (item == null)
|
||||
{
|
||||
Tokens.Add(new OAuth2Tokens
|
||||
{
|
||||
TokenType = "Bearer", // FIXME why value.TokenType would be null?
|
||||
AccessToken = value.AccessToken,
|
||||
RefreshToken = value.RefreshToken,
|
||||
Expiration = DateTime.Now.AddSeconds(int.Parse(value.ExpiresIn)),
|
||||
UserId = googleUserId
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
item.AccessToken = value.AccessToken;
|
||||
item.Expiration = DateTime.Now.AddMinutes(int.Parse(value.ExpiresIn));
|
||||
if (value.RefreshToken != null)
|
||||
item.RefreshToken = value.RefreshToken;
|
||||
Tokens.Update(item);
|
||||
}
|
||||
SaveChanges();
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
Client FindApplication(string clientId)
|
||||
{
|
||||
return Applications.FirstOrDefault(
|
||||
app=>app.Id == clientId);
|
||||
}
|
||||
|
||||
public DbSet<ExceptionSIREN> ExceptionsSIREN { get; set; }
|
||||
|
||||
public DbSet<Location> Locations { get; set; }
|
||||
|
||||
public DbSet<Tag> Tags { get; set; }
|
||||
|
||||
public DbSet<PostTag> TagsDomain { get; set; }
|
||||
|
||||
public DbSet<EstimateTemplate> EstimateTemplates { get; set; }
|
||||
|
||||
public DbSet<Contact> Contacts { get; set; }
|
||||
|
||||
public DbSet<ClientProviderInfo> ClientProviderInfo { get; set; }
|
||||
|
||||
public DbSet<Connection> Connections { get; set; }
|
||||
|
||||
public DbSet<BlackListed> BlackListed { get; set; }
|
||||
|
||||
public DbSet<MusicalPreference> MusicalPreferences { get; set; }
|
||||
|
||||
public DbSet<MusicalTendency> MusicalTendency { get; set; }
|
||||
|
||||
public DbSet<LocationType> LocationType { get; set; }
|
||||
|
||||
public DbSet<Instrument> Instrument { get; set; }
|
||||
public DbSet<DjSettings> DjSettings { get; set; }
|
||||
public DbSet<Instrumentation> Instrumentation { get; set; }
|
||||
public DbSet<FormationSettings> FormationSettings { get; set; }
|
||||
public DbSet<GeneralSettings> GeneralSettings { get; set; }
|
||||
public DbSet<CoWorking> WorkflowProviders { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
using Interfaces;
|
||||
|
||||
public partial class AccountBalance: IAccountBalance {
|
||||
[Key]
|
||||
|
@ -9,6 +9,8 @@ namespace Yavsc.Models.Billing
|
||||
{
|
||||
using Interfaces;
|
||||
using Models.Booking;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
public partial class Estimate : IEstimate
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@ -61,8 +63,13 @@ namespace Yavsc.Models.Billing
|
||||
[Required]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
public virtual PerformerProfile Owner { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ClientId { get; set; }
|
||||
[ForeignKey("ClientId")]
|
||||
public virtual ApplicationUser Client { get; set; }
|
||||
|
||||
public string CommandType
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ namespace Yavsc.Models.Billing
|
||||
{
|
||||
public class ExceptionSIREN {
|
||||
|
||||
[Key]
|
||||
[Key,MinLength(9)]
|
||||
public string SIREN { get; set; }
|
||||
}
|
||||
}
|
@ -8,7 +8,8 @@ using Yavsc.Models.Workflow;
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
|
||||
public class NominativeServiceCommand : Query<Service> {
|
||||
public class NominativeServiceCommand<T> : Query<T> where T:Service
|
||||
{
|
||||
|
||||
public string ClientId { get; set; }
|
||||
|
||||
|
@ -2,7 +2,6 @@ using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
@ -2,6 +2,7 @@ using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc.Models.Booking
|
||||
{
|
||||
@ -9,7 +10,7 @@ namespace Yavsc.Models.Booking
|
||||
/// Query, for a date, with a given perfomer, at this given place.
|
||||
/// </summary>
|
||||
|
||||
public class BookQuery : NominativeServiceCommand {
|
||||
public class BookQuery : NominativeServiceCommand<RendezVous> {
|
||||
/// <summary>
|
||||
/// The command identifier
|
||||
/// </summary>
|
||||
@ -25,7 +26,13 @@ namespace Yavsc.Models.Booking
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
|
||||
public LocationType LocationType {
|
||||
set;
|
||||
get;
|
||||
}
|
||||
public string Reason { get; set; }
|
||||
|
||||
public BookQuery()
|
||||
{
|
||||
}
|
||||
|
15
Yavsc/Models/Booking/Instrument.cs
Normal file
15
Yavsc/Models/Booking/Instrument.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Booking
|
||||
{
|
||||
public class Instrument
|
||||
{
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id {get; set; }
|
||||
|
||||
[MaxLength(255),Required]
|
||||
public string Name { get ; set; }
|
||||
}
|
||||
}
|
20
Yavsc/Models/Booking/InstrumentRating.cs
Normal file
20
Yavsc/Models/Booking/InstrumentRating.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.Models.Booking
|
||||
{
|
||||
public class InstrumentRating
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id {get; set; }
|
||||
public Instrument Instrument { get; set; }
|
||||
public int Rate { get; set; }
|
||||
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
public virtual PerformerProfile Profile { get; set; }
|
||||
|
||||
}
|
||||
}
|
26
Yavsc/Models/Booking/MusicalPreference.cs
Normal file
26
Yavsc/Models/Booking/MusicalPreference.cs
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.Models.Booking {
|
||||
|
||||
public class MusicalPreference {
|
||||
|
||||
[Key]
|
||||
public string OwnerProfileId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
|
||||
public int Rate { get; set; }
|
||||
|
||||
[Required]
|
||||
public long TendencyId {get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
21
Yavsc/Models/Booking/MusicalTendency.cs
Normal file
21
Yavsc/Models/Booking/MusicalTendency.cs
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
namespace Yavsc.Models.Booking {
|
||||
|
||||
|
||||
|
||||
public class MusicalTendency {
|
||||
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id {get; set; }
|
||||
|
||||
[MaxLength(255),Required]
|
||||
public string Name { get ; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
24
Yavsc/Models/Booking/Profiles/DjSettings.cs
Normal file
24
Yavsc/Models/Booking/Profiles/DjSettings.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Workflow;
|
||||
using YavscLib;
|
||||
|
||||
namespace Yavsc.Models.Booking.Profiles
|
||||
{
|
||||
public class DjSettings : ISpecializationSettings
|
||||
{
|
||||
|
||||
public string SoundCloudId { get; set; }
|
||||
|
||||
public virtual List<MusicalPreference> SoundColor { get; set; }
|
||||
|
||||
[Key]
|
||||
public string UserId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
19
Yavsc/Models/Booking/Profiles/FormationSettings.cs
Normal file
19
Yavsc/Models/Booking/Profiles/FormationSettings.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Booking.Profiles
|
||||
{
|
||||
using Models.Workflow;
|
||||
using YavscLib;
|
||||
public class FormationSettings : ISpecializationSettings
|
||||
{
|
||||
public virtual List<CoWorking> CoWorking { get; set; }
|
||||
|
||||
[Key]
|
||||
public string UserId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
18
Yavsc/Models/Booking/Profiles/GeneralSettings.cs
Normal file
18
Yavsc/Models/Booking/Profiles/GeneralSettings.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Workflow;
|
||||
using YavscLib;
|
||||
|
||||
namespace Yavsc.Models.Booking.Profiles
|
||||
{
|
||||
public class GeneralSettings : ISpecializationSettings
|
||||
{
|
||||
public virtual List<MusicalPreference> SoundColor { get; set; }
|
||||
[Key]
|
||||
public string UserId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
25
Yavsc/Models/Booking/Profiles/Instrumentation.cs
Normal file
25
Yavsc/Models/Booking/Profiles/Instrumentation.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Workflow;
|
||||
using YavscLib;
|
||||
|
||||
namespace Yavsc.Models.Booking.Profiles
|
||||
{
|
||||
public class Instrumentation : ISpecializationSettings
|
||||
{
|
||||
public string UserId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[ForeignKeyAttribute("UserId")]
|
||||
public virtual PerformerProfile User { get; set; }
|
||||
public long InstrumentId { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("InstrumentId")]
|
||||
public virtual Instrument Tool { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Model.Chat
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
using YavscLib;
|
||||
|
||||
public class Connection
|
||||
public class Connection : IConnection
|
||||
{
|
||||
[JsonIgnore]
|
||||
public string ApplicationUserId { get; set; }
|
||||
@ -19,4 +19,4 @@ namespace Yavsc.Model.Chat
|
||||
public bool Connected { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,9 @@ using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Identity;
|
||||
using Yavsc.Model.Chat;
|
||||
using Yavsc.Models.Chat;
|
||||
using Yavsc.Model.Bank;
|
||||
using Yavsc.Models.Access;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
@ -87,5 +88,7 @@ namespace Yavsc.Models
|
||||
|
||||
public long DiskQuota { get; set; } = 512*1024*1024;
|
||||
public long DiskUsage { get; set; } = 0;
|
||||
|
||||
public virtual List<BlackListed> BlackList { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ using System;
|
||||
|
||||
namespace Yavsc.Model
|
||||
{
|
||||
using Models.Messaging;
|
||||
|
||||
public class BookQueryProviderInfo
|
||||
{
|
||||
@ -12,5 +13,8 @@ namespace Yavsc.Model
|
||||
|
||||
public DateTime EventDate { get; set; }
|
||||
public decimal? Previsional { get; set; }
|
||||
|
||||
public string Reason { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace Yavsc.Model
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public class ClientProviderInfo
|
||||
{
|
||||
@ -8,10 +8,8 @@ namespace Yavsc.Model
|
||||
public string Avatar { get; set; }
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
public int Rate { get; set; }
|
||||
public string EMail { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public Location BillingAddress { get; set; }
|
||||
public string ChatHubConnectionId { get; set; }
|
||||
}
|
||||
}
|
||||
|
54
Yavsc/Models/Messaging/EstimationEvent.cs
Normal file
54
Yavsc/Models/Messaging/EstimationEvent.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public class EstimationEvent: IEvent
|
||||
{
|
||||
public EstimationEvent(ApplicationDbContext context, Estimate estimate, IStringLocalizer SR)
|
||||
{
|
||||
Estimation = estimate;
|
||||
var perfer = context.Performers.FirstOrDefault(
|
||||
p => p.PerformerId == estimate.OwnerId
|
||||
);
|
||||
// Use estimate.OwnerId;
|
||||
ProviderInfo = new ProviderClientInfo {
|
||||
Rate = perfer.Rate,
|
||||
UserName = perfer.Performer.UserName,
|
||||
Avatar = perfer.Performer.Avatar,
|
||||
UserId = perfer.PerformerId
|
||||
};
|
||||
((IEvent)this).Sender = perfer.Performer.UserName;
|
||||
((IEvent)this).Message = string.Format(SR["EstimationMessageToClient"],perfer.Performer.UserName,
|
||||
estimate.Title,estimate.GetTotal());
|
||||
}
|
||||
ProviderClientInfo ProviderInfo { get; set; }
|
||||
Estimate Estimation { get; set; }
|
||||
|
||||
private string subtopic = null;
|
||||
string IEvent.Topic
|
||||
{
|
||||
get
|
||||
{
|
||||
return "/topic/estimate"+subtopic!=null?"/"+subtopic:"";
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
subtopic = value;
|
||||
}
|
||||
}
|
||||
|
||||
string IEvent.Sender
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
string IEvent.Message
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
8
Yavsc/Models/Messaging/ProviderClientInfo.cs
Normal file
8
Yavsc/Models/Messaging/ProviderClientInfo.cs
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public class ProviderClientInfo : ClientProviderInfo
|
||||
{
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
}
|
13
Yavsc/Models/Relationship/LocationType.cs
Normal file
13
Yavsc/Models/Relationship/LocationType.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public class LocationType
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -18,6 +18,15 @@ namespace Yavsc.Models
|
||||
[StringLength(512),Required()]
|
||||
public string Name {get; set;}
|
||||
|
||||
[StringLength(512)]
|
||||
public string ParentCode { get; set; }
|
||||
|
||||
[ForeignKey("ParentCode")]
|
||||
public virtual Activity Parent { get; set; }
|
||||
|
||||
[InverseProperty("Parent")]
|
||||
public virtual List<Activity> Children { get; set; }
|
||||
|
||||
public string Description {get; set;}
|
||||
/// <summary>
|
||||
/// Name to associate to a performer in this activity domain
|
||||
@ -36,5 +45,16 @@ namespace Yavsc.Models
|
||||
/// <returns></returns>
|
||||
string ModeratorGroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// indice de recherche de cette activité
|
||||
/// rendu par le système.
|
||||
/// Valide entre 0 et 100,
|
||||
/// Il démarre à 0.
|
||||
/// </summary>
|
||||
[Range(0,100)]
|
||||
public int Rate { get; set; }
|
||||
|
||||
[DisplayAttribute(Name="SettingsClass")]
|
||||
public string SettingsClassName { get; set; }
|
||||
}
|
||||
}
|
||||
|
21
Yavsc/Models/Workflow/CoWorking.cs
Normal file
21
Yavsc/Models/Workflow/CoWorking.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
public class CoWorking
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id {get; set; }
|
||||
|
||||
public string PerformerId { get; set; }
|
||||
public string WorkingForId { get; set; }
|
||||
|
||||
[ForeignKey("PerformerId")]
|
||||
public virtual PerformerProfile Performer { get; set; }
|
||||
|
||||
[ForeignKey("WorkingForId")]
|
||||
public virtual ApplicationUser WorkingFor { get; set; }
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
@ -12,10 +12,9 @@ namespace Yavsc.Models.Workflow
|
||||
[ForeignKey("PerformerId"),Display(Name="Performer")]
|
||||
public virtual ApplicationUser Performer { get; set; }
|
||||
|
||||
[Display(Name="Activity"),Required]
|
||||
public string ActivityCode { get; set; }
|
||||
|
||||
public Service Offer { get; set; }
|
||||
[InverseProperty("User")]
|
||||
[Display(Name="Activity")]
|
||||
public virtual List<UserActivity> Activity { get; set; }
|
||||
|
||||
[Required,StringLength(14),Display(Name="SIREN"),
|
||||
RegularExpression(@"^[0-9]{9,14}$", ErrorMessage = "Only numbers are allowed here")]
|
||||
@ -26,9 +25,6 @@ namespace Yavsc.Models.Workflow
|
||||
[Required,Display(Name="Organization address"),ForeignKey("OrganizationAddressId")]
|
||||
public virtual Location OrganizationAddress { get; set; }
|
||||
|
||||
[ForeignKey("ActivityCode"),Display(Name="Activity")]
|
||||
public virtual Activity Activity { get; set; }
|
||||
|
||||
[Display(Name="Accept notifications on client query")]
|
||||
public bool AcceptNotifications { get; set; }
|
||||
|
||||
@ -55,7 +51,7 @@ namespace Yavsc.Models.Workflow
|
||||
|
||||
[NotMapped]
|
||||
public bool DoesBlog { get {
|
||||
return Performer?.Posts != null ? Performer.Posts.Count > 0 : false;
|
||||
return Performer.Posts?.Count > 0 ;
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yavsc.Models
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public abstract class Action<TResult,TInput>
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class Conjonction : List<IRequisition>, IRequisition
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class Disjonction : List<IRequisition>, IRequisition
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
namespace Yavsc.Models
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class ConstInputValue : NamedRequisition
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
namespace Yavsc.Models
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public abstract class NamedRequisition : IRequisition
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
namespace Yavsc.Models
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class Negation<Exp> : IRequisition where Exp : IRequisition
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
/// <summary>
|
||||
/// An abstract, identified rule
|
||||
|
@ -11,7 +11,7 @@ namespace Yavsc.Models {
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// indice de recherche de cette capacité
|
||||
/// indice de recherche de ce talent
|
||||
/// rendu par le système.
|
||||
/// Valide entre 0 et 100,
|
||||
/// Il démarre à 0.
|
||||
|
24
Yavsc/Models/Workflow/UserActivity.cs
Normal file
24
Yavsc/Models/Workflow/UserActivity.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
public class UserActivity
|
||||
{
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual PerformerProfile User { get; set; }
|
||||
|
||||
[Required]
|
||||
public string DoesCode { get; set; }
|
||||
|
||||
[ForeignKey("DoesCode")]
|
||||
public virtual Activity Does { get; set; }
|
||||
|
||||
[Range(0,100)]
|
||||
public int Weight { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -8,12 +8,16 @@ namespace Yavsc.Models
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[ForeignKeyAttribute("AspNetUsers.Id")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("Skill.Id")]
|
||||
[ForeignKey("UserId")]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
|
||||
public long SkillId { get; set; }
|
||||
|
||||
[ForeignKey("SkillId")]
|
||||
public virtual Skill Skill { get; set; }
|
||||
|
||||
public string Comment { get; set; }
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user