renamed the base name of the model
This commit is contained in:
parent
6630876b38
commit
83ca421100
104 changed files with 0 additions and 0 deletions
50
Yavsc/Models/Access/Publishing.cs
Normal file
50
Yavsc/Models/Access/Publishing.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// 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
|
||||
}
|
||||
|
||||
}
|
||||
10
Yavsc/Models/Access/Rule.cs
Normal file
10
Yavsc/Models/Access/Rule.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using Microsoft.AspNet.Authorization;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public abstract class Rule<TResource> where TResource : IAuthorizationRequirement
|
||||
{
|
||||
public virtual bool Mandatory { get; set; }
|
||||
public abstract bool Allow(ApplicationUser user);
|
||||
}
|
||||
}
|
||||
16
Yavsc/Models/Access/RuleSet.cs
Normal file
16
Yavsc/Models/Access/RuleSet.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
|
||||
public class RuleSet <TResource>:List<Rule<TResource>> where TResource : IAuthorizationRequirement{
|
||||
|
||||
bool Allow(ApplicationUser user)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
8
Yavsc/Models/Access/WhiteCard.cs
Normal file
8
Yavsc/Models/Access/WhiteCard.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
|
||||
public class WhiteCard {
|
||||
|
||||
}
|
||||
}
|
||||
194
Yavsc/Models/ApplicationDbContext.cs
Normal file
194
Yavsc/Models/ApplicationDbContext.cs
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authentication.OAuth;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models.Auth;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Booking;
|
||||
using Yavsc.Models.OAuth;
|
||||
using Yavsc.Models.Workflow;
|
||||
using Yavsc.Models.Identity;
|
||||
using Yavsc.Models.Market;
|
||||
using Yavsc.Model;
|
||||
using Yavsc.Model.Chat;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
// Customize the ASP.NET Identity model and override the defaults if needed.
|
||||
// For example, you can rename the ASP.NET Identity table names and more.
|
||||
// Add your customizations after calling base.OnModelCreating(builder);
|
||||
builder.Entity<Contact>().HasKey(x => new { x.OwnerId, x.UserId });
|
||||
builder.Entity<BookQuery>().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<Blog>().Property(x=>x.Posted).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<GoogleCloudMobileDeclaration>().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<PostTag>().HasKey(x=>new { x.PostId, x.TagId});
|
||||
builder.Entity<ApplicationUser>().HasMany<Connection>( c=>c.Connections );
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseNpgsql(Startup.ConnectionString);
|
||||
}
|
||||
|
||||
public DbSet<Client> Applications { get; set; }
|
||||
|
||||
public DbSet<RefreshToken> RefreshTokens { get; set; }
|
||||
/// <summary>
|
||||
/// Activities referenced on this site
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Activity> Activities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Users posts
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Blog> Blogspot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skills propulsed by this site
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<Skill> SiteSkills { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Circle members
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<CircleMember> CircleMembers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Commands, from an user, to a performer
|
||||
/// (A performer is an user who's actived a main activity
|
||||
/// on his profile).
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<BookQuery> Commands { get; set; }
|
||||
/// <summary>
|
||||
/// Special commands, talking about
|
||||
/// a given place and date.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<BookQuery> BookQueries { get; set; }
|
||||
public DbSet<PerformerProfile> Performers { get; set; }
|
||||
public DbSet<Estimate> Estimates { get; set; }
|
||||
public DbSet<AccountBalance> BankStatus { get; set; }
|
||||
public DbSet<BalanceImpact> BankBook { get; set; }
|
||||
public DbSet<Location> Map { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Google Calendar offline
|
||||
/// open auth tokens
|
||||
/// </summary>
|
||||
/// <returns>tokens</returns>
|
||||
public DbSet<OAuth2Tokens> Tokens { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// References all declared external GCM devices
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<GoogleCloudMobileDeclaration> GCMDevices { get; set; }
|
||||
|
||||
public DbSet<Service> Services { get; set; }
|
||||
public DbSet<Product> Products { get; set; }
|
||||
public Task ClearTokensAsync()
|
||||
{
|
||||
Tokens.RemoveRange(this.Tokens);
|
||||
SaveChanges();
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task DeleteTokensAsync(string email)
|
||||
{
|
||||
if (string.IsNullOrEmpty(email))
|
||||
{
|
||||
throw new ArgumentException("email MUST have a value");
|
||||
}
|
||||
|
||||
var item = this.Tokens.FirstOrDefault(x => x.UserId == email);
|
||||
if (item != null)
|
||||
{
|
||||
Tokens.Remove(item);
|
||||
SaveChanges();
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task<OAuth2Tokens> GetTokensAsync(string googleUserId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(googleUserId))
|
||||
{
|
||||
throw new ArgumentException("email MUST have a value");
|
||||
}
|
||||
|
||||
using (var context = new ApplicationDbContext())
|
||||
{
|
||||
var item = this.Tokens.FirstOrDefault(x => x.UserId == googleUserId);
|
||||
return Task.FromResult(item);
|
||||
}
|
||||
}
|
||||
|
||||
public Task StoreTokenAsync(string googleUserId, OAuthTokenResponse value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(googleUserId))
|
||||
{
|
||||
throw new ArgumentException("googleUserId MUST have a value");
|
||||
}
|
||||
|
||||
var item = this.Tokens.SingleOrDefaultAsync(x => x.UserId == googleUserId).Result;
|
||||
if (item == null)
|
||||
{
|
||||
Tokens.Add(new OAuth2Tokens
|
||||
{
|
||||
TokenType = "Bearer", // FIXME why value.TokenType would be null?
|
||||
AccessToken = value.AccessToken,
|
||||
RefreshToken = value.RefreshToken,
|
||||
Expiration = DateTime.Now.AddSeconds(int.Parse(value.ExpiresIn)),
|
||||
UserId = googleUserId
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
item.AccessToken = value.AccessToken;
|
||||
item.Expiration = DateTime.Now.AddMinutes(int.Parse(value.ExpiresIn));
|
||||
if (value.RefreshToken != null)
|
||||
item.RefreshToken = value.RefreshToken;
|
||||
Tokens.Update(item);
|
||||
}
|
||||
SaveChanges();
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
Client FindApplication(string clientId)
|
||||
{
|
||||
return Applications.FirstOrDefault(
|
||||
app=>app.Id == clientId);
|
||||
}
|
||||
|
||||
public DbSet<ExceptionSIREN> ExceptionsSIREN { get; set; }
|
||||
|
||||
public DbSet<Location> Locations { get; set; }
|
||||
|
||||
public DbSet<Tag> Tags { get; set; }
|
||||
|
||||
public DbSet<PostTag> TagsDomain { get; set; }
|
||||
|
||||
public DbSet<EstimateTemplate> EstimateTemplates { get; set; }
|
||||
|
||||
public DbSet<Contact> Contacts { get; set; }
|
||||
|
||||
public DbSet<ClientProviderInfo> ClientProviderInfo { get; set; }
|
||||
|
||||
public DbSet<Connection> Connections { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
10
Yavsc/Models/Auth/ApplicationTypes.cs
Normal file
10
Yavsc/Models/Auth/ApplicationTypes.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
namespace Yavsc.Models.Auth
|
||||
{
|
||||
public enum ApplicationTypes: int
|
||||
{
|
||||
JavaScript = 0,
|
||||
NativeConfidential = 1
|
||||
};
|
||||
}
|
||||
20
Yavsc/Models/Auth/Client.cs
Normal file
20
Yavsc/Models/Auth/Client.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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; }
|
||||
|
||||
}
|
||||
}
|
||||
33
Yavsc/Models/Auth/ExternalViewModel.cs
Normal file
33
Yavsc/Models/Auth/ExternalViewModel.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
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; }
|
||||
}
|
||||
}
|
||||
48
Yavsc/Models/Auth/OAuth2Tokens.cs
Normal file
48
Yavsc/Models/Auth/OAuth2Tokens.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
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; }
|
||||
}
|
||||
}
|
||||
23
Yavsc/Models/Auth/RefreshToken.cs
Normal file
23
Yavsc/Models/Auth/RefreshToken.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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; }
|
||||
}
|
||||
}
|
||||
15
Yavsc/Models/Auth/Scope.cs
Normal file
15
Yavsc/Models/Auth/Scope.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Auth {
|
||||
public class Scope {
|
||||
|
||||
|
||||
[Key]
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
22
Yavsc/Models/Auth/UserCredentials.cs
Normal file
22
Yavsc/Models/Auth/UserCredentials.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
22
Yavsc/Models/Bank/AccountBalance.cs
Normal file
22
Yavsc/Models/Bank/AccountBalance.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
|
||||
public partial class AccountBalance: IAccountBalance {
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[Required,Display(Name="Credits in €")]
|
||||
public decimal Credits { get; set; }
|
||||
|
||||
public long ContactCredits { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
26
Yavsc/Models/Bank/BalanceImpact.cs
Normal file
26
Yavsc/Models/Bank/BalanceImpact.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
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; }
|
||||
}
|
||||
}
|
||||
63
Yavsc/Models/Bank/BankIdentity.cs
Normal file
63
Yavsc/Models/Bank/BankIdentity.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Model.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; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
27
Yavsc/Models/Billing/CommandLine.cs
Normal file
27
Yavsc/Models/Billing/CommandLine.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
|
||||
public class CommandLine {
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required,MaxLength(512)]
|
||||
public string Description { get; set; }
|
||||
public BaseProduct Article { get; set; }
|
||||
public int Count { get; set; }
|
||||
public decimal UnitaryCost { get; set; }
|
||||
|
||||
public long EstimateId { get; set; }
|
||||
|
||||
[JsonIgnore,NotMapped,ForeignKey("EstimateId")]
|
||||
virtual public Estimate Estimate { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
11
Yavsc/Models/Billing/Contract.cs
Normal file
11
Yavsc/Models/Billing/Contract.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
|
||||
public class ServiceContract<P> where P : Service
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
78
Yavsc/Models/Billing/Estimate.cs
Normal file
78
Yavsc/Models/Billing/Estimate.cs
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
using Interfaces;
|
||||
using Models.Booking;
|
||||
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")]
|
||||
public BookQuery 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(); }
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ClientId { get; set; }
|
||||
|
||||
public string CommandType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public Byte [] ProviderSignature { get; set; }
|
||||
public Byte [] ClientSignature { get; set; }
|
||||
public DateTime ProviderValidationDate { get; set; }
|
||||
public DateTime ClientValidationDate { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
20
Yavsc/Models/Billing/EstimateTemplate.cs
Normal file
20
Yavsc/Models/Billing/EstimateTemplate.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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; }
|
||||
}
|
||||
|
||||
}
|
||||
10
Yavsc/Models/Billing/ExceptionSIREN.cs
Normal file
10
Yavsc/Models/Billing/ExceptionSIREN.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public class ExceptionSIREN {
|
||||
|
||||
[Key]
|
||||
public string SIREN { get; set; }
|
||||
}
|
||||
}
|
||||
14
Yavsc/Models/Billing/FixedImpacter.cs
Normal file
14
Yavsc/Models/Billing/FixedImpacter.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
6
Yavsc/Models/Billing/IBillingImpacter.cs
Normal file
6
Yavsc/Models/Billing/IBillingImpacter.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
public interface IBillingImpacter {
|
||||
decimal Impact(decimal orgValue);
|
||||
|
||||
}
|
||||
45
Yavsc/Models/Billing/NominatvieCommand.cs
Normal file
45
Yavsc/Models/Billing/NominatvieCommand.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Market;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
|
||||
public class NominativeServiceCommand : Query<Service> {
|
||||
|
||||
public string ClientId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The client
|
||||
/// </summary>
|
||||
[Required,ForeignKey("ClientId")]
|
||||
public ApplicationUser Client { get; set; }
|
||||
|
||||
[Required]
|
||||
public string PerformerId { get; set; }
|
||||
/// <summary>
|
||||
/// The performer identifier
|
||||
/// </summary>
|
||||
[ForeignKey("PerformerId")]
|
||||
public PerformerProfile PerformerProfile { get; set; }
|
||||
|
||||
public DateTime? ValidationDate {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// Command creation Date & time
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime CreationDate {get; set;}
|
||||
|
||||
public decimal? Previsional { get; set; }
|
||||
/// <summary>
|
||||
/// The bill
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
11
Yavsc/Models/Billing/ProportionalImpacter.cs
Normal file
11
Yavsc/Models/Billing/ProportionalImpacter.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace Yavsc.Models.Billing {
|
||||
public class ProportionalImpacter : IBillingImpacter
|
||||
{
|
||||
public decimal K { get; set; }
|
||||
public decimal Impact(decimal orgValue)
|
||||
{
|
||||
return orgValue * K;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
12
Yavsc/Models/Billing/Query.cs
Normal file
12
Yavsc/Models/Billing/Query.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using Yavsc.Interfaces.Workflow;
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
|
||||
public class Query<P> where P : BaseProduct
|
||||
{
|
||||
QueryStatus Status { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
31
Yavsc/Models/Billing/ReductionCode.cs
Normal file
31
Yavsc/Models/Billing/ReductionCode.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
5
Yavsc/Models/Billing/Service/ChatBilling.cs
Normal file
5
Yavsc/Models/Billing/Service/ChatBilling.cs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
|
||||
class ChatBilling {
|
||||
|
||||
}
|
||||
14
Yavsc/Models/Billing/histoestim.cs
Normal file
14
Yavsc/Models/Billing/histoestim.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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; }
|
||||
}
|
||||
}
|
||||
17
Yavsc/Models/Billing/satisfaction.cs
Normal file
17
Yavsc/Models/Billing/satisfaction.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public partial class satisfaction
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long _id { get; set; }
|
||||
public string comnt { get; set; }
|
||||
public int? rate { get; set; }
|
||||
|
||||
[ForeignKey("Skill.Id")]
|
||||
public long? userskillid { get; set; }
|
||||
}
|
||||
}
|
||||
13
Yavsc/Models/Billing/writtings.cs
Normal file
13
Yavsc/Models/Billing/writtings.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public partial class writtings
|
||||
{
|
||||
public long _id { get; set; }
|
||||
public int? count { get; set; }
|
||||
public string description { get; set; }
|
||||
public long estimid { get; set; }
|
||||
public string productid { get; set; }
|
||||
public decimal? ucost { get; set; }
|
||||
}
|
||||
}
|
||||
9
Yavsc/Models/Billing/wrtags.cs
Normal file
9
Yavsc/Models/Billing/wrtags.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public partial class wrtags
|
||||
{
|
||||
public long wrid { get; set; }
|
||||
public long tagid { get; set; }
|
||||
}
|
||||
}
|
||||
26
Yavsc/Models/Blog/Blog.cs
Normal file
26
Yavsc/Models/Blog/Blog.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class Blog : IBlog
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string Content { get; set; }
|
||||
public DateTime Modified { get; set; }
|
||||
public string Photo { get; set; }
|
||||
public DateTime Posted { get; set; }
|
||||
public int Rate { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string AuthorId { get; set; }
|
||||
|
||||
[ForeignKey("AuthorId"),JsonIgnore]
|
||||
public ApplicationUser Author { set; get; }
|
||||
public bool Visible { get; set; }
|
||||
}
|
||||
}
|
||||
15
Yavsc/Models/Blog/BlogAccess.cs
Normal file
15
Yavsc/Models/Blog/BlogAccess.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
public partial class BlogAccess
|
||||
{
|
||||
[ForeignKey("Blog.Id")]
|
||||
public long PostId { get; set; }
|
||||
|
||||
[ForeignKey("Circle.Id")]
|
||||
public long CircleId { get; set; }
|
||||
}
|
||||
}
|
||||
16
Yavsc/Models/Blog/comment.cs
Normal file
16
Yavsc/Models/Blog/comment.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class comment
|
||||
{
|
||||
public long _id { get; set; }
|
||||
public string applicationname { get; set; }
|
||||
public string bcontent { get; set; }
|
||||
public DateTime modified { get; set; }
|
||||
public DateTime posted { get; set; }
|
||||
public long? postid { get; set; }
|
||||
public string username { get; set; }
|
||||
public bool visible { get; set; }
|
||||
}
|
||||
}
|
||||
39
Yavsc/Models/Booking/BookQuery.cs
Normal file
39
Yavsc/Models/Booking/BookQuery.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
namespace Yavsc.Models.Booking
|
||||
{
|
||||
/// <summary>
|
||||
/// Query, for a date, with a given perfomer, at this given place.
|
||||
/// </summary>
|
||||
|
||||
public class BookQuery : NominativeServiceCommand {
|
||||
/// <summary>
|
||||
/// The command identifier
|
||||
/// </summary>
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id {get; set; }
|
||||
|
||||
[Display(Name="Event date")]
|
||||
public DateTime EventDate{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public Location Location {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public BookQuery()
|
||||
{
|
||||
}
|
||||
|
||||
public BookQuery(Location eventLocation, DateTime eventDate)
|
||||
{
|
||||
Location = eventLocation;
|
||||
EventDate = eventDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Yavsc/Models/Booking/RendezVous.cs
Normal file
38
Yavsc/Models/Booking/RendezVous.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Booking
|
||||
{
|
||||
/// <summary>
|
||||
/// A date, between two persons
|
||||
/// </summary>
|
||||
|
||||
public class RendezVous: Service {
|
||||
// Haut les mains.
|
||||
|
||||
/// <summary>
|
||||
/// Event date
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required(),Display(Name="EventDate")]
|
||||
public DateTime EventDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Location identifier
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required]
|
||||
public long LocationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A Location for this event
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required(ErrorMessage="SpecifyPlace"),Display(Name="Location"),ForeignKey("LocationId")]
|
||||
public Location Location { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
46
Yavsc/Models/Calendar/ICalendarManager.cs
Normal file
46
Yavsc/Models/Calendar/ICalendarManager.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
//
|
||||
// ICalendarManager.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/>.
|
||||
|
||||
|
||||
using Yavsc.Models.Booking;
|
||||
using Yavsc.Models.Messaging;
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// I calendar manager.
|
||||
/// </summary>
|
||||
public interface ICalendarManager {
|
||||
/// <summary>
|
||||
/// Gets the free dates.
|
||||
/// </summary>
|
||||
/// <returns>The free dates.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
/// <param name="req">Req.</param>
|
||||
IFreeDateSet GetFreeDates(string username, BookQuery req);
|
||||
/// <summary>
|
||||
/// Book the specified username and ev.
|
||||
/// </summary>
|
||||
/// <param name="username">Username.</param>
|
||||
/// <param name="ev">Ev.</param>
|
||||
bool Book(string username, YaEvent ev);
|
||||
}
|
||||
}
|
||||
53
Yavsc/Models/Calendar/IFreeDateSet.cs
Normal file
53
Yavsc/Models/Calendar/IFreeDateSet.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
// 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; }
|
||||
}
|
||||
}
|
||||
|
||||
60
Yavsc/Models/Calendar/OpenDay.cs
Normal file
60
Yavsc/Models/Calendar/OpenDay.cs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
//
|
||||
// OpenDay.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>
|
||||
/// Open day.
|
||||
/// </summary>
|
||||
public class OpenDay {
|
||||
/// <summary>
|
||||
/// The day.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public WeekDay Day;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the s.
|
||||
/// </summary>
|
||||
/// <value>The s.</value>
|
||||
public TimeSpan S { get; set; }
|
||||
|
||||
// ASSERT Start <= End
|
||||
/// <summary>
|
||||
/// Gets or sets the start hour.
|
||||
/// </summary>
|
||||
/// <value>The start.</value>
|
||||
[Required]
|
||||
public TimeSpan Start { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the end hour
|
||||
/// (from the next day if lower than the Start).
|
||||
/// </summary>
|
||||
/// <value>The end.</value>
|
||||
[Required]
|
||||
public TimeSpan End { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
45
Yavsc/Models/Calendar/Period.cs
Normal file
45
Yavsc/Models/Calendar/Period.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// 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]
|
||||
public DateTime Start { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the end.
|
||||
/// </summary>
|
||||
/// <value>The end.</value>
|
||||
[Required]
|
||||
public DateTime End { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
54
Yavsc/Models/Calendar/Periodicity.cs
Normal file
54
Yavsc/Models/Calendar/Periodicity.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
//
|
||||
// Periodicity.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>
|
||||
/// 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
|
||||
}
|
||||
|
||||
}
|
||||
40
Yavsc/Models/Calendar/PositionAndKeyphrase.cs
Normal file
40
Yavsc/Models/Calendar/PositionAndKeyphrase.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// PositionAndKeyphrase.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>
|
||||
/// Position and keyphrase.
|
||||
/// </summary>
|
||||
public class PositionAndKeyphrase {
|
||||
/// <summary>
|
||||
/// The phrase.
|
||||
/// </summary>
|
||||
public string phrase;
|
||||
/// <summary>
|
||||
/// The position.
|
||||
/// </summary>
|
||||
public Position pos;
|
||||
}
|
||||
|
||||
}
|
||||
40
Yavsc/Models/Calendar/ProvidedEvent.cs
Normal file
40
Yavsc/Models/Calendar/ProvidedEvent.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// 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 : YaEvent {
|
||||
/// <summary>
|
||||
/// The privacy.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Publishing Privacy;
|
||||
}
|
||||
|
||||
}
|
||||
50
Yavsc/Models/Calendar/Schedule.cs
Normal file
50
Yavsc/Models/Calendar/Schedule.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// 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/>.
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Schedule.
|
||||
/// </summary>
|
||||
public class Schedule {
|
||||
/// <summary>
|
||||
/// Gets or sets the period.
|
||||
/// </summary>
|
||||
/// <value>The period.</value>
|
||||
public Periodicity Period { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the schedule of an open week.
|
||||
/// One item by bay in the week,
|
||||
/// </summary>
|
||||
/// <value>The weekly workdays.</value>
|
||||
public OpenDay [] WeekDays { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the hollydays.
|
||||
/// </summary>
|
||||
/// <value>The hollydays.</value>
|
||||
[Required]
|
||||
public Period [] Validity { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
58
Yavsc/Models/Calendar/WeekDay.cs
Normal file
58
Yavsc/Models/Calendar/WeekDay.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
//
|
||||
// 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
|
||||
}
|
||||
|
||||
}
|
||||
22
Yavsc/Models/Chat/Connection.cs
Normal file
22
Yavsc/Models/Chat/Connection.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Model.Chat
|
||||
{
|
||||
|
||||
public class Connection
|
||||
{
|
||||
[JsonIgnore]
|
||||
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; }
|
||||
}
|
||||
|
||||
}
|
||||
13
Yavsc/Models/Edition/IDocument.cs
Normal file
13
Yavsc/Models/Edition/IDocument.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
namespace Yavsc.Models {
|
||||
|
||||
public class Parameter {
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
public interface IDocument {
|
||||
string Template { get; set; }
|
||||
Parameter [] Parameters { get; set; }
|
||||
}
|
||||
}
|
||||
24
Yavsc/Models/Forms/Field.cs
Normal file
24
Yavsc/Models/Forms/Field.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Model.Forms.Validation;
|
||||
|
||||
namespace Yavsc.Model.Forms
|
||||
{
|
||||
public abstract class Field
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public abstract Method [] ValidationMethods ();
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Label { get; set; }
|
||||
|
||||
public string PlaceHolder { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ValueType { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
11
Yavsc/Models/Forms/FieldSet.cs
Normal file
11
Yavsc/Models/Forms/FieldSet.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Model.Forms
|
||||
{
|
||||
public class FieldSet
|
||||
{
|
||||
public string Legend {get; set;}
|
||||
public List<Field> Fields { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
16
Yavsc/Models/Forms/Form.cs
Normal file
16
Yavsc/Models/Forms/Form.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Model.Forms
|
||||
{
|
||||
using Interfaces;
|
||||
|
||||
public class Form
|
||||
{
|
||||
[Key]
|
||||
public string Id {get; set;}
|
||||
|
||||
public string Summary { get; set; }
|
||||
public List<IFormNode> Content { get; set; }
|
||||
}
|
||||
}
|
||||
17
Yavsc/Models/Forms/Validation/Method.cs
Normal file
17
Yavsc/Models/Forms/Validation/Method.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Model.Forms.Validation
|
||||
{
|
||||
public class Method
|
||||
{
|
||||
[Key]
|
||||
public string Name {get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO localisation ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required]
|
||||
public string ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
7
Yavsc/Models/Forms/Validation/Required.cs
Normal file
7
Yavsc/Models/Forms/Validation/Required.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
namespace Yavsc.Model.Forms.Validation
|
||||
{
|
||||
public class Required : Method
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
56
Yavsc/Models/Google/AuthToken.cs
Normal file
56
Yavsc/Models/Google/AuthToken.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// 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; }
|
||||
}
|
||||
}
|
||||
43
Yavsc/Models/Google/Calendar/CalendarEventList.cs
Normal file
43
Yavsc/Models/Google/Calendar/CalendarEventList.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// 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/>.
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Calendar event list.
|
||||
/// </summary>
|
||||
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 ;
|
||||
}
|
||||
}
|
||||
|
||||
51
Yavsc/Models/Google/Calendar/CalendarList.cs
Normal file
51
Yavsc/Models/Google/Calendar/CalendarList.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
//
|
||||
// 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/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Calendar list.
|
||||
/// </summary>
|
||||
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 nextSyncToken { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the items.
|
||||
/// </summary>
|
||||
/// <value>The items.</value>
|
||||
public CalendarListEntry[] items { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
121
Yavsc/Models/Google/Calendar/CalendarListEntry.cs
Normal file
121
Yavsc/Models/Google/Calendar/CalendarListEntry.cs
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
//
|
||||
// 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/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Calendar list entry.
|
||||
/// </summary>
|
||||
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>
|
||||
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; }
|
||||
}
|
||||
|
||||
}
|
||||
43
Yavsc/Models/Google/GDate.cs
Normal file
43
Yavsc/Models/Google/GDate.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
64
Yavsc/Models/Google/Messaging/GCMRegisterModel.cs
Normal file
64
Yavsc/Models/Google/Messaging/GCMRegisterModel.cs
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
//
|
||||
// GCMRegisterModel.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 System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Google.Messaging
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// GCM register model.
|
||||
/// </summary>
|
||||
public class GCMRegisterModel {
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the user.
|
||||
/// </summary>
|
||||
/// <value>The name of the user.</value>
|
||||
[Localizable(true)]
|
||||
[Display(Name="UserName")]
|
||||
[Required(ErrorMessage = "S'il vous plait, entrez un nom d'utilisateur")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the password.
|
||||
/// </summary>
|
||||
/// <value>The password.</value>
|
||||
[DisplayName("Mot de passe")]
|
||||
[Required(ErrorMessage = "S'il vous plait, entez un mot de passe")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the email.
|
||||
/// </summary>
|
||||
/// <value>The email.</value>
|
||||
[DisplayName("Adresse e-mail")]
|
||||
[Required(ErrorMessage = "S'il vous plait, entrez un e-mail valide")]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the registration identifier against Google Clood Messaging and their info on this application.
|
||||
/// </summary>
|
||||
/// <value>The registration identifier.</value>
|
||||
public string RegistrationId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
78
Yavsc/Models/Google/Messaging/MessageWithPayLoad.cs
Normal file
78
Yavsc/Models/Google/Messaging/MessageWithPayLoad.cs
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// 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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
69
Yavsc/Models/Google/Messaging/MessageWithPayloadResponse.cs
Normal file
69
Yavsc/Models/Google/Messaging/MessageWithPayloadResponse.cs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
//
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
165
Yavsc/Models/Google/People/People.cs
Normal file
165
Yavsc/Models/Google/People/People.cs
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
//
|
||||
// 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; }
|
||||
}
|
||||
}
|
||||
36
Yavsc/Models/Google/Resource.cs
Normal file
36
Yavsc/Models/Google/Resource.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
47
Yavsc/Models/Google/Tracks/Entity.cs
Normal file
47
Yavsc/Models/Google/Tracks/Entity.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
37
Yavsc/Models/Google/Tracks/EntityQuery.cs
Normal file
37
Yavsc/Models/Google/Tracks/EntityQuery.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
89
Yavsc/Models/Identity/ApplicationUser.cs
Normal file
89
Yavsc/Models/Identity/ApplicationUser.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Identity;
|
||||
using Yavsc.Model.Chat;
|
||||
using Yavsc.Model.Bank;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public class ApplicationUser : IdentityUser
|
||||
{
|
||||
/// <summary>
|
||||
/// Another me, as a byte array.
|
||||
/// This value points a picture that may be used
|
||||
/// to sign documents.
|
||||
/// </summary>
|
||||
/// <returns>the path to an user's image, relative to it's 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")]
|
||||
public virtual List<Blog> Posts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User's contact list
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("Owner")]
|
||||
public virtual List<Contact> Book { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// External devices using the API
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("DeviceOwner")]
|
||||
public virtual List<GoogleCloudMobileDeclaration> Devices { get; set; }
|
||||
|
||||
[InverseProperty("Owner")]
|
||||
public virtual List<Connection> Connections { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// User's circles
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("Owner")]
|
||||
|
||||
public virtual List<Circle> Circles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Billing postal address
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual Location PostalAddress { 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; }
|
||||
|
||||
}
|
||||
}
|
||||
27
Yavsc/Models/Identity/MobileAppDeclaration.cs
Normal file
27
Yavsc/Models/Identity/MobileAppDeclaration.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Identity
|
||||
{
|
||||
[JsonObject]
|
||||
|
||||
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; }
|
||||
}
|
||||
|
||||
}
|
||||
11
Yavsc/Models/Identity/passwrecovery.cs
Normal file
11
Yavsc/Models/Identity/passwrecovery.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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; }
|
||||
}
|
||||
}
|
||||
30
Yavsc/Models/Market/BaseProduct.cs
Normal file
30
Yavsc/Models/Market/BaseProduct.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Market
|
||||
{
|
||||
public partial class BaseProduct
|
||||
{
|
||||
/// <summary>
|
||||
/// An unique product identifier.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
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; }
|
||||
}
|
||||
|
||||
}
|
||||
10
Yavsc/Models/Market/Catalog.cs
Normal file
10
Yavsc/Models/Market/Catalog.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.Market {
|
||||
|
||||
|
||||
public class Catalog {
|
||||
public List<Product> Products { get; set; }
|
||||
public List<Service> Services { get; set; }
|
||||
}
|
||||
}
|
||||
7
Yavsc/Models/Market/IUnit.cs
Normal file
7
Yavsc/Models/Market/IUnit.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
namespace Yavsc.Models.Market {
|
||||
public interface IUnit<VType> {
|
||||
string Name { get; }
|
||||
bool CanConvertFrom(IUnit<VType> other);
|
||||
VType ConvertFrom (IUnit<VType> other, VType orgValue) ;
|
||||
}
|
||||
}
|
||||
40
Yavsc/Models/Market/Money.cs
Normal file
40
Yavsc/Models/Market/Money.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Yavsc/Models/Market/Product.cs
Normal file
32
Yavsc/Models/Market/Product.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
|
||||
namespace Yavsc.Models.Market
|
||||
{
|
||||
public partial class Product : BaseProduct
|
||||
{
|
||||
/// <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; }
|
||||
}
|
||||
|
||||
}
|
||||
31
Yavsc/Models/Market/Service.cs
Normal file
31
Yavsc/Models/Market/Service.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
namespace Yavsc.Models.Market {
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Billing;
|
||||
|
||||
public partial class Service : BaseProduct
|
||||
{
|
||||
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; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
63
Yavsc/Models/Messaging/BaseEvent.cs
Normal file
63
Yavsc/Models/Messaging/BaseEvent.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
//
|
||||
// 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/>.
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
/// <summary>
|
||||
/// Base event.
|
||||
/// </summary>
|
||||
|
||||
public class BaseEvent : IEvent {
|
||||
public BaseEvent()
|
||||
{
|
||||
Topic = GetType().Name;
|
||||
}
|
||||
public BaseEvent(string topic)
|
||||
{
|
||||
Topic = topic;
|
||||
}
|
||||
public string Topic { get; set; }
|
||||
public string Sender { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
public class GeneralEvent: BaseEvent, ITitle
|
||||
{
|
||||
/// <summary>
|
||||
/// The title.
|
||||
/// </summary>
|
||||
[Required(ErrorMessageResourceName="ChooseATitle")]
|
||||
[Display(Name="Title")]
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// The description.
|
||||
/// </summary>
|
||||
[Required(ErrorMessageResourceName="ChooseADescription")]
|
||||
[Display(Name="Description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
50
Yavsc/Models/Messaging/BookQueryEvent.cs
Normal file
50
Yavsc/Models/Messaging/BookQueryEvent.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Yavsc.Model;
|
||||
|
||||
//
|
||||
// BookQueryEvent.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015-2016 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/>.
|
||||
|
||||
public class BookQueryEvent: BookQueryProviderInfo, IEvent
|
||||
{
|
||||
public BookQueryEvent()
|
||||
{
|
||||
Topic = "BookQuery";
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Sender
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Topic
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
16
Yavsc/Models/Messaging/BookQueryProviderInfo.cs
Normal file
16
Yavsc/Models/Messaging/BookQueryProviderInfo.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Model
|
||||
{
|
||||
|
||||
public class BookQueryProviderInfo
|
||||
{
|
||||
public ClientProviderInfo Client { get; set; }
|
||||
public Location Location { get; set; }
|
||||
|
||||
public long Id { get; set; }
|
||||
|
||||
public DateTime EventDate { get; set; }
|
||||
public decimal? Previsional { get; set; }
|
||||
}
|
||||
}
|
||||
43
Yavsc/Models/Messaging/CircleEvent.cs
Normal file
43
Yavsc/Models/Messaging/CircleEvent.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// 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
|
||||
{
|
||||
/// <summary>
|
||||
/// Event pub.
|
||||
/// </summary>
|
||||
public class CircleEvent: YaEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the circles.
|
||||
/// </summary>
|
||||
/// <value>The circles.</value>
|
||||
[Required(ErrorMessageResourceName="DoSpecifyCircles"),
|
||||
Display(Name="Circles")]
|
||||
public virtual List<Circle> Circles{ get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
17
Yavsc/Models/Messaging/ClientProviderInfo.cs
Normal file
17
Yavsc/Models/Messaging/ClientProviderInfo.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace Yavsc.Model
|
||||
{
|
||||
public class ClientProviderInfo
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Avatar { get; set; }
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
public int Rate { get; set; }
|
||||
public string EMail { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public Location BillingAddress { get; set; }
|
||||
public string ChatHubConnectionId { get; set; }
|
||||
}
|
||||
}
|
||||
50
Yavsc/Models/Messaging/Notification.cs
Normal file
50
Yavsc/Models/Messaging/Notification.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
/// <summary>
|
||||
/// A Notification, that mocks the one sent to Google,
|
||||
/// since it fits my needs
|
||||
/// </summary>
|
||||
public class Notification
|
||||
{
|
||||
[Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// The title.
|
||||
/// </summary>
|
||||
[Required, Display(Name = "Title")]
|
||||
public string title { get; set; }
|
||||
/// <summary>
|
||||
/// The body.
|
||||
/// </summary>
|
||||
[Required, Display(Name = "Title")]
|
||||
public string body { get; set; }
|
||||
/// <summary>
|
||||
/// The icon.
|
||||
/// </summary>
|
||||
[Display(Name = "Icon")]
|
||||
public string icon { get; set; }
|
||||
/// <summary>
|
||||
/// The sound.
|
||||
/// </summary>
|
||||
[Display(Name = "Sound")]
|
||||
public string sound { get; set; }
|
||||
/// <summary>
|
||||
/// The tag.
|
||||
/// </summary>
|
||||
[Display(Name = "Tag")]
|
||||
public string tag { get; set; }
|
||||
/// <summary>
|
||||
/// The color.
|
||||
/// </summary>
|
||||
[Display(Name = "Color")]
|
||||
public string color { get; set; }
|
||||
/// <summary>
|
||||
/// The click action.
|
||||
/// </summary>
|
||||
[Required, Display(Name = "Click action")]
|
||||
public string click_action { get; set; }
|
||||
}
|
||||
}
|
||||
48
Yavsc/Models/Messaging/YaEvent.cs
Normal file
48
Yavsc/Models/Messaging/YaEvent.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// NFEvent.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;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
/// <summary>
|
||||
/// NF event.
|
||||
/// </summary>
|
||||
public class YaEvent : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The NF provider identifier.
|
||||
/// </summary>
|
||||
[Display(Name="From")]
|
||||
public string FromUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The event web page.
|
||||
/// </summary>
|
||||
[Display(Name="EventWebPage")]
|
||||
public string EventWebPage { get; set; }
|
||||
/// <summary>
|
||||
/// The image locator.
|
||||
/// </summary>
|
||||
[Display(Name="Photo")]
|
||||
public string Photo { get; set; }
|
||||
}
|
||||
}
|
||||
22
Yavsc/Models/Relationship/Circle.cs
Normal file
22
Yavsc/Models/Relationship/Circle.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class Circle {
|
||||
[Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId"),JsonIgnore,NotMapped]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[InverseProperty("Circle")]
|
||||
public virtual List<CircleMember> Members { get; set; }
|
||||
}
|
||||
}
|
||||
19
Yavsc/Models/Relationship/CircleMember.cs
Normal file
19
Yavsc/Models/Relationship/CircleMember.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
public partial class CircleMember
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public virtual Circle Circle { get; set; }
|
||||
|
||||
[Required]
|
||||
public virtual ApplicationUser Member { get; set; }
|
||||
}
|
||||
}
|
||||
21
Yavsc/Models/Relationship/Contact.cs
Normal file
21
Yavsc/Models/Relationship/Contact.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public class Contact
|
||||
{
|
||||
[Required()]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[Required()]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("OwnerId"),NotMapped]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("UserId"),NotMapped]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
}
|
||||
}
|
||||
38
Yavsc/Models/Relationship/Location.cs
Normal file
38
Yavsc/Models/Relationship/Location.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Position.
|
||||
/// </summary>
|
||||
public class Position
|
||||
{
|
||||
/// <summary>
|
||||
/// The longitude.
|
||||
/// </summary>
|
||||
[Required(),Display(Name="Longitude")]
|
||||
[Range(-180, 360.0)]
|
||||
|
||||
public double Longitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The latitude.
|
||||
/// </summary>
|
||||
[Required(),Display(Name="Latitude")]
|
||||
[Range(-90, 90 )]
|
||||
public double Latitude { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class Location : Position {
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[Required(),
|
||||
Display(Name="Address"),
|
||||
MaxLength(512)]
|
||||
public string Address { get; set; }
|
||||
}
|
||||
}
|
||||
12
Yavsc/Models/Relationship/PostTag.cs
Normal file
12
Yavsc/Models/Relationship/PostTag.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class PostTag
|
||||
{
|
||||
[ForeignKey("PostId")]
|
||||
public virtual Blog Post { get; set; }
|
||||
public long PostId { get; set; }
|
||||
public long TagId { get; set; }
|
||||
}
|
||||
}
|
||||
14
Yavsc/Models/Relationship/Tag.cs
Normal file
14
Yavsc/Models/Relationship/Tag.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class Tag
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[Required()]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
40
Yavsc/Models/Workflow/Activity.cs
Normal file
40
Yavsc/Models/Workflow/Activity.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public class Activity
|
||||
{
|
||||
|
||||
[StringLength(512),Required,Key]
|
||||
public string Code {get; set;}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[StringLength(512),Required()]
|
||||
public string Name {get; set;}
|
||||
|
||||
public string Description {get; set;}
|
||||
/// <summary>
|
||||
/// Name to associate to a performer in this activity domain
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ActorDenomination {get; set;}
|
||||
|
||||
public string Photo {get; set;}
|
||||
|
||||
[InverseProperty("Context")]
|
||||
public List<Service> Services { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Moderation settings
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string ModeratorGroupName { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
8
Yavsc/Models/Workflow/IRequisition.cs
Normal file
8
Yavsc/Models/Workflow/IRequisition.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public interface IRequisition
|
||||
{
|
||||
bool Eval();
|
||||
}
|
||||
}
|
||||
62
Yavsc/Models/Workflow/PerformerProfile.cs
Normal file
62
Yavsc/Models/Workflow/PerformerProfile.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
|
||||
public class PerformerProfile {
|
||||
|
||||
[Key]
|
||||
public string PerformerId { get; set; }
|
||||
[ForeignKey("PerformerId"),Display(Name="Performer")]
|
||||
public virtual ApplicationUser Performer { get; set; }
|
||||
|
||||
[Display(Name="Activity"),Required]
|
||||
public string ActivityCode { get; set; }
|
||||
|
||||
public Service Offer { get; set; }
|
||||
|
||||
[Required,StringLength(14),Display(Name="SIREN"),
|
||||
RegularExpression(@"^[0-9]{9,14}$", ErrorMessage = "Only numbers are allowed here")]
|
||||
public string SIREN { get; set; }
|
||||
|
||||
public long OrganizationAddressId { get; set; }
|
||||
|
||||
[Required,Display(Name="Organization address"),ForeignKey("OrganizationAddressId")]
|
||||
public virtual Location OrganizationAddress { get; set; }
|
||||
|
||||
[ForeignKey("ActivityCode"),Display(Name="Activity")]
|
||||
public virtual Activity Activity { get; set; }
|
||||
|
||||
[Display(Name="Accept notifications on client query")]
|
||||
public bool AcceptNotifications { get; set; }
|
||||
|
||||
[Display(Name="Accept notifications from non-VIP users")]
|
||||
public bool AcceptPublicContact { get; set; }
|
||||
|
||||
[Display(Name="Allow my geo-localization, nearby my clients")]
|
||||
public bool AcceptGeoLocalization { get; set; }
|
||||
|
||||
[Display(Name="Web site")]
|
||||
public string WebSite { get; set; }
|
||||
|
||||
[Display(Name="Active")]
|
||||
public bool Active { get; set; }
|
||||
|
||||
[Display(Name="Maximal Daily Cost (euro/day)")]
|
||||
public int? MaxDailyCost { get; set; }
|
||||
|
||||
[Display(Name="Minimal Daily Cost (euro/day)")]
|
||||
public int? MinDailyCost { get; set; }
|
||||
|
||||
[Display(Name="Rate from clients")]
|
||||
public int Rate { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool DoesBlog { get {
|
||||
return Performer?.Posts != null ? Performer.Posts.Count > 0 : false;
|
||||
} }
|
||||
|
||||
}
|
||||
}
|
||||
9
Yavsc/Models/Workflow/Process/Action.cs
Normal file
9
Yavsc/Models/Workflow/Process/Action.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public abstract class Action<TResult,TInput>
|
||||
{
|
||||
public abstract Task<TResult> GetTask(TInput data);
|
||||
}
|
||||
}
|
||||
16
Yavsc/Models/Workflow/Process/Conjonction.cs
Normal file
16
Yavsc/Models/Workflow/Process/Conjonction.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public class Conjonction : List<IRequisition>, IRequisition
|
||||
{
|
||||
public bool Eval()
|
||||
{
|
||||
foreach (var req in this)
|
||||
if (!req.Eval())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
16
Yavsc/Models/Workflow/Process/Disjonction.cs
Normal file
16
Yavsc/Models/Workflow/Process/Disjonction.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public class Disjonction : List<IRequisition>, IRequisition
|
||||
{
|
||||
public bool Eval()
|
||||
{
|
||||
foreach (var req in this)
|
||||
if (req.Eval())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
12
Yavsc/Models/Workflow/Process/InputValue.cs
Normal file
12
Yavsc/Models/Workflow/Process/InputValue.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public class ConstInputValue : NamedRequisition
|
||||
{
|
||||
public bool Value { get; set; }
|
||||
public override bool Eval()
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
9
Yavsc/Models/Workflow/Process/NamedRequisition.cs
Normal file
9
Yavsc/Models/Workflow/Process/NamedRequisition.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public abstract class NamedRequisition : IRequisition
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public abstract bool Eval();
|
||||
}
|
||||
}
|
||||
16
Yavsc/Models/Workflow/Process/Negation.cs
Normal file
16
Yavsc/Models/Workflow/Process/Negation.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public class Negation<Exp> : IRequisition where Exp : IRequisition
|
||||
{
|
||||
Exp _expression;
|
||||
public Negation(Exp expression)
|
||||
{
|
||||
_expression = expression;
|
||||
}
|
||||
public bool Eval()
|
||||
{
|
||||
return !_expression.Eval();
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Yavsc/Models/Workflow/Process/Rule.cs
Normal file
34
Yavsc/Models/Workflow/Process/Rule.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// An abstract, identified rule
|
||||
/// </summary>
|
||||
public class Rule<TResult,TInput>
|
||||
{
|
||||
[Key]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Left part for this rule, a conjonction.
|
||||
/// All of these requisitions must be true
|
||||
/// in order to begin any related process.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Conjonction Left { get; set; }
|
||||
/// <summary>
|
||||
/// Right part of this rule, a disjonction.
|
||||
/// That is, only one of these post requisitions
|
||||
/// has to be true in order for this rule
|
||||
/// to expose a success.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Disjonction Right { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public Action<TResult,TInput> Execution { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
17
Yavsc/Models/Workflow/Projet.cs
Normal file
17
Yavsc/Models/Workflow/Projet.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class Projet
|
||||
{
|
||||
[Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("AspNetUsers.Id")]
|
||||
public string ManagerId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
22
Yavsc/Models/Workflow/Skill.cs
Normal file
22
Yavsc/Models/Workflow/Skill.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models {
|
||||
public class Skill {
|
||||
public string Name { get; set; }
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// indice de recherche de cette capacité
|
||||
/// rendu par le système.
|
||||
/// Valide entre 0 et 100,
|
||||
/// Il démarre à 0.
|
||||
/// </summary>
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
20
Yavsc/Models/Workflow/UserSkills.cs
Normal file
20
Yavsc/Models/Workflow/UserSkills.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class UserSkills
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[ForeignKeyAttribute("AspNetUsers.Id")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("Skill.Id")]
|
||||
public long SkillId { get; set; }
|
||||
|
||||
public string Comment { get; set; }
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
}
|
||||
10
Yavsc/Models/Workflow/hr.cs
Normal file
10
Yavsc/Models/Workflow/hr.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class hr
|
||||
{
|
||||
public string userid { get; set; }
|
||||
public string comment { get; set; }
|
||||
public decimal rate { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue