Skip to content

Commit

Permalink
Add EndpointModelBase for models that can be GET/PUT/POSTED directled…
Browse files Browse the repository at this point in the history
…; All other models are children. Tidy up model .cs files.
  • Loading branch information
Dan Barratt committed May 31, 2012
1 parent 619129c commit 6f015ca
Show file tree
Hide file tree
Showing 22 changed files with 902 additions and 904 deletions.
96 changes: 48 additions & 48 deletions source/XeroApi/Model/Account.cs
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
using System;

namespace XeroApi.Model
{
public class Account : ModelBase
{
[ItemId]
public Guid AccountID { get; set; }

public string Code { get; set; }

public string Name { get; set; }

public string Status { get; set; }

public string Type { get; set; }

public string TaxType { get; set; }

public string Description { get; set; }

public string Class { get; set; }

public string SystemAccount { get; set; }

public bool? EnablePaymentsToAccount { get; set; }

public string BankAccountNumber { get; set; }

public string CurrencyCode { get; set; }

public string ReportingCode { get; set; }

public string ReportingCodeName { get; set; }

// Added for v2.14
public bool ShowInExpenseClaims { get; set; }

public override string ToString()
{
return string.Format("Account:{0}", Code);
}
}


public class Accounts : ModelList<Account>
{
}
using System;

namespace XeroApi.Model
{
public class Account : EndpointModelBase
{
[ItemId]
public Guid AccountID { get; set; }

public string Code { get; set; }

public string Name { get; set; }

public string Status { get; set; }

public string Type { get; set; }

public string TaxType { get; set; }

public string Description { get; set; }

public string Class { get; set; }

public string SystemAccount { get; set; }

public bool? EnablePaymentsToAccount { get; set; }

public string BankAccountNumber { get; set; }

public string CurrencyCode { get; set; }

public string ReportingCode { get; set; }

public string ReportingCodeName { get; set; }

// Added for v2.14
public bool ShowInExpenseClaims { get; set; }

public override string ToString()
{
return string.Format("Account:{0}", Code);
}
}


public class Accounts : ModelList<Account>
{
}
}
110 changes: 55 additions & 55 deletions source/XeroApi/Model/BankTransaction.cs
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
using System;

namespace XeroApi.Model
{
public class BankTransaction : ModelBase
{
[ItemId]
public Guid? BankTransactionID { get; set; }

public Account BankAccount { get; set; }

public string Type { get; set; }

public string Reference { get; set; }

public string Url { get; set; }

public string ExternalLinkProviderName { get; set; }

public bool IsReconciled { get; set; }

public decimal? CurrencyRate { get; set; }

public Contact Contact { get; set; }

public DateTime? Date { get; set; }

public DateTime? DueDate { get; set; }

public virtual Guid? BrandingThemeID { get; set; }

public virtual string Status { get; set; }

public LineAmountType LineAmountTypes { get; set; }

public virtual LineItems LineItems { get; set; }

public virtual decimal? SubTotal { get; set; }

public virtual decimal? TotalTax { get; set; }

public virtual decimal? Total { get; set; }

[ItemUpdatedDate]
public DateTime? UpdatedDateUTC { get; set; }

public virtual string CurrencyCode { get; set; }

public DateTime? FullyPaidOnDate { get; set; }
}


public class BankTransactions : ModelList<BankTransaction>
{
}
using System;

namespace XeroApi.Model
{
public class BankTransaction : EndpointModelBase
{
[ItemId]
public Guid? BankTransactionID { get; set; }

public Account BankAccount { get; set; }

public string Type { get; set; }

public string Reference { get; set; }

public string Url { get; set; }

public string ExternalLinkProviderName { get; set; }

public bool IsReconciled { get; set; }

public decimal? CurrencyRate { get; set; }

public Contact Contact { get; set; }

public DateTime? Date { get; set; }

public DateTime? DueDate { get; set; }

public virtual Guid? BrandingThemeID { get; set; }

public virtual string Status { get; set; }

public LineAmountType LineAmountTypes { get; set; }

public virtual LineItems LineItems { get; set; }

public virtual decimal? SubTotal { get; set; }

public virtual decimal? TotalTax { get; set; }

public virtual decimal? Total { get; set; }

[ItemUpdatedDate]
public DateTime? UpdatedDateUTC { get; set; }

public virtual string CurrencyCode { get; set; }

public DateTime? FullyPaidOnDate { get; set; }
}


public class BankTransactions : ModelList<BankTransaction>
{
}
}
44 changes: 22 additions & 22 deletions source/XeroApi/Model/BrandingTheme.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
using System;

namespace XeroApi.Model
{
public class BrandingTheme : ModelBase
{
[ItemId]
public Guid BrandingThemeID { get; set; }

[ItemNumber]
public string Name { get; set; }

public int SortOrder { get; set; }

[ItemUpdatedDate]
public DateTime CreatedDateUTC { get; set; }
}

public class BrandingThemes : ModelList<BrandingTheme>
{
}
}
using System;

namespace XeroApi.Model
{
public class BrandingTheme : EndpointModelBase
{
[ItemId]
public Guid BrandingThemeID { get; set; }

[ItemNumber]
public string Name { get; set; }

public int SortOrder { get; set; }

[ItemUpdatedDate]
public DateTime CreatedDateUTC { get; set; }
}

public class BrandingThemes : ModelList<BrandingTheme>
{
}
}
118 changes: 59 additions & 59 deletions source/XeroApi/Model/Contact.cs
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
using System;

namespace XeroApi.Model
{
public class Contact : ModelBase
{
[ItemId]
public Guid ContactID { get; set; }

[ItemNumber]
public string ContactNumber { get; set; }

[ItemUpdatedDate]
public DateTime? UpdatedDateUTC { get; set; }

public string ContactStatus { get; set; }

public string Name { get; set; }

public string FirstName { get; set; }

public string LastName { get; set; }

public string EmailAddress { get; set; }

public string SkypeUserName { get; set; }

public string BankAccountDetails { get; set; }

public string TaxNumber { get; set; }

public string AccountsReceivableTaxType { get; set; }

public string AccountsPayableTaxType { get; set; }

public Addresses Addresses { get; set; }

public Phones Phones { get; set; }

public ContactGroups ContactGroups { get; set; }

[ReadOnly]
public bool IsSupplier { get; set; }

[ReadOnly]
public bool IsCustomer { get; set; }

public string DefaultCurrency { get; set; }

public override string ToString()
{
return string.Format("Contact:{0}", Name);
}
}

public class Contacts : ModelList<Contact>
{
}

using System;

namespace XeroApi.Model
{
public class Contact : EndpointModelBase
{
[ItemId]
public Guid ContactID { get; set; }

[ItemNumber]
public string ContactNumber { get; set; }

[ItemUpdatedDate]
public DateTime? UpdatedDateUTC { get; set; }

public string ContactStatus { get; set; }

public string Name { get; set; }

public string FirstName { get; set; }

public string LastName { get; set; }

public string EmailAddress { get; set; }

public string SkypeUserName { get; set; }

public string BankAccountDetails { get; set; }

public string TaxNumber { get; set; }

public string AccountsReceivableTaxType { get; set; }

public string AccountsPayableTaxType { get; set; }

public Addresses Addresses { get; set; }

public Phones Phones { get; set; }

public ContactGroups ContactGroups { get; set; }

[ReadOnly]
public bool IsSupplier { get; set; }

[ReadOnly]
public bool IsCustomer { get; set; }

public string DefaultCurrency { get; set; }

public override string ToString()
{
return string.Format("Contact:{0}", Name);
}
}

public class Contacts : ModelList<Contact>
{
}

}
Loading

0 comments on commit 6f015ca

Please sign in to comment.