Re-fabrication
This commit is contained in:
@ -1,34 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
using Yavsc;
|
||||
|
||||
public class Ban : IBaseTrackedEntity
|
||||
{
|
||||
public DateTime DateCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public DateTime DateModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string UserCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string UserModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public class BanByEmail
|
||||
{
|
||||
[Required]
|
||||
public long BanId { get; set; }
|
||||
|
||||
[ForeignKey("BanId")]
|
||||
public virtual Ban UserBan { get; set; }
|
||||
|
||||
[Required]
|
||||
public string email { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public class BlackListed: IBlackListed
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[Required]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId"),JsonIgnore]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Models.Relationship;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc;
|
||||
using Blog;
|
||||
|
||||
public class CircleAuthorizationToBlogPost : ICircleAuthorization
|
||||
{
|
||||
public long CircleId { get; set; }
|
||||
public long BlogPostId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("BlogPostId")]
|
||||
public virtual BlogPost Target { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CircleId")]
|
||||
public virtual Circle Allowed { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
//
|
||||
// Publishing.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Publishing.
|
||||
/// </summary>
|
||||
public enum Publishing {
|
||||
/// <summary>
|
||||
/// In the context of immediate use, with no related stored content.
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// In the context of private use of an uploaded content.
|
||||
/// </summary>
|
||||
Private,
|
||||
/// <summary>
|
||||
/// In the context of restricted access areas, like circle members views.
|
||||
/// </summary>
|
||||
Restricted,
|
||||
/// <summary>
|
||||
/// Publishing a content in a public access area.
|
||||
/// </summary>
|
||||
Public
|
||||
}
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public abstract class Rule<TResource,TRequirement>
|
||||
{
|
||||
public Rule()
|
||||
{
|
||||
|
||||
}
|
||||
// Abstract method to compute any authorization on a resource
|
||||
public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement);
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public abstract class RuleSet <TResource,TRequirement>:List<Rule<TResource,TRequirement>> {
|
||||
|
||||
public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement);
|
||||
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
|
||||
public class WhiteCard {
|
||||
|
||||
}
|
||||
}
|
@ -1,303 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authentication.OAuth;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Microsoft.Data.Entity;
|
||||
using System.Threading;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Models.IT.Maintaining;
|
||||
using Yavsc.Models.IT.Fixing;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
using Relationship;
|
||||
using Forms;
|
||||
using Yavsc;
|
||||
using Auth;
|
||||
using Billing;
|
||||
using Musical;
|
||||
using OAuth;
|
||||
using Workflow;
|
||||
using Identity;
|
||||
using Market;
|
||||
using Chat;
|
||||
using Messaging;
|
||||
using Access;
|
||||
using Musical.Profiles;
|
||||
using Workflow.Profiles;
|
||||
using Drawing;
|
||||
using Attributes;
|
||||
using Bank;
|
||||
using Payment;
|
||||
using Yavsc.Models.Calendar;
|
||||
using Blog;
|
||||
|
||||
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<Relationship.Contact>().HasKey(x => new { x.OwnerId, x.UserId });
|
||||
builder.Entity<GoogleCloudMobileDeclaration>().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<BlogTag>().HasKey(x=>new { x.PostId, x.TagId});
|
||||
builder.Entity<ApplicationUser>().HasMany<ChatConnection>( c=>c.Connections );
|
||||
builder.Entity<ApplicationUser>().Property(u=>u.Avatar).HasDefaultValue(Constants.DefaultAvatar);
|
||||
builder.Entity<ApplicationUser>().Property(u=>u.DiskQuota).HasDefaultValue(Constants.DefaultFSQ);
|
||||
builder.Entity<UserActivity>().HasKey(u=> new { u.DoesCode, u.UserId});
|
||||
builder.Entity<Instrumentation>().HasKey(u=> new { u.InstrumentId, u.UserId});
|
||||
builder.Entity<CircleAuthorizationToBlogPost>().HasKey(a=> new { a.CircleId, a.BlogPostId});
|
||||
builder.Entity<CircleMember>().HasKey(c=> new { MemberId = c.MemberId, CircleId = c.CircleId });
|
||||
builder.Entity<DimissClicked>().HasKey(c=>new { uid = c.UserId, notid = c.NotificationId});
|
||||
builder.Entity<HairTaintInstance>().HasKey(ti=>new { ti.TaintId, ti.PrestationId } );
|
||||
builder.Entity<HyperLink>().HasKey(l=>new { l.HRef, l.Method });
|
||||
builder.Entity<Period>().HasKey(l=>new { l.Start, l.End });
|
||||
builder.Entity<Models.Cratie.Option>().HasKey( o => new { o.Code, o.CodeScrutin });
|
||||
builder.Entity<Notification>().Property(n=> n.icon).HasDefaultValue("exclam");
|
||||
builder.Entity<ChatRoomPresence>().HasKey(p=>new { room = p.ChannelName, user = p.ChatUserConnectionId });
|
||||
foreach (var et in builder.Model.GetEntityTypes()) {
|
||||
if (et.ClrType.GetInterface("IBaseTrackedEntity")!=null)
|
||||
et.FindProperty("DateCreated").IsReadOnlyAfterSave = true;
|
||||
}
|
||||
}
|
||||
|
||||
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.BlogPost> 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>
|
||||
/// Special commands, talking about
|
||||
/// a given place and date.
|
||||
/// </summary>
|
||||
public DbSet<RdvQuery> RdvQueries { get; set; }
|
||||
|
||||
public DbSet<HairCutQuery> HairCutQueries { get; set; }
|
||||
public DbSet<HairPrestation> HairPrestation { get; set; }
|
||||
|
||||
public DbSet<HairMultiCutQuery> HairMultiCutQueries { 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<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);
|
||||
// TODO Refresh token
|
||||
|
||||
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(googleUserId);
|
||||
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<BlogTag> TagsDomain { get; set; }
|
||||
|
||||
public DbSet<EstimateTemplate> EstimateTemplates { get; set; }
|
||||
|
||||
public DbSet<Relationship.Contact> Contacts { get; set; }
|
||||
|
||||
public DbSet<ClientProviderInfo> ClientProviderInfo { get; set; }
|
||||
|
||||
public DbSet<ChatConnection> 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; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<DjSettings> DjSettings { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<Instrumentation> Instrumentation { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<FormationSettings> FormationSettings { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<GeneralSettings> GeneralSettings { get; set; }
|
||||
public DbSet<CoWorking> WorkflowProviders { get; set; }
|
||||
|
||||
private void AddTimestamps(string currentUsername)
|
||||
{
|
||||
var entities =
|
||||
ChangeTracker.Entries()
|
||||
.Where(x => x.Entity.GetType().GetInterface("IBaseTrackedEntity")!=null
|
||||
&& (x.State == EntityState.Added || x.State == EntityState.Modified));
|
||||
|
||||
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
if (entity.State == EntityState.Added)
|
||||
{
|
||||
((IBaseTrackedEntity)entity.Entity).DateCreated = DateTime.Now;
|
||||
((IBaseTrackedEntity)entity.Entity).UserCreated = currentUsername;
|
||||
}
|
||||
|
||||
((IBaseTrackedEntity)entity.Entity).DateModified = DateTime.Now;
|
||||
((IBaseTrackedEntity)entity.Entity).UserModified = currentUsername;
|
||||
}
|
||||
}
|
||||
public int SaveChanges(string userId) {
|
||||
AddTimestamps(userId);
|
||||
return base.SaveChanges();
|
||||
}
|
||||
|
||||
public async Task<int> SaveChangesAsync(string userId, CancellationToken ctoken = default(CancellationToken)) {
|
||||
AddTimestamps(userId);
|
||||
return await base.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public DbSet<Circle> Circle { get; set; }
|
||||
|
||||
public DbSet<CircleAuthorizationToBlogPost> BlogACL { get; set; }
|
||||
|
||||
public DbSet<CommandForm> CommandForm { get; set; }
|
||||
|
||||
public DbSet<Form> Form { get; set; }
|
||||
|
||||
public DbSet<Ban> Banlist { get ; set; }
|
||||
|
||||
public DbSet<HairTaint> HairTaint { get; set; }
|
||||
|
||||
public DbSet<Color> Color { get; set; }
|
||||
|
||||
public DbSet<Notification> Notification { get; set; }
|
||||
|
||||
public DbSet<DimissClicked> DimissClicked { get; set; }
|
||||
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<BrusherProfile> BrusherProfile { get; set; }
|
||||
|
||||
public DbSet<BankIdentity> BankIdentity { get; set; }
|
||||
|
||||
public DbSet<PayPalPayment> PayPalPayments { get; set; }
|
||||
|
||||
public DbSet<HyperLink> Links { get; set; }
|
||||
|
||||
public DbSet<Period> Period { get; set; }
|
||||
|
||||
public DbSet<BlogTag> BlogTags { get; set; }
|
||||
|
||||
public DbSet<ApplicationUser> ApplicationUser { get; set; }
|
||||
|
||||
public DbSet<Feature> Feature { get; set; }
|
||||
|
||||
public DbSet<Bug> Bug { get; set; }
|
||||
|
||||
public DbSet<Comment> Comment { get; set; }
|
||||
|
||||
public DbSet<Announce> Announce { get; set; }
|
||||
|
||||
public DbSet<ChatConnection> ChatConnection { get; set; }
|
||||
public DbSet<ChatRoom> ChatRoom { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
|
||||
|
||||
namespace Yavsc.Models.Auth
|
||||
{
|
||||
public enum ApplicationTypes: int
|
||||
{
|
||||
JavaScript = 0,
|
||||
NativeConfidential = 1
|
||||
};
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Auth
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
[Key]
|
||||
public string Id { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string RedirectUri { get; set; }
|
||||
[MaxLength(100)]
|
||||
public string LogoutRedirectUri { get; set; }
|
||||
public string Secret { get; set; }
|
||||
public ApplicationTypes Type { get; set; }
|
||||
|
||||
public bool Active { get; set; }
|
||||
public int RefreshTokenLifeTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Auth {
|
||||
|
||||
public class ExternalLoginViewModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Url { get; set; }
|
||||
|
||||
public string State { get; set; }
|
||||
}
|
||||
|
||||
public class RegisterExternalBindingModel
|
||||
{
|
||||
[Required]
|
||||
public string UserName { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Provider { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ExternalAccessToken { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ParsedExternalAccessToken
|
||||
{
|
||||
public string user_id { get; set; }
|
||||
public string app_id { get; set; }
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.OAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// OffLine OAuth2 Token
|
||||
/// To use against a third party Api
|
||||
/// </summary>
|
||||
public partial class OAuth2Tokens
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique identifier, equals the user email from OAuth provider
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Expiration date & time
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime Expiration { get; set; }
|
||||
/// <summary>
|
||||
/// Expiration time span in seconds
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Should always be <c>Bearer</c> ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string TokenType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Access Token!
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The refresh token
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string RefreshToken { get; set; }
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Auth
|
||||
{
|
||||
|
||||
|
||||
public class RefreshToken
|
||||
{
|
||||
[Key]
|
||||
public string Id { get; set; }
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public string Subject { get; set; }
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public string ClientId { get; set; }
|
||||
public DateTime IssuedUtc { get; set; }
|
||||
public DateTime ExpiresUtc { get; set; }
|
||||
[Required]
|
||||
public string ProtectedTicket { get; set; }
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Auth {
|
||||
public class Scope {
|
||||
|
||||
|
||||
[Key]
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
|
||||
using Yavsc.Models.OAuth;
|
||||
|
||||
namespace Yavsc.Models.Auth {
|
||||
|
||||
public class UserCredential {
|
||||
public string UserId { get; set; }
|
||||
|
||||
public OAuth2Tokens Tokens { get; set; }
|
||||
public UserCredential(string userId, OAuth2Tokens tokens)
|
||||
{
|
||||
UserId = userId;
|
||||
Tokens = tokens;
|
||||
}
|
||||
|
||||
public string GetHeader()
|
||||
{
|
||||
return Tokens.TokenType+" "+Tokens.AccessToken;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
using Yavsc;
|
||||
|
||||
public partial class AccountBalance: IAccountBalance {
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[Required,Display(Name="Credits en €")]
|
||||
public decimal Credits { get; set; }
|
||||
|
||||
public long ContactCredits { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class BalanceImpact {
|
||||
[Required,Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required,Display(Name="Impact")]
|
||||
public decimal Impact { get; set; }
|
||||
|
||||
[Required,Display(Name="Execution date")]
|
||||
public DateTime ExecDate { get; set; }
|
||||
|
||||
[Required,Display(Name="Reason")]
|
||||
public string Reason { get; set; }
|
||||
[Required]
|
||||
public string BalanceId { get; set; }
|
||||
|
||||
[ForeignKey("BalanceId")]
|
||||
public virtual AccountBalance Balance { get; set; }
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Bank
|
||||
{
|
||||
public class BankIdentity
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the BI.
|
||||
/// </summary>
|
||||
/// <value>The BI.</value>
|
||||
[DisplayName("Code BIC")]
|
||||
[StringLength(15)]
|
||||
public string BIC { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IBA.
|
||||
/// </summary>
|
||||
/// <value>The IBA.</value>
|
||||
[DisplayName("Code IBAN")]
|
||||
[StringLength(33)]
|
||||
public string IBAN { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the bank code.
|
||||
/// </summary>
|
||||
/// <value>The bank code.</value>
|
||||
[DisplayName("Code Banque")]
|
||||
[StringLength(5)]
|
||||
public string BankCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the wicket code.
|
||||
/// </summary>
|
||||
/// <value>The wicket code.</value>
|
||||
[DisplayName("Code Guichet")]
|
||||
[StringLength(5)]
|
||||
public string WicketCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the account number.
|
||||
/// </summary>
|
||||
/// <value>The account number.</value>
|
||||
[DisplayName("Numéro de compte")]
|
||||
[StringLength(15)]
|
||||
public string AccountNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the banked key.
|
||||
/// </summary>
|
||||
/// <value>The banked key.</value>
|
||||
[DisplayName("Clé RIB")]
|
||||
public int BankedKey { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
using Yavsc.Billing;
|
||||
|
||||
public class CommandLine : ICommandLine {
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required,MaxLength(256)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required,MaxLength(512)]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Display(Name="Nombre")]
|
||||
public int Count { get; set; } = 1;
|
||||
|
||||
[DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal UnitaryCost { get; set; }
|
||||
|
||||
public long EstimateId { get; set; }
|
||||
|
||||
[JsonIgnore,NotMapped,ForeignKey("EstimateId")]
|
||||
virtual public Estimate Estimate { get; set; }
|
||||
|
||||
public string Currency
|
||||
{
|
||||
get;
|
||||
|
||||
set;
|
||||
} = "EUR";
|
||||
|
||||
[NotMapped]
|
||||
public string Reference {
|
||||
get {
|
||||
return "CL/"+this.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public class ServiceContract<P> where P : Service
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
using Models.Workflow;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public partial class Estimate : IEstimate
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public long? CommandId { get; set; }
|
||||
/// <summary>
|
||||
/// A command is not required to create
|
||||
/// an estimate,
|
||||
/// it will result in a new estimate template
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[ForeignKey("CommandId"),JsonIgnore]
|
||||
public RdvQuery Query { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
[InverseProperty("Estimate")]
|
||||
public virtual List<CommandLine> Bill { get; set; }
|
||||
/// <summary>
|
||||
/// List of attached graphic files
|
||||
/// to this estimate, as relative pathes to
|
||||
/// the command performer's root path.
|
||||
/// In db, they are separated by <c>:</c>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NotMapped]
|
||||
public List<string> AttachedGraphics { get; set; }
|
||||
|
||||
public string AttachedGraphicsString
|
||||
{
|
||||
get { return string.Join(":", AttachedGraphics); }
|
||||
set { AttachedGraphics = value.Split(':').ToList(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// List of attached files
|
||||
/// to this estimate, as relative pathes to
|
||||
/// the command performer's root path.
|
||||
/// In db, they are separated by <c>:</c>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NotMapped]
|
||||
public List<string> AttachedFiles { get; set; }
|
||||
public string AttachedFilesString
|
||||
{
|
||||
get { return string.Join(":", AttachedFiles); }
|
||||
set { AttachedFiles = value.Split(':').ToList(); }
|
||||
}
|
||||
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId"),JsonIgnore]
|
||||
public virtual PerformerProfile Owner { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ClientId { get; set; }
|
||||
[ForeignKey("ClientId"),JsonIgnore]
|
||||
public virtual ApplicationUser Client { get; set; }
|
||||
|
||||
[Required]
|
||||
public string CommandType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public DateTime ProviderValidationDate { get; set; }
|
||||
public DateTime ClientValidationDate { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public partial class EstimateTemplate
|
||||
{
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Title { get; set; }
|
||||
public List<CommandLine> Bill { get; set; }
|
||||
|
||||
[Required]
|
||||
public string OwnerId { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public class ExceptionSIREN {
|
||||
|
||||
[Key,MinLength(9)]
|
||||
public string SIREN { get; set; }
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using Yavsc.Billing;
|
||||
|
||||
namespace Yavsc.Models.Billing {
|
||||
public class FixedImpacter : IBillingImpacter
|
||||
{
|
||||
public decimal ImpactedValue { get; set; }
|
||||
public FixedImpacter (decimal impact)
|
||||
{
|
||||
ImpactedValue = impact;
|
||||
}
|
||||
public decimal Impact(decimal orgValue)
|
||||
{
|
||||
return orgValue + ImpactedValue;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
using Newtonsoft.Json;
|
||||
using Workflow;
|
||||
using Yavsc.Models.Payment;
|
||||
using Yavsc;
|
||||
using Yavsc.Billing;
|
||||
using Yavsc.Abstract.Workflow;
|
||||
|
||||
public abstract class NominativeServiceCommand : IBaseTrackedEntity, INominativeQuery, IIdentified<long>
|
||||
{
|
||||
public string GetInvoiceId() { return GetType().Name + "/" + Id; }
|
||||
|
||||
public abstract long Id { get; set; }
|
||||
public abstract string GetDescription ();
|
||||
|
||||
[Required()]
|
||||
public bool Consent { get; set; }
|
||||
public DateTime DateCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public DateTime DateModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string UserCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string UserModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[DisplayAttribute(Name="Status de la requête")]
|
||||
public QueryStatus Status { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ClientId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The client
|
||||
/// </summary>
|
||||
[ForeignKey("ClientId"),Display(Name="Client")]
|
||||
public ApplicationUser Client { get; set; }
|
||||
|
||||
[Required]
|
||||
public string PerformerId { get; set; }
|
||||
/// <summary>
|
||||
/// The performer identifier
|
||||
/// </summary>
|
||||
[ForeignKey("PerformerId"),Display(Name="Préstataire")]
|
||||
public PerformerProfile PerformerProfile { get; set; }
|
||||
|
||||
public DateTime? ValidationDate {get; set;}
|
||||
|
||||
|
||||
[Display(Name="Montant prévisionel de la préstation")]
|
||||
public decimal? Previsional { get; set; }
|
||||
/// <summary>
|
||||
/// The bill
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
[Required]
|
||||
public string ActivityCode { get; set; }
|
||||
|
||||
[ForeignKey("ActivityCode"),JsonIgnore,Display(Name="Domaine d'activité")]
|
||||
public virtual Activity Context { get; set ; }
|
||||
|
||||
public bool Rejected { get; set; }
|
||||
|
||||
public DateTime RejectedAt { get; set; }
|
||||
|
||||
public abstract System.Collections.Generic.List<IBillItem> GetBillItems();
|
||||
|
||||
public bool GetIsAcquitted()
|
||||
{
|
||||
return Regularisation?.IsOk() ?? false;
|
||||
}
|
||||
|
||||
public string GetFileBaseName()
|
||||
{
|
||||
string type = GetType().Name;
|
||||
string ack = GetIsAcquitted() ? "-ack" : null;
|
||||
var bcode = Startup.BillingMap[type];
|
||||
return $"facture-{bcode}-{Id}{ack}";
|
||||
}
|
||||
|
||||
[Display(Name = "PaymentId")]
|
||||
public string PaymentId { get; set; }
|
||||
|
||||
[ForeignKey("PaymentId"), Display(Name = "Acquittement de la facture")]
|
||||
public virtual PayPalPayment Regularisation { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
using Yavsc.Billing;
|
||||
|
||||
namespace Yavsc.Models.Billing {
|
||||
public class ProportionalImpacter : IBillingImpacter
|
||||
{
|
||||
public decimal K { get; set; }
|
||||
public decimal Impact(decimal orgValue)
|
||||
{
|
||||
return orgValue * K;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Billing;
|
||||
|
||||
namespace Yavsc.Models.Billing {
|
||||
|
||||
public class ReductionCode : IBillingClause
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public ReductionCode(string descr, decimal impact) {
|
||||
Description = descr;
|
||||
impacter = new FixedImpacter(impact);
|
||||
}
|
||||
public string Description
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
IBillingImpacter impacter;
|
||||
public IBillingImpacter Impacter
|
||||
{
|
||||
get
|
||||
{
|
||||
return impacter ;
|
||||
}
|
||||
private set {
|
||||
impacter = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
|
||||
|
||||
class ChatBilling {
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public partial class histoestim
|
||||
{
|
||||
public long _id { get; set; }
|
||||
public string applicationname { get; set; }
|
||||
public DateTime datechange { get; set; }
|
||||
public long estid { get; set; }
|
||||
public int? status { get; set; }
|
||||
public string username { get; set; }
|
||||
}
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Interfaces;
|
||||
using Yavsc.Models.Access;
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc.Models.Blog
|
||||
{
|
||||
public class BlogPost : IBlogPost, ICircleAuthorized, ITaggable<long>, IIdentified<long>
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Display(Name="Identifiant du post")]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Display(Name="Contenu")][StringLength(56224)]
|
||||
public string Content { get; set; }
|
||||
|
||||
[Display(Name="Photo")][StringLength(1024)]
|
||||
public string Photo { get; set; }
|
||||
|
||||
[Display(Name="Indice de qualité")]
|
||||
public int Rate { get; set; }
|
||||
|
||||
[Display(Name="Titre")][StringLength(1024)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[Display(Name="Identifiant de l'auteur")]
|
||||
public string AuthorId { get; set; }
|
||||
|
||||
[Display(Name="Auteur")]
|
||||
[ForeignKey("AuthorId"),JsonIgnore]
|
||||
public ApplicationUser Author { set; get; }
|
||||
|
||||
[Display(Name="Visible")]
|
||||
public bool Visible { get; set; }
|
||||
|
||||
[Display(Name="Date de création")]
|
||||
public DateTime DateCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name="Créateur")]
|
||||
public string UserCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name="Dernière modification")]
|
||||
public DateTime DateModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name="Utilisateur ayant modifé le dernier")]
|
||||
public string UserModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[InverseProperty("Target")]
|
||||
[Display(Name="Liste de contrôle d'accès")]
|
||||
public virtual List<CircleAuthorizationToBlogPost> ACL { get; set; }
|
||||
|
||||
public bool AuthorizeCircle(long circleId)
|
||||
{
|
||||
return ACL?.Any( i=>i.CircleId == circleId) ?? true;
|
||||
}
|
||||
|
||||
public string GetOwnerId()
|
||||
{
|
||||
return AuthorId;
|
||||
}
|
||||
|
||||
public ICircleAuthorization[] GetACL()
|
||||
{
|
||||
return ACL.ToArray();
|
||||
}
|
||||
|
||||
public void Tag(Tag tag)
|
||||
{
|
||||
var existent = Tags.SingleOrDefault(t => t.PostId == Id && t.TagId == tag.Id);
|
||||
if (existent==null) Tags.Add(new BlogTag { PostId = Id, Tag = tag } );
|
||||
}
|
||||
|
||||
public void Detag(Tag tag)
|
||||
{
|
||||
var existent = Tags.SingleOrDefault(t => (( t.TagId == tag.Id) && t.PostId == Id));
|
||||
if (existent!=null) Tags.Remove(existent);
|
||||
}
|
||||
|
||||
public string[] GetTags()
|
||||
{
|
||||
return Tags.Select(t=>t.Tag.Name).ToArray();
|
||||
}
|
||||
|
||||
[InverseProperty("Post")]
|
||||
public virtual List<BlogTag> Tags { get; set; }
|
||||
|
||||
[InverseProperty("Post")]
|
||||
public virtual List<Comment> Comments { get; set; }
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc.Models.Blog
|
||||
{
|
||||
public partial class BlogTag
|
||||
{
|
||||
[ForeignKey("PostId")]
|
||||
public virtual BlogPost Post { get; set; }
|
||||
public long PostId { get; set; }
|
||||
|
||||
[ForeignKey("TagId")]
|
||||
public virtual Tag Tag{ get; set; }
|
||||
public long TagId { get; set; }
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Attributes.Validation;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models.Blog
|
||||
{
|
||||
public class Comment : IComment<long>, IBaseTrackedEntity
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[YaStringLength(1024)]
|
||||
public string Content { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("PostId")][JsonIgnore]
|
||||
public virtual BlogPost Post { get; set; }
|
||||
|
||||
[Required]
|
||||
public long PostId { get; set; }
|
||||
public bool Visible { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("AuthorId")][JsonIgnore]
|
||||
public virtual ApplicationUser Author {
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string AuthorId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string UserCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public DateTime DateModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string UserModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public DateTime DateCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public long GetReceiverId()
|
||||
{
|
||||
return PostId;
|
||||
}
|
||||
public void SetReceiverId(long rid)
|
||||
{
|
||||
PostId = rid;
|
||||
}
|
||||
|
||||
public long? ParentId { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("ParentId")]
|
||||
public virtual Comment Parent { get; set; }
|
||||
|
||||
[InversePropertyAttribute("Parent")]
|
||||
|
||||
public virtual List<Comment> Children { get; set; }
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
// FreeDate.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Free date.
|
||||
/// </summary>
|
||||
public interface IFreeDateSet
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the reference.
|
||||
/// </summary>
|
||||
/// <value>The reference.</value>
|
||||
IEnumerable<Period> Values { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the duration.
|
||||
/// </summary>
|
||||
/// <value>The duration.</value>
|
||||
TimeSpan Duration { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the attendees.
|
||||
/// </summary>
|
||||
/// <value>The attendees.</value>
|
||||
string UserName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the location.
|
||||
/// </summary>
|
||||
/// <value>The location.</value>
|
||||
string Location { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
//
|
||||
// IScheduledEvent.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
public interface IScheduledEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the period.
|
||||
/// </summary>
|
||||
/// <value>The period.</value>
|
||||
Periodicity Reccurence { get; set; }
|
||||
Period Period { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
//
|
||||
// Period.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Hollydays.
|
||||
/// </summary>
|
||||
public class Period {
|
||||
/// <summary>
|
||||
/// Gets or sets the start.
|
||||
/// </summary>
|
||||
/// <value>The start.</value>
|
||||
[Required,Display(Name="Début")]
|
||||
public DateTime Start { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the end.
|
||||
/// </summary>
|
||||
/// <value>The end.</value>
|
||||
[Required,Display(Name="Fin")]
|
||||
public DateTime End { get; set; }
|
||||
|
||||
public static Period operator ^ (Period foo, Period bar) {
|
||||
var min = ( DateTime.Compare(foo.Start, bar.Start) > 0 ) ? foo.Start : bar.Start;
|
||||
var max = ( DateTime.Compare(bar.End, foo.End) > 0 ) ? foo.End : bar.End;
|
||||
if (DateTime.Compare(max, min)>0) return new Period { Start = min, End = max };
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
//
|
||||
// Periodicity.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Periodicity.
|
||||
/// </summary>
|
||||
public enum Periodicity {
|
||||
/// <summary>
|
||||
/// The daily.
|
||||
/// </summary>
|
||||
Daily,
|
||||
/// <summary>
|
||||
/// The weekly.
|
||||
/// </summary>
|
||||
Weekly,
|
||||
/// <summary>
|
||||
/// The monthly.
|
||||
/// </summary>
|
||||
Monthly,
|
||||
/// <summary>
|
||||
/// The three m.
|
||||
/// </summary>
|
||||
ThreeM,
|
||||
/// <summary>
|
||||
/// The six m.
|
||||
/// </summary>
|
||||
SixM,
|
||||
/// <summary>
|
||||
/// The yearly.
|
||||
/// </summary>
|
||||
Yearly
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
//
|
||||
// PositionAndKeyphrase.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
using Models.Relationship;
|
||||
/// <summary>
|
||||
/// Position and keyphrase.
|
||||
/// </summary>
|
||||
public class PositionAndKeyphrase {
|
||||
/// <summary>
|
||||
/// The phrase.
|
||||
/// </summary>
|
||||
public string phrase;
|
||||
/// <summary>
|
||||
/// The position.
|
||||
/// </summary>
|
||||
public Position pos;
|
||||
}
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
//
|
||||
// ProvidedEvent.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Models.Messaging;
|
||||
using Yavsc.Models.Access;
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Provided event.
|
||||
/// </summary>
|
||||
public class ProvidedEvent : BaseEvent {
|
||||
/// <summary>
|
||||
/// The privacy.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Publishing Privacy;
|
||||
|
||||
public override string CreateBody()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
//
|
||||
// Schedule.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//
|
||||
// Calendar.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Le calendrier, l'emploi du temps.
|
||||
/// </summary>
|
||||
public class Schedule {
|
||||
|
||||
[Key,Required]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
[Display(Name="Professionnel")]
|
||||
public virtual ApplicationUser Owner { get ; set; }
|
||||
|
||||
public ScheduledEvent [] Events { get ; set; }
|
||||
}
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
//
|
||||
// ScheduledEvent.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
public class ScheduledEvent : IScheduledEvent
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public Period Period
|
||||
{
|
||||
get;
|
||||
|
||||
set;
|
||||
}
|
||||
|
||||
public Periodicity Reccurence
|
||||
{
|
||||
get;
|
||||
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
//
|
||||
// WeekDay.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Week day.
|
||||
/// </summary>
|
||||
public enum WeekDay:int {
|
||||
/// <summary>
|
||||
/// The monday (0).
|
||||
/// </summary>
|
||||
Monday=0,
|
||||
/// <summary>
|
||||
/// The tuesday.
|
||||
/// </summary>
|
||||
Tuesday,
|
||||
/// <summary>
|
||||
/// The wednesday.
|
||||
/// </summary>
|
||||
Wednesday,
|
||||
/// <summary>
|
||||
/// The thursday.
|
||||
/// </summary>
|
||||
Thursday,
|
||||
/// <summary>
|
||||
/// The friday.
|
||||
/// </summary>
|
||||
Friday,
|
||||
/// <summary>
|
||||
/// The saturday.
|
||||
/// </summary>
|
||||
Saturday,
|
||||
/// <summary>
|
||||
/// The sunday.
|
||||
/// </summary>
|
||||
Sunday
|
||||
}
|
||||
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
//
|
||||
// Connection.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatConnection : Abstract.Streaming.IChatConnection<ChatRoomPresence>
|
||||
{
|
||||
[JsonIgnore,Required]
|
||||
public string ApplicationUserId { get; set; }
|
||||
|
||||
[ForeignKey("ApplicationUserId"),JsonIgnore]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[Key]
|
||||
public string ConnectionId { get; set; }
|
||||
|
||||
public string UserAgent { get; set; }
|
||||
|
||||
public bool Connected { get; set; }
|
||||
|
||||
[InverseProperty("ChatUserConnection")]
|
||||
public virtual List<ChatRoomPresence> Rooms { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Abstract.Streaming;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatRoom: IChatRoom<ChatRoomPresence>
|
||||
{
|
||||
[StringLengthAttribute(1023,MinimumLength=1)]
|
||||
public string Topic { get; set; }
|
||||
|
||||
[Key]
|
||||
[StringLengthAttribute(255,MinimumLength=1)]
|
||||
public string Name { get; set;}
|
||||
|
||||
public string ApplicationUserId { get; set; }
|
||||
|
||||
[ForeignKey("ApplicationUserId")]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[InverseProperty("Room")]
|
||||
public virtual List<ChatRoomPresence> UserList { get; set;}
|
||||
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Abstract.Streaming;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatRoomPresence: IChatRoomUsage
|
||||
{
|
||||
public string ChannelName { get; set; }
|
||||
[ForeignKey("ChannelName")]
|
||||
public virtual ChatRoom Room { get; set; }
|
||||
|
||||
public string ChatUserConnectionId { get; set; }
|
||||
|
||||
[ForeignKey("ChatUserConnectionId")]
|
||||
public virtual ChatConnection ChatUserConnection { get; set; }
|
||||
|
||||
public ChatRoomUsageLevel Level
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Cratie.AName
|
||||
{
|
||||
public class NameSubmission : Submission
|
||||
{
|
||||
[RegularExpression(@"[a-zA-Z]+", ErrorMessage = "Nom invalide (seules les lettres de l'alphabet sont autorisées).", ErrorMessageResourceName = "EInvalidName")]
|
||||
|
||||
public string FirstChoice {get; set;}
|
||||
[RegularExpression(@"[a-zA-Z]+", ErrorMessage = "Nom invalide (seules les lettres de l'alphabet sont autorisées).", ErrorMessageResourceName = "EInvalidName")]
|
||||
public string SecondChoice {get; set;}
|
||||
[RegularExpression(@"[a-zA-Z]+", ErrorMessage = "Nom invalide (seules les lettres de l'alphabet sont autorisées).", ErrorMessageResourceName = "EInvalidName")]
|
||||
public string ThirdChoice {get; set;}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Cratie
|
||||
{
|
||||
public class Option: IBaseTrackedEntity
|
||||
{
|
||||
public string CodeScrutin { get; set; }
|
||||
public string Code { get; set ; }
|
||||
public string Description { get; set; }
|
||||
public DateTime DateCreated { get ; set ; }
|
||||
public string UserCreated { get ; set ; }
|
||||
public DateTime DateModified { get ; set ; }
|
||||
public string UserModified { get ; set ; }
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Cratie
|
||||
{
|
||||
public class Scrutin : IBaseTrackedEntity
|
||||
{
|
||||
[Key]
|
||||
public string Code { get; set ; }
|
||||
public string Description { get ; set ; }
|
||||
public DateTime DateCreated { get; set; }
|
||||
public string UserCreated { get; set; }
|
||||
public DateTime DateModified { get; set; }
|
||||
public string UserModified { get; set; }
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Cratie
|
||||
{
|
||||
public class Submission
|
||||
{
|
||||
[ForeignKey("CodeScrutin")]
|
||||
public virtual Scrutin Context { get; set; }
|
||||
public string CodeScrutin { get; set ; }
|
||||
|
||||
[ForeignKey("CodeOption")]
|
||||
public virtual Option Choice { get; set; }
|
||||
public string CodeOption { get; set; }
|
||||
|
||||
[ForeignKey("AuthorId")]
|
||||
public virtual ApplicationUser Author { get; set; }
|
||||
public string AuthorId { get ; set ;}
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
//
|
||||
// Color.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Drawing
|
||||
{
|
||||
public class Color
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public Color(){
|
||||
|
||||
}
|
||||
public Color(Color c)
|
||||
{
|
||||
Red=c.Red;
|
||||
Green=c.Green;
|
||||
Blue=c.Blue;
|
||||
Name=c.Name;
|
||||
}
|
||||
public byte Red {get;set;}
|
||||
public byte Green {get;set;}
|
||||
public byte Blue {get;set;}
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
|
||||
//
|
||||
// IDocument.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models {
|
||||
|
||||
public class Parameter {
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
[Obsolete("Templates are ala Razor")]
|
||||
public interface IDocument {
|
||||
string Template { get; set; }
|
||||
Parameter [] Parameters { get; set; }
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
|
||||
//
|
||||
// FileRecievedInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
using Yavsc.Abstract.FileSystem;
|
||||
|
||||
namespace Yavsc.Models.FileSystem
|
||||
{
|
||||
public class FileRecievedInfo : IFileRecievedInfo
|
||||
{
|
||||
public FileRecievedInfo()
|
||||
{
|
||||
QuotaOffensed = Overriden = false;
|
||||
MimeType = DestDir = FileName = null;
|
||||
}
|
||||
|
||||
public string MimeType { get; set; }
|
||||
public string DestDir { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public bool Overriden { get; set; }
|
||||
|
||||
public bool QuotaOffensed { get; set; }
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Forms
|
||||
{
|
||||
|
||||
public class Form
|
||||
{
|
||||
[Key]
|
||||
public string Id {get; set;}
|
||||
public string Summary { get; set; }
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Forms.Validation
|
||||
{
|
||||
public class Method
|
||||
{
|
||||
[Key]
|
||||
public string Name {get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO localisation ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required]
|
||||
public string ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace Yavsc.Models.Forms.Validation
|
||||
{
|
||||
public class Required : Method
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
//
|
||||
// GoogleAuthToken.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Auth token, as they are received.
|
||||
/// </summary>
|
||||
public class AuthToken {
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the access token.
|
||||
/// </summary>
|
||||
/// <value>The access token.</value>
|
||||
public string access_token { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier token.
|
||||
/// </summary>
|
||||
/// <value>The identifier token.</value>
|
||||
public string id_token { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the token.
|
||||
/// </summary>
|
||||
/// <value>The type of the token.</value>
|
||||
public string token_type { get; set ; }
|
||||
/// <summary>
|
||||
/// Gets or sets the refresh token.
|
||||
/// </summary>
|
||||
/// <value>The refresh token.</value>
|
||||
public string refresh_token { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the expires in.
|
||||
/// </summary>
|
||||
/// <value>The expires in.</value>
|
||||
public int expires_in { get; set; }
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
//
|
||||
// CalendarEventList.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Calendar event list.
|
||||
/// </summary>
|
||||
[Obsolete("use GoogleUse.Apis")]
|
||||
public class CalendarEventList
|
||||
{
|
||||
/// <summary>
|
||||
/// The next page token.
|
||||
/// </summary>
|
||||
public string nextPageToken;
|
||||
/// <summary>
|
||||
/// The next sync token.
|
||||
/// </summary>
|
||||
public string nextSyncToken;
|
||||
/// <summary>
|
||||
/// The items.
|
||||
/// </summary>
|
||||
public Resource [] items ;
|
||||
}
|
||||
}
|
||||
|
@ -1,56 +0,0 @@
|
||||
//
|
||||
// CalendarList.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Calendar list.
|
||||
/// </summary>
|
||||
[Obsolete("use Google.Apis")]
|
||||
public class CalendarList {
|
||||
/// <summary>
|
||||
/// Gets or sets the kind.
|
||||
/// </summary>
|
||||
/// <value>The kind.</value>
|
||||
public string kind { get; set;}
|
||||
/// <summary>
|
||||
/// Gets or sets the etag.
|
||||
/// </summary>
|
||||
/// <value>The etag.</value>
|
||||
public string etag { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the next sync token.
|
||||
/// </summary>
|
||||
/// <value>The next sync token.</value>
|
||||
public string description { get; set; }
|
||||
public string summpary { get; set; }
|
||||
public string nextSyncToken { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the items.
|
||||
/// </summary>
|
||||
/// <value>The items.</value>
|
||||
public CalendarListEntry[] items { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
//
|
||||
// CalendarListEntry.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Calendar list entry.
|
||||
/// </summary>
|
||||
///
|
||||
[Obsolete("use GoogleUse.Apis")]
|
||||
public class CalendarListEntry {
|
||||
/// <summary>
|
||||
/// Gets or sets the kind.
|
||||
/// </summary>
|
||||
/// <value>The kind.</value>
|
||||
public string kind { get; set;}
|
||||
/// <summary>
|
||||
/// Gets or sets the etag.
|
||||
/// </summary>
|
||||
/// <value>The etag.</value>
|
||||
public string etag { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
public string id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the summary.
|
||||
/// </summary>
|
||||
/// <value>The summary.</value>
|
||||
public string summary { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the description.
|
||||
/// </summary>
|
||||
/// <value>The description.</value>
|
||||
public string description { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the time zone.
|
||||
/// </summary>
|
||||
/// <value>The time zone.</value>
|
||||
public string timeZone { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the color identifier.
|
||||
/// </summary>
|
||||
/// <value>The color identifier.</value>
|
||||
public string colorId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the background.
|
||||
/// </summary>
|
||||
/// <value>The color of the background.</value>
|
||||
public string backgroundColor { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the foreground.
|
||||
/// </summary>
|
||||
/// <value>The color of the foreground.</value>
|
||||
public string foregroundColor { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.CalendarListEntry"/> is selected.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if selected; otherwise, <c>false</c>.</value>
|
||||
public bool selected { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.CalendarListEntry"/> is primary.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if primary; otherwise, <c>false</c>.</value>
|
||||
public bool primary { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the access role.
|
||||
/// </summary>
|
||||
/// <value>The access role.</value>
|
||||
public string accessRole { get; set; }
|
||||
/// <summary>
|
||||
/// Reminder.
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default reminders.
|
||||
/// </summary>
|
||||
/// <value>The default reminders.</value>
|
||||
public Reminder[] defaultReminders { get; set; }
|
||||
/* "notificationSettings": { "notifications":
|
||||
[ { "type": "eventCreation", "method": "email" },
|
||||
{ "type": "eventChange", "method": "email" },
|
||||
{ "type": "eventCancellation", "method": "email" },
|
||||
{ "type": "eventResponse", "method": "email" } ] }, "primary": true },
|
||||
|
||||
*/
|
||||
}
|
||||
/// <summary>
|
||||
/// Reminder.
|
||||
/// </summary>
|
||||
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google.Calendar
|
||||
{
|
||||
[Obsolete("use GoogleUse.Apis")]
|
||||
public class Reminder {
|
||||
/// <summary>
|
||||
/// Gets or sets the method.
|
||||
/// </summary>
|
||||
/// <value>The method.</value>
|
||||
public string method { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the minutes.
|
||||
/// </summary>
|
||||
/// <value>The minutes.</value>
|
||||
public int minutes { get; set; }
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
//
|
||||
// GDate.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// G date.
|
||||
/// </summary>
|
||||
public class GDate {
|
||||
/// <summary>
|
||||
/// The date.
|
||||
/// </summary>
|
||||
public DateTime? date;
|
||||
/// <summary>
|
||||
/// The datetime.
|
||||
/// </summary>
|
||||
public DateTime? datetime;
|
||||
/// <summary>
|
||||
/// The time zone.
|
||||
/// </summary>
|
||||
public string timeZone;
|
||||
}
|
||||
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
//
|
||||
// MessageWithPayLoad.cs
|
||||
//
|
||||
// Author:
|
||||
// paul <>
|
||||
//
|
||||
// Copyright (c) 2015 paul
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using Yavsc.Models.Messaging;
|
||||
|
||||
namespace Yavsc.Models.Google.Messaging
|
||||
{
|
||||
// https://gcm-http.googleapis.com/gcm/send
|
||||
/// <summary>
|
||||
/// Message with payload.
|
||||
/// </summary>
|
||||
public class MessageWithPayload<T> {
|
||||
/// <summary>
|
||||
/// To.
|
||||
/// </summary>
|
||||
public string to;
|
||||
/// <summary>
|
||||
/// The registration identifiers.
|
||||
/// </summary>
|
||||
public string [] registration_ids;
|
||||
/// <summary>
|
||||
/// The data.
|
||||
/// </summary>
|
||||
public T data ;
|
||||
/// <summary>
|
||||
/// The notification.
|
||||
/// </summary>
|
||||
public Notification notification;
|
||||
/// <summary>
|
||||
/// The collapse key.
|
||||
/// </summary>
|
||||
public string collapse_key; // in order to collapse ...
|
||||
/// <summary>
|
||||
/// The priority.
|
||||
/// </summary>
|
||||
public int priority; // between 0 and 10, 10 is the lowest!
|
||||
/// <summary>
|
||||
/// The content available.
|
||||
/// </summary>
|
||||
public bool content_available;
|
||||
/// <summary>
|
||||
/// The delay while idle.
|
||||
/// </summary>
|
||||
public bool delay_while_idle;
|
||||
/// <summary>
|
||||
/// The time to live.
|
||||
/// </summary>
|
||||
public int time_to_live; // seconds
|
||||
/// <summary>
|
||||
/// The name of the restricted package.
|
||||
/// </summary>
|
||||
public string restricted_package_name;
|
||||
/// <summary>
|
||||
/// The dry run.
|
||||
/// </summary>
|
||||
public bool dry_run;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,69 +0,0 @@
|
||||
//
|
||||
// MessageWithPayloadResponse.cs
|
||||
//
|
||||
// Author:
|
||||
// paul <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 paul
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google.Messaging
|
||||
{
|
||||
// https://gcm-http.googleapis.com/gcm/send
|
||||
|
||||
/// <summary>
|
||||
/// Message with payload response.
|
||||
/// </summary>
|
||||
public class MessageWithPayloadResponse {
|
||||
/// <summary>
|
||||
/// The multicast identifier.
|
||||
/// </summary>
|
||||
public string multicast_id;
|
||||
/// <summary>
|
||||
/// The success count.
|
||||
/// </summary>
|
||||
public int success;
|
||||
/// <summary>
|
||||
/// The failure count.
|
||||
/// </summary>
|
||||
public int failure;
|
||||
/// <summary>
|
||||
/// The canonical identifiers... ?!?
|
||||
/// </summary>
|
||||
public string canonical_ids;
|
||||
/// <summary>
|
||||
/// Detailled result.
|
||||
/// </summary>
|
||||
public class Result {
|
||||
/// <summary>
|
||||
/// The message identifier.
|
||||
/// </summary>
|
||||
public string message_id;
|
||||
/// <summary>
|
||||
/// The registration identifier.
|
||||
/// </summary>
|
||||
public string registration_id;
|
||||
/// <summary>
|
||||
/// The error.
|
||||
/// </summary>
|
||||
public string error;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The results.
|
||||
/// </summary>
|
||||
public Result [] results;
|
||||
}
|
||||
}
|
@ -1,165 +0,0 @@
|
||||
//
|
||||
// People.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// People.
|
||||
/// </summary>
|
||||
public class People {
|
||||
/// <summary>
|
||||
/// Gets or sets the kind.
|
||||
/// </summary>
|
||||
/// <value>The kind.</value>
|
||||
public string kind { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the etag.
|
||||
/// </summary>
|
||||
/// <value>The etag.</value>
|
||||
public string etag { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the gender.
|
||||
/// </summary>
|
||||
/// <value>The gender.</value>
|
||||
public string gender { get; set; }
|
||||
/// <summary>
|
||||
/// E mail.
|
||||
/// </summary>
|
||||
public class EMail{
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public string value { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the type.
|
||||
/// </summary>
|
||||
/// <value>The type.</value>
|
||||
public string type { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the emails.
|
||||
/// </summary>
|
||||
/// <value>The emails.</value>
|
||||
public EMail[] emails { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the object.
|
||||
/// </summary>
|
||||
/// <value>The type of the object.</value>
|
||||
public string objectType { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
public string id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the display name.
|
||||
/// </summary>
|
||||
/// <value>The display name.</value>
|
||||
public string displayName { get; set; }
|
||||
/// <summary>
|
||||
/// Name.
|
||||
/// </summary>
|
||||
public class Name {
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the family.
|
||||
/// </summary>
|
||||
/// <value>The name of the family.</value>
|
||||
public string familyName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the given.
|
||||
/// </summary>
|
||||
/// <value>The name of the given.</value>
|
||||
public string givenName { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public Name name { get; set;}
|
||||
/// <summary>
|
||||
/// Gets or sets the URL.
|
||||
/// </summary>
|
||||
/// <value>The URL.</value>
|
||||
public string url { get; set; }
|
||||
/// <summary>
|
||||
/// Image.
|
||||
/// </summary>
|
||||
public class Image {
|
||||
/// <summary>
|
||||
/// Gets or sets the URL.
|
||||
/// </summary>
|
||||
/// <value>The URL.</value>
|
||||
public string url { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People.Image"/> is default.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if is default; otherwise, <c>false</c>.</value>
|
||||
public bool isDefault { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the image.
|
||||
/// </summary>
|
||||
/// <value>The image.</value>
|
||||
public Image image { get; set; }
|
||||
/// <summary>
|
||||
/// Place.
|
||||
/// </summary>
|
||||
public class Place {
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public string value { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People.Place"/> is primary.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if primary; otherwise, <c>false</c>.</value>
|
||||
public bool primary { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the places lived.
|
||||
/// </summary>
|
||||
/// <value>The places lived.</value>
|
||||
public Place[] placesLived { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People"/> is plus user.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if is plus user; otherwise, <c>false</c>.</value>
|
||||
public bool isPlusUser { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the language.
|
||||
/// </summary>
|
||||
/// <value>The language.</value>
|
||||
public string language { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the circled by count.
|
||||
/// </summary>
|
||||
/// <value>The circled by count.</value>
|
||||
public int circledByCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People"/> is verified.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if verified; otherwise, <c>false</c>.</value>
|
||||
public bool verified { get; set; }
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
//
|
||||
// Resource.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Resource.
|
||||
/// </summary>
|
||||
public class Resource {
|
||||
public string id;
|
||||
public string location;
|
||||
public string status;
|
||||
public GDate start;
|
||||
public GDate end;
|
||||
public string recurence;
|
||||
|
||||
public string description;
|
||||
|
||||
public string summary;
|
||||
|
||||
/// <summary>
|
||||
/// Available <=> transparency == "transparent"
|
||||
/// </summary>
|
||||
public string transparency;
|
||||
}
|
||||
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
//
|
||||
// Entity.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity.
|
||||
/// </summary>
|
||||
public class Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// The I.
|
||||
/// </summary>
|
||||
public string ID;
|
||||
/// <summary>
|
||||
/// The name.
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// The type: AUTOMOBILE: A car or passenger vehicle.
|
||||
/// * TRUCK: A truck or cargo vehicle.
|
||||
/// * WATERCRAFT: A boat or other waterborne vehicle.
|
||||
/// * PERSON: A person.
|
||||
/// </summary>
|
||||
public string Type;
|
||||
}
|
||||
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
//
|
||||
// EntityQuery.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity query.
|
||||
/// </summary>
|
||||
public class EntityQuery {
|
||||
/// <summary>
|
||||
/// The entity identifiers.
|
||||
/// </summary>
|
||||
public string [] EntityIds;
|
||||
/// <summary>
|
||||
/// The minimum identifier.
|
||||
/// </summary>
|
||||
public string MinId;
|
||||
}
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
|
||||
//
|
||||
// BrusherProfile.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
using Workflow;
|
||||
using Relationship;
|
||||
using Calendar;
|
||||
|
||||
public class BrusherProfile : ISpecializationSettings
|
||||
{
|
||||
public BrusherProfile()
|
||||
{
|
||||
}
|
||||
|
||||
[Key]
|
||||
public string UserId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[JsonIgnore,ForeignKey("UserId")]
|
||||
public virtual PerformerProfile BaseProfile { get; set; }
|
||||
|
||||
[Display(Name="Portfolio")]
|
||||
public virtual List<HyperLink> Links { get; set; }
|
||||
|
||||
|
||||
[Display(Name="Rayon d'action"),DisplayFormat(DataFormatString="{0} km")]
|
||||
|
||||
public int ActionDistance { get; set; }
|
||||
/// <summary>
|
||||
/// StartOfTheDay In munutes
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
[DisplayFormat(ConvertEmptyStringToNull = true, NullDisplayText = "[Pas d'emploi du temps spécifié]")]
|
||||
[Display(Name="Emploi du temps")]
|
||||
public virtual Schedule Schedule { get; set; }
|
||||
|
||||
[Display(Name="Coupe femme cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal WomenLongCutPrice { get; set; }
|
||||
|
||||
[Display(Name="Coupe femme cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal WomenHalfCutPrice { get; set; }
|
||||
|
||||
[Display(Name="Coupe femme cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal WomenShortCutPrice { get; set; }
|
||||
|
||||
[Display(Name="Coupe homme"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ManCutPrice { get; set; }
|
||||
|
||||
[Display(Name="brushing homme"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ManBrushPrice { get; set; }
|
||||
|
||||
|
||||
|
||||
[Display(Name="Coupe enfant"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal KidCutPrice { get; set; }
|
||||
|
||||
[Display(Name="Brushing cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal LongBrushingPrice { get; set; }
|
||||
|
||||
[Display(Name="Brushing cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfBrushingPrice { get; set; }
|
||||
|
||||
[Display(Name="Brushing cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortBrushingPrice { get; set; }
|
||||
|
||||
[Display(Name="couleur cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal LongColorPrice { get; set; }
|
||||
|
||||
[Display(Name="couleur cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfColorPrice { get; set; }
|
||||
|
||||
[Display(Name="couleur cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortColorPrice { get; set; }
|
||||
|
||||
[Display(Name="couleur multiple cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal LongMultiColorPrice { get; set; }
|
||||
|
||||
[Display(Name="couleur multiple cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfMultiColorPrice { get; set; }
|
||||
|
||||
[Display(Name="couleur multiple cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortMultiColorPrice { get; set; }
|
||||
|
||||
[Display(Name="permanente cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal LongPermanentPrice { get; set; }
|
||||
|
||||
[Display(Name="permanente cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfPermanentPrice { get; set; }
|
||||
|
||||
[Display(Name="permanente cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortPermanentPrice { get; set; }
|
||||
|
||||
[Display(Name="défrisage cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal LongDefrisPrice { get; set; }
|
||||
|
||||
[Display(Name="défrisage cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfDefrisPrice { get; set; }
|
||||
|
||||
[Display(Name="défrisage cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortDefrisPrice { get; set; }
|
||||
|
||||
[Display(Name="mêches sur cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal LongMechPrice { get; set; }
|
||||
|
||||
[Display(Name="mêches sur cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfMechPrice { get; set; }
|
||||
|
||||
[Display(Name="mêches sur cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortMechPrice { get; set; }
|
||||
|
||||
[Display(Name="balayage cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal LongBalayagePrice { get; set; }
|
||||
|
||||
[Display(Name="balayage cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfBalayagePrice { get; set; }
|
||||
|
||||
[Display(Name="balayage cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortBalayagePrice { get; set; }
|
||||
|
||||
|
||||
[Display(Name="Mise en plis cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal LongFoldingPrice { get; set; }
|
||||
|
||||
[Display(Name="Mise en plis cheveux mi-longs"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal HalfFoldingPrice { get; set; }
|
||||
|
||||
[Display(Name="Mise en plis cheveux courts"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal ShortFoldingPrice { get; set; }
|
||||
|
||||
[Display(Name="Shampoing"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal ShampooPrice { get; set; }
|
||||
|
||||
[Display(Name="Soin"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal CarePrice { get; set; }
|
||||
|
||||
[Display(Name="Remise au forfait coupe+technique"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal FlatFeeDiscount { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public enum HairCutGenders : int
|
||||
{
|
||||
[Display(Name="Femme")]
|
||||
Women,
|
||||
|
||||
[Display(Name="Homme")]
|
||||
Man,
|
||||
|
||||
[Display(Name="Enfant")]
|
||||
Kid
|
||||
|
||||
}
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System.Linq;
|
||||
|
||||
using Yavsc.Interfaces.Workflow;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.ViewModels.PayPal;
|
||||
using Yavsc.Helpers;
|
||||
|
||||
namespace Yavsc.Models.HairCut
|
||||
{
|
||||
public class HairCutPayementEvent: IEvent
|
||||
{
|
||||
public HairCutPayementEvent(string sender, PaymentInfo info, HairCutQuery query, IStringLocalizer localizer)
|
||||
{
|
||||
Sender = sender;
|
||||
this.query = query;
|
||||
invoiceId = info.DetailsFromPayPal.GetExpressCheckoutDetailsResponseDetails.InvoiceID;
|
||||
payerName = info.DetailsFromPayPal.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.Name;
|
||||
phone = info.DetailsFromPayPal.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.Phone;
|
||||
payerEmail = info.DetailsFromPayPal.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Payer;
|
||||
amount = string.Join(", ",
|
||||
info.DetailsFromPayPal.GetExpressCheckoutDetailsResponseDetails.PaymentDetails.Select(
|
||||
p => $"{p.OrderTotal.value} {p.OrderTotal.currencyID}"));
|
||||
gender = query.Prestation.Gender;
|
||||
date = query.EventDate?.ToString("dd MM yyyy hh:mm");
|
||||
lieu = query.Location.Address;
|
||||
clientFinal = (gender == HairCutGenders.Women) ? localizer["Women"] +
|
||||
" " + localizer[query.Prestation.Length.ToString()] : localizer[gender.ToString()];
|
||||
token = info.DetailsFromPayPal.GetExpressCheckoutDetailsResponseDetails.Token;
|
||||
payerId = info.DetailsFromPayPal.GetExpressCheckoutDetailsResponseDetails.PayerInfo.PayerID;
|
||||
}
|
||||
|
||||
public string Topic => "/topic/HaircutPayment";
|
||||
|
||||
public string Sender { get; set; }
|
||||
|
||||
HairCutQuery query;
|
||||
|
||||
private string invoiceId;
|
||||
private string payerName;
|
||||
private string phone;
|
||||
private string payerEmail;
|
||||
private string amount;
|
||||
private HairCutGenders gender;
|
||||
private string date;
|
||||
private string lieu;
|
||||
private string clientFinal;
|
||||
private string token;
|
||||
private string payerId;
|
||||
|
||||
public string CreateBody()
|
||||
{
|
||||
return $@"# Paiment confirmé: {amount}
|
||||
|
||||
Effectué par : {payerName} [{payerEmail}]
|
||||
Identifiant PayPal du paiment: {token}
|
||||
Identifiant PayPal du payeur: {payerId}
|
||||
Identifiant de la facture sur site: {invoiceId}
|
||||
|
||||
|
||||
# La prestation concernée:
|
||||
|
||||
Demandeur: {query.Client.UserName}
|
||||
|
||||
Date: {date}
|
||||
|
||||
Lieu: {lieu}
|
||||
|
||||
Le client final: {clientFinal}
|
||||
|
||||
{query.GetBillText()}
|
||||
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
@ -1,412 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Relationship;
|
||||
using Yavsc.Billing;
|
||||
using System.Globalization;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Models.Messaging;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Yavsc.ViewModels.PayPal;
|
||||
using Yavsc.Models.HairCut;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public class HairCutQuery : NominativeServiceCommand
|
||||
{
|
||||
|
||||
// Bill description
|
||||
public override string GetDescription()
|
||||
{
|
||||
string type = Startup.GlobalLocalizer[this.GetType().Name];
|
||||
string gender = Startup.GlobalLocalizer[this.Prestation.Gender.ToString()];
|
||||
|
||||
return $"{type} ({gender})";
|
||||
}
|
||||
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
override public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public long PrestationId { get; set; }
|
||||
|
||||
[ForeignKey("PrestationId"), Required, Display(Name = "Préstation")]
|
||||
public virtual HairPrestation Prestation { get; set; }
|
||||
|
||||
[ForeignKey("LocationId")]
|
||||
[Display(Name = "Lieu du rendez-vous")]
|
||||
[DisplayFormat(ConvertEmptyStringToNull = true, NullDisplayText = "[Pas de lieu spécifié]")]
|
||||
public virtual Location Location { get; set; }
|
||||
|
||||
[Display(Name = "Date et heure")]
|
||||
[DisplayFormat(NullDisplayText = "[Pas de date ni heure]", ApplyFormatInEditMode = true, DataFormatString = "{0:d}")]
|
||||
public DateTime? EventDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public long? LocationId
|
||||
{
|
||||
get;
|
||||
|
||||
set;
|
||||
}
|
||||
|
||||
[Display(Name = "Informations complémentaires"),
|
||||
StringLengthAttribute(512)]
|
||||
[DisplayFormat(ConvertEmptyStringToNull = true, NullDisplayText = "[pas d'informations complémentaires]")]
|
||||
public string AdditionalInfo { get; set; }
|
||||
|
||||
|
||||
|
||||
public override List<IBillItem> GetBillItems()
|
||||
{
|
||||
string longhairsuffix = " (cheveux longs)";
|
||||
string halflonghairsuffix = " (cheveux mi-longs)";
|
||||
string shorthairsuffix = " (cheveux courts)";
|
||||
|
||||
List<IBillItem> bill = new List<IBillItem>();
|
||||
|
||||
if (this.Prestation==null) throw new InvalidOperationException("Prestation property is null");
|
||||
if (this.SelectedProfile==null) throw new InvalidOperationException("SelectedProfile property is null");
|
||||
// Le shampoing
|
||||
if (this.Prestation.Shampoo)
|
||||
bill.Add(new CommandLine { Name = "Shampoing", Description="Shampoing", UnitaryCost = SelectedProfile.ShampooPrice });
|
||||
|
||||
// la coupe
|
||||
if (Prestation.Cut) {
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
|
||||
Name = "Coupe",
|
||||
Description = $"Coupe "+Startup.GlobalLocalizer[Prestation.Gender.ToString()]+ " "+
|
||||
(Prestation.Gender == HairCutGenders.Women ?
|
||||
Prestation.Length == HairLength.Long ? longhairsuffix :
|
||||
Prestation.Length == HairLength.HalfLong ? halflonghairsuffix :
|
||||
shorthairsuffix: null),
|
||||
UnitaryCost =
|
||||
Prestation.Gender == HairCutGenders.Women ?
|
||||
Prestation.Length == HairLength.Long ? SelectedProfile.WomenLongCutPrice :
|
||||
Prestation.Length == HairLength.HalfLong ? SelectedProfile.WomenHalfCutPrice :
|
||||
SelectedProfile.WomenShortCutPrice : Prestation.Gender == HairCutGenders.Man ?
|
||||
SelectedProfile.ManCutPrice : SelectedProfile.KidCutPrice
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Les techniques
|
||||
switch (Prestation.Tech)
|
||||
{
|
||||
case HairTechnos.Color:
|
||||
{
|
||||
bool multicolor = Prestation.Taints.Count > 1;
|
||||
string name = multicolor ? "Couleur" : "Multi-couleur";
|
||||
switch (Prestation.Length)
|
||||
{
|
||||
case HairLength.Long:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + longhairsuffix,
|
||||
UnitaryCost = multicolor ? SelectedProfile.LongMultiColorPrice :
|
||||
SelectedProfile.LongColorPrice
|
||||
});
|
||||
break;
|
||||
case HairLength.HalfLong:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + halflonghairsuffix,
|
||||
UnitaryCost = multicolor ? SelectedProfile.HalfMultiColorPrice : SelectedProfile.HalfColorPrice
|
||||
});
|
||||
break;
|
||||
default:
|
||||
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name = name + shorthairsuffix,
|
||||
UnitaryCost = multicolor ? SelectedProfile.ShortMultiColorPrice : SelectedProfile.ShortColorPrice
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Balayage:
|
||||
{
|
||||
string name = "Balayage";
|
||||
switch (Prestation.Length)
|
||||
{
|
||||
case HairLength.Long:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + longhairsuffix,
|
||||
UnitaryCost = SelectedProfile.LongBalayagePrice
|
||||
});
|
||||
break;
|
||||
case HairLength.HalfLong:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + halflonghairsuffix,
|
||||
UnitaryCost = SelectedProfile.HalfBalayagePrice
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + shorthairsuffix,
|
||||
UnitaryCost = SelectedProfile.ShortBalayagePrice
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Defris:
|
||||
{
|
||||
string name = "Defrisage";
|
||||
switch (Prestation.Length)
|
||||
{
|
||||
case HairLength.Long:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + longhairsuffix,
|
||||
UnitaryCost = SelectedProfile.LongDefrisPrice
|
||||
});
|
||||
break;
|
||||
case HairLength.HalfLong:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + halflonghairsuffix,
|
||||
UnitaryCost = SelectedProfile.HalfDefrisPrice
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + shorthairsuffix,
|
||||
UnitaryCost = SelectedProfile.ShortDefrisPrice
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Mech:
|
||||
{
|
||||
string name = "Mèches";
|
||||
switch (Prestation.Length)
|
||||
{
|
||||
case HairLength.Long:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + longhairsuffix,
|
||||
UnitaryCost = SelectedProfile.LongMechPrice
|
||||
});
|
||||
break;
|
||||
case HairLength.HalfLong:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + halflonghairsuffix,
|
||||
UnitaryCost = SelectedProfile.HalfMechPrice
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + shorthairsuffix,
|
||||
UnitaryCost = SelectedProfile.ShortMechPrice
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Permanent:
|
||||
{
|
||||
string name = "Mèches";
|
||||
switch (Prestation.Length)
|
||||
{
|
||||
case HairLength.Long:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + longhairsuffix,
|
||||
UnitaryCost = SelectedProfile.LongPermanentPrice
|
||||
});
|
||||
break;
|
||||
case HairLength.HalfLong:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + halflonghairsuffix,
|
||||
UnitaryCost = SelectedProfile.HalfPermanentPrice
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + shorthairsuffix,
|
||||
UnitaryCost = SelectedProfile.ShortPermanentPrice
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Les coiffages
|
||||
switch (Prestation.Dressing)
|
||||
{
|
||||
case HairDressings.Brushing:
|
||||
{
|
||||
string name = "Brushing";
|
||||
|
||||
|
||||
switch (Prestation.Gender)
|
||||
{
|
||||
case HairCutGenders.Women:
|
||||
switch (Prestation.Length)
|
||||
{
|
||||
case HairLength.Long:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + longhairsuffix,
|
||||
UnitaryCost = SelectedProfile.LongBrushingPrice
|
||||
});
|
||||
break;
|
||||
case HairLength.HalfLong:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + halflonghairsuffix,
|
||||
UnitaryCost = SelectedProfile.HalfBrushingPrice
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + shorthairsuffix,
|
||||
UnitaryCost = SelectedProfile.ShortBrushingPrice
|
||||
});
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HairCutGenders.Man:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + shorthairsuffix,
|
||||
UnitaryCost = SelectedProfile.ManBrushPrice
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HairDressings.Coiffage:
|
||||
// est offert
|
||||
/* bill.Add(new CommandLine
|
||||
{
|
||||
Name = "Coiffage (offert)",
|
||||
UnitaryCost = 0m
|
||||
}); */
|
||||
break;
|
||||
case HairDressings.Folding:
|
||||
{
|
||||
string name = "Mise en plis";
|
||||
|
||||
switch (Prestation.Length)
|
||||
{
|
||||
case HairLength.Long:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + longhairsuffix,
|
||||
UnitaryCost = SelectedProfile.LongFoldingPrice
|
||||
});
|
||||
break;
|
||||
case HairLength.HalfLong:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + halflonghairsuffix,
|
||||
UnitaryCost = SelectedProfile.HalfFoldingPrice
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bill.Add(new CommandLine
|
||||
{
|
||||
Name = name,
|
||||
Description = name + shorthairsuffix,
|
||||
UnitaryCost = SelectedProfile.ShortFoldingPrice
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// les soins
|
||||
if (Prestation.Cares) {
|
||||
bill.Add(new CommandLine { Name = "Soins",
|
||||
Description = "Soins",
|
||||
UnitaryCost = SelectedProfile.CarePrice });
|
||||
|
||||
}
|
||||
return bill;
|
||||
}
|
||||
|
||||
public HairCutPayementEvent CreatePaymentEvent(PaymentInfo info, IStringLocalizer localizer)
|
||||
{
|
||||
|
||||
return new HairCutPayementEvent(Client.UserName,info,this, localizer);
|
||||
}
|
||||
|
||||
public virtual BrusherProfile SelectedProfile { get; set; }
|
||||
|
||||
public HairCutQueryEvent CreateEvent(string subTopic, string reason, string sender) {
|
||||
|
||||
string evdate = EventDate?.ToString("dddd dd/MM/yyyy à HH:mm")??"[pas de date spécifiée]";
|
||||
string address = Location?.Address??"[pas de lieu spécifié]";
|
||||
var p = Prestation;
|
||||
string total = GetBillItems().Addition().ToString("C",CultureInfo.CurrentUICulture);
|
||||
string strprestation = GetDescription();
|
||||
string bill = string.Join("\n", GetBillItems().Select(
|
||||
l=> $"{l.Name} {l.Description} {l.UnitaryCost} € " +
|
||||
((l.Count != 1) ? "*"+l.Count.ToString() : "")));
|
||||
var yaev = new HairCutQueryEvent(subTopic)
|
||||
{
|
||||
Client = new ClientProviderInfo {
|
||||
UserName = Client.UserName ,
|
||||
UserId =ClientId,
|
||||
Avatar = Client.Avatar } ,
|
||||
Previsional = Previsional,
|
||||
EventDate = EventDate,
|
||||
Location = Location,
|
||||
Id = Id,
|
||||
ActivityCode = ActivityCode,
|
||||
Reason = reason,
|
||||
Sender = sender,
|
||||
BillingCode = BillingCodes.Brush
|
||||
};
|
||||
return yaev;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
using Yavsc.Interfaces.Workflow;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public class HairCutQueryEvent : RdvQueryProviderInfo, IEvent
|
||||
{
|
||||
public HairCutQueryEvent(string subTopic)
|
||||
{
|
||||
Topic = "/topic/HairCutQuery";
|
||||
if (subTopic!=null) Topic+="/"+subTopic;
|
||||
}
|
||||
public string CreateBody()
|
||||
{
|
||||
return $"{Reason}\r\n-- \r\n{Previsional}\r\n{EventDate}\r\n";
|
||||
}
|
||||
|
||||
public string CreateBoby()
|
||||
{
|
||||
return string.Format(Startup.GlobalLocalizer["RdvToPerf"], Client.UserName,
|
||||
EventDate?.ToString("dddd dd/MM/yyyy à HH:mm"),
|
||||
Location.Address,
|
||||
ActivityCode);
|
||||
}
|
||||
|
||||
public string Sender
|
||||
{
|
||||
get;
|
||||
|
||||
set;
|
||||
}
|
||||
|
||||
public string Topic
|
||||
{
|
||||
get;
|
||||
|
||||
private set;
|
||||
}
|
||||
|
||||
HairCutQuery Data { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public enum HairDressings {
|
||||
|
||||
Coiffage,
|
||||
|
||||
Brushing,
|
||||
|
||||
[Display(Name="Mise en plis")]
|
||||
Folding
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public enum HairLength : int
|
||||
{
|
||||
HalfLong=0,
|
||||
Short=1,
|
||||
|
||||
Long=2
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Relationship;
|
||||
using Yavsc.Billing;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public class HairPrestationCollectionItem {
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public long PrestationId { get; set; }
|
||||
[ForeignKeyAttribute("PrestationId")]
|
||||
public virtual HairPrestation Prestation { get; set; }
|
||||
|
||||
public long QueryId { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("QueryId")]
|
||||
public virtual HairMultiCutQuery Query { get; set; }
|
||||
}
|
||||
|
||||
public class HairMultiCutQuery : NominativeServiceCommand
|
||||
{
|
||||
// Bill description
|
||||
public override string GetDescription()
|
||||
{
|
||||
return "Prestation en coiffure à domicile [commande groupée]";
|
||||
}
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
override public long Id { get; set; }
|
||||
|
||||
[InversePropertyAttribute("Query")]
|
||||
public virtual List<HairPrestationCollectionItem> Prestations { get; set; }
|
||||
|
||||
public Location Location { get; set; }
|
||||
|
||||
public DateTime EventDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override List<IBillItem> GetBillItems()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public class HairPrestation
|
||||
{
|
||||
// Homme ou enfant => Coupe seule
|
||||
// Couleur => Shampoing
|
||||
// Forfaits : Coupe + Technique
|
||||
// pas de coupe => technique
|
||||
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Display(Name="Longueur de cheveux")]
|
||||
public HairLength Length { get; set; }
|
||||
|
||||
[Display(Name="Pour qui")]
|
||||
public HairCutGenders Gender { get; set; }
|
||||
|
||||
[Display(Name="Coupe")]
|
||||
public bool Cut { get; set; }
|
||||
|
||||
[Display(Name="Coiffage")]
|
||||
|
||||
public HairDressings Dressing { get; set; }
|
||||
|
||||
[Display(Name="Technique")]
|
||||
public HairTechnos Tech { get; set; }
|
||||
|
||||
[Display(Name="Shampoing")]
|
||||
public bool Shampoo { get; set; }
|
||||
|
||||
[Display(Name="Couleurs"),JsonIgnore,InverseProperty("Prestation")]
|
||||
|
||||
public virtual List<HairTaintInstance> Taints { get; set; }
|
||||
|
||||
[Display(Name="Soins")]
|
||||
public bool Cares { get; set; }
|
||||
|
||||
|
||||
}
|
||||
public class HairTaintInstance {
|
||||
|
||||
public long TaintId { get; set; }
|
||||
|
||||
[ForeignKey("TaintId")]
|
||||
public virtual HairTaint Taint { get; set; }
|
||||
public long PrestationId { get; set; }
|
||||
|
||||
[ForeignKey("PrestationId")]
|
||||
public virtual HairPrestation Prestation { get; set; }
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
using Drawing;
|
||||
public class HairTaint
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set;}
|
||||
|
||||
public string Brand { get; set; }
|
||||
|
||||
[Required]
|
||||
public long ColorId { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("ColorId")]
|
||||
public virtual Color Color {get; set;}
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
|
||||
public enum HairTechnos
|
||||
{
|
||||
[Display(Name="Aucune technique spécifique")]
|
||||
NoTech,
|
||||
|
||||
[Display(Name="Couleur")]
|
||||
Color,
|
||||
|
||||
[Display(Name="Permantante")]
|
||||
Permanent,
|
||||
[Display(Name="Défrisage")]
|
||||
Defris,
|
||||
[Display(Name="Mêches")]
|
||||
Mech,
|
||||
Balayage
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
using System;
|
||||
namespace Yavsc.Haircut
|
||||
{
|
||||
public interface IProviderInfo
|
||||
{
|
||||
|
||||
string UserId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
string UserName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
string Avatar
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHaircutQuery
|
||||
{
|
||||
|
||||
IProviderInfo ProviderInfo
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
long Id
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
IHairPrestation Prestation
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
long Status
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
ILocation Location
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
DateTime EventDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
namespace Yavsc
|
||||
{
|
||||
public interface IHairPrestation
|
||||
{
|
||||
long Id { get; set; }
|
||||
int Length { get; set; }
|
||||
int Gender { get; set; }
|
||||
bool Cut { get; set; }
|
||||
|
||||
int Dressing { get; set; }
|
||||
int Tech { get; set; }
|
||||
|
||||
bool Shampoo { get; set; }
|
||||
|
||||
long[] Taints { get; set; }
|
||||
|
||||
bool Cares { get; set; }
|
||||
}
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
|
||||
//
|
||||
// HaircutQueryInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Models.Auth;
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc.Models.Haircut.Views
|
||||
{
|
||||
public class HaircutQueryProviderInfo : HaircutQueryComonInfo {
|
||||
public HaircutQueryProviderInfo(HairCutQuery query) : base (query)
|
||||
{
|
||||
ClientInfo = new UserInfo(query.Client.Id, query.Client.UserName, query.Client.Avatar);
|
||||
}
|
||||
public UserInfo ClientInfo { get; set; }
|
||||
|
||||
}
|
||||
public class HaircutQueryClientInfo : HaircutQueryComonInfo {
|
||||
public HaircutQueryClientInfo(HairCutQuery query) : base (query)
|
||||
{
|
||||
var user = query.PerformerProfile.Performer;
|
||||
ProviderInfo = new UserInfo(user.Id, user.UserName, user.Avatar);
|
||||
}
|
||||
public UserInfo ProviderInfo { get; set; }
|
||||
|
||||
}
|
||||
public class HaircutQueryComonInfo
|
||||
{
|
||||
public HaircutQueryComonInfo(HairCutQuery query)
|
||||
{
|
||||
Id = query.Id;
|
||||
Prestation = query.Prestation;
|
||||
Status = query.Status;
|
||||
Location = query.Location;
|
||||
EventDate = query.EventDate;
|
||||
AdditionalInfo = query.AdditionalInfo;
|
||||
}
|
||||
public long Id { get; set; }
|
||||
public HairPrestation Prestation { get; set; }
|
||||
|
||||
public QueryStatus Status { get; set; }
|
||||
|
||||
public virtual Location Location { get; set; }
|
||||
public DateTime? EventDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Display(Name="Informations complémentaires")]
|
||||
public string AdditionalInfo { get; set; }
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.IT.Maintaining
|
||||
{
|
||||
public class Feature
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[YaStringLength(256,MinLen=3)]
|
||||
public string ShortName { get; set; }
|
||||
|
||||
[YaStringLength(10*1024,MinLen=3)]
|
||||
public string Description { get; set; }
|
||||
public FeatureStatus Status { get; set; }
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
namespace Yavsc.Models.IT.Maintaining
|
||||
{
|
||||
/// <summary>
|
||||
/// A Feature status
|
||||
/// <c>Ko</c>: A Bug has just been discovered
|
||||
/// <c>InSane</c>: This feature is not correctly integrating its ecosystem
|
||||
/// <c>Obsolete</c>: This will be replaced in a short future, or yet has been replaced
|
||||
/// with a better solution.
|
||||
/// <c>Ok</c> : nothing to say
|
||||
/// </summary>
|
||||
public enum FeatureStatus: int
|
||||
{
|
||||
Requested,
|
||||
Accepted,
|
||||
Rejected,
|
||||
Implemented
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
using Yavsc.Models.IT.Maintaining;
|
||||
|
||||
namespace Yavsc.Models.IT.Fixing
|
||||
{
|
||||
public class Bug
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[ForeignKey("FeatureId")]
|
||||
public virtual Feature False { get; set; }
|
||||
public long? FeatureId { get; set; }
|
||||
|
||||
[YaStringLength(2048)]
|
||||
public string Description { get; set; }
|
||||
|
||||
public BugStatus Status { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
namespace Yavsc.Models.IT.Fixing
|
||||
{
|
||||
/// <summary>
|
||||
/// Bug status:
|
||||
/// * Inserted -> Confirmed|FeatureRequest|Feature|Rejected
|
||||
/// * Confirmed -> Fixed
|
||||
/// * FeatureRequest -> Implemented
|
||||
/// </summary>
|
||||
public enum BugStatus : int
|
||||
{
|
||||
Inserted,
|
||||
Confirmed,
|
||||
Rejected,
|
||||
Feature,
|
||||
Fixed
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.IT.Modeling
|
||||
{
|
||||
public abstract class Code<TLetter> : ICode<TLetter> where TLetter : ILetter<TLetter>
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// !a Count^3 task len
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Validate()
|
||||
{
|
||||
foreach (var letter in this) {
|
||||
var word = this.CreateWord(letter);
|
||||
foreach (var other in this) {
|
||||
IWord<TLetter> first = word.Aggregate(other);
|
||||
foreach (var tierce in this)
|
||||
{
|
||||
var otherword = word.Aggregate(tierce);
|
||||
if (first.Equals(otherword))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract IEnumerator<TLetter> GetEnumerator();
|
||||
|
||||
public abstract IWord<TLetter> CreateWord(TLetter letter);
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
|
||||
namespace Yavsc.Models.IT.Modeling
|
||||
{
|
||||
public abstract class Letter<T> : ILetter<T>
|
||||
{
|
||||
public abstract bool Equals(T x, T y);
|
||||
|
||||
public int GetHashCode(T obj)
|
||||
{
|
||||
return obj.GetHashCode();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace Yavsc.Models {
|
||||
public interface IUnit<VType> {
|
||||
string Name { get; }
|
||||
bool CanConvertFrom(IUnit<VType> other);
|
||||
VType ConvertFrom (IUnit<VType> other, VType orgValue) ;
|
||||
}
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
using Models.Relationship;
|
||||
using Models.Identity;
|
||||
using Models.Chat;
|
||||
using Models.Bank;
|
||||
using Models.Access;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class ApplicationUser : IdentityUser
|
||||
{
|
||||
/// <summary>
|
||||
/// Another me, as a byte array.
|
||||
/// This value points a picture that may be used
|
||||
/// to present the user
|
||||
/// </summary>
|
||||
/// <returns>the path to an user's image, relative to it's user dir<summary>
|
||||
/// <see>Startup.UserFilesOptions</see>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[MaxLength(512)]
|
||||
public string Avatar { get; set; }
|
||||
|
||||
[MaxLength(512)]
|
||||
public string FullName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// WIP Paypal
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Display(Name="Account balance")]
|
||||
public virtual AccountBalance AccountBalance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User's posts
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("Author"),JsonIgnore]
|
||||
public virtual List<Blog.BlogPost> Posts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User's contact list
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("Owner"),JsonIgnore]
|
||||
public virtual List<Contact> Book { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// External devices using the API
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("DeviceOwner"),JsonIgnore]
|
||||
public virtual List<GoogleCloudMobileDeclaration> Devices { get; set; }
|
||||
|
||||
[InverseProperty("Owner"),JsonIgnore]
|
||||
public virtual List<ChatConnection> Connections { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// User's circles
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("Owner"),JsonIgnore]
|
||||
|
||||
public virtual List<Circle> Circles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Billing postal address
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[ForeignKeyAttribute("PostalAddressId")]
|
||||
public virtual Location PostalAddress { get; set; }
|
||||
public long? PostalAddressId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User's Google calendar
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string DedicatedGoogleCalendar { get; set; }
|
||||
|
||||
public override string ToString() {
|
||||
return this.Id+" "+this.AccountBalance?.Credits.ToString()+this.Email+" "+this.UserName+" $"+this.AccountBalance?.Credits.ToString();
|
||||
}
|
||||
|
||||
public BankIdentity BankInfo { get; set; }
|
||||
|
||||
public long DiskQuota { get; set; } = 512*1024*1024;
|
||||
public long DiskUsage { get; set; } = 0;
|
||||
|
||||
public long MaxFileSize { get; set; } = 512*1024*1024;
|
||||
|
||||
[JsonIgnore][InverseProperty("Owner")]
|
||||
public virtual List<BlackListed> BlackList { get; set; }
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Identity
|
||||
{
|
||||
using Yavsc;
|
||||
|
||||
[JsonObject]
|
||||
|
||||
public class GivenGoogleCloudMobileDeclaration : GoogleCloudMobileDeclaration, IGCMDeclaration {
|
||||
public DateTime? LatestActivityUpdate { get; set; }
|
||||
}
|
||||
|
||||
public class GoogleCloudMobileDeclaration {
|
||||
|
||||
[Required]
|
||||
public string GCMRegistrationId { get; set; }
|
||||
|
||||
[Key,Required]
|
||||
public string DeviceId { get; set; }
|
||||
|
||||
public string Model { get; set; }
|
||||
public string Platform { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string DeviceOwnerId { get; set; }
|
||||
public DateTime DeclarationDate { get; set; }
|
||||
[JsonIgnore,ForeignKey("DeviceOwnerId")]
|
||||
public virtual ApplicationUser DeviceOwner { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class passwrecovery
|
||||
{
|
||||
public string pkid { get; set; }
|
||||
public DateTime creation { get; set; }
|
||||
public string one_time_pass { get; set; }
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
|
||||
|
||||
namespace Yavsc.Models.Market
|
||||
{
|
||||
public class BaseProduct
|
||||
{
|
||||
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// A contractual description for this product.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls wether this product or service
|
||||
/// may be offered to clients, or simply
|
||||
/// are internal workflow entry point.
|
||||
/// </summary>
|
||||
/// <returns>true when this product belongs to the public catalog.</returns>
|
||||
public bool Public { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.Market {
|
||||
|
||||
public class Catalog {
|
||||
public List<Product> Products { get; set; }
|
||||
public List<Service> Services { get; set; }
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Market {
|
||||
/// <summary>
|
||||
/// Not yet used!
|
||||
/// </summary>
|
||||
public class Money : IUnit<decimal>
|
||||
{
|
||||
public Money(string name, decimal euroExchangeRate)
|
||||
{
|
||||
Name = name;
|
||||
EuroExchangeRate = euroExchangeRate;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get; private set ;
|
||||
}
|
||||
|
||||
public decimal EuroExchangeRate
|
||||
{
|
||||
get; private set ;
|
||||
}
|
||||
public bool CanConvertFrom(IUnit<decimal> other)
|
||||
{
|
||||
if (other is Money)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public decimal ConvertFrom(IUnit<decimal> other, decimal orgValue)
|
||||
{
|
||||
if (other is Money) {
|
||||
var om = other as Money;
|
||||
return orgValue * om.EuroExchangeRate / EuroExchangeRate;
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Market
|
||||
{
|
||||
public class Product : BaseProduct
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Weight in gram
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public decimal Weight { get; set; }
|
||||
/// <summary>
|
||||
/// Height in meter
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public decimal Height { get; set; }
|
||||
/// <summary>
|
||||
/// Width in meter
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public decimal Width { get; set; }
|
||||
public decimal Depth { get; set; }
|
||||
/// <summary>
|
||||
/// In euro
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public decimal? Price { get; set; }
|
||||
|
||||
// TODO make use of public Money Money { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Market {
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Workflow;
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
public class Service : BaseProduct
|
||||
{
|
||||
/// <summary>
|
||||
/// An unique product identifier.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string ContextId { get; set; }
|
||||
[ForeignKey("ContextId")]
|
||||
public virtual Activity Context { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of billing clause,
|
||||
/// associated to this service,
|
||||
/// that defines the transformation rules
|
||||
/// to take in account during the transformation
|
||||
/// of a corresponding prestation to an amount to pay.
|
||||
/// This property is built at constructing a new instance
|
||||
/// and is not mapped in database.
|
||||
/// For the moment, it's hard coded only.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
[NotMapped]
|
||||
public List<IBillingClause> Billing { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public enum Reason: byte {
|
||||
Private,
|
||||
Corporate,
|
||||
SearchingAPro,
|
||||
Selling,
|
||||
Buying,
|
||||
ServiceProposal
|
||||
|
||||
}
|
||||
public class Announce: BaseEvent, IOwned
|
||||
{
|
||||
public Reason For { get; set; }
|
||||
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
public override string CreateBody()
|
||||
{
|
||||
return $"Annonce de {Owner.UserName}: {For}\n\n{Message}";
|
||||
}
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
//
|
||||
// BaseEvent.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Interfaces.Workflow;
|
||||
|
||||
/// <summary>
|
||||
/// /// Base event.
|
||||
/// </summary>
|
||||
|
||||
public abstract class BaseEvent : IEvent {
|
||||
public BaseEvent()
|
||||
{
|
||||
Topic = GetType().Name;
|
||||
}
|
||||
public BaseEvent(string topic)
|
||||
{
|
||||
Topic = GetType().Name+"/"+topic;
|
||||
}
|
||||
public string Topic { get; private set; }
|
||||
public string Sender { get; set; }
|
||||
|
||||
abstract public string CreateBody();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
//
|
||||
// EventPub.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Models.Relationship;
|
||||
/// <summary>
|
||||
/// Event pub.
|
||||
/// </summary>
|
||||
public class CircleEvent: BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the circles.
|
||||
/// </summary>
|
||||
/// <value>The circles.</value>
|
||||
[Required(ErrorMessageResourceName="DoSpecifyCircles"),
|
||||
Display(Name="Circles")]
|
||||
public virtual List<Circle> Circles{ get; set; }
|
||||
|
||||
public override string CreateBody()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public class DimissClicked
|
||||
{
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
|
||||
[Required]
|
||||
public long NotificationId { get; set; }
|
||||
|
||||
[ForeignKey("NotificationId")]
|
||||
public virtual Notification Notified { get; set; }
|
||||
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user