Skip to content

Commit

Permalink
added an API stub, changed customer data model, added angular holder …
Browse files Browse the repository at this point in the history
…service
  • Loading branch information
Jeremy Mill committed Nov 3, 2015
1 parent eeb7b99 commit b1707c9
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 15 deletions.
21 changes: 21 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/Controllers/NewCustomerController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TeamDBAwesome.Models;

namespace TeamDBAwesome.Controllers
{
public class NewCustomerController : ApiController
{
// GET api/NewCustomer/a JSON object rep of a customer
public HttpResponseMessage Get(Customer customer)
{
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
return response;
}

}
}
31 changes: 16 additions & 15 deletions TeamDBAwesome/TeamDBAwesome/Models/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,52 @@ public class Customer
{
//alpha upper and lowercase, spaces, dots and dashes from 2 to 20 chars
[RegularExpression(@"^([A-Za-z\s\.-]{2,20})$")]
public string FName;
public string FName { get; set; }

//alpha upper and lowercase, spaces, dots and dashes from 2 to 20 chars
[RegularExpression(@"^([A-Za-z\s\.-]{2,20})$")]
public string LName;
public string LName { get; set; }

//alpha upper and lowercase, spaces, dots, dashes, numbers, colons, pounds and commas from 2 to 70 chars
[RegularExpression(@"^([A-z\s\-\d\.\#\:\,]{2,70})$")]
public string Address;
public string Address { get; set; }

//alpha upper and lowercase, spaces, dots and dashes from 2 to 40 chars
[RegularExpression(@"^([A-Za-z\s\.-]{2,40})$")]
public string City;
public string City { get; set; }

//alpha upper and lowercase, spaces, dots and dashes from 2 to 40 chars
[RegularExpression(@"^([A-Za-z\s\.-]{2,40})$")]
public string State;
public string State { get; set; }

//5-15 digit long numbers
[RegularExpression(@"^(\d{5,15})$")]
public string Post;
public string Post { get; set; }

//alpha upper and lowercase, spaces, dots and dashes from 2 to 40 chars
[RegularExpression(@"^([A-Za-z\s\.-]{2,40})$")]
public string Country;
public string Country { get; set; }

//match a 10-15 digit long number
[RegularExpression(@"^(\d{10,15})$")]
public string Phone;
public string Phone { get; set; }

//match a 10-15 digit long number
[RegularExpression(@"^(\d{10,15})$")]
public string Fax;
public string Fax { get; set; }

//an Email Address
[EmailAddress]
public string Email;
public string Email { get; set; }

//alpha upper and lowercase, spaces, dots and dashes from 2 to 80 chars
[RegularExpression(@"^([A-Za-z\s\.-]{2,80})$")]
public string Company;
//right now I'm going to leave company blank because it's optional
//[RegularExpression(@"^([A-Za-z\s\.-]{2,80})$")]
public string Company { get; set; }

//both of these are just ints
public int SupportRepId;
public int PersonID;
public int CustomerID;
public int SupportRepId { get; set; }
public int PersonID { get; set; }
public int CustomerID { get; set; }
}
}
Binary file modified TeamDBAwesome/TeamDBAwesome/Scripts/_references.js
Binary file not shown.
30 changes: 30 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/js/HolderService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
app.service('HolderService', function () {

//declare the type
//don't change this without also changing the data model
var Blank_Customer = {
FName: null,
LName: null,
Address: null,
City: null,
State: null,
Post: null,
Country: null,
Phone: null,
Fax: null,
Email: null,
Company: null,
SupportRepID: null,
PersonID: null,
CustomerID: null
};


//create the accessor for it
return {
getBlankCustomer: function () {
return Blank_Customer;
}
};

});
41 changes: 41 additions & 0 deletions api_outline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Customer:
-Create account
-NEED: first and Last name, addr, city, state, country, postal, phone, fax, email
-OPT: company name
-edit account
-Search By:
-track name
-album name
-artist name
-composer name
-genre name
-media name
-OR, combination of all
-playlist:
-create playlist
-add track
-remove track
-create order
-playlists (either type)
-get order
-playlists (either type)


Employee:
-New media
-track name, album name, artist name, composer name, genre name, milliseconds, bytes, media type
-modify protected playlists
-add tracks
-remove tracks
-create new protected playlist
-View Customer Data:
-their demographics
-their playlists
-Orders:
-view pending orders
-approve or deny





0 comments on commit b1707c9

Please sign in to comment.