-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PartTemplate work #293
PartTemplate work #293
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Needs a couple of integration tests added for put and post i think.
public class PartTemplateResponseProcessor : JsonResponseProcessor<PartTemplate> | ||
{ | ||
public PartTemplateResponseProcessor(IResourceBuilder<PartTemplate> resourceBuilder) | ||
: base(resourceBuilder, "linnapps-part-templates", 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be the singular. "linnapps-part-template"
[SetUp] | ||
public void SetUp() | ||
{ | ||
var a = new PartTemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd use a more descriptive variable name than a
resource.PartRoot.Should().Be("PARTTEMP"); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we tend to add a newline at the end of files to stop github complaining at us
src/Service/Modules/PartsModule.cs
Outdated
var result = this.partTemplateService.Add(resource); | ||
return this.Negotiate.WithStatusCode(HttpStatusCode.Created) | ||
.WithModel(result) | ||
.WithMediaRangeModel("text/html", ApplicationSettings.Get) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to handle html here because it will never be requested in a PUT or a POST
@@ -0,0 +1,59 @@ | |||
namespace Linn.Stores.Service.Tests.PartsModuleSpecs | |||
{ | |||
using System.Collections.Generic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these usings needed for the get by id?
{ | ||
var a = new PartTemplate | ||
{ | ||
PartRoot = "PARTTEMP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be nice to declare "PARTTEMP" into a string field and then you can reference it against all the tests which avoids typos and also makes it clear what's being tested
AccountingCompany = model.AccountingCompany, | ||
ProductCode = model.ProductCode, | ||
StockControlled = model.StockControlled, | ||
LinnProduced = model.LinnProduced, | ||
RmFg = model.RmFg, | ||
BomType = model.BomType, | ||
AssemblyTechnology = model.AssemblyTechnology, | ||
AllowPartCreation = model.AllowPartCreation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember you can set the "self" linkrel in GetLocation down below
@@ -35,7 +35,7 @@ public IQueryable<PartTemplate> FindAll() | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to take off AsNoTracking up above if we're amending these things now
No worries, was going to add a few more tests on Monday morning so I’ll make these cha ges then too! |
@@ -6,13 +6,16 @@ import partsSelectors from '../../selectors/partsSelectors'; | |||
import { getPrivileges } from '../../selectors/userSelectors'; | |||
import partTemplatesActions from '../../actions/partTemplatesActions'; | |||
import partTemplatesSelectors from '../../selectors/partTemplatesSelectors'; | |||
import partTemplateActions from '../../actions/partTemplatesActions'; | |||
import partTemplateSelectors from '../../selectors/partTemplatesSelectors'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need these extra action creators and selectors in the parts container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also just realised I never got you set up witht the linter which would have complained about this most likely. Give me a shout today and I can try and remember what we need to do to get it working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can talk about it after stand up if you're about
PR for PartTemplate work. Initial backend submitted more submissions and tests to follow.