00:00:07.255 --> 00:00:12.085 Today, what I was thinking about I'm I was assuming it was just.
00:00:13.475 --> 00:00:16.967 Umm. Basically appending functionality to current
00:00:16.967 --> 00:00:17.875 workflows as.
00:00:19.735 --> 00:00:23.466 I would say I would say that we probably want to the intent with
00:00:20.025 --> 00:00:20.635 I.
00:00:23.466 --> 00:00:26.279 this is to generate documentation for new people
00:00:26.279 --> 00:00:29.953 ramping up. And so I would say if we can cover both and we it's
00:00:26.765 --> 00:00:27.125 Umm.
00:00:29.953 --> 00:00:33.741 not difficult to make a new like workflow method and we've got an
00:00:33.741 --> 00:00:37.358 hour and a half to cover it. So I think we're probably fine to
00:00:37.358 --> 00:00:40.572 show how to find them, how to make new ones, how to add
00:00:40.572 --> 00:00:44.246 functionality, all that kind of stuff. And we don't have to get
00:00:43.745 --> 00:00:44.175 Yeah.
00:00:44.246 --> 00:00:47.805 like super deep into the weeds. So but just enough that a new
00:00:45.005 --> 00:00:45.255 It's.
00:00:47.805 --> 00:00:49.585 person could use it as a guide.
00:00:49.655 --> 00:00:51.675 To do some day-to-day stuff.
00:00:50.715 --> 00:00:55.048 Yeah, and that's quite. I wasn't gonna get too deep into actually
00:00:55.048 --> 00:00:59.250 making new workflows as that's usually indicative of a of a new
00:00:59.250 --> 00:01:01.745 schema or some kind of schema change.
00:01:03.435 --> 00:01:06.332 Yeah. I mean, if you're adding like a new workflow method to
00:01:04.625 --> 00:01:05.095 So.
00:01:06.332 --> 00:01:09.325 like a like the product workflow because you you have a client
00:01:09.325 --> 00:01:12.222 customization of some specific thing that can happen without
00:01:12.222 --> 00:01:14.787 schema changes like not necessarily making like whole
00:01:13.715 --> 00:01:17.315 That's what I was going to focus on that in the end. Yeah, the
00:01:14.787 --> 00:01:17.305 new types. Yeah, that's good. Yeah, that's good. OK.
00:01:17.315 --> 00:01:20.973 the I think the the core focus of the workflow was more also to
00:01:20.973 --> 00:01:23.145 talk about entity framework and LINQ.
00:01:24.085 --> 00:01:25.655 Perfect. Sounds good to me.
00:01:25.175 --> 00:01:25.605 So.
00:01:26.745 --> 00:01:28.865 OK. Tristan, you back now.
00:01:30.645 --> 00:01:32.085 I've been here the whole time.
00:01:30.725 --> 00:01:31.255 The kids.
00:01:32.325 --> 00:01:35.575 Ah, what did you say? You were not here?
00:01:37.255 --> 00:01:38.575 Did I? Did I say I wasn't here?
00:01:39.295 --> 00:01:40.785 I don't, I don't. I don't know.
00:01:42.195 --> 00:01:44.715 I don't think I did back. You know, I'm here so.
00:01:43.535 --> 00:01:43.915 OK.
00:01:44.625 --> 00:01:46.415 Let me get. Let me go ahead and share my screen.
00:01:50.855 --> 00:01:54.735 OK, so workflows alright so.
00:01:55.745 --> 00:02:00.255 Basically, workflows are the business logic as it says.
00:02:02.495 --> 00:02:03.255 No 5.
00:02:04.635 --> 00:02:07.716 Business logic directory UM is where all of the kind of
00:02:07.716 --> 00:02:11.293 functionality is going to happen outside of the endpoint, so the
00:02:11.293 --> 00:02:14.045 endpoints are gonna be the ones calling these to.
00:02:15.205 --> 00:02:18.271 Do some kind of logic to produce the results that you want to to
00:02:18.271 --> 00:02:20.395 get the data that you want on the front end.
00:02:22.515 --> 00:02:26.281 The basically the structure of the workflows in here. I mean
00:02:26.281 --> 00:02:30.172 it's it's pretty obvious to see, you can see the the different
00:02:30.172 --> 00:02:33.445 kind of schemas that we're going to be working with.
00:02:34.025 --> 00:02:36.955 Umm, so if you need to add something to.
00:02:37.745 --> 00:02:41.028 Let's say the product workflow. Obviously it's going to be in
00:02:41.028 --> 00:02:44.312 the products folder, umm and then you can see as we drop down
00:02:44.312 --> 00:02:46.855 into the products schema, we can see different.
00:02:49.135 --> 00:02:52.789 What looked like tables where those methods would live to kind
00:02:52.789 --> 00:02:54.645 of organize those appropriately.
00:02:57.795 --> 00:02:59.815 One note on I guess.
00:03:00.845 --> 00:03:04.390 Adding functionality before we get kind of started in that is
00:03:04.390 --> 00:03:07.592 when you open up these directories, you're going to see
00:03:07.592 --> 00:03:11.080 two different kinds. You're going to see a dot generated and
00:03:11.080 --> 00:03:14.397 you're going to see a dot extended. If you are looking to
00:03:14.397 --> 00:03:18.056 just add a workflow method for something that's been done to an
00:03:18.056 --> 00:03:20.115 entity, or you need some something.
00:03:21.315 --> 00:03:24.784 A little bit more custom than what's happening. Always add
00:03:24.784 --> 00:03:28.489 them to the extended as if you add them to the generator, they
00:03:28.489 --> 00:03:29.665 will be overwritten.
00:03:30.985 --> 00:03:34.877 If at 4 is run in this particular schema, so anytime
00:03:34.877 --> 00:03:35.465 you add.
00:03:36.315 --> 00:03:40.725 Anything to a workflow always added into the dot extended
00:03:40.725 --> 00:03:42.855 folder or dot extended file.
00:03:43.745 --> 00:03:45.345 For that? Umm.
00:03:48.005 --> 00:03:51.635 So diving into kind of the workflow itself.
00:03:54.525 --> 00:03:58.469 If you look at the generated and you'll kind of see the basic
00:03:58.469 --> 00:04:01.395 crud workflows in here. So the get async the.
00:04:02.115 --> 00:04:04.884 Things of that nature and and a lot of times in here what you'll
00:04:04.884 --> 00:04:05.055 see.
00:04:06.005 --> 00:04:11.375 Is overrides of, creates updates things like that.
00:04:14.425 --> 00:04:16.655 And I guess we can probably look at that as well.
00:04:17.515 --> 00:04:18.085 Umm.
00:04:21.535 --> 00:04:24.710 So the basic crud workflow is going to be created by at 4
00:04:24.710 --> 00:04:28.160 provided it's been created. You create a schema, you run the T
00:04:28.160 --> 00:04:31.226 fours and you're gonna be looking at the crud endpoints
00:04:31.226 --> 00:04:33.855 are gonna be using the base crud endpoints now.
00:04:34.655 --> 00:04:39.436 A lot of times with, let's say I think products has one. I know
00:04:39.436 --> 00:04:43.545 users has one, it's going to override the base create.
00:04:44.985 --> 00:04:48.573 So if you're ever looking in there to find out, OK, is there
00:04:48.573 --> 00:04:52.220 anything specific happening with with this particular entity,
00:04:52.220 --> 00:04:55.455 you're gonna end up looking at the base create method.
00:04:56.175 --> 00:04:59.104 If you're having an issue with Prada creation or whatever
00:04:59.104 --> 00:05:02.134 entity you're working with that creation, and then what you
00:05:02.134 --> 00:05:04.205 wanna look for is, is there an override?
00:05:04.915 --> 00:05:09.215 For this particular entity, uh on the create or say update
00:05:09.215 --> 00:05:13.806 methods in the specific workflow directory that you're looking
00:05:13.806 --> 00:05:14.025 at.
00:05:15.565 --> 00:05:16.905 Otherwise it's going to be.
00:05:18.445 --> 00:05:19.785 In the the shared.
00:05:20.765 --> 00:05:24.065 Folder for the base crud methods for workflows.
00:05:24.785 --> 00:05:25.635 Ohm.
00:05:31.235 --> 00:05:32.825 Brendan, is there any kind of other?
00:05:33.915 --> 00:05:37.925 Preliminary information other than that that we need to go
00:05:37.925 --> 00:05:38.265 into.
00:05:42.145 --> 00:05:43.215 No, I think.
00:05:43.865 --> 00:05:46.875 Uh, as far as I've been hearing, I think it's going good.
00:05:47.675 --> 00:05:51.175 But call up before we start making one.
00:05:47.705 --> 00:05:48.095 OK.
00:05:52.595 --> 00:05:55.995 And I was. I was gonna say like what branch are do you use?
00:05:55.995 --> 00:05:57.185 Because I know where.
00:05:56.325 --> 00:05:57.315 I'm going to create a new one.
00:05:57.975 --> 00:06:00.605 And I I selected Rob, yeah.
00:05:58.225 --> 00:06:00.445 Because there are on Rob right now and robs.
00:06:01.135 --> 00:06:04.545 Forked, so maybe let's choose something that's working so we
00:06:04.185 --> 00:06:05.615 Does it need to work?
00:06:04.545 --> 00:06:04.825 know.
00:06:06.475 --> 00:06:10.634 Well, if we wanna observe testing the endpoint, then
00:06:09.945 --> 00:06:10.415 OK.
00:06:10.634 --> 00:06:11.105 maybe.
00:06:12.325 --> 00:06:17.789 If that's not important, then we don't have to do that. But yeah,
00:06:12.945 --> 00:06:13.415 OK.
00:06:17.789 --> 00:06:18.535 just for.
00:06:18.095 --> 00:06:20.188 I always figuring if you could, as long as you could test it
00:06:20.188 --> 00:06:20.635 with postman.
00:06:22.795 --> 00:06:23.275 Umm.
00:06:23.015 --> 00:06:25.603 We'd be OK because, I mean, we're specifically talking about
00:06:25.603 --> 00:06:28.362 back end tasks. So I wasn't too worried about seeing anything in
00:06:28.362 --> 00:06:31.035 the UI or anything like that. So as long as we can hit it with
00:06:29.775 --> 00:06:32.643 I'm just thinking I'm wondering if a migration issue would
00:06:31.035 --> 00:06:31.375 postman.
00:06:32.643 --> 00:06:35.025 cause. I mean maybe it would work anyways, yeah.
00:06:35.095 --> 00:06:35.585 I don't know.
00:06:38.305 --> 00:06:41.310 I don't know if you have any other like SEF Pay hub locals,
00:06:41.310 --> 00:06:43.715 but pretty much any other one would be working.
00:06:42.805 --> 00:06:43.295 No.
00:06:44.175 --> 00:06:46.265 This is the only pay hub local that I have.
00:06:47.025 --> 00:06:49.535 You could check out to coma, QA and just.
00:06:51.265 --> 00:06:55.951 You'll have to build anyways, right? So, but that would 100%
00:06:53.675 --> 00:06:54.375 Most likely.
00:06:55.951 --> 00:06:56.335 work.
00:06:56.465 --> 00:06:59.095 Is there a reason we need to show this on a pay help local
00:06:59.095 --> 00:07:01.235 you have other working stuff locals we can use.
00:07:01.515 --> 00:07:01.955 I mean.
00:07:02.785 --> 00:07:06.490 I was just thinking because he's already on a pay hub local, so
00:07:06.490 --> 00:07:09.849 like I was just thinking, what's another payab local that
00:07:09.045 --> 00:07:10.115 Ah, OK, so you say.
00:07:09.849 --> 00:07:13.497 actually doesn't have like site breaking bugs that would might
00:07:13.497 --> 00:07:17.145 cause some weird outcome at the end when we try to test stuff?
00:07:19.995 --> 00:07:20.515 I mean I can.
00:07:21.355 --> 00:07:23.015 I could check out Tacoma if you want me to.
00:07:24.575 --> 00:07:27.530 I'd do that before we make the changes, just so we know. We're
00:07:26.905 --> 00:07:27.365 That's fine.
00:07:27.425 --> 00:07:29.850 If there's migration issues, there's migration issues
00:07:27.530 --> 00:07:29.125 like on a on a working QA branch.
00:07:29.355 --> 00:07:30.665 Yeah, there is currently.
00:07:29.850 --> 00:07:32.500 unrobbed then we're not gonna be able to show querying for
00:07:31.815 --> 00:07:32.215 It's.
00:07:32.500 --> 00:07:35.061 anything from the database, which we're definitely gonna
00:07:35.061 --> 00:07:35.555 wanna show.
00:07:35.935 --> 00:07:38.665 Yeah, I figured. So that's why I called that.
00:07:37.145 --> 00:07:39.195 We're we're currently is.
00:07:39.275 --> 00:07:42.865 If they're currently is, unfortunately.
00:07:45.245 --> 00:07:47.825 Which will we'll probably want to look at that.
00:07:45.255 --> 00:07:46.155 So.
00:07:48.305 --> 00:07:51.495 Uh, Greg, maybe after training, if you're free?
00:07:53.585 --> 00:07:57.677 Uh, unfortunately not today. I am not. Yeah, I got. I gotta
00:07:55.955 --> 00:07:56.765 OK, that's fine.
00:07:57.677 --> 00:08:00.815 office hours with you on the Monday for that.
00:08:00.885 --> 00:08:02.485 Right, yeah. Perfect that works.
00:08:01.645 --> 00:08:01.885 Yep.
00:08:04.175 --> 00:08:06.215 So yeah, that's OK, right in there now.
00:08:07.585 --> 00:08:08.685 Q's fine Tristan.
00:08:09.125 --> 00:08:09.615 Yep.
00:08:09.485 --> 00:08:10.145 Is it OK?
00:08:13.755 --> 00:08:14.505 They're all.
00:08:15.905 --> 00:08:17.155 Equal right now.
00:08:17.795 --> 00:08:18.295 What's that?
00:08:18.995 --> 00:08:19.935 They are all equal.
00:08:22.595 --> 00:08:26.637 I don't think I need any of the changes I was working on this
00:08:26.637 --> 00:08:27.615 one to try and.
00:08:28.675 --> 00:08:30.055 Yeah, just stash them, I guess.
00:08:28.895 --> 00:08:31.450 Deal with the I'm gonna stash and. Yeah, because I was trying
00:08:31.450 --> 00:08:33.800 to deal with this with the migration issues on this one,
00:08:33.800 --> 00:08:33.965 but.
00:08:44.965 --> 00:08:48.371 Speaking of a checking out to a new branch, not that I mean it
00:08:48.371 --> 00:08:51.669 should be self-explanatory, but I know for some front Enders
00:08:51.669 --> 00:08:55.130 that are noticed they run into this like yeah, if you check out
00:08:55.130 --> 00:08:55.995 to a new branch.
00:08:56.655 --> 00:08:59.335 Rebuild. Do yourself a favor. Don't.
00:09:00.265 --> 00:09:02.375 Don't make assumptions so.
00:09:00.385 --> 00:09:01.015 Umm.
00:09:05.155 --> 00:09:05.955 You're all of it.
00:09:06.865 --> 00:09:07.245 Yeah.
00:09:08.955 --> 00:09:10.275 Probably not had this on today.
00:09:14.555 --> 00:09:15.155 Turn off.
00:09:29.415 --> 00:09:31.125 OK. So while we're waiting for that.
00:09:34.765 --> 00:09:37.509 Though he pretty much gone over the kind of preliminary
00:09:37.509 --> 00:09:40.547 information on what uh, what a workflow is, where to look for
00:09:40.547 --> 00:09:42.605 them and kind of how to add the logic in.
00:09:44.595 --> 00:09:47.546 So Tristan, did you have any specific in mind? Do you wanna
00:09:47.546 --> 00:09:49.415 where you wanted me to add something?
00:09:50.625 --> 00:09:53.339 Ohh, I don't think it matters as long as we're just doing a
00:09:50.705 --> 00:09:51.865 To Shogun of a working.
00:09:53.339 --> 00:09:55.195 paginated results thing we do invoicing.
00:09:55.235 --> 00:09:56.855 No paginator results.
00:09:57.805 --> 00:09:58.945 Yeah, that's that's a.
00:10:00.095 --> 00:10:03.667 That was the thing, wasn't it? We wanna do like a paginated
00:10:02.165 --> 00:10:06.920 That was your thing, not mine. That was your thing. That's what
00:10:03.667 --> 00:10:07.120 results endpoint or did I say that I might have said that
00:10:06.920 --> 00:10:07.515 we said.
00:10:07.120 --> 00:10:10.811 because it's like a an example of something where you need to
00:10:10.811 --> 00:10:14.145 do a post even though it feels like it should be a get.
00:10:15.015 --> 00:10:18.175 I think that's why I I said that cause matters.
00:10:15.045 --> 00:10:15.545 Umm.
00:10:19.665 --> 00:10:19.905 Yeah.
00:10:29.445 --> 00:10:33.215 See, we have in here. So the more they cannot soon.
00:10:30.955 --> 00:10:34.456 Yeah, User Account Control in the bottom right is that what's
00:10:34.456 --> 00:10:35.755 happening your taskbar?
00:10:38.485 --> 00:10:40.775 Tristan Ohi probably hear more than once.
00:10:41.865 --> 00:10:43.275 Thinking it was, it was already on.
00:10:45.275 --> 00:10:50.205 OK, so I'm thinking we could probably let's.
00:11:04.265 --> 00:11:06.965 Sales so that sales invoice payment.
00:11:08.465 --> 00:11:08.955 Uh.
00:11:08.605 --> 00:11:09.015 Yeah.
00:11:11.265 --> 00:11:12.505 Each one invoices themselves.
00:11:13.915 --> 00:11:16.342 Yeah, I was gonna say we could just do like invoices for
00:11:16.342 --> 00:11:18.855 current account which is already a thing, but we can just.
00:11:18.955 --> 00:11:20.105 Yeah. No, I got you.
00:11:21.175 --> 00:11:22.075 Do it anyways.
00:11:22.505 --> 00:11:23.005 OK.
00:11:24.225 --> 00:11:27.851 So for that one to keep the structure the way it is, I think
00:11:27.851 --> 00:11:31.715 we're, we'd probably need, we're gonna need a new file for that.
00:11:32.505 --> 00:11:35.375 So because I mean you, you kind of see how these are organized?
00:11:36.695 --> 00:11:40.334 And this one specific to sales invoice payments. So we wouldn't
00:11:40.334 --> 00:11:43.803 want to put any logic that's specific to gathering just flat
00:11:43.803 --> 00:11:44.315 invoices.
00:11:45.395 --> 00:11:48.983 In here, in order to make keep this organized so the
00:11:48.983 --> 00:11:53.180 information of the the the code is easy to find for others in
00:11:53.180 --> 00:11:53.925 the future.
00:11:55.185 --> 00:11:58.285 So, I mean, it's really as simple.
00:12:01.975 --> 00:12:04.125 That's my screw up my build here.
00:12:05.615 --> 00:12:06.595 That's done OK, good.
00:12:18.425 --> 00:12:21.243 Yeah, we're in the interfaces. So we want that one there. Yeah,
00:12:21.243 --> 00:12:21.375 OK.
00:12:29.235 --> 00:12:29.915 Right. Name it right.
00:12:37.395 --> 00:12:40.752 I guess we should probably give it a weird name just because
00:12:40.752 --> 00:12:44.055 that if we just do get sales, invoices might already exist.
00:12:41.595 --> 00:12:42.605 That like.
00:12:45.185 --> 00:12:46.555 Uh for the method itself.
00:12:45.265 --> 00:12:45.805 Do this.
00:12:48.835 --> 00:12:49.455 Uh.
00:12:51.415 --> 00:12:54.515 Or no, no, no, I guess not for the file necessarily. I mean for
00:12:54.515 --> 00:12:57.421 the method signature and I should and I'll say this because
00:12:57.421 --> 00:13:00.376 some people don't know what a method signature is and that's
00:13:00.376 --> 00:13:01.055 fine cuz like.
00:13:02.235 --> 00:13:05.492 Couple years ago, I was like, what's the signature as well,
00:13:05.492 --> 00:13:08.586 even though I knew I just, I didn't know what I I didn't
00:13:05.755 --> 00:13:06.725 It's your face, right?
00:13:08.586 --> 00:13:11.408 know. I do, but it's just basically the name of the
00:13:11.408 --> 00:13:14.991 method, the parameters. And it's basically like the name. So what
00:13:14.991 --> 00:13:18.356 would show up in an interface which all an interface contains
00:13:17.165 --> 00:13:17.625 Indeed.
00:13:18.356 --> 00:13:20.745 when it comes to methods as signatures? So.
00:13:19.875 --> 00:13:20.695 So yeah, we're.
00:13:19.905 --> 00:13:24.254 The signature. Yeah. Signature includes the name, the
00:13:21.515 --> 00:13:21.785 Yeah.
00:13:24.254 --> 00:13:28.845 parameters and the return type. That is and every every.
00:13:28.035 --> 00:13:31.045 Although you cannot have two that have the same name in
00:13:31.045 --> 00:13:33.195 parameters with different return types.
00:13:32.055 --> 00:13:32.475 Umm.
00:13:34.375 --> 00:13:35.735 Right, that's true. Good point.
00:13:35.665 --> 00:13:36.175 Correct.
00:13:38.415 --> 00:13:42.055 OK, so in here we have our new file that's going to actually.
00:13:45.645 --> 00:13:48.663 Inherit from this and I'm going to assume that, yeah, this
00:13:48.663 --> 00:13:49.635 exists already. UM.
00:13:48.945 --> 00:13:49.235 Yeah.
00:13:50.815 --> 00:13:53.855 And I can kind of, yeah, I'd be a little worried if.
00:13:50.945 --> 00:13:51.625 It didn't.
00:13:54.075 --> 00:13:55.365 I'd be a little worried too.
00:13:55.885 --> 00:13:59.485 So this might be a little confusing for for newer folks
00:13:59.485 --> 00:14:03.472 that are looking at this because you're not gonna see this in
00:14:03.472 --> 00:14:05.015 here where this initial.
00:14:06.865 --> 00:14:12.105 In face interface excuse me is going to exist is going to be in
00:14:12.105 --> 00:14:12.515 here.
00:14:14.995 --> 00:14:18.377 So there's that's where these initial interfaces are going to
00:14:18.377 --> 00:14:20.505 be in the uh acrid workflow generated.
00:14:24.635 --> 00:14:27.524 I break those out into separated files as they grow so when they
00:14:27.524 --> 00:14:30.279 get to a point where it's like it's gonna be like 8000 lines,
00:14:28.055 --> 00:14:28.435 Umm.
00:14:30.279 --> 00:14:33.035 I'm like, oh, that's too big for like Resharper and Roslyn to
00:14:31.165 --> 00:14:31.455 Yeah.
00:14:33.035 --> 00:14:33.835 process correctly.
00:14:34.995 --> 00:14:37.751 Alright, well, they still stick to it correctly. It just be
00:14:37.751 --> 00:14:40.508 really slow about it. So I start breaking them up into like
00:14:40.508 --> 00:14:43.540 originally all of them were like it was like it generate one file
00:14:43.540 --> 00:14:46.389 that had all the lines in it and then when they got too big I
00:14:44.515 --> 00:14:44.865 Umm.
00:14:46.389 --> 00:14:49.329 would break it up by schema so that it would be a lot. It would
00:14:49.329 --> 00:14:52.178 last for quite a while that way, but then eventually it would
00:14:52.178 --> 00:14:55.118 just get to the point where like OK now I need to do individual
00:14:55.118 --> 00:14:57.829 files for all of them. And thanks to the multi file output
00:14:55.575 --> 00:14:56.045 Yeah.
00:14:57.829 --> 00:15:00.677 functionality working the way that it does now I can actually
00:15:00.677 --> 00:15:02.928 go in and out of folder structures and move them
00:15:02.928 --> 00:15:05.731 entirely over to their separate folders which is how you see
00:15:05.731 --> 00:15:05.915 the.
00:15:06.195 --> 00:15:09.264 The the workflows, concrete ones, uh work now is is they.
00:15:09.264 --> 00:15:12.334 They all go to their actual folders rather than all being
00:15:12.334 --> 00:15:14.345 underneath the under score T4 folder.
00:15:15.755 --> 00:15:16.245 For stuff.
00:15:16.765 --> 00:15:20.211 Gotcha. Yeah. Just I just wanted to call that out for some from
00:15:20.211 --> 00:15:23.603 some for some newer folks that might be a little confused that
00:15:23.603 --> 00:15:26.887 they don't see that in here where a good portion of them are
00:15:26.887 --> 00:15:30.225 gonna live is in there. So just so you know where to look for
00:15:30.225 --> 00:15:30.495 them?
00:15:31.565 --> 00:15:34.767 One thing I wanna talk about prior to actually getting into
00:15:34.767 --> 00:15:36.475 creating these is documentation.
00:15:38.645 --> 00:15:42.099 I was gonna say I was like, if I was like, let's start with
00:15:41.955 --> 00:15:42.715 Yeah.
00:15:42.099 --> 00:15:44.575 what's gonna like block your PR, you know?
00:15:43.535 --> 00:15:47.175 So yeah, exactly. So and it's not.
00:15:48.585 --> 00:15:52.393 I mean I'm, I should say this, but I'm not a huge fan of a lot
00:15:52.393 --> 00:15:54.025 of this documentation, but.
00:15:56.215 --> 00:15:59.660 In the interest of keeping everything in here consistent,
00:15:59.660 --> 00:16:02.926 consistent so that you are confident you can tell what
00:16:02.926 --> 00:16:06.490 you're going to be seeing in this file before you even open
00:16:06.490 --> 00:16:07.025 the file.
00:16:09.185 --> 00:16:13.041 We need to include everything that was in here in here, so the
00:16:13.041 --> 00:16:16.958 method should be documented. The interface should be documented
00:16:16.958 --> 00:16:20.630 as well as the file itself should be documented and you can
00:16:20.630 --> 00:16:24.425 kind of see the format here of how the how this works on the.
00:16:25.495 --> 00:16:28.657 The the method signature, so it's going to have the
00:16:28.657 --> 00:16:32.487 parameters or return the summary of kind of what it what it is
00:16:32.487 --> 00:16:36.075 and what it does. It doesn't have to be extremely verbose,
00:16:36.075 --> 00:16:36.805 but just so.
00:16:37.895 --> 00:16:40.955 You can kind of tell in in a single line what this is
00:16:40.955 --> 00:16:41.805 intended to do.
00:16:43.425 --> 00:16:46.330 Because this is kind of what this is what you're going to see
00:16:46.330 --> 00:16:48.767 when you hover over it. And let's say you're you're
00:16:48.767 --> 00:16:51.626 somewhere else in the code and you see this. Uh, that's what
00:16:51.626 --> 00:16:54.485 you're going to see. O make it descriptive enough so you can
00:16:54.485 --> 00:16:57.391 kind of say, OK, this is what this is doing. So, you know, at
00:16:57.391 --> 00:17:00.390 a basic level. So you can keep rolling through the code without
00:17:00.390 --> 00:17:03.203 having to dig into, OK, that doesn't make any sense. Let me
00:17:03.203 --> 00:17:05.968 go find this method and look at the code and see what it's
00:17:05.968 --> 00:17:08.873 actually doing. Try to make it descriptive enough so it makes
00:17:08.873 --> 00:17:09.155 sense.
00:17:10.775 --> 00:17:13.765 Tell me what's wrong with lines 124 and 10.
00:17:10.945 --> 00:17:11.365 But.
00:17:14.305 --> 00:17:17.705 124 and 10 well, first of all, the the uh, the file name is
00:17:17.705 --> 00:17:18.045 wrong.
00:17:21.525 --> 00:17:25.532 And the that's wrong in and of itself right there. That makes
00:17:25.532 --> 00:17:28.765 this wrong because that you're looking for James.
00:17:27.245 --> 00:17:27.475 OK.
00:17:29.275 --> 00:17:31.680 That's that's one thing. So go ahead, make those two
00:17:31.680 --> 00:17:32.225 corrections.
00:17:32.335 --> 00:17:32.685 OK.
00:17:34.705 --> 00:17:37.165 And notice how that made it right. Uh, I've not read a
00:17:37.165 --> 00:17:38.105 yellow squiggle away.
00:17:38.775 --> 00:17:39.155 Mm-hmm.
00:17:39.875 --> 00:17:42.045 OK, so now it's just two and 10.
00:17:44.615 --> 00:17:45.405 That's correct.
00:17:47.375 --> 00:17:48.505 And then now just 10.
00:17:50.115 --> 00:17:53.453 Actually speaking, so is that like? Is that a new thing where
00:17:50.625 --> 00:17:51.215 Oh 10.
00:17:53.453 --> 00:17:56.415 we only want the current year in the copyright header?
00:17:55.845 --> 00:17:57.345 That is for new files.
00:17:55.945 --> 00:17:56.765 No, it's.
00:17:58.645 --> 00:18:00.495 I'll for new files, OK.
00:17:59.895 --> 00:18:00.235 Mm-hmm.
00:18:01.175 --> 00:18:01.435 Yeah.
00:18:01.725 --> 00:18:04.836 18 whenever the the original value copied that from came
00:18:04.685 --> 00:18:04.955 Yeah.
00:18:04.836 --> 00:18:07.894 from. So when you make new files, the copyright date is
00:18:06.685 --> 00:18:07.295 I see.
00:18:07.894 --> 00:18:11.060 just the year it is now, and then when the following year
00:18:11.060 --> 00:18:14.499 rolls around, we do 2023 to 2024 and then you know the year it
00:18:14.499 --> 00:18:16.465 was created remains the first year.
00:18:14.765 --> 00:18:18.998 Yeah. And I have replaced all that I I do rollouts for that in
00:18:18.998 --> 00:18:20.275 January every year.
00:18:20.925 --> 00:18:21.555 OK.
00:18:21.135 --> 00:18:21.395 Umm.
00:18:21.815 --> 00:18:22.725 To to do that.
00:18:24.105 --> 00:18:25.375 So just do yourself a favor.
00:18:26.435 --> 00:18:26.915 Yeah.
00:18:27.615 --> 00:18:31.195 So, well, let's say let's say we were, for whatever reason, we're
00:18:27.875 --> 00:18:28.985 Do us all a favor.
00:18:31.195 --> 00:18:33.365 in the rollover period and I said 2022.
00:18:34.785 --> 00:18:37.305 We would do 2022 Dash 2023.
00:18:37.995 --> 00:18:38.425 Yes.
00:18:39.205 --> 00:18:41.595 OK. Or if we were editing a file that?
00:18:42.745 --> 00:18:46.165 Yeah, we would. We would update that. Yeah, I'm just making sure
00:18:45.995 --> 00:18:46.295 Yeah.
00:18:46.165 --> 00:18:48.796 that it's clear to someone watching what with the
00:18:48.495 --> 00:18:51.174 I in in theory you should never have to like you would just be.
00:18:48.796 --> 00:18:49.375 procedures.
00:18:51.174 --> 00:18:53.854 You wouldn't just be going into a file noticing that it was out
00:18:53.854 --> 00:18:56.533 of date and then manually fixing it because at the beginning of
00:18:55.525 --> 00:18:55.855 Yeah.
00:18:56.533 --> 00:18:59.087 the year there would be some replace all that would go in as
00:18:59.087 --> 00:19:01.725 a as a singular PR that would just knock all that out for you.
00:19:03.105 --> 00:19:06.381 All at once because it has to be done in at the at the top of the
00:19:06.381 --> 00:19:09.409 stack, top headers at the top of the. The headers inside the
00:19:09.409 --> 00:19:12.536 TypeScript files. There's a few HTML files that have that kind
00:19:12.536 --> 00:19:15.564 of thing. There's the numbers that are inside the copyrights
00:19:15.564 --> 00:19:18.443 of the assembly info, and that's inside the project files
00:19:18.443 --> 00:19:21.422 themselves. It's all over the place with slightly different
00:19:21.422 --> 00:19:24.648 formats, and so you want to make sure you hit all of them at the
00:19:24.648 --> 00:19:25.145 same time.
00:19:26.235 --> 00:19:28.575 With, with with the appropriate stuff to make sure that they
00:19:28.575 --> 00:19:29.535 they get carried forward.
00:19:32.425 --> 00:19:33.035 Make sense?
00:19:32.455 --> 00:19:35.153 And it's largely a a cover cover your *** thing, because if
00:19:35.153 --> 00:19:37.941 somebody pulls that down, they immediately have code in there
00:19:37.941 --> 00:19:40.505 that says this belongs to clarity, stops trying to steal
00:19:40.505 --> 00:19:41.045 it, *******.
00:19:42.805 --> 00:19:43.595 Kind of thing.
00:19:45.955 --> 00:19:48.820 OK, so now we've covered documentation. Always, always.
00:19:48.820 --> 00:19:51.941 Always make sure this is in here, otherwise your PR won't go
00:19:51.941 --> 00:19:55.164 through because I think James, you set this to actually throws
00:19:55.164 --> 00:19:56.085 an error, correct?
00:19:56.745 --> 00:20:00.391 Yeah. So most of the style cop rules will will block your PR if
00:19:57.835 --> 00:19:58.195 OK.
00:20:00.391 --> 00:20:03.923 they fail. They do not block it while you're building on your
00:20:03.923 --> 00:20:07.569 local so that you can do faster prototyping and working through
00:20:07.569 --> 00:20:11.273 stuff. I don't want you to have to fail your local build because
00:20:11.273 --> 00:20:14.748 you didn't put the header in when you're just trying to test
00:20:14.748 --> 00:20:17.255 something or build something out initially.
00:20:20.195 --> 00:20:22.886 OK, so now we have our documentation down. We pretty
00:20:22.886 --> 00:20:26.085 much have the file set up the way we wanted to. Now we need to
00:20:26.085 --> 00:20:29.030 add actually our our method signature in here that we are
00:20:29.030 --> 00:20:32.026 going to implement later into the actual workflow file. So
00:20:32.026 --> 00:20:35.073 what is it you said you wanted to actually do, Tristan, you
00:20:35.073 --> 00:20:36.495 wanna get paginated results?
00:20:37.865 --> 00:20:41.373 Yeah. And I think I think this this signature here is already
00:20:38.805 --> 00:20:39.125 OK.
00:20:41.373 --> 00:20:44.769 doing that. I think it the reason it's sneaking, correct me
00:20:43.335 --> 00:20:43.615 Umm.
00:20:44.769 --> 00:20:48.221 if I'm wrong. Brendan James, I think the reasons for turning
00:20:48.221 --> 00:20:51.672 the object is because I don't know if there's like an actual
00:20:51.672 --> 00:20:54.842 iPad paginated results interface. I think it's only the
00:20:54.842 --> 00:20:57.445 concrete type which isn't accessible in here.
00:20:55.085 --> 00:20:59.579 The the workflow layer should be returning the actual types the
00:20:59.579 --> 00:21:03.371 the service layer is what's supposed to return object
00:20:59.825 --> 00:21:00.475 Umm yeah.
00:21:03.371 --> 00:21:04.355 question mark.
00:21:05.695 --> 00:21:08.866 Yeah, I'm thinking in this specific instance of. So is
00:21:06.835 --> 00:21:07.665 So when you.
00:21:08.866 --> 00:21:11.115 there like an eye paginate results of?
00:21:12.055 --> 00:21:15.173 No, what you would do is return a tuple where the first the
00:21:15.173 --> 00:21:18.446 first argument of the tuple is the list of results, the second
00:21:18.446 --> 00:21:21.045 one is the total count, and the third one is the.
00:21:21.405 --> 00:21:22.235 Uh.
00:21:23.315 --> 00:21:27.685 Current count, I think, uh. If you go to the I workflow base.
00:21:28.395 --> 00:21:31.646 Umm. And look at the search one, you'll see what the defaults
00:21:31.646 --> 00:21:34.425 with for that would normally that would normally be.
00:21:35.855 --> 00:21:37.185 So if you press control T.
00:21:38.015 --> 00:21:40.878 And do I workflow based it would bring you over to this file,
00:21:40.878 --> 00:21:43.464 find the one that says I workflow based has search. You
00:21:43.464 --> 00:21:46.328 can see it there on 37 and you can go to the definition of it
00:21:46.328 --> 00:21:46.605 there.
00:21:50.475 --> 00:21:54.712 Yeah, just click on it and have 12. Yep, and then Scroll down a
00:21:54.712 --> 00:21:58.552 smidge because the line is slightly cut off. There we go,
00:21:58.552 --> 00:22:02.657 line 379. So a list of TI model results. Total pages in total
00:21:59.625 --> 00:22:00.095 OK.
00:22:02.657 --> 00:22:03.055 count.
00:22:03.865 --> 00:22:04.835 Is it as a tuple?
00:22:07.225 --> 00:22:07.585 Yeah.
00:22:07.705 --> 00:22:09.495 And that's your normal signature for it.
00:22:08.245 --> 00:22:08.715 So that.
00:22:09.995 --> 00:22:13.662 OK. Yeah. And the reason I actually specifically chose the
00:22:13.662 --> 00:22:17.205 pages, I wasn't trying to make your life difficult. It's
00:22:17.205 --> 00:22:20.810 because of a lot of places people like all over, and I've
00:22:18.145 --> 00:22:18.515 Yeah.
00:22:20.810 --> 00:22:24.725 done this, it just returns an object. So I wanted to also know
00:22:24.725 --> 00:22:25.285 what the.
00:22:26.055 --> 00:22:28.285 Best way to do this was I guess.
00:22:29.555 --> 00:22:31.925 Not just a way, but yeah, there you go.
00:22:32.275 --> 00:22:32.585 Yeah.
00:22:33.315 --> 00:22:35.195 I got you. OK, so that's good.
00:22:36.825 --> 00:22:37.845 OK so.
00:22:40.355 --> 00:22:43.490 Onto the method itself. So I mean, we're just really looking
00:22:43.490 --> 00:22:43.645 at.
00:22:52.095 --> 00:22:54.532 Getting sales invoices, that kind of what you want to do,
00:22:54.532 --> 00:22:54.995 trust them.
00:22:55.205 --> 00:22:58.845 Umm, I mean I would do for current account.
00:23:00.045 --> 00:23:03.487 Just as a better example, I don't know if I'd name it
00:23:03.487 --> 00:23:07.375 exactly like sales invoices for current account. Just add an
00:23:07.375 --> 00:23:11.199 extra word that says test or something in there, but you do
00:23:11.199 --> 00:23:14.960 get sales invoices, tests for current account or something
00:23:13.265 --> 00:23:16.014 Well, the IT, it definitely won't be on the sales invoice
00:23:14.960 --> 00:23:15.215 but.
00:23:16.014 --> 00:23:19.000 workflow by default because all the sales invoice custom stuff
00:23:19.000 --> 00:23:21.796 is inside the provider for invoices now. So you're safe to
00:23:21.765 --> 00:23:22.275 Umm.
00:23:21.796 --> 00:23:23.645 write whatever you need to write here.
00:23:22.055 --> 00:23:23.065 Ohh that's right.
00:23:23.725 --> 00:23:24.485 OK, true.
00:23:24.765 --> 00:23:29.255 OK, gotcha. OK. So we should be, yeah, we should be fine, so.
00:23:28.565 --> 00:23:30.967 And it probably wouldn't be complaining if there was a
00:23:30.967 --> 00:23:33.195 signature at the same name, so I think we're good.
00:23:33.925 --> 00:23:36.087 And then if you're not trying to do a sales invoice payment, just
00:23:34.015 --> 00:23:34.645 So with.
00:23:36.087 --> 00:23:37.955 make sure you take payment out of the rest of the stuff.
00:23:39.245 --> 00:23:40.345 Like where your cursor is.
00:23:39.615 --> 00:23:43.048 Yeah, that's what I'm that's what I'm getting ready to do.
00:23:43.048 --> 00:23:46.539 Red. Right now. OK. So for the for paginated results, we're
00:23:46.539 --> 00:23:50.321 gonna be using that search async method. So we're gonna wanna be
00:23:50.321 --> 00:23:53.812 able to pass in the isales invoice search model and not the
00:23:53.812 --> 00:23:54.685 isales invoice.
00:23:56.465 --> 00:23:59.259 Payment search model and typically you will. You
00:23:59.259 --> 00:24:02.795 shouldn't have an issue. Every model should come stock with a
00:24:02.795 --> 00:24:06.273 search model or I should say every entity comes stock with a
00:24:06.095 --> 00:24:06.365 That's.
00:24:06.273 --> 00:24:07.015 search model.
00:24:09.125 --> 00:24:12.785 I'm sure there are exceptions to that, none that I've seen, but.
00:24:12.255 --> 00:24:16.746 The only exceptions are the truly identity spec tables like
00:24:16.746 --> 00:24:17.495 user role.
00:24:17.945 --> 00:24:21.155 Gotcha. OK. Yeah, that makes sense. OK, so.
00:24:20.955 --> 00:24:21.415 There would.
00:24:22.205 --> 00:24:25.115 Do you wanna do their turn type now before we update the
00:24:25.115 --> 00:24:27.005 documentation I guess or you forget?
00:24:25.225 --> 00:24:25.395 Yeah.
00:24:27.885 --> 00:24:28.755 The return type here.
00:24:29.405 --> 00:24:29.675 Yeah.
00:24:30.595 --> 00:24:31.385 Yeah.
00:24:31.425 --> 00:24:34.505 Make that your two. You copy that from your workflows
00:24:34.235 --> 00:24:34.455 Yep.
00:24:34.505 --> 00:24:37.814 workflow base engine to just change the TI model to the I
00:24:37.814 --> 00:24:38.955 sales invoice model.
00:24:39.865 --> 00:24:40.175 This.
00:24:42.955 --> 00:24:45.735 Yeah, so 379 copy that one's return type.
00:24:53.995 --> 00:24:57.219 And this is good to know cause yeah, and a lot of places it is
00:24:54.015 --> 00:24:54.215 Yep.
00:24:57.219 --> 00:25:00.392 just object. Well, even in that place it's just an object. So
00:24:59.935 --> 00:25:00.265 Umm.
00:25:00.392 --> 00:25:01.365 that's more proper.
00:25:02.445 --> 00:25:06.035 So then replace the TI model with I sales invoice model.
00:25:08.805 --> 00:25:11.954 And just to reinforce why we're doing eye sales invoice modeling
00:25:11.954 --> 00:25:14.909 here in sales invoice model, generally speaking you you want
00:25:14.909 --> 00:25:18.058 to try to use interfaces instead of concrete types. It's just as
00:25:18.058 --> 00:25:21.207 a general programming rule, but especially interfaces. Later you
00:25:20.455 --> 00:25:21.995 And two, you can't represent.
00:25:21.207 --> 00:25:22.515 should be using interfaces.
00:25:24.195 --> 00:25:27.148 And you can't reference it. I think is what James was gonna
00:25:27.148 --> 00:25:27.345 say.
00:25:28.815 --> 00:25:31.392 Interfaces that workflows cannot reference the the concrete
00:25:31.392 --> 00:25:31.865 models one.
00:25:32.055 --> 00:25:34.216 It's gonna say you can't reference them from up here
00:25:34.216 --> 00:25:34.665 anyhow, so.
00:25:35.345 --> 00:25:36.795 And even if you could, you shouldn't.
00:25:37.105 --> 00:25:41.590 Yes, don't do it. So use the interface wherever you possibly
00:25:37.575 --> 00:25:37.775 Yeah.
00:25:40.515 --> 00:25:41.575 Uh, definitely, definitely.
00:25:41.590 --> 00:25:41.885 can.
00:25:43.855 --> 00:25:46.885 OK, so now we have a method signature for being able to
00:25:46.885 --> 00:25:49.645 return the sales invoices for the current account.
00:25:47.015 --> 00:25:47.215 Yeah.
00:25:51.075 --> 00:25:52.545 As a paginated result.
00:25:51.215 --> 00:25:51.885 Will you?
00:25:53.385 --> 00:25:57.935 Will you cut lines 14 to 17 so that it's in your clipboard?
00:25:59.975 --> 00:26:03.558 And then where that space is where your cursor is type triple
00:26:03.558 --> 00:26:03.905 slash.
00:26:05.175 --> 00:26:05.425 Yep.
00:26:06.215 --> 00:26:09.658 That's what it's gonna generate by default. Whenever you do
00:26:09.658 --> 00:26:13.274 that. So you have your, your, your your stub out that you then
00:26:13.274 --> 00:26:16.545 go fill in with additional information. Now obviously we
00:26:16.545 --> 00:26:20.104 don't need to do that in this case because we have it in your
00:26:20.104 --> 00:26:23.891 clipboard, you can just paste it back, but that's what it will do
00:26:20.105 --> 00:26:20.355 Yeah.
00:26:23.891 --> 00:26:27.278 by default. I have an extension called Atomineer that uses
00:26:27.278 --> 00:26:30.778 heuristics on the names of the objects such as the parameter
00:26:30.778 --> 00:26:34.452 name, the types and the method name itself that generates this.
00:26:34.452 --> 00:26:36.805 Other info in the way that you see here.
00:26:37.555 --> 00:26:41.040 With some other stuff and it does it with a simple hotkey of
00:26:41.040 --> 00:26:44.354 control shift D which is nice. Atomineer is a paid plugin
00:26:44.354 --> 00:26:47.896 though, so I don't have licenses for everybody to go do that.
00:26:47.896 --> 00:26:49.325 It's like 20 bucks ahead.
00:26:50.105 --> 00:26:50.635 Umm.
00:26:52.335 --> 00:26:55.310 The but by doing that like it does simplify some of stuff and
00:26:55.310 --> 00:26:58.285 that's why you see it all over the place, because I literally
00:26:58.285 --> 00:27:01.116 just do a keystroke and it could do entire files or entire
00:27:01.116 --> 00:27:03.947 projects to make sure they're all covered for that kind of
00:27:03.947 --> 00:27:04.235 thing.
00:27:09.895 --> 00:27:12.962 Alright, so we've worked out our our interface for this
00:27:12.962 --> 00:27:13.565 particular.
00:27:14.655 --> 00:27:17.705 I workflow method that we need to add down and actually into
00:27:17.705 --> 00:27:18.955 the workflows themselves.
00:27:19.535 --> 00:27:20.125 Umm.
00:27:21.625 --> 00:27:23.375 Any questions on any of that?
00:27:26.505 --> 00:27:27.305 Yeah, I have a question.
00:27:27.715 --> 00:27:28.005 Sure.
00:27:28.505 --> 00:27:32.713 Is every single one of these methods supposed to be async by
00:27:32.713 --> 00:27:33.265 default?
00:27:35.125 --> 00:27:38.007 Unless there's a really good reason not to, almost everything
00:27:38.007 --> 00:27:40.890 you're gonna be doing is gonna involve some kind of interface
00:27:38.075 --> 00:27:38.255 Yeah.
00:27:40.890 --> 00:27:43.726 or interaction with the database which needs to be done with
00:27:41.085 --> 00:27:41.555 Umm.
00:27:43.726 --> 00:27:44.005 async.
00:27:44.505 --> 00:27:48.322 There's a very there's a very rare occasions and use cases to
00:27:48.322 --> 00:27:52.078 where you will not need some kind of asynchronous method. So
00:27:52.078 --> 00:27:53.495 as a general rule, yes.
00:27:55.175 --> 00:27:56.705 OK. And then?
00:27:55.825 --> 00:27:58.335 They're they're nearly always gonna be async methods.
00:27:59.215 --> 00:28:01.125 OK. And then?
00:28:00.305 --> 00:28:03.387 And even if you don't know if it's going to be honestly
00:28:03.387 --> 00:28:06.909 started out that way, and if you realized once you get into it,
00:28:06.909 --> 00:28:07.735 just change it.
00:28:10.105 --> 00:28:10.595 Gotcha.
00:28:10.495 --> 00:28:13.502 Yeah, changing it away from async when you realize that it
00:28:13.502 --> 00:28:16.663 doesn't it it if it at the end that it's not going to need it
00:28:16.663 --> 00:28:19.875 is easier than trying to change it to a sync across the board.
00:28:17.095 --> 00:28:17.455 Mm-hmm.
00:28:21.575 --> 00:28:23.465 Yeah, I agree.
00:28:24.735 --> 00:28:28.133 Speaking of which, just a touch on on that as well. And sorry,
00:28:25.005 --> 00:28:25.335 Alright.
00:28:28.133 --> 00:28:28.835 they're Nick.
00:28:29.315 --> 00:28:32.913 Uh, real quick because it's async. That's why we have the
00:28:29.805 --> 00:28:30.325 Very good.
00:28:32.913 --> 00:28:36.326 word async at the end, so anything that's async should
00:28:34.685 --> 00:28:34.975 Umm.
00:28:36.326 --> 00:28:39.615 have async at the end of the method signatures name.
00:28:40.065 --> 00:28:45.902 Yep, and that is that is not just a, a, A clarity standard.
00:28:41.535 --> 00:28:41.805 Yep.
00:28:45.902 --> 00:28:50.865 That's just the C# standard standard behavior for.
00:28:49.105 --> 00:28:52.735 Yeah, Microsoft started that a long *** time ago.
00:28:51.735 --> 00:28:52.145 Yes.
00:28:52.995 --> 00:28:56.475 Yeah. So that ones, that one is just.
00:28:57.105 --> 00:29:00.499 Best practices for the language itself, not just working itself,
00:29:00.499 --> 00:29:03.789 so that should be. That should be your go to behavior, whether
00:29:03.789 --> 00:29:06.975 you're writing code, uh C# code and SEV or in anything else.
00:29:08.065 --> 00:29:11.820 And in many, many cases I from what I've seen in the reason for
00:29:11.820 --> 00:29:15.164 that is, is a lot of the ERP's I've worked for, and when
00:29:15.164 --> 00:29:18.567 interacting with the ERP's in several cases, they do have
00:29:18.567 --> 00:29:22.205 separate methods, one that's asynchronous and one that's not.
00:29:23.775 --> 00:29:26.575 So my assumption was is that that's probably why.
00:29:27.845 --> 00:29:29.575 They came up with that naming convention.
00:29:28.005 --> 00:29:31.227 Yeah, it's yeah, because C# didn't get async functionality
00:29:31.227 --> 00:29:34.504 until C# 5, so they had to start differentiating from their
00:29:34.504 --> 00:29:37.781 original, like C# four and earlier methods that didn't have
00:29:37.781 --> 00:29:37.945 it.
00:29:39.125 --> 00:29:42.132 With all that stuff. So they didn't and they and they to this
00:29:42.132 --> 00:29:45.236 day, they still have them side by side. And in fact some places
00:29:45.236 --> 00:29:48.146 where they did async but they didn't actually do task async
00:29:48.146 --> 00:29:50.765 because they were trying to do it in a different way.
00:29:48.905 --> 00:29:49.235 You.
00:29:51.225 --> 00:29:54.460 Uh. In four before they finished making five. Like there's
00:29:54.460 --> 00:29:57.367 there's a few like file operation ones that do this,
00:29:57.367 --> 00:30:00.438 they'll actually say task async to get the task, one to
00:30:00.438 --> 00:30:04.003 differentiate from the bad ones that got named improperly inside
00:30:04.003 --> 00:30:05.155 their core libraries.
00:30:08.275 --> 00:30:11.515 OK. That makes perfect sense. OK.
00:30:10.785 --> 00:30:13.869 And then, since we're since this is a focus, stores near
00:30:13.869 --> 00:30:16.954 developers. What you just did there is probably the most
00:30:16.954 --> 00:30:19.335 important thing you can do. Save your work.
00:30:20.135 --> 00:30:25.296 Yeah, right there. Save all. Just just make it a habit about
00:30:25.296 --> 00:30:27.665 every 30 seconds. Control S.
00:30:29.365 --> 00:30:31.852 Maybe if you need to you can get an extension that autosaves
00:30:31.852 --> 00:30:34.299 every whatever or extreme an extension. I think it's just a
00:30:32.225 --> 00:30:33.325 That you could do that.
00:30:34.299 --> 00:30:35.115 Visual Studio thing.
00:30:36.225 --> 00:30:40.472 Yes. Yeah. No, you. Yeah, you can get stuff like that. I just
00:30:40.472 --> 00:30:40.815 from.
00:30:41.865 --> 00:30:46.006 From my the way I work, it's just control shift S I'll almost
00:30:46.006 --> 00:30:50.015 nearly every time I actually my fingers leave the keyboard.
00:30:50.915 --> 00:30:54.583 So that should be. That should definitely be a habit for
00:30:54.583 --> 00:30:56.965 everyone. I think is save your work.
00:30:58.355 --> 00:31:00.999 OK, so we have our interface worked out. We got all the, we
00:31:00.999 --> 00:31:03.247 get the documentation straightened out. We got the
00:31:03.247 --> 00:31:06.112 proper naming convention on our method. We have the right return
00:31:06.112 --> 00:31:06.685 type on here.
00:31:07.525 --> 00:31:07.895 Umm.
00:31:09.405 --> 00:31:13.693 Now we will be able to access this in an actual workflow down
00:31:13.693 --> 00:31:17.842 in 05, so we can come in here and I'm kind of close some of
00:31:17.842 --> 00:31:19.295 this up a little bit.
00:31:22.425 --> 00:31:27.067 That invoicing. OK, so now we wanna add this into we're
00:31:27.067 --> 00:31:32.042 getting sales invoices. So we wanna add this somewhere into
00:31:32.042 --> 00:31:34.115 the actual sales invoice.
00:31:35.495 --> 00:31:36.685 Extended workflow.
00:31:38.105 --> 00:31:38.575 So.
00:31:41.925 --> 00:31:45.393 And and just to elaborate on that, if there isn't an extended
00:31:45.393 --> 00:31:49.029 file, you make one. In fact, if you open up generated real quick
00:31:46.815 --> 00:31:48.035 Yes, correct. Yeah.
00:31:49.029 --> 00:31:52.666 and you'll see this across stuff on the front and back end. This
00:31:50.075 --> 00:31:50.345 Umm.
00:31:52.666 --> 00:31:55.855 is autogenerated at the top at the very top of the file.
00:31:57.335 --> 00:32:00.085 That little auto generated tag? That means no touchy.
00:32:01.065 --> 00:32:01.285 Yep.
00:32:01.225 --> 00:32:05.075 Just pretend this is read only, because anything you make in
00:32:05.075 --> 00:32:08.862 here is gonna immediately be overridden if a specific T4 is
00:32:08.862 --> 00:32:09.115 ran.
00:32:11.225 --> 00:32:14.885 So, and that's the whole reason why we have partial classes.
00:32:11.355 --> 00:32:11.945 Absolutely.
00:32:15.395 --> 00:32:15.765 Umm.
00:32:15.675 --> 00:32:18.811 So that allows us to do is have a class that spans multiple
00:32:18.811 --> 00:32:21.737 files, and I know this is all like self-explanatory for
00:32:21.737 --> 00:32:25.030 probably everyone in here, but you know for somebody new who's
00:32:25.030 --> 00:32:27.905 maybe new to C# or whatever, that's that's that's why.
00:32:29.285 --> 00:32:33.319 So you know, if we didn't have a sales credit sales, invoice,
00:32:33.319 --> 00:32:34.295 CRUD, workflow.
00:32:34.885 --> 00:32:38.920 Uh thought extended file. We would basically just copy that
00:32:38.920 --> 00:32:43.090 class signature, just the part that says public partial class
00:32:43.090 --> 00:32:46.991 and we'd we'd put that in that new dot extended file we'd
00:32:46.991 --> 00:32:48.135 create, but yeah.
00:32:52.965 --> 00:32:57.695 OK, so now we need to actually add our method into.
00:32:58.785 --> 00:33:02.828 The workflow itself, so we have we have our interface worked out
00:33:02.828 --> 00:33:06.559 and we can, you know, I'm just gonna go ahead and grab that
00:33:06.559 --> 00:33:07.555 where it was it.
00:33:09.225 --> 00:33:11.145 So I sales of Sarah girl, OK so.
00:33:11.795 --> 00:33:13.045 We can just kind of take this.
00:33:14.785 --> 00:33:16.465 And add it to the extended.
00:33:19.805 --> 00:33:21.435 Actually make this one.
00:33:22.675 --> 00:33:23.355 Public.
00:33:27.755 --> 00:33:30.702 And the reasoning scrolled up there is because there is a
00:33:30.702 --> 00:33:33.954 there is an order to the methods that you're supposed to follow
00:33:33.954 --> 00:33:35.225 with their accessibility.
00:33:34.215 --> 00:33:37.672 So yeah, the order they're going to go in is public, protected,
00:33:37.672 --> 00:33:38.105 private.
00:33:38.885 --> 00:33:41.611 So as you add them in here, if it's gonna be a public method,
00:33:41.611 --> 00:33:44.250 you're gonna be looking towards the top protected, possibly
00:33:44.250 --> 00:33:46.757 somewhere towards the middle, private always towards the
00:33:46.757 --> 00:33:47.065 bottom.
00:33:48.265 --> 00:33:50.115 So just remember that as a general rule.
00:33:52.565 --> 00:33:53.215 OK so.
00:33:52.955 --> 00:33:57.125 Uh, I have a screenshot I can share that will show that.
00:33:57.985 --> 00:34:00.915 Full list of ordering patterns real quick.
00:34:01.845 --> 00:34:03.845 Uh, if you wanna keep going, I'll bring that up on.
00:34:02.535 --> 00:34:05.168 Because I know it's. Yeah, it's gonna say cause there are
00:34:05.168 --> 00:34:08.120 others. Like there are some more down in there with when you get
00:34:08.120 --> 00:34:10.345 in regards to static I think is in their dreams.
00:34:08.985 --> 00:34:09.405 Yeah.
00:34:10.665 --> 00:34:15.788 It's it's internal and static and read only and all that stuff
00:34:13.035 --> 00:34:13.455 Yeah.
00:34:15.305 --> 00:34:15.675 Yeah.
00:34:15.788 --> 00:34:16.195 cost.
00:34:20.855 --> 00:34:22.485 OK, so now we go ahead.
00:34:20.895 --> 00:34:21.525 Sport.
00:34:23.385 --> 00:34:27.586 Should say before we get into the weeds. You'll notice that
00:34:27.586 --> 00:34:31.297 all these or a lot of them should have these inherit
00:34:31.297 --> 00:34:35.289 inherit dock documentation tags on them. Basically. Now,
00:34:33.145 --> 00:34:33.395 Yep.
00:34:35.289 --> 00:34:39.630 although ID's do handle this pretty well nowadays, if there's
00:34:39.630 --> 00:34:43.481 like an inheriting class or implementing interface, it
00:34:43.481 --> 00:34:47.893 basically explicitly says hey, we're getting our documentation
00:34:47.893 --> 00:34:52.234 for this method from whatever the the the base implementation
00:34:52.234 --> 00:34:53.215 or interfaces.
00:34:53.815 --> 00:34:56.981 So you know, if you hover over get sales invoices for current
00:34:56.981 --> 00:35:00.148 account it should give us back the same documentation that we
00:34:57.995 --> 00:34:58.285 Yeah.
00:35:00.148 --> 00:35:01.425 wrote in that other file.
00:35:02.085 --> 00:35:04.145 Which it does. So there you go.
00:35:03.405 --> 00:35:03.965 Yes it is.
00:35:05.165 --> 00:35:07.910 And again, it would probably do that even if we didn't have an
00:35:07.910 --> 00:35:10.568 inherit talk. But it's it's a way of saying explicitly, hey,
00:35:10.568 --> 00:35:11.135 this is this.
00:35:12.545 --> 00:35:12.985 And it does.
00:35:13.765 --> 00:35:14.035 Yeah.
00:35:17.095 --> 00:35:20.171 But you should always include that. I guess it's my point
00:35:18.555 --> 00:35:22.490 But again, yes, for for no again for consistency sake. And I know
00:35:20.171 --> 00:35:20.755 regardless.
00:35:22.490 --> 00:35:26.366 you. You're gonna hear that in a kind of sounds. Like just do it
00:35:22.865 --> 00:35:23.165 Yep.
00:35:26.366 --> 00:35:28.275 because that's the way we do it.
00:35:29.115 --> 00:35:32.715 Umm, I can tell you from experience that it does help.
00:35:33.815 --> 00:35:37.649 When I can generally assume the structure of a file before I
00:35:34.085 --> 00:35:35.655 Let's just put it, yeah.
00:35:37.649 --> 00:35:41.231 even open it, because I have worked in areas of projects
00:35:41.231 --> 00:35:44.939 where that's not the case and it is much more difficult to
00:35:44.939 --> 00:35:48.773 navigate and try to figure out what is happening, especially
00:35:48.773 --> 00:35:52.545 when maybe you're new to a project and they hand you a bug.
00:35:53.565 --> 00:35:56.795 And say fix this and if that project in the structure of the
00:35:56.795 --> 00:35:59.390 project is not consistent throughout, it becomes
00:35:59.390 --> 00:36:02.515 infinitely more difficult to navigate and to try to figure
00:36:02.515 --> 00:36:05.905 out what is actually happening and where that bug is occurring.
00:36:07.755 --> 00:36:08.795 You're gonna make me cry.
00:36:08.095 --> 00:36:08.645 So just.
00:36:10.785 --> 00:36:11.235 Just.
00:36:10.945 --> 00:36:14.195 No, he's right, though. Like when you're new. All of this is
00:36:14.195 --> 00:36:17.073 gonna be overwhelming. Regardless, like you're you're
00:36:15.705 --> 00:36:16.285 Yeah.
00:36:17.073 --> 00:36:20.323 not. You're not. Just be like, oh, yeah, this is all just. I
00:36:20.323 --> 00:36:23.680 just understand everything. You know, it is gonna be confusing
00:36:23.680 --> 00:36:26.504 and overwhelming. And you might be like, why so much
00:36:26.504 --> 00:36:29.755 documentation? Why so much of this? Why do we have to follow
00:36:29.755 --> 00:36:33.165 all these specific little rules? The answer is is once you kind
00:36:33.165 --> 00:36:36.522 of understand once you get your head wrapped around a vertical
00:36:36.522 --> 00:36:39.826 slice of steps back end right through endpoints to workflows,
00:36:39.826 --> 00:36:41.265 to interfaces to all of it.
00:36:42.065 --> 00:36:45.965 Everything else just kind of makes sense after that, right?
00:36:45.825 --> 00:36:46.405 It'll click.
00:36:45.965 --> 00:36:49.866 Because it's all the same and that's the value in following
00:36:47.875 --> 00:36:48.185 Umm.
00:36:49.866 --> 00:36:53.767 these conventions is that we don't we can do the exact same
00:36:53.767 --> 00:36:57.603 thing, not just in invoicing sales invoice and other sales
00:36:57.603 --> 00:37:01.698 invoice. You know fragments like sales, invoice file blah blah
00:37:01.698 --> 00:37:05.794 blah blah we can do an any part of the schema because it's all
00:37:05.794 --> 00:37:08.135 works the same issue way right? So.
00:37:07.855 --> 00:37:09.185 Like you really gonna make me cry?
00:37:09.815 --> 00:37:14.094 So I mean, I'll be honest, even in my own personal projects,
00:37:14.094 --> 00:37:18.373 I've I've started to do this kind of thing just so that when
00:37:16.435 --> 00:37:16.755 Yeah.
00:37:18.373 --> 00:37:22.722 things do get convoluted and that's just kind of a symptom of
00:37:22.722 --> 00:37:27.212 object oriented programming, but it it continues to make sense,
00:37:27.212 --> 00:37:28.615 right? Cuz you know.
00:37:29.495 --> 00:37:32.886 If you don't do this and complexity does increase, it's
00:37:32.886 --> 00:37:36.761 going to go to the point where quite literally just moving from
00:37:36.761 --> 00:37:40.515 one end of the project to the other is going to be, you know,
00:37:40.515 --> 00:37:44.330 it's gonna be like relearning the entire thing all over again.
00:37:44.330 --> 00:37:47.055 Whereas in CEF, it's not generally speaking.
00:37:45.975 --> 00:37:48.745 It makes simple changes take forever.
00:37:49.855 --> 00:37:52.735 Yeah, simple changes can take forever, yeah.
00:37:50.485 --> 00:37:53.025 And complex changes nearly impossible.
00:37:54.225 --> 00:37:57.327 So, so just just always keep that in the back of your mind,
00:37:57.327 --> 00:38:00.532 because it's gonna frustrate you when you get it. And this is
00:38:00.532 --> 00:38:03.634 more for newer people. It's gonna frustrate you when you go
00:38:03.634 --> 00:38:06.736 to put a PR up and he gets rejected because you've missed a
00:38:06.736 --> 00:38:07.925 piece of documentation.
00:38:10.215 --> 00:38:11.975 But this but This is why.
00:38:12.025 --> 00:38:15.113 Little things too. Like everyone does it. I still do it all the
00:38:13.325 --> 00:38:13.735 Yeah.
00:38:15.113 --> 00:38:15.355 time.
00:38:15.325 --> 00:38:16.295 I do as well.
00:38:17.235 --> 00:38:21.848 But you know it's there. There's a reason for it, you know. So
00:38:21.045 --> 00:38:21.615 Yeah.
00:38:21.848 --> 00:38:22.215 yeah.
00:38:23.235 --> 00:38:25.115 It'll make everyone's life easier in the long run.
00:38:27.275 --> 00:38:31.114 OK, so now we yeah, so now we pretty much have everything we
00:38:27.455 --> 00:38:28.205 Including your own.
00:38:31.114 --> 00:38:35.142 need to start implementing the logic for this workflow and this
00:38:35.142 --> 00:38:38.855 this is just gonna air because it's not returning anything
00:38:38.855 --> 00:38:39.485 right now.
00:38:41.615 --> 00:38:45.746 So now after we've gotten all the structural stuff in now, we
00:38:45.746 --> 00:38:49.945 can actually start working on the logic that's inside of here.
00:38:51.585 --> 00:38:53.909 So it was going to happen inside of. Here is it's going to take
00:38:53.909 --> 00:38:56.197 in this request which is going to be an I sales invoice search
00:38:56.197 --> 00:38:56.415 model.
00:38:58.345 --> 00:38:59.455 So realistically.
00:39:00.835 --> 00:39:04.544 We could probably just have this just on a return statement if
00:39:04.544 --> 00:39:05.545 I'm not mistaken.
00:39:07.665 --> 00:39:10.255 I think so. One one thing I usually do.
00:39:11.615 --> 00:39:17.055 Is and maybe this is wrong. I would usually now.
00:39:17.755 --> 00:39:20.524 Just granted, because we I'm let's just assume there's gonna
00:39:20.524 --> 00:39:23.429 be, like, storefront facing. And generally speaking, I think in
00:39:23.429 --> 00:39:25.245 the admin you can't see active records.
00:39:25.965 --> 00:39:31.273 I think we should probably set active to true on the request,
00:39:31.273 --> 00:39:36.325 regardless of whatever's being asked. Is that a? Yeah, so.
00:39:33.265 --> 00:39:33.705 Yes.
00:39:34.375 --> 00:39:35.145 That's a fair point.
00:39:35.705 --> 00:39:38.565 A a future version I plan to make it so that if you're
00:39:38.565 --> 00:39:41.893 sending a search model from the storefront and you have not set
00:39:41.893 --> 00:39:45.013 active, then it forces it, but that's only if it's from the
00:39:45.013 --> 00:39:45.585 storefront.
00:39:46.965 --> 00:39:50.505 Other API is like the brand admin or admin or the main API
00:39:50.505 --> 00:39:53.625 won't do it, but I'm going to start enforcing that.
00:39:54.785 --> 00:39:59.115 Inside the, UM, uh, a global hook thing that that checks
00:39:59.115 --> 00:39:59.495 that.
00:40:01.075 --> 00:40:03.925 If it's, if it's, if it's a uh, I search model base and you
00:40:03.925 --> 00:40:06.870 haven't sent it from the that with that. So that just to keep
00:40:06.870 --> 00:40:09.625 from accidentally sending dead records to the storefront.
00:40:11.585 --> 00:40:15.822 Yeah. And then another thing I would check for is I would
00:40:15.822 --> 00:40:20.498 ensure that account ID is set, otherwise you could accidentally
00:40:20.498 --> 00:40:24.808 return everything. Now it's not the workflow layers job to
00:40:24.808 --> 00:40:25.685 ensure that.
00:40:26.755 --> 00:40:31.491 The person requesting it is the person. So like for example in
00:40:31.491 --> 00:40:33.145 my endpoints you know.
00:40:34.115 --> 00:40:37.202 Method or whatever, all checked to make sure hey that the
00:40:37.202 --> 00:40:40.502 request dot account ID is the current account like. I'll make
00:40:40.502 --> 00:40:43.642 sure that they're, you know, authenticated and I make sure
00:40:43.642 --> 00:40:46.943 that I'm setting that, but in here all we got to check is hey
00:40:46.943 --> 00:40:47.635 is there one.
00:40:48.415 --> 00:40:51.619 Because if there isn't, we, you know, there's we don't want to
00:40:51.619 --> 00:40:52.535 return everything.
00:40:55.325 --> 00:40:55.635 Yeah.
00:40:57.795 --> 00:40:58.405 That makes.
00:40:57.815 --> 00:40:59.965 It it can't hurt, I guess is my point.
00:41:02.795 --> 00:41:05.992 And yet Timmy is sharing his screen. Can everyone else see
00:41:05.992 --> 00:41:06.155 it?
00:41:07.525 --> 00:41:07.825 Yeah.
00:41:08.585 --> 00:41:08.995 OK.
00:41:09.675 --> 00:41:10.865 Well, that would be a tragedy.
00:41:12.505 --> 00:41:14.215 We got this far into it.
00:41:15.385 --> 00:41:17.852 And over half of our roads like Nope, the screen share is
00:41:15.415 --> 00:41:16.065 Ohm.
00:41:17.852 --> 00:41:18.405 broken. Yeah.
00:41:19.475 --> 00:41:22.575 So one one thing that we that I could note here is.
00:41:20.055 --> 00:41:20.325 That's.
00:41:23.755 --> 00:41:26.045 As utility methods so.
00:41:26.815 --> 00:41:28.285 Instead of writing something.
00:41:28.725 --> 00:41:30.545 Uh, this is.
00:41:32.615 --> 00:41:33.315 Like this?
00:41:34.025 --> 00:41:38.207 We have utility methods that we're going to want to use that
00:41:38.207 --> 00:41:42.115 do all of those things, but are in many cases optimized.
00:41:42.785 --> 00:41:46.099 To be worked with working with the data so and what those are
00:41:46.099 --> 00:41:49.306 going to be going to be static methods could they're on the
00:41:49.306 --> 00:41:52.674 contract. So it's contract dot and in this case we're checking
00:41:52.674 --> 00:41:52.995 an ID.
00:41:54.025 --> 00:41:57.365 So we have a method in there.
00:41:58.995 --> 00:42:03.245 Check valid ID and you can pass in let's say request.
00:42:06.565 --> 00:42:07.365 That account ID.
00:42:08.825 --> 00:42:11.595 So now we now we know that contract method.
00:42:12.475 --> 00:42:15.698 Is going to check and make sure that that request that account
00:42:15.698 --> 00:42:16.005 ID is.
00:42:17.665 --> 00:42:20.565 And integer and not zero or a negative number.
00:42:23.855 --> 00:42:26.303 Yeah, because if you know, if you get into the habit of
00:42:26.303 --> 00:42:29.145 playing like ohh I don't need to use the contract blah blah blah
00:42:29.145 --> 00:42:32.030 blah, I'll just do my own thing. It's very easy to make a mistake
00:42:32.030 --> 00:42:34.828 because not only do you have to check if it's not null, it also
00:42:32.385 --> 00:42:32.625 Yep.
00:42:34.828 --> 00:42:36.315 has to be a positive integer. So.
00:42:36.045 --> 00:42:37.975 Yeah. So there's more going on.
00:42:37.405 --> 00:42:41.282 And the other thing is it makes the code more maintainable
00:42:41.282 --> 00:42:45.356 because going forward, let's say we change our rules for some
00:42:45.356 --> 00:42:49.233 reason we can just update you know what contract dot check
00:42:49.233 --> 00:42:53.176 valid whatever does or check invalid whatever does. Whereas
00:42:53.176 --> 00:42:54.425 if we're not using.
00:42:55.645 --> 00:42:59.316 The utility classes where it's appropriate it we would have to
00:42:59.316 --> 00:43:02.930 change it. You know in all those places as well. And then the
00:43:02.930 --> 00:43:06.369 other thing just because this isn't returning a CEF action
00:43:06.369 --> 00:43:09.982 response, I don't think we can really do anything in terms of
00:43:09.982 --> 00:43:13.771 handling. We might as well just do a contract that requires. And
00:43:13.771 --> 00:43:17.209 Speaking of the utility classes, there is a difference. So
00:43:14.575 --> 00:43:16.215 Yeah, looks like point.
00:43:17.209 --> 00:43:20.357 basically contract up check valid ID just returns the
00:43:17.305 --> 00:43:17.515 Yep.
00:43:20.357 --> 00:43:23.854 Boolean right? So it doesn't throw an error, do anything if
00:43:23.854 --> 00:43:24.495 it's wrong.
00:43:25.245 --> 00:43:28.481 So what we can do is we do requires valid, it'll just
00:43:28.481 --> 00:43:31.897 throw, which in this case because we're not returning AC
00:43:31.897 --> 00:43:35.673 far, we can't say action didn't succeed, blah blah blah. We're
00:43:35.673 --> 00:43:39.449 just basically gonna say just just throw an error. And in this
00:43:39.449 --> 00:43:43.345 case, we're not even gonna need an if statement. We can just do.
00:43:41.505 --> 00:43:41.695 No.
00:43:43.345 --> 00:43:46.701 I'm not sure what like the technical term is for like I
00:43:46.701 --> 00:43:50.477 guess disposing like basically just like under score equals or
00:43:50.477 --> 00:43:52.935 that could also just be unnecessary but.
00:43:51.295 --> 00:43:51.895 Discard.
00:43:53.765 --> 00:43:54.635 Discard yes.
00:43:53.925 --> 00:43:55.775 Sorry it discard.
00:43:56.745 --> 00:44:00.349 Yeah. So in, in this case, this one, the requires a valid ID is
00:43:56.825 --> 00:43:57.155 But.
00:44:00.349 --> 00:44:03.672 going to throw an invalid operation exception and give you
00:44:03.672 --> 00:44:04.405 this message.
00:44:11.405 --> 00:44:11.765 Well.
00:44:12.875 --> 00:44:13.895 That if this one's null.
00:44:19.095 --> 00:44:22.823 Umm, so I would say if there are, if if you're wondering if
00:44:22.823 --> 00:44:26.675 there is a contract method to do it specifically, what you're
00:44:26.675 --> 00:44:27.545 wanting to do.
00:44:28.875 --> 00:44:30.235 Always. Just look at them.
00:44:31.125 --> 00:44:34.032 Just come in here, into the contract and look and see. OK.
00:44:34.032 --> 00:44:37.186 Is there something that I need? What do I need done? OK, I need
00:44:37.186 --> 00:44:39.995 to check. Uh, this string is valid. OK, there's probably
00:44:37.825 --> 00:44:38.135 And.
00:44:39.995 --> 00:44:43.148 something in here that's gonna do exactly that for you and even
00:44:43.148 --> 00:44:43.395 more.
00:44:44.575 --> 00:44:48.479 Another statement that I will make for this is I have been
00:44:48.479 --> 00:44:52.251 trying to make a positive and negative versions of these
00:44:52.251 --> 00:44:56.552 things, so you'll have requires valid ID and requires invalid ID
00:44:56.552 --> 00:45:00.456 so that you don't have to do double negative if statements
00:44:59.405 --> 00:45:00.665 So that that. Yeah.
00:45:00.456 --> 00:45:04.559 you don't want to do have to do, if not require. If not check
00:45:04.559 --> 00:45:08.265 valid ID on something. You could just check invalid ID.
00:45:08.675 --> 00:45:11.026 And that's perfect example. That's a check not knowing the
00:45:11.026 --> 00:45:11.465 check null.
00:45:12.685 --> 00:45:13.295 Yeah.
00:45:13.455 --> 00:45:16.466 So we don't. So we don't want to have just the check not null and
00:45:16.466 --> 00:45:19.385 have to put a double negative on it to you know do the opposite
00:45:19.385 --> 00:45:22.305 of what this is doing. We have both of these in here and if you
00:45:22.305 --> 00:45:23.355 don't see that in here.
00:45:24.085 --> 00:45:26.855 And it's specific to what you're to what you're doing.
00:45:29.015 --> 00:45:29.525 You can add it.
00:45:29.885 --> 00:45:30.675 I would say edit.
00:45:33.285 --> 00:45:36.454 And that would that, I mean that that just helps us all out
00:45:36.454 --> 00:45:38.936 because if if it if it's something that you're
00:45:38.936 --> 00:45:42.052 experiencing that you're doing the task unless it's really
00:45:42.052 --> 00:45:45.274 hyperspecific, it's probably something that somebody else is
00:45:45.274 --> 00:45:46.595 going to need eventually.
00:45:47.535 --> 00:45:49.375 And that's what these are kind of for these are just.
00:45:50.425 --> 00:45:52.916 For everybody to use, and if you've used it as a, if you had
00:45:52.916 --> 00:45:55.611 a use case for it, then somebody else is eventually going to have
00:45:55.611 --> 00:45:56.755 the use case for it as well.
00:45:58.875 --> 00:46:02.395 One of the useful side effects of using these utility methods
00:46:02.395 --> 00:46:06.028 as well outside of just the back end is that sometimes when the
00:46:06.028 --> 00:46:09.435 front end, whether it be with angular or react, you need to
00:46:09.435 --> 00:46:13.012 have some kind of identifier on something, but you don't wanna
00:46:13.012 --> 00:46:15.908 assign it a valid identifier like has to be unique
00:46:15.908 --> 00:46:19.541 identifier, but you don't want a valid 1 because you want it to
00:46:19.541 --> 00:46:22.948 do like a create operation or whatever. Basically you don't
00:46:22.948 --> 00:46:26.241 want it to be accidentally associated to a real record in
00:46:26.241 --> 00:46:29.591 the database that all our exists. So you can actually send
00:46:29.591 --> 00:46:29.875 like.
00:46:30.075 --> 00:46:34.248 You know a bunch of invalid ID in the back end will will
00:46:34.248 --> 00:46:38.788 basically quote UN quote no that like ohh these aren't actual
00:46:38.788 --> 00:46:43.328 records and do like a create operation or whatever. So that's
00:46:43.328 --> 00:46:47.867 a neat little side effect of this contract class which I know
00:46:47.245 --> 00:46:47.555 Yeah.
00:46:47.867 --> 00:46:51.895 it's Super Edge Casey but it it does it can be useful.
00:46:51.245 --> 00:46:51.655 And.
00:46:52.575 --> 00:46:52.825 Yeah.
00:46:53.075 --> 00:46:56.207 Not really, but raise your hand if you've ever seen an error
00:46:56.207 --> 00:46:59.392 that come out of something from Microsoft with a -, 2 billion
00:46:59.392 --> 00:47:00.265 something number.
00:47:02.285 --> 00:47:04.155 And I raise my hand if it was.
00:47:02.335 --> 00:47:06.325 That that's why we check in in dot Max value checks.
00:47:10.095 --> 00:47:12.930 And actually on on that subject, James, do we have a contract
00:47:12.930 --> 00:47:14.165 method for checking to see?
00:47:15.525 --> 00:47:17.165 If a Boolean value is true or false.
00:47:18.845 --> 00:47:20.295 I don't know if I've ever looked for one before.
00:47:21.105 --> 00:47:23.285 If a Boolean value is through.
00:47:21.205 --> 00:47:24.180 We don't necessarily need, we don't necessarily need one for
00:47:22.595 --> 00:47:25.403 I don't know if we necessarily need one. That's certainly need
00:47:24.180 --> 00:47:27.302 that, since it's just already is true or false, and there's not
00:47:25.403 --> 00:47:25.805 one, but.
00:47:27.302 --> 00:47:29.595 really a valid or invalid state at that point.
00:47:29.075 --> 00:47:29.295 Yeah.
00:47:32.705 --> 00:47:36.026 The basically we're the what that equals true is, and the
00:47:36.026 --> 00:47:39.520 reason we're doing it that way there instead of doing like a
00:47:39.520 --> 00:47:43.300 check is cause we're just saying we don't care. It's good. You're
00:47:39.785 --> 00:47:40.045 Yeah.
00:47:42.685 --> 00:47:43.105 I.
00:47:43.300 --> 00:47:46.565 only getting active. So that's why that's the way it is.
00:47:44.545 --> 00:47:47.906 Yeah, we and that yet that's why it didn't surround it with it.
00:47:47.906 --> 00:47:51.109 I've check because it in this case, we do not want to return
00:47:51.109 --> 00:47:54.050 an active records from here. So it this workflow method
00:47:54.050 --> 00:47:57.307 shouldn't care what was passed from the front end. We're only
00:47:57.307 --> 00:47:58.935 going to return active records.
00:47:59.735 --> 00:48:00.595 From the database.
00:48:01.915 --> 00:48:05.238 Yeah, and requests that have account ID S if it's not one of
00:48:05.238 --> 00:48:06.165 those, then just.
00:48:05.955 --> 00:48:06.245 Yeah.
00:48:06.965 --> 00:48:07.995 Yeah, too bad.
00:48:09.325 --> 00:48:13.717 OK, so now I think we're ready to actually return those
00:48:13.717 --> 00:48:14.345 results.
00:48:14.925 --> 00:48:18.955 Uh. Which it's, uh from memory correctly? UM.
00:48:21.855 --> 00:48:22.765 Uh.
00:48:23.755 --> 00:48:26.292 We can go through, we can do this in one of two ways, right?
00:48:26.292 --> 00:48:28.829 We go through the context or we can go through the work, the
00:48:28.829 --> 00:48:29.245 workflows.
00:48:32.715 --> 00:48:33.555 Do you want to see?
00:48:32.815 --> 00:48:34.525 You guys think we should do?
00:48:34.245 --> 00:48:35.225 You want to see both.
00:48:40.315 --> 00:48:41.835 Both it is OK.
00:48:43.355 --> 00:48:44.225 OK so.
00:48:46.145 --> 00:48:48.155 Here is the way for going to the workflow.
00:48:52.115 --> 00:48:55.905 And so each workflow's gonna have should.
00:48:57.195 --> 00:48:58.385 Sales invoices.
00:49:03.555 --> 00:49:06.524 But what am I doing that we're going to do a search async
00:49:06.524 --> 00:49:06.985 invoices?
00:49:19.935 --> 00:49:22.745 Actually just going to be search async.
00:49:25.555 --> 00:49:28.285 Of type sales invoice. By doing that correct James.
00:49:31.375 --> 00:49:33.945 Uh, take the L off the workflows.
00:49:37.025 --> 00:49:37.505 Thank you.
00:49:43.705 --> 00:49:46.785 So now that we're in the workflows, we're in the sales
00:49:46.785 --> 00:49:50.314 invoices, workflows. We already have a search async method. So
00:49:50.314 --> 00:49:53.562 and this is a kind of a good example of you use the stock
00:49:53.562 --> 00:49:54.795 methods if they exist.
00:49:56.455 --> 00:49:57.885 Don't try to reinvent the wheel.
00:49:58.675 --> 00:49:59.925 OK so.
00:49:58.875 --> 00:49:59.265 Uh.
00:49:59.715 --> 00:50:00.085 And.
00:50:01.405 --> 00:50:04.455 You're requiring a valid ID to have come from over the wire,
00:50:04.455 --> 00:50:07.205 but this is a server side endpoint that says that it's
00:50:07.205 --> 00:50:10.105 four current account, which means we need to be enforcing
00:50:10.105 --> 00:50:13.005 its server side. So instead of contract or requires valid
00:50:13.005 --> 00:50:16.055 request, that account ID do request that account ID equal to
00:50:16.055 --> 00:50:17.655 current account ID or throw 401.
00:50:21.025 --> 00:50:22.275 Yeah, and that's another.
00:50:21.085 --> 00:50:23.992 Oh, this is the workflow layer. I'm sorry. I'm sorry. Never
00:50:23.765 --> 00:50:26.245 Yeah, that's what. That's why I didn't do it.
00:50:23.992 --> 00:50:24.235 mind.
00:50:25.015 --> 00:50:27.868 That's the service layer. I ****** that up. You. You'll be
00:50:27.505 --> 00:50:28.495 No, you're good. You're good.
00:50:27.665 --> 00:50:28.475 That being said.
00:50:27.868 --> 00:50:28.835 doing that up there.
00:50:29.265 --> 00:50:32.655 That being said, I will, uh quickly just add on to that.
00:50:33.555 --> 00:50:38.409 If you're ever creating an endpoint that operates on the
00:50:38.409 --> 00:50:43.349 current user or the current account, never put user ID or
00:50:43.349 --> 00:50:47.864 account ID as part of the request body and then just
00:50:47.864 --> 00:50:50.845 accept that over the wire, that's.
00:50:51.375 --> 00:50:56.656 Uh, fantastic way to just let anybody query for any users
00:50:56.656 --> 00:50:59.115 information which is a big.
00:51:00.045 --> 00:51:00.935 Don't do that.
00:51:01.815 --> 00:51:02.425 Big no no.
00:51:02.135 --> 00:51:06.252 So so if if the point of an endpoint is to operate on a
00:51:06.252 --> 00:51:10.590 specific user or account, then don't make that part of the
00:51:10.590 --> 00:51:14.928 request, enforce it in the service layer with current user
00:51:14.928 --> 00:51:19.267 ID and current account ID. If you want a method that could
00:51:19.267 --> 00:51:23.899 potentially be called by admins with the given account or user
00:51:23.899 --> 00:51:27.722 ID, then you can make the workflow, except any user
00:51:27.722 --> 00:51:31.105 account ID, but in the service layer for the.
00:51:31.175 --> 00:51:34.283 Current user current account ones. You still use current user
00:51:34.283 --> 00:51:37.392 or current current account ID and then for the admin ones you
00:51:37.392 --> 00:51:40.651 can allow them to pass in and a user or an account ID as long as
00:51:40.651 --> 00:51:43.459 the endpoint is sufficiently locked down with requiring
00:51:43.459 --> 00:51:45.465 various permissions or roles or things.
00:51:45.855 --> 00:51:49.126 Yeah. And normally for those like, if you look at the cart
00:51:46.625 --> 00:51:47.015 So.
00:51:49.126 --> 00:51:52.563 ones, there's current cart for current user. And then for the
00:51:52.563 --> 00:51:55.834 admin version as a separate endpoint, it says get cart for
00:51:55.834 --> 00:51:58.995 user and then you're supposed to pass it in the user ID.
00:51:59.575 --> 00:52:04.523 Yep. So I just making it clear through naming and through the
00:52:04.523 --> 00:52:08.275 arguments allowed to be passed to an endpoint.
00:52:08.875 --> 00:52:12.611 Uh, what? What state or what user they're operating on, I
00:52:12.611 --> 00:52:14.995 guess probably a good way to put it.
00:52:16.345 --> 00:52:18.743 And then inside the server end point, like if you're
00:52:18.743 --> 00:52:21.640 overwriting the account ID, it doesn't matter what they say for
00:52:21.640 --> 00:52:24.582 the wire, even if they tried to send something different in a in
00:52:24.582 --> 00:52:27.117 a malicious manner, you're overriding it, preventing it
00:52:27.045 --> 00:52:27.285 Yep.
00:52:27.117 --> 00:52:29.697 from happening, which is the more secure way about doing
00:52:29.697 --> 00:52:31.915 things. So he's absolutely right in that regard.
00:52:32.885 --> 00:52:35.276 Yeah, that was. I was in the, I was in. Let you cover that,
00:52:33.145 --> 00:52:34.745 And we'll, we'll show that.
00:52:35.276 --> 00:52:35.595 Tristan.
00:52:36.355 --> 00:52:38.475 Oh yeah. I was gonna say well, and we'll cover that.
00:52:38.795 --> 00:52:39.055 Yeah.
00:52:39.205 --> 00:52:42.495 As well, when we do the service layer thing but just.
00:52:41.865 --> 00:52:43.245 In in yeah.
00:52:44.135 --> 00:52:48.303 In summary, you should never be sending a user ID or account ID
00:52:48.303 --> 00:52:49.215 over the wire.
00:52:50.145 --> 00:52:53.872 If you if, unless I I don't. If it, especially if it's current,
00:52:52.205 --> 00:52:52.465 Yep.
00:52:53.872 --> 00:52:57.484 I don't, I don't see a reason for it. The back end has static
00:52:56.725 --> 00:52:59.991 Yet now if you. Yeah, if you're ever operating on the current
00:52:57.484 --> 00:53:00.105 variables that are capable of handling that.
00:52:59.991 --> 00:53:00.255 user.
00:53:00.925 --> 00:53:04.069 If you're operating on current user or current account, the the
00:53:04.069 --> 00:53:06.918 blanket rule you can set for yourself is. If it's current
00:53:06.918 --> 00:53:09.375 user current account, just don't have parameters.
00:53:10.065 --> 00:53:14.519 Even and as part of the endpoint to allow sending a user or an
00:53:14.519 --> 00:53:18.832 account, just use current user ID and current account ID and
00:53:18.832 --> 00:53:22.934 that will be the correct guidance 99.999% of the time and
00:53:22.934 --> 00:53:27.317 then the very rare edge case where for some reason that's not
00:53:27.317 --> 00:53:31.489 the case, that's probably gonna require further discussion
00:53:31.489 --> 00:53:35.661 anyway, so you can just roll with the that kind of blanket
00:53:35.661 --> 00:53:36.015 rule.
00:53:37.225 --> 00:53:40.700 That's that was gonna be my next point is if you if you have a
00:53:40.700 --> 00:53:44.065 use case to where you think you are gonna need to be sending
00:53:44.065 --> 00:53:47.155 user or account identifiable information over the wire.
00:53:47.845 --> 00:53:50.855 There is a chat we'll back end developers ask anything.
00:53:51.785 --> 00:53:52.055 Yep.
00:53:51.995 --> 00:53:52.715 Post in there.
00:53:53.635 --> 00:53:56.867 Get Brendan's input, get James's input, get my input, get
00:53:56.867 --> 00:54:00.433 Tristan's input. Any of the back Enders, get their input on. If
00:54:00.433 --> 00:54:03.665 that's the case, because it may actually not be the case.
00:54:04.885 --> 00:54:06.925 There may be a way, you just may not be seeing it.
00:54:07.575 --> 00:54:10.437 And that's I mean that's true for any of us. We, we don't see
00:54:10.437 --> 00:54:13.299 everything that's happening all at once. We all need help and
00:54:13.299 --> 00:54:14.915 that's why we're development team.
00:54:18.175 --> 00:54:22.594 OK, so we have the workflow written so as of right now, this
00:54:22.594 --> 00:54:26.940 method will ensure that we're only returning active records
00:54:26.940 --> 00:54:30.925 that we have. This requires a valid account ID on the.
00:54:32.035 --> 00:54:35.213 On the search model and then we are using that stock search
00:54:35.213 --> 00:54:37.545 model. Uh, returning the paginated results.
00:54:38.845 --> 00:54:41.955 Umm well, the sales invoices from the database.
00:54:43.625 --> 00:54:45.615 Any questions on any of that?
00:54:50.105 --> 00:54:54.732 And anybody feel free to ask devil's advocate questions. UM,
00:54:54.732 --> 00:54:58.980 keeping in mind that this is largely being recorded for
00:54:58.980 --> 00:55:03.456 documentation for new people who as yet don't exist to ask
00:55:03.456 --> 00:55:04.215 questions.
00:55:05.555 --> 00:55:08.490 So if anybody can think of questions they might have had
00:55:08.490 --> 00:55:11.735 when they were new or questions they remember having when they
00:55:11.735 --> 00:55:15.083 were new or anything like that, feel free to throw those out and
00:55:15.083 --> 00:55:16.525 we can answer those so that.
00:55:18.255 --> 00:55:19.905 New people don't have to ask them to.
00:55:26.355 --> 00:55:27.285 Going once.
00:55:28.715 --> 00:55:29.705 Going twice.
00:55:29.005 --> 00:55:29.895 Soul.
00:55:29.085 --> 00:55:30.545 Silence is compliance.
00:55:31.345 --> 00:55:35.217 Alrighty. OK, so I think at this point we have a workflow that
00:55:35.217 --> 00:55:38.966 that should theoretically work when connected to the service
00:55:38.966 --> 00:55:39.335 layer.
00:55:39.835 --> 00:55:40.525 Ohm.
00:55:42.635 --> 00:55:46.721 So on that, I'm going to turn it over to you, Tristan. But first,
00:55:46.721 --> 00:55:50.497 I'm going to highlight the fact that I've made a massive Boo
00:55:50.497 --> 00:55:50.745 Boo.
00:55:52.665 --> 00:55:55.015 And I've developed this all on Como QA.
00:55:56.425 --> 00:55:58.555 You haven't committed yet, so it's not too late.
00:55:58.535 --> 00:56:01.902 No, I know, but that the as a general rule, just make sure you
00:56:01.902 --> 00:56:02.865 create the branch.
00:56:04.185 --> 00:56:08.506 That's based on UM, in most cases, if you're doing active
00:56:08.506 --> 00:56:13.275 development on the QA branch of the project that you're on, so.
00:56:19.045 --> 00:56:22.774 And I'll just, uh, I can talk through this. So with branching
00:56:22.774 --> 00:56:23.135 rules.
00:56:23.775 --> 00:56:28.426 Umm. Obviously like yeah support clients comma and then it would
00:56:28.426 --> 00:56:33.149 either be feature or hot fix and then usually the last part of it
00:56:33.149 --> 00:56:37.085 will be like a ticket number dash feature or fix name.
00:56:38.315 --> 00:56:41.725 So in this case we just do like feature slash.
00:56:42.425 --> 00:56:46.253 And then we can put like 0 as if there was a ticket number there
00:56:46.253 --> 00:56:49.846 which we don't have one, but we can pretend there was, so it
00:56:49.846 --> 00:56:53.557 would be like support clients Como feature slash 0 you have to
00:56:53.557 --> 00:56:57.033 replace that with you taking number dash and then we could
00:56:57.033 --> 00:57:00.685 just say get sales invoices for current account or something.
00:57:03.765 --> 00:57:06.327 So for this one I'm I was gonna make it very explicit as the
00:57:06.327 --> 00:57:08.595 testing branch that we're going to delete after this.
00:57:09.935 --> 00:57:14.227 Yeah, I could do zero dash training test or whatever, but I
00:57:14.227 --> 00:57:14.585 yeah.
00:57:21.575 --> 00:57:23.605 We're zero dash training doesn't matter.
00:57:24.665 --> 00:57:27.808 And as I, as I recall, James, you were not extremely strict on
00:57:25.155 --> 00:57:25.755 But yeah.
00:57:27.808 --> 00:57:29.655 this as long as it's not ridiculous.
00:57:30.625 --> 00:57:31.535 And it's descriptive.
00:57:30.795 --> 00:57:31.415 Yes.
00:57:32.285 --> 00:57:35.725 Yeah. So generally camel case or yeah.
00:57:32.625 --> 00:57:34.355 Yeah. And like I would like.
00:57:35.515 --> 00:57:38.935 Camel case or like I would prefer dashes or underscores.
00:57:38.935 --> 00:57:41.695 But I mean again, as long as it's reasonable.
00:57:42.375 --> 00:57:45.845 It's fine if you go nuts and do something crazy stupid and it's
00:57:45.845 --> 00:57:48.285 like 90 characters long. I'm gonna slap you.
00:57:49.945 --> 00:57:53.635 That don't do something like like this and add a, you know,
00:57:53.635 --> 00:57:55.235 at A at a GUID in here at.
00:57:56.575 --> 00:58:00.349 Don't do that. Make sure. Yeah. Make sure that whoever is going
00:57:56.635 --> 00:57:57.755 And an emoji.
00:58:00.349 --> 00:58:03.711 to review your PR can easily tell what exactly they they
00:58:03.711 --> 00:58:07.544 they're looking at that OK, this is. This is the one of the more
00:58:07.544 --> 00:58:11.142 important parts is get this right. Is it a feature? OK, it's
00:58:11.142 --> 00:58:14.739 going into the feature. It's going into the features. OK, is
00:58:14.739 --> 00:58:18.337 it a, is it a hot fix and is to get up there quickly. OK. It
00:58:18.337 --> 00:58:21.345 needs to go into the hot fixes. So get this right.
00:58:21.545 --> 00:58:25.823 Pasted a link to a branching XLSX file if you wanna open it
00:58:23.745 --> 00:58:24.885 Umm OK.
00:58:25.823 --> 00:58:29.175 real quick. It is the guide on how to do this.
00:58:29.575 --> 00:58:31.475 OK. Yep, certainly can.
00:58:30.645 --> 00:58:34.177 And and the the hope would be is wherever this is documented.
00:58:34.177 --> 00:58:37.653 This is linked as well so you guys can look at it in case it
00:58:37.653 --> 00:58:39.705 gets updated or whatever, but yeah.
00:58:38.755 --> 00:58:41.225 It's set to anyone with the link can view so.
00:58:42.395 --> 00:58:42.675 Ohh.
00:58:44.645 --> 00:58:48.295 This is the entire life cycle diagram of branching.
00:58:50.555 --> 00:58:53.585 And then the left side there is is all the.
00:58:51.125 --> 00:58:51.765 Uh, so?
00:58:53.295 --> 00:58:53.665 Yeah.
00:58:55.385 --> 00:58:58.195 Is examples of like if you're working on core then you would
00:58:58.195 --> 00:59:01.097 do a feature or hot fix branch from the root level and there's
00:59:01.097 --> 00:59:03.999 a develop branch. There's the master branch. If you're talking
00:59:03.999 --> 00:59:06.762 to a release and you're trying to fix something that is the
00:59:06.762 --> 00:59:09.526 specific to that release, you would go hot fix and then you
00:59:09.526 --> 00:59:11.185 would prefix the hot fix with your.
00:59:11.605 --> 00:59:15.884 A what version you're trying to fix and then your ticket number
00:59:15.884 --> 00:59:20.096 and then your description, and then just like you did for Como
00:59:20.096 --> 00:59:24.041 just now, if it's for for client, you'd do it a hot fix or
00:59:24.041 --> 00:59:28.320 feature underneath their section so that we know who the branch
00:59:28.320 --> 00:59:32.465 belongs to and our our comparing against the last week I went
00:59:32.465 --> 00:59:36.610 through to clean up branches. There were more than 730 in the
00:59:36.610 --> 00:59:36.945 repo.
00:59:38.565 --> 00:59:41.655 We are down to under 175 today.
00:59:44.355 --> 00:59:45.005 What branches?
00:59:46.125 --> 00:59:46.805 Yeah.
00:59:47.735 --> 00:59:51.296 Umm, so that's why I went through and cleaned a bunch of
00:59:51.296 --> 00:59:53.295 **** up. There were things that.
00:59:53.785 --> 00:59:56.756 And a lot of it was probably branches that had had a PR on
00:59:56.756 --> 00:59:59.879 it, but the PR wasn't set to two. Delete the branch ones that
00:59:59.879 --> 01:00:03.053 had merged and comparing it to their QA branch for the client.
01:00:03.053 --> 01:00:06.075 Like let's say that that one through 4-5, some bug was zero
01:00:06.075 --> 01:00:09.298 commits ahead of the QA branch. I could just straight up delete
01:00:09.298 --> 01:00:12.270 it because I know that it's already merged or it never got
01:00:12.270 --> 01:00:15.292 to commit into it. That was actually like new work error or
01:00:15.292 --> 01:00:18.214 whatever. Anyway, those kinds of cases I was able to just
01:00:18.214 --> 01:00:21.085 straight up delete that was probably about half of them.
01:00:22.205 --> 01:00:24.275 And then there were a lot that were.
01:00:25.465 --> 01:00:28.669 Really quick little PR that could just like slap it, slap
01:00:28.669 --> 01:00:31.983 them together and and push and push them in. And then there
01:00:31.983 --> 01:00:35.519 were a bunch that were like it was abandoned six months ago and
01:00:35.519 --> 01:00:39.165 the DEV approved going ahead and wiping them out because they had
01:00:39.165 --> 01:00:42.700 already accomplished the the the fix in a different way kind of
01:00:42.700 --> 01:00:46.291 thing. So just try to make sure you clean up after yourselves. I
01:00:46.291 --> 01:00:49.882 have a report auditing for that now that can help me stay on top
01:00:49.882 --> 01:00:53.362 of it. I'll run it probably once a week and just say, oh, this
01:00:53.362 --> 01:00:55.075 stuff is more than 30 days old.
01:00:55.605 --> 01:00:59.353 Let's make sure we get these branches cleaned up so that we
01:00:59.353 --> 01:01:03.350 don't over bloat our thing. And I noticed a marked reduction in
01:01:03.350 --> 01:01:07.348 size from a for a fresh checkout of Seth was like 850 megabytes
01:01:07.348 --> 01:01:09.035 instead of nearly two gigs.
01:01:10.495 --> 01:01:13.990 So that's that's helping reduce the size of our repo by by
01:01:13.990 --> 01:01:17.842 cleaning that kind of stuff out. And it's fewer branches for you
01:01:17.842 --> 01:01:21.456 to have to sift through to find where stuff is actually, you
01:01:21.456 --> 01:01:25.307 know, at whenever you're having to take over someone else's work
01:01:25.307 --> 01:01:25.485 or.
01:01:26.655 --> 01:01:29.668 Come in and and start new work for yourself and like knowing
01:01:29.668 --> 01:01:32.435 where to put stuff and everything. A lot of that's been
01:01:32.435 --> 01:01:33.325 cleaned up now so.
01:01:33.645 --> 01:01:36.379 Umm, but let's try and stay on top of it if we can. And if
01:01:36.379 --> 01:01:39.252 you're having a problem, call it out. Get a team lead to help
01:01:39.252 --> 01:01:41.986 you. We we're more than happy to help clean stuff up so it
01:01:41.986 --> 01:01:43.655 doesn't get bad in the first place.
01:01:44.215 --> 01:01:48.084 Umm, yeah, that's one thing. I will. I will point out to is
01:01:48.084 --> 01:01:52.147 don't be afraid to ask for ask questions or ask for help. Just
01:01:52.147 --> 01:01:52.405 ask.
01:01:53.575 --> 01:01:57.117 There's, I mean, I know like, like James, you always you
01:01:57.117 --> 01:02:00.596 always respond as best you can to make sure that you're
01:02:00.596 --> 01:02:04.325 extremely busy, Brendan, the same thing. But there. I mean,
01:02:04.325 --> 01:02:08.364 there are other people that just James and Brendan that can help
01:02:08.364 --> 01:02:11.968 people with things. I mean myself. I do the best I can to
01:02:11.968 --> 01:02:15.883 monitor those. Uh those the the back end chats and things like
01:02:15.883 --> 01:02:19.798 that and I'll respond if I have meaningful input. I know I see
01:02:19.798 --> 01:02:23.464 Tristan on some of those but there are plenty of devs here
01:02:23.464 --> 01:02:24.645 that can help with.
01:02:24.945 --> 01:02:27.235 Especially this this administrative stuff.
01:02:28.155 --> 01:02:28.525 You know.
01:02:29.255 --> 01:02:32.387 Aside from because you don't need to get a necessarily you
01:02:32.387 --> 01:02:35.626 into office hours to to learn things like this, just ask one
01:02:35.626 --> 01:02:35.945 of us.
01:02:40.135 --> 01:02:41.765 We're all of us, put in the chat.
01:02:44.285 --> 01:02:47.475 OK, so I'm going to create a new branch here.
01:02:49.605 --> 01:02:51.175 Who do go down here?
01:02:51.785 --> 01:02:54.325 Make sure you save first too before we commit.
01:02:53.785 --> 01:02:55.565 Like that I am man.
01:02:57.205 --> 01:03:01.588 And generally speaking so like I know I do stuff through VS code,
01:03:01.588 --> 01:03:05.507 I do like half VS code, half command line, but it's always
01:03:05.507 --> 01:03:09.625 good usually to check whatever changes you're about to commit
01:03:09.625 --> 01:03:14.009 before you make them and look at DEF. That's what I would do, but
01:03:14.009 --> 01:03:17.995 I'll I'll show that on like the VS code command line front.
01:03:15.905 --> 01:03:18.106 Yeah. And I was gonna say I think for stuff like that, we're
01:03:18.106 --> 01:03:20.452 gonna cover. I think we're gonna cover, like, get best practices
01:03:20.452 --> 01:03:22.546 and behaviors in a separate training in more depth. So we
01:03:20.905 --> 01:03:21.275 Umm.
01:03:22.546 --> 01:03:24.495 don't really need to go too much into that right now.
01:03:22.685 --> 01:03:23.075 OK.
01:03:25.155 --> 01:03:25.535 Alright.
01:03:25.335 --> 01:03:29.033 Yeah, yeah, that's that's fine. So we'll just to do the OK,
01:03:29.033 --> 01:03:30.205 we'll just do this.
01:03:36.945 --> 01:03:40.704 Branch, we're gonna base this off of Como QA and we're going
01:03:40.704 --> 01:03:42.615 to check out. And this is nice.
01:03:46.695 --> 01:03:49.377 OK, so we have our new branch. We have the changes on our
01:03:49.377 --> 01:03:52.060 branch before we do really anything else. We really wanna
01:03:52.060 --> 01:03:54.882 rebuild this project and make sure that whatever we just did
01:03:54.882 --> 01:03:56.825 did not break it, break the entire world.
01:04:02.785 --> 01:04:04.525 Do your front end partner in favor?
01:04:05.715 --> 01:04:09.050 Well, or back at like sometimes you'll be working with another
01:04:09.050 --> 01:04:12.492 back end and the the last thing someone wants is like, ohh yeah,
01:04:09.575 --> 01:04:09.975 Hmm.
01:04:12.492 --> 01:04:15.933 I just pushed a change, pull it down and someone pulls down your
01:04:15.933 --> 01:04:19.321 change and it broke the entire site. It's like ah, and now they
01:04:17.855 --> 01:04:18.965 Yeah. So just.
01:04:19.321 --> 01:04:22.075 have to fix it in order to continue working, right.
01:04:20.115 --> 01:04:20.435 Yeah.
01:04:22.055 --> 01:04:24.844 Do that. Do everyone that's involved in in what you're
01:04:22.615 --> 01:04:23.275 It.
01:04:24.844 --> 01:04:27.837 currently working on a favor, including yourself, and just
01:04:27.837 --> 01:04:29.815 rebuild it before you commit anything.
01:04:48.155 --> 01:04:51.302 And Tristan, I think I left you just enough time to go over that
01:04:51.302 --> 01:04:51.835 edge point.
01:04:52.805 --> 01:04:53.855 Yeah, we should be good.
01:04:53.995 --> 01:04:54.865 Yeah. No, it's.
01:04:55.125 --> 01:04:58.529 Most of it's going to be just going over the security things.
01:04:58.529 --> 01:05:01.165 We don't even need to spend a lot of time like.
01:05:00.215 --> 01:05:00.605 Umm.
01:05:02.305 --> 01:05:05.398 Well, let's play this way. You should test all your work, but
01:05:05.398 --> 01:05:08.292 we don't need to spend a, you know, 30 minutes going over
01:05:05.705 --> 01:05:06.115 Yes.
01:05:08.292 --> 01:05:11.436 postman or whatever. I think we have a a, an explicit training
01:05:11.436 --> 01:05:11.885 for that.
01:05:12.885 --> 01:05:14.355 Umm yeah we do.
01:05:13.925 --> 01:05:17.175 So we'll we'll mainly just focus on the the actual.
01:05:17.965 --> 01:05:18.915 Code part.
01:05:19.455 --> 01:05:22.499 And I will. I will say this about like adding workflow
01:05:19.925 --> 01:05:20.415 Umm.
01:05:22.499 --> 01:05:25.765 methods and endpoints and things like that there, there's.
01:05:25.855 --> 01:05:26.385 Umm.
01:05:27.975 --> 01:05:31.919 Maybe a maybe a mean spirited nickname for self developers out
01:05:31.919 --> 01:05:32.295 there.
01:05:33.475 --> 01:05:35.585 The where copy and paste developers.
01:05:37.985 --> 01:05:40.876 Don't take that as an insult because a lot of what we could
01:05:40.876 --> 01:05:42.755 could be doing is just copy and paste.
01:05:44.035 --> 01:05:47.160 Imagine if there weren't four and you had to write all of that
01:05:47.160 --> 01:05:47.805 code by hand.
01:05:48.675 --> 01:05:52.855 Yeah, if you can copy and paste something, just do it.
01:05:51.195 --> 01:05:53.385 Do you remember? I remember.
01:05:55.845 --> 01:05:57.895 I I don't, James, I don't, sorry.
01:05:56.965 --> 01:05:59.935 I I'm pretty sure none of you were around back then.
01:06:00.325 --> 01:06:00.925 Yeah.
01:06:00.955 --> 01:06:05.527 I've I've seen old, old, old, even precept things. And let's
01:06:05.527 --> 01:06:10.175 just put this way B anyone who just be glad that's all I have
01:06:10.175 --> 01:06:11.375 to say. Be glad.
01:06:12.345 --> 01:06:14.995 It could be so much so much worse.
01:06:23.365 --> 01:06:25.957 And I would say if you're committing work, just make sure
01:06:25.957 --> 01:06:28.594 it's the script enough so the person that's looking at the
01:06:28.594 --> 01:06:30.695 changes on the project. Until what did you do?
01:06:31.635 --> 01:06:33.991 Without having to take to the cow to find that exactly what
01:06:33.991 --> 01:06:34.305 you did.
01:06:34.955 --> 01:06:35.965 What did you do?
01:06:35.115 --> 01:06:38.945 And as a quickest as a quick aside, they shouldn't even have
01:06:36.685 --> 01:06:37.445 What'd you do?
01:06:38.945 --> 01:06:42.965 to look at the the git logs to know what what WTF is happening.
01:06:44.165 --> 01:06:47.807 That should never be the case if you're working on a feature with
01:06:47.807 --> 01:06:51.395 someone you should be talking to that person actively and making
01:06:51.395 --> 01:06:54.816 sure you're on the same page before you write code and before
01:06:54.125 --> 01:06:57.797 This seems like a good time. Seems like a good time to say,
01:06:54.816 --> 01:06:55.755 you even do this.
01:06:57.797 --> 01:07:01.346 and this will probably be discussed in a separate video a
01:07:01.346 --> 01:07:04.651 little bit more as well, but good time to add talk to
01:07:04.651 --> 01:07:05.325 developers.
01:07:05.545 --> 01:07:06.665 Yeah. Talk to a police.
01:07:06.045 --> 01:07:10.372 Uh, it's job is a lot better when you actually communicate
01:07:10.372 --> 01:07:15.067 with the people you work with, hang out with them, set up times
01:07:15.067 --> 01:07:19.175 to work with them. You know, it just makes life easier.
01:07:20.055 --> 01:07:23.348 Yes, I would say specially if that's a a feature that spans
01:07:23.348 --> 01:07:24.885 both front and the back end.
01:07:27.315 --> 01:07:28.465 Just get in a meeting.
01:07:30.455 --> 01:07:30.785 It.
01:07:32.985 --> 01:07:35.742 I think there's, I think it's various opinions out there, the
01:07:35.742 --> 01:07:38.456 weather, that's that's what's what's more productive. But in
01:07:38.456 --> 01:07:41.036 my opinion, it's always been more productive to me to get
01:07:41.036 --> 01:07:43.749 into the meeting with the front end or if I'm working on the
01:07:43.749 --> 01:07:46.285 back end portion of a of a of a feature that spans both.
01:07:46.775 --> 01:07:50.355 Uh, it gives me better context on on what we're working on.
01:07:46.805 --> 01:07:48.425 Yeah, if nothing else.
01:07:49.285 --> 01:07:49.575 Yeah.
01:07:50.905 --> 01:07:53.752 If nothing else, it makes the feedback cycle for whatever
01:07:53.752 --> 01:07:55.225 you're working on much faster.
01:07:54.515 --> 01:07:55.645 You know, yeah.
01:07:56.375 --> 01:07:56.845 Agreed.
01:07:56.625 --> 01:08:00.301 At, you know, at at the bare minimum you can get really quick
01:08:00.301 --> 01:08:04.096 back and forth with that person and that's great. And you know,
01:08:04.096 --> 01:08:07.772 it turns out most of the people work here pretty cool too. So
01:08:07.772 --> 01:08:11.448 you you might make a friend and have someone to chat to while
01:08:11.448 --> 01:08:12.575 you're working. So.
01:08:13.715 --> 01:08:15.825 You know, that's pretty cool, I guess.
01:08:14.425 --> 01:08:16.365 Faith to make a friend.
01:08:17.095 --> 01:08:21.428 Speaking of communication and collaboration, what what would
01:08:21.428 --> 01:08:25.477 happen in the say IRL with quotation marks is Greg would
01:08:25.477 --> 01:08:29.882 copy the branch name, put in Chad be like, hey, I pushed this
01:08:29.882 --> 01:08:34.358 up. You can pull it down and I would be able to copy that. And
01:08:34.358 --> 01:08:38.691 you know, once he sends it in chat there I'll I'll steal the
01:08:38.691 --> 01:08:39.615 screen share.
01:08:40.135 --> 01:08:40.325 Yep.
01:08:42.495 --> 01:08:43.385 OK so.
01:08:42.645 --> 01:08:44.015 You can show what I'll do in mind.
01:08:47.425 --> 01:08:47.675 You.
01:08:52.955 --> 01:08:55.745 Get a copy, copy and pastes now and I can just type it out.
01:08:58.475 --> 01:08:59.105 Testing.
01:09:00.395 --> 01:09:03.465 One of the benefits of command liner.
01:09:04.665 --> 01:09:07.755 Right there is just type Git branch and highlighted.
01:09:05.875 --> 01:09:06.705 Yep.
01:09:18.645 --> 01:09:19.185 I could type.
01:09:23.555 --> 01:09:23.945 OK.
01:09:26.945 --> 01:09:27.855 Alrighty.
01:09:27.865 --> 01:09:31.684 Alright. And that would pretty much be the the end of that
01:09:31.684 --> 01:09:32.655 portion of the?
01:09:33.975 --> 01:09:36.811 Back in feature for the front end or to take over while in
01:09:36.811 --> 01:09:38.735 this case it's still back end work but.
01:09:39.235 --> 01:09:42.067 Yeah. I mean, generally speaking, what I'm about to do
01:09:41.125 --> 01:09:41.735 But.
01:09:42.067 --> 01:09:43.355 would be the same person.
01:09:43.775 --> 01:09:44.025 Yeah.
01:09:44.365 --> 01:09:49.167 Usually, but just, you know, just to show some basic git
01:09:49.167 --> 01:09:53.885 branching stuff. So obviously he sent me a branch. I'm.
01:09:54.615 --> 01:09:57.880 Out of a habit, I like to see. Like, hey, what? What branch am
01:09:57.880 --> 01:10:01.198 I on? Just to know what Branch AM on. Make sure I'm not already
01:10:01.198 --> 01:10:04.205 on the same branch, because then I just do git pull. But.
01:10:06.105 --> 01:10:08.781 In this case, because he just pushed it up, I am gonna have
01:10:08.781 --> 01:10:08.915 to.
01:10:09.875 --> 01:10:13.195 See. Hey, is, you know, let's get whatever is there and.
01:10:14.255 --> 01:10:19.138 I think and here you'll actually notice a little line that shows
01:10:19.138 --> 01:10:19.815 that hey.
01:10:20.445 --> 01:10:24.310 He pushed that up from his local to origin, which is, you know,
01:10:20.465 --> 01:10:21.085 2 branch.
01:10:24.310 --> 01:10:27.994 the the server. So now what I can do is I can either copy it
01:10:27.994 --> 01:10:31.739 from here or, you know, he sent me the message, but I'll just
01:10:31.739 --> 01:10:35.665 copy it from here because then I know I can't mess it up because
01:10:35.665 --> 01:10:39.651 teams likes to just throw random crap. Anything you copy and then
01:10:39.305 --> 01:10:40.825 It all my name and the time signature.
01:10:39.651 --> 01:10:40.195 do a git.
01:10:41.505 --> 01:10:44.955 Check out. Yeah, or or whatever who does.
01:10:45.825 --> 01:10:47.745 And Alma checked out to that branch. So.
01:10:49.875 --> 01:10:53.366 Quick little cool thing you can do. Obviously I wanna open this
01:10:53.366 --> 01:10:56.857 up in like VS code writer. I'm gonna use writer, but you can do
01:10:56.857 --> 01:10:57.185 start.
01:10:58.305 --> 01:10:59.935 Like that, and that'll open up.
01:11:01.385 --> 01:11:02.735 Windows explorer there.
01:11:04.735 --> 01:11:05.625 And now I can.
01:11:06.465 --> 01:11:08.415 Go ahead and open that project up.
01:11:11.035 --> 01:11:14.036 And since I knew Tristan was probably going to use command
01:11:14.036 --> 01:11:17.240 line for for his get stuff, I wanted to because I know I think
01:11:17.240 --> 01:11:20.597 it was Nick that mentioned he he wanted to kind of see the Visual
01:11:20.597 --> 01:11:23.852 Studio stuff in here and I think it'd be beneficial for for new
01:11:23.852 --> 01:11:27.209 people to just to see that there are different ways of doing this
01:11:27.209 --> 01:11:29.905 just through the one that's most productive for you.
01:11:31.855 --> 01:11:35.471 Whatever works is what works. Whatever's gonna be easiest for
01:11:34.585 --> 01:11:34.795 Yeah.
01:11:35.471 --> 01:11:35.705 you.
01:11:38.285 --> 01:11:41.675 So I think it's still loading there I know with.
01:11:43.465 --> 01:11:46.735 Yeah, it's indexing, so I'm going to let my ID do the thing.
01:11:49.225 --> 01:11:53.059 Once it's done indexing stuff, which it is now I'm gonna
01:11:53.059 --> 01:11:54.405 rebuild immediately.
01:11:54.845 --> 01:11:55.135 Umm.
01:11:55.105 --> 01:11:57.989 Because I don't know what happened. You know I'm not gonna
01:11:57.989 --> 01:11:59.065 find out the hard way.
01:12:03.075 --> 01:12:05.607 You mean after you've written all your code, spent three hours
01:12:05.607 --> 01:12:07.859 writing your code, and then realize it won't even build
01:12:07.859 --> 01:12:09.065 because it's a back end issue?
01:12:10.245 --> 01:12:14.226 Or whatever, right? Like, you know, generally speaking, never.
01:12:14.226 --> 01:12:16.375 I check out to a new branch ever.
01:12:17.275 --> 01:12:19.785 Assuming it's not just checking out from like.
01:12:20.515 --> 01:12:23.660 Something I was, you know, working on or whatever to
01:12:23.660 --> 01:12:26.925 something new. I'm always rebuilding after doing that.
01:12:48.535 --> 01:12:52.273 And generally speaking, yeah, I'll, I'll make this like little
01:12:52.273 --> 01:12:55.893 build window bigger while it's building to make sure nothing
01:12:55.893 --> 01:12:59.572 weird happens. And at that at this time that's a normal thing
01:12:59.572 --> 01:13:02.065 to see. So looks like we're all good, so.
01:13:04.505 --> 01:13:07.886 First thing, obviously the endpoint we're going to be in
01:13:07.886 --> 01:13:10.615 the services layer, which is the 06 services.
01:13:12.225 --> 01:13:13.985 Two projects under here core.
01:13:14.945 --> 01:13:18.320 Has the core stuff that you shouldn't have to worry about
01:13:18.320 --> 01:13:21.986 most of the time, but what you really want to look at is this.
01:13:21.986 --> 01:13:23.965 This normal just service project.
01:13:24.815 --> 01:13:26.825 Is there any way you could make that a little bigger, Tristan?
01:13:27.855 --> 01:13:32.970 Yeah, maybe. I don't know if there's a way to do it. That's
01:13:28.995 --> 01:13:32.489 I don't know if I don't know if any, maybe maybe just zoom in
01:13:32.489 --> 01:13:32.715 but.
01:13:32.970 --> 01:13:36.295 super easy because there's VS code so.
01:13:36.975 --> 01:13:38.615 That might be able to.
01:13:37.245 --> 01:13:39.957 I just maybe if you could just zoom in and I don't know if you
01:13:37.635 --> 01:13:39.205 Usually control mouse wheel.
01:13:39.957 --> 01:13:41.765 can, but I don't know if anybody else is.
01:13:40.135 --> 01:13:42.455 Control Control Plus does it too.
01:13:40.465 --> 01:13:41.055 To zoom.
01:13:40.795 --> 01:13:44.568 Or are we just talking about the the the code code? Because I was
01:13:44.568 --> 01:13:48.284 gonna say that ID itself I don't know if that's gonna be easy to
01:13:48.005 --> 01:13:48.975 I just met the code.
01:13:48.035 --> 01:13:51.372 Well, the ID the if you're in VS code, the entire IDE will scale.
01:13:48.284 --> 01:13:49.085 change. I see.
01:13:51.372 --> 01:13:54.305 If you do control plus to make everything easier to read.
01:13:53.575 --> 01:13:56.883 Yeah, I was just saying I'm right or I don't know if I can
01:13:56.883 --> 01:13:58.005 let me see is there.
01:13:57.355 --> 01:13:58.885 Oh, you're not? I thought you're VS code.
01:14:01.185 --> 01:14:02.895 Maybe I can just do that.
01:14:04.145 --> 01:14:07.451 There we go. Is that a little bit better on the left hand
01:14:06.475 --> 01:14:09.761 Yeah, I wasn't sure if anybody else was having a little bit of
01:14:07.451 --> 01:14:07.965 side, OK.
01:14:09.761 --> 01:14:11.065 trouble seeing that, but.
01:14:10.675 --> 01:14:12.185 Sorry, I'm like a.
01:14:13.265 --> 01:14:17.495 I haven't hit the the I need glasses age yet so.
01:14:19.235 --> 01:14:21.565 I'm good and plus I'm.
01:14:20.225 --> 01:14:22.115 I cheated and got LASIK so.
01:14:22.145 --> 01:14:23.255 Wow.
01:14:22.625 --> 01:14:26.575 And I say I I I cheated and hit that age when I was 10, so.
01:14:22.925 --> 01:14:23.725 Yeah, well.
01:14:27.025 --> 01:14:27.835 Wow.
01:14:27.195 --> 01:14:30.199 I was gonna say I know most. I've blucky. I'll just put it
01:14:27.775 --> 01:14:28.925 Rub it in. Why don't you?
01:14:30.199 --> 01:14:33.305 that way. Most people I know would have trouble. So I'm. I'm
01:14:33.305 --> 01:14:33.865 sorry. I'm.
01:14:34.555 --> 01:14:37.845 35 and I'm already an old man to you, trusting my goodness.
01:14:35.305 --> 01:14:38.987 I was sabotaging, probably at least, yeah, that it's a I'm
01:14:38.987 --> 01:14:42.982 lucky. I'm sure it will not last forever. In fact, I know cause
01:14:42.982 --> 01:14:46.851 you know, my my dad used to have excellent vision, and now he
01:14:46.851 --> 01:14:50.035 can't see anything within 10 feet of his face. So.
01:14:51.025 --> 01:14:51.925 That's unfortunate.
01:14:51.385 --> 01:14:55.352 It's just a matter of time of enjoying. It will last. OK, so
01:14:55.352 --> 01:14:59.384 just like and again, this is the great thing about everything
01:14:59.384 --> 01:15:03.547 being consistent and organized just like the other layers. It's
01:15:03.547 --> 01:15:07.839 all organized. So I know exactly where to go without even looking
01:15:07.839 --> 01:15:12.001 at his endpoint or anything. I just go not inventory invoicing.
01:15:12.001 --> 01:15:15.904 And then in here just like the other folder we saw, there's
01:15:15.904 --> 01:15:17.855 generated an extended ones so.
01:15:18.975 --> 01:15:22.552 Obviously I would be looking at normal sales invoice. We can see
01:15:22.552 --> 01:15:26.129 that all these sale like contact event blah blah blah blah blah.
01:15:26.129 --> 01:15:27.065 So it looks like.
01:15:28.015 --> 01:15:31.485 There is not.
01:15:32.675 --> 01:15:35.350 Any. Is that right? There's no. Oh, yeah. There's one extended
01:15:35.350 --> 01:15:36.285 in there. I caught it.
01:15:36.915 --> 01:15:40.571 But right now there are not any other ones and actually this is
01:15:40.571 --> 01:15:43.884 the one we're actually wanna edit, cause it sells invoice
01:15:43.884 --> 01:15:47.425 service dot extended. So again it was already created for us.
01:15:47.425 --> 01:15:49.425 But if you had to make one if you.
01:15:50.415 --> 01:15:53.629 Yeah, if you had to make one, don't put it in here. Don't put
01:15:53.629 --> 01:15:55.495 it in where it says auto generated.
01:15:56.205 --> 01:15:59.515 Put it in where it says extended or make the extended one.
01:16:00.585 --> 01:16:02.375 Umm so.
01:16:03.475 --> 01:16:08.326 You can see there's two parts of this file. Basically you might
01:16:08.326 --> 01:16:13.177 see a bunch of these and a bunch of these. Basically a bunch of
01:16:13.177 --> 01:16:17.573 like post get, you know, patch, whatever methods within a
01:16:17.573 --> 01:16:22.045 partial class, and then a bunch of classes with a bunch of
01:16:22.045 --> 01:16:26.593 attributes. So this is the endpoint definition up here. And
01:16:26.593 --> 01:16:31.445 then this is what gets actually hit when the endpoint gets hit.
01:16:32.245 --> 01:16:36.479 So these endpoints essentially define like hey, where is this
01:16:36.479 --> 01:16:40.782 gonna be available? Is it gonna be on the store front or admin
01:16:40.782 --> 01:16:44.607 or whatever? Does it require authentication? What's the
01:16:44.607 --> 01:16:48.705 route? What's the HTTP verb? Quick summary stuff like that.
01:16:48.705 --> 01:16:52.940 So I'm going to go ahead and do the endpoint definition first
01:16:52.940 --> 01:16:53.145 so.
01:16:53.825 --> 01:16:54.345 One second.
01:16:54.175 --> 01:16:55.475 Real good.
01:16:55.835 --> 01:17:00.165 2 two things, one, the priority equals a number.
01:17:00.925 --> 01:17:04.486 I'm if you see that on an endpoint kill it. It's not
01:17:04.486 --> 01:17:06.435 supposed to be there anymore.
01:17:10.395 --> 01:17:14.187 Yes. So those were part of an old thing that we did when we
01:17:14.187 --> 01:17:17.600 still had split endpoints between cached ones and non
01:17:17.600 --> 01:17:21.329 cached ones. And I never got rid of all of them. So you're
01:17:21.329 --> 01:17:24.616 welcome to just straight up delete those off of the
01:17:24.616 --> 01:17:25.185 endpoint.
01:17:26.005 --> 01:17:29.313 Umm, you don't need them and it actually if you do it wrong it
01:17:29.313 --> 01:17:32.621 can have a negative impact on your endpoint. If you misuse it.
01:17:32.621 --> 01:17:35.825 So just don't use them and get rid of them. If you see them.
01:17:36.795 --> 01:17:40.505 Two uh. The verb where you have post.
01:17:41.615 --> 01:17:44.565 I am going to start doing. I'm gonna do like a replace all
01:17:44.565 --> 01:17:45.315 eventually but.
01:17:46.815 --> 01:17:53.630 There is a HTTP methods dot post that you can use instead that is
01:17:53.630 --> 01:17:55.695 a concrete constant.
01:17:56.525 --> 01:18:00.409 And to get that instead, and now you're using a variable instead
01:18:00.409 --> 01:18:01.485 of a magic string.
01:18:03.305 --> 01:18:06.465 And that's comes right out of the service deck stuff. So that
01:18:03.315 --> 01:18:04.035 Good call.
01:18:06.465 --> 01:18:09.524 makes that a little nicer. I would like to start doing more
01:18:09.524 --> 01:18:12.685 of those things so that we have fewer magic strings on stuff.
01:18:14.265 --> 01:18:15.255 Awesome. Good to know.
01:18:16.445 --> 01:18:20.067 So again, I'm just gonna just to keep it consistent again if if
01:18:20.067 --> 01:18:23.463 no one was watching, this is what I would do. I'd just copy
01:18:23.463 --> 01:18:27.086 it cause it's easier to follow format when you're not having to
01:18:27.086 --> 01:18:30.539 handwrite literally everything and there's no benefit if you
01:18:30.539 --> 01:18:33.822 know what you're doing. So again, this is James said, now
01:18:33.822 --> 01:18:34.445 there is a.
01:19:00.695 --> 01:19:01.015 Yes.
01:19:01.075 --> 01:19:01.515 Post.
01:19:02.285 --> 01:19:03.635 It doesn't cough.
01:19:05.985 --> 01:19:06.465 Well.
01:19:05.995 --> 01:19:09.195 A lot of our get endpoints are actually gets and it turns them
01:19:08.855 --> 01:19:09.415 Yes.
01:19:09.195 --> 01:19:11.685 on to query string parameters instead of a body.
01:19:12.365 --> 01:19:15.334 Yes, yes. So in this, I guess what I was trying to say is in
01:19:15.334 --> 01:19:18.061 this specific case with paginated results, the reason I
01:19:18.061 --> 01:19:21.225 actually chose this because it's like an edge case where in this
01:19:21.225 --> 01:19:24.439 one instance, yeah, you're gonna have to use a post for something
01:19:24.439 --> 01:19:27.409 that seems like it should be a get. It's a little confusing,
01:19:27.409 --> 01:19:29.405 but I purposely chose the confusing one.
01:19:30.825 --> 01:19:34.825 To to show that sometimes you will need to use a post.
01:19:35.805 --> 01:19:36.675 Sometimes.
01:19:40.045 --> 01:19:42.910 And then obviously I think we called it what just get sales
01:19:42.910 --> 01:19:44.295 invoices for current account.
01:19:45.825 --> 01:19:46.915 Yes.
01:19:50.085 --> 01:19:53.488 Now I'm gonna put test after it, because there's probably already
01:19:53.488 --> 01:19:54.365 another endpoint.
01:19:56.185 --> 01:19:58.760 Now, again, just to reiterate, authenticate this, make sure you
01:19:58.760 --> 01:20:01.175 were logged in. It doesn't do anything else, just says hey.
01:20:01.875 --> 01:20:06.185 Is this person logged into the website OK? It's not checking if
01:20:06.185 --> 01:20:08.745 you have a specific role or whatever.
01:20:10.045 --> 01:20:13.445 Used in the storefront means is exposed in the API storefront.
01:20:14.185 --> 01:20:17.355 Umm API so.
01:20:18.075 --> 01:20:22.387 Basically like you you have you can make endpoint calls to like
01:20:22.387 --> 01:20:26.700 API admin or API storefront or API brand admin whatever used in
01:20:26.700 --> 01:20:30.609 XYZ. That's basically it says used in this specific thing
01:20:30.609 --> 01:20:31.485 there's also.
01:20:32.695 --> 01:20:34.525 The user and addendums files.
01:20:35.565 --> 01:20:38.495 Should probably take a quick look at.
01:20:41.635 --> 01:20:43.455 And they're split out by Portal.
01:20:44.645 --> 01:20:49.251 So you'll see a bunch of partial classes. These are pointing
01:20:49.251 --> 01:20:49.855 towards.
01:20:50.875 --> 01:20:52.005 Actual endpoints.
01:20:53.615 --> 01:20:57.475 And especially just adding that whatever attribute in the case
01:20:57.475 --> 01:21:00.416 of using the denims dot storefront, the used in
01:21:00.416 --> 01:21:04.214 storefront is getting added to this. That's why all these are
01:21:04.214 --> 01:21:05.195 partial classes.
01:21:06.155 --> 01:21:09.220 Or should be. That way you can just readily add them or remove
01:21:09.220 --> 01:21:10.485 them from using addendums.
01:21:12.125 --> 01:21:15.929 Next part is the route. Obviously this isn't payments. I
01:21:15.929 --> 01:21:20.001 don't know why this one's under payments. I mean, I guess it
01:21:20.001 --> 01:21:24.073 sales invoice payments, but it probably should be like sales
01:21:24.073 --> 01:21:28.211 invoices, current account and then or invoicing rather. Yeah,
01:21:24.535 --> 01:21:25.225 Invoicing.
01:21:28.211 --> 01:21:31.015 it's not looking at a good example of so.
01:21:32.415 --> 01:21:38.083 Invoicing current account sales invoice test. I'll just make it
01:21:38.083 --> 01:21:39.235 that for now.
01:21:42.005 --> 01:21:45.355 And then we'll say use to get sales invoices.
01:21:46.205 --> 01:21:48.325 For the current accounts.
01:21:50.965 --> 01:21:56.039 Generally speaking, there might be like a permission we need for
01:21:56.039 --> 01:22:00.880 this. So and that for that we can do like required permission
01:22:00.880 --> 01:22:05.720 and then I think there is one specifically for sales invoices
01:22:05.720 --> 01:22:05.955 so.
01:22:06.125 --> 01:22:10.080 That every table has a standard set of permissions that are crud
01:22:10.080 --> 01:22:10.445 based.
01:22:11.145 --> 01:22:16.035 Yeah. And this one specifically has one for storefront as well.
01:22:11.755 --> 01:22:14.415 Uh, so you can do requires permission.
01:22:15.095 --> 01:22:15.605 Uh.
01:22:17.485 --> 01:22:18.695 Uh, yeah. There's two of them.
01:22:19.155 --> 01:22:22.185 Umm, there's invoicing dot.
01:22:23.975 --> 01:22:27.095 Sales invoice dot uh view.
01:22:27.755 --> 01:22:29.325 Which is the read permission.
01:22:35.285 --> 01:22:36.145 It's on that we're there.
01:22:36.725 --> 01:22:41.099 And the reason I'm doing requires any is because I think
01:22:36.965 --> 01:22:37.275 It would.
01:22:41.099 --> 01:22:45.626 that one's specifically for admins, so invoicing dot sales
01:22:45.626 --> 01:22:50.230 invoice dot view this is one that I think only connects and
01:22:50.230 --> 01:22:51.765 the admin role have.
01:22:52.605 --> 01:22:55.118 So you'll also want to do if this is like a storefront
01:22:54.505 --> 01:22:54.665 Yeah.
01:22:55.118 --> 01:22:57.952 endpoint, you'll also want to do one that the normal set user
01:22:57.952 --> 01:22:58.135 has.
01:22:59.495 --> 01:23:02.895 So that's why I was kind of just pulling up the database there,
01:23:02.895 --> 01:23:05.870 but just the show we're looking at Como just to keep it
01:23:05.870 --> 01:23:06.455 consistent.
01:23:07.355 --> 01:23:08.675 Tables.
01:23:08.755 --> 01:23:09.645 Uh.
01:23:12.605 --> 01:23:13.605 Starts.
01:23:12.925 --> 01:23:14.245 My text app permissions.
01:23:16.185 --> 01:23:21.025 Sorry my this is where this is where it does get too small for
01:23:21.025 --> 01:23:22.255 me, but I OK so.
01:23:23.235 --> 01:23:24.315 Oh really?
01:23:25.125 --> 01:23:27.817 Yeah, this is actually where I start having trouble seeing
01:23:27.817 --> 01:23:29.415 stuff, and when it gets this well.
01:23:30.045 --> 01:23:32.815 And they're gonna have too many. So I'm just gonna do.
01:23:32.775 --> 01:23:37.595 So I at aware name like.
01:23:38.345 --> 01:23:42.057 Uh, with a pair of single quotes and then a pair of single are a
01:23:42.057 --> 01:23:43.885 pair of parentheses inside that.
01:23:45.305 --> 01:23:47.285 There is, I think it's like this.
01:23:45.535 --> 01:23:47.595 Backwards, it's backwards, yeah.
01:23:46.365 --> 01:23:47.855 In inside the single quotes.
01:23:48.195 --> 01:23:48.765 Yep.
01:23:48.375 --> 01:23:52.525 And then just put invoice without the letter E at the end.
01:23:55.665 --> 01:23:56.485 And then do that.
01:23:57.315 --> 01:24:00.345 That narrowed it down to a bunch of invoice related stuff.
01:24:02.665 --> 01:24:06.729 OK. So yeah, so we can see we have storefront dot store
01:24:06.729 --> 01:24:09.705 dashboard dot sales, invoices dot stuff.
01:24:10.385 --> 01:24:12.835 So in this case I would assume.
01:24:14.445 --> 01:24:17.506 Storefront dot store dashboard dot sales invoices dot view
01:24:17.506 --> 01:24:20.515 should work. I don't know if that's the right one though.
01:24:18.055 --> 01:24:22.129 That's actually has to do with the mice that that permission
01:24:22.129 --> 01:24:26.137 specifically and the like the brand one. You see the little
01:24:25.615 --> 01:24:25.995 Umm.
01:24:26.137 --> 01:24:29.945 bit blower row 1110. Those are for the old versions of X
01:24:29.945 --> 01:24:31.415 portals before we had.
01:24:30.875 --> 01:24:31.665 Ah.
01:24:31.985 --> 01:24:32.705 Umm.
01:24:33.135 --> 01:24:37.146 There should be another one that is for storefront in there
01:24:33.825 --> 01:24:35.455 Ohh I see dashboard.
01:24:37.146 --> 01:24:37.815 somewhere.
01:24:39.505 --> 01:24:41.915 See sales.
01:24:41.995 --> 01:24:42.875 Uh.
01:24:45.365 --> 01:24:48.825 User dashboard OK, yeah, that's the right one.
01:24:47.965 --> 01:24:50.635 Very good user dashboard one. That's the one you want.
01:24:51.025 --> 01:24:54.469 Yeah. And I and again, it's good that we're showing this cause
01:24:54.469 --> 01:24:57.368 it's very easy to get confused by with the amount of
01:24:57.368 --> 01:25:00.594 permissions in here. But yeah, so anything, yeah, anything
01:25:00.594 --> 01:25:04.039 that's gonna say storefront dot user dashboard that's gonna be
01:25:04.039 --> 01:25:07.046 the storefront facing permission. So I'm just gonna go
01:25:07.046 --> 01:25:10.491 ahead and copy it. I'll paste it in here. And again, I'm using
01:25:10.491 --> 01:25:13.389 requires any because if I just did required requires
01:25:13.389 --> 01:25:16.670 permission, it would want both of these and that means that
01:25:16.670 --> 01:25:20.115 anyone who isn't an admin isn't going to be able to view this.
01:25:21.035 --> 01:25:24.753 So we want to make sure so that someone who's admin or blah blah
01:25:24.753 --> 01:25:28.013 blah can see it. And in this case realistically we could
01:25:27.025 --> 01:25:27.235 And.
01:25:28.013 --> 01:25:29.615 probably just get away with.
01:25:28.655 --> 01:25:32.267 Will you double check that that invoicing dot sales invoices
01:25:32.267 --> 01:25:33.985 wasn't supposed to be plural?
01:25:35.865 --> 01:25:36.355 Uh.
01:25:35.935 --> 01:25:38.745 But since you deleted it now no longer matters. Never mind.
01:25:39.635 --> 01:25:40.065 OK.
01:25:43.255 --> 01:25:44.925 But in the yeah in this case.
01:25:43.775 --> 01:25:47.132 And then I usually put the required permission on the same
01:25:47.132 --> 01:25:48.555 line as the authenticate.
01:25:49.535 --> 01:25:52.954 And because it, uh, they're directly tied, you can't do a
01:25:49.685 --> 01:25:50.105 Yeah.
01:25:52.954 --> 01:25:56.019 requirement of our permission for someone who's not
01:25:56.019 --> 01:25:56.845 authenticated.
01:26:00.665 --> 01:26:03.315 Well, you can. It just wouldn't do anything. I would just would
01:26:03.315 --> 01:26:05.055 never work because they're not logged in.
01:26:05.925 --> 01:26:07.795 And somebody's not logged in. Can't have.
01:26:09.195 --> 01:26:11.605 I guess these permissions as far as I'm aware at least.
01:26:12.355 --> 01:26:14.535 Yeah, you can't do anonymous permissions.
01:26:16.835 --> 01:26:19.748 And then do you do you? And this is the question, do you usually
01:26:19.748 --> 01:26:21.765 put the user in storefront after public API?
01:26:22.495 --> 01:26:22.965 Yes.
01:26:23.505 --> 01:26:23.845 OK.
01:26:24.655 --> 01:26:26.465 That's what I would do. So I'm just curious.
01:26:25.245 --> 01:26:28.215 Yeah, although using Addendums to public API here.
01:26:29.405 --> 01:26:33.959 Yeah. So and yeah, so basically what he's saying here is
01:26:33.959 --> 01:26:37.555 anything that has to do with like access or.
01:26:38.835 --> 01:26:42.186 You know permissions or whatever you wanna have that on the same
01:26:42.186 --> 01:26:45.485 line, so authenticate regarded permission and then for like you
01:26:45.485 --> 01:26:48.682 know the the API or the portal you want that on the same line
01:26:48.682 --> 01:26:51.827 and then we do like the whole route thing on its own line as
01:26:51.827 --> 01:26:52.085 well.
01:26:53.045 --> 01:26:54.995 Umm, so I think we.
01:26:54.305 --> 01:26:57.521 I just throwing out. We are at time, so if you need to go, you
01:26:57.405 --> 01:26:57.885 OK. Yeah.
01:26:57.521 --> 01:27:00.838 don't have to stay here. I think we'll keep going and finish out
01:27:00.838 --> 01:27:02.115 the rest of this for the.
01:27:01.645 --> 01:27:02.075 Yeah.
01:27:05.225 --> 01:27:07.135 For those who are going to draw happy Friday.
01:27:08.475 --> 01:27:09.865 We'll keep a drilling away here.
01:27:08.785 --> 01:27:09.685 Yeah.
01:27:12.115 --> 01:27:15.997 Alright, so we did update the name of her class. We do need to
01:27:15.997 --> 01:27:19.695 update this return type. So in this case it's just gonna be
01:27:19.695 --> 01:27:20.065 sales.
01:27:21.045 --> 01:27:25.318 Invoice search model and this this first one. This is what the
01:27:25.318 --> 01:27:29.660 endpoints taking in. So in this case the endpoints saying hey I
01:27:29.660 --> 01:27:33.595 want you to send me a sales invoice search model and then
01:27:33.595 --> 01:27:37.801 this I return is gonna be within the type here is going to be
01:27:37.801 --> 01:27:42.142 whatever it's returning. So in this case it would be like sales
01:27:42.142 --> 01:27:43.635 invoice paged results.
01:27:45.725 --> 01:27:49.619 And this should be minus the documentation. Uh, pretty good
01:27:49.619 --> 01:27:53.708 for the endpoint definition. Of course we do the three things.
01:27:53.708 --> 01:27:55.785 It doesn't cover the. See alsos.
01:27:56.475 --> 01:27:58.965 But we can do that as well.
01:27:57.785 --> 01:27:59.725 I get those from my automating tension.
01:28:00.305 --> 01:28:02.565 Yeah, I figured that would be something.
01:28:03.275 --> 01:28:05.305 Something that was a part of a cool extension.
01:28:06.995 --> 01:28:14.225 So get sales invoices or current accounts and then we can always
01:28:14.225 --> 01:28:16.005 just copy these.
01:28:16.905 --> 01:28:19.385 This is referring to the types here.
01:28:22.165 --> 01:28:23.895 So sales invoice.
01:28:25.425 --> 01:28:28.665 Search model and then sales invoice model.
01:28:30.495 --> 01:28:31.655 Go ahead and save.
01:28:30.535 --> 01:28:33.768 Well, that would be so vigorous paged results, not sales invoice
01:28:33.768 --> 01:28:34.365 model there.
01:28:35.315 --> 01:28:36.905 Yeah. So would this be?
01:28:35.965 --> 01:28:38.285 Well, that is actually wrong on the on both of them.
01:28:40.065 --> 01:28:43.617 Now when you have these like nested things, would it be I
01:28:43.617 --> 01:28:45.945 return the in the squiggles of paged?
01:28:47.085 --> 01:28:48.865 Results of.
01:28:49.315 --> 01:28:51.994 No, no, you just put the sales invoice page results. Just copy
01:28:51.994 --> 01:28:53.355 it straight out of what's there.
01:28:54.235 --> 01:28:54.805 OK.
01:28:55.365 --> 01:28:56.685 Yeah, just copy that onto the.
01:28:55.595 --> 01:28:59.661 Ohh sorry, I see what you were saying. I was confusing myself,
01:28:58.075 --> 01:28:58.385 Yeah.
01:28:59.661 --> 01:28:59.855 OK.
01:29:01.265 --> 01:29:02.395 Yeah. So this is actually.
01:29:02.445 --> 01:29:03.485 It's got the wrong value.
01:29:04.345 --> 01:29:06.755 So this is actually this should be payment.
01:29:04.545 --> 01:29:06.375 It's supposed to say payment page results.
01:29:07.235 --> 01:29:07.845 Sales.
01:29:08.345 --> 01:29:08.845 There you go.
01:29:09.835 --> 01:29:11.565 There we go. Core bug.
01:29:14.175 --> 01:29:16.395 OK, so now I think it's actually good.
01:29:18.485 --> 01:29:21.741 Yeah. And it's and and just and I kind of just proved it. It's
01:29:21.741 --> 01:29:24.947 good to not blindly copy paste cause it's really easy to miss
01:29:24.947 --> 01:29:27.686 some small little things like that even if it's just
01:29:25.525 --> 01:29:26.025 Umm.
01:29:27.686 --> 01:29:30.840 documentation where you know someone might come back to this
01:29:30.840 --> 01:29:34.200 later and be confused because if the documentation doesn't match
01:29:34.200 --> 01:29:37.457 what's actually happening, it can either lead someone down the
01:29:37.457 --> 01:29:39.525 wrong path or confuse them or whatever.
01:29:38.125 --> 01:29:41.624 Or someone is referencing your DLL and the XML. The summary XML
01:29:41.624 --> 01:29:44.904 doc file that came with it had wrong info and told them the
01:29:44.904 --> 01:29:48.130 wrong class and then they're like, what the hell happened?
01:29:48.130 --> 01:29:51.575 And this is not what this thing says. It's supposed to return.
01:29:52.765 --> 01:29:53.145 Yeah.
01:29:54.095 --> 01:29:56.085 Which is obviously not good because.
01:29:57.445 --> 01:29:58.795 That would be very confusing.
01:29:59.595 --> 01:30:03.511 So now I'm down in the sales invoice payments service class.
01:30:03.511 --> 01:30:07.685 This is where we're actually add the method that does the thing.
01:30:09.675 --> 01:30:13.039 Disinherits from eventually from clarity and Commerce service
01:30:13.039 --> 01:30:16.512 base, but usually there is one or two of these until it gets to
01:30:16.512 --> 01:30:18.195 clarity ecommerce service base.
01:30:20.005 --> 01:30:26.073 This is basically all the the endpoint rest crud handling
01:30:26.073 --> 01:30:27.015 stuff so.
01:30:27.795 --> 01:30:28.065 Yeah.
01:30:28.805 --> 01:30:32.925 We won't dive too late. Too deep into that cause it's we're all
01:30:32.925 --> 01:30:33.955 really over but.
01:30:35.105 --> 01:30:36.345 Sorry not there.
01:30:35.555 --> 01:30:38.494 It overrides it it. It lets it be an abstract class that's
01:30:38.494 --> 01:30:41.583 partial so that you can come in here, and the extended filing
01:30:41.583 --> 01:30:43.875 overwrite an endpoint handler if you need to.
01:30:45.535 --> 01:30:46.725 That's the long and short of it.
01:30:50.265 --> 01:30:53.895 So go ahead and create a public async task of.
01:30:55.255 --> 01:30:58.805 And then in here we return objects and the reason why is
01:30:56.165 --> 01:30:56.335 Yeah.
01:30:58.805 --> 01:31:02.667 because if something goes wrong, you're not necessarily gonna
01:31:02.667 --> 01:31:04.225 always get the type back.
01:31:04.965 --> 01:31:08.030 Umm, that's expected as far as I'm aware. I think that's why I
01:31:08.030 --> 01:31:10.415 don't know if you have more info on that, James.
01:31:09.785 --> 01:31:13.085 But the number one reason is because the cached endpoints
01:31:13.085 --> 01:31:16.271 that we use, the 304 stuff, return a different physical
01:31:16.271 --> 01:31:19.686 result called a compressed result that comes out of service
01:31:19.686 --> 01:31:23.157 stack, which is like completely different casts. I'm sorry I
01:31:23.157 --> 01:31:26.685 completely different class than what you would normally send.
01:31:27.895 --> 01:31:33.750 Back and it's it's basically a a an HTTP result that's pre built
01:31:33.750 --> 01:31:38.885 with with deflated compression on the bits already done.
01:31:39.645 --> 01:31:41.909 Umm to go through it, so you need that object so that it
01:31:41.909 --> 01:31:44.254 doesn't freak out with the fact that it's gonna completely
01:31:44.254 --> 01:31:45.605 different result out of that 304.
01:31:46.275 --> 01:31:47.195 Uh response?
01:31:48.235 --> 01:31:50.015 That's good to know because I did not know that.
01:31:51.955 --> 01:31:55.536 Obviously for the request, the type of the request is going to
01:31:55.536 --> 01:31:57.185 be the thing you're you know.
01:31:58.845 --> 01:32:02.645 Basically the the class endpoint definitions, uh, endpoint
01:32:02.645 --> 01:32:06.575 definitions class. We're gonna call it request to keep with.
01:32:08.595 --> 01:32:11.845 Standards. And then all we really have to do in here is.
01:32:12.665 --> 01:32:15.905 Return and just like just like above return away.
01:32:17.095 --> 01:32:18.725 Workflows dot.
01:32:19.765 --> 01:32:21.515 Sales invoices dot.
01:32:23.005 --> 01:32:26.716 Yet sales invoice for current account and as you can see just
01:32:26.716 --> 01:32:30.188 based off of the documentation that we did, which is good
01:32:30.188 --> 01:32:34.018 because This is why it's useful. I can I can see it right away.
01:32:34.018 --> 01:32:35.635 Oh yeah, this is the thing.
01:32:37.685 --> 01:32:41.625 That Greg made, you can even see his name there and IDE one
01:32:41.625 --> 01:32:45.631 implementation. Ohh yeah. OK cool. Already is active already
01:32:45.631 --> 01:32:49.506 has requires blah blah. Cool, cool, cool. I'm gonna finish
01:32:49.506 --> 01:32:53.578 this, but there is one thing I haven't done yet which is very
01:32:53.578 --> 01:32:54.235 important.
01:33:03.355 --> 01:33:07.057 And real quick, you'll notice my ID did it for me, but when you
01:33:07.057 --> 01:33:10.412 have these method arguments, these should be indented one
01:33:10.412 --> 01:33:13.305 more than you know your actual extension methods.
01:33:14.155 --> 01:33:18.601 I believe James uh, if I'm not mistaken, the rule for these is
01:33:18.601 --> 01:33:22.906 as far as convention, if you have four more parameters named
01:33:22.906 --> 01:33:23.965 the parameters.
01:33:25.815 --> 01:33:26.555 Yes, please.
01:33:31.285 --> 01:33:34.386 So in here this is where I'm actually to set the request on
01:33:34.386 --> 01:33:34.955 account ID.
01:33:36.935 --> 01:33:40.375 This is where I'm gonna do a, you know, current.
01:33:41.575 --> 01:33:45.869 You or I guess current account ID or throw 401. It's important
01:33:45.869 --> 01:33:49.891 to do the OR or throw 401 because if you just basically if
01:33:49.891 --> 01:33:54.117 you write something to where it doesn't throw and just passes
01:33:54.117 --> 01:33:57.934 through, that still allows someone to put whatever they
01:33:57.934 --> 01:34:02.433 want or put nothing or whatever, right? So because I'm using this
01:34:02.433 --> 01:34:04.955 current account ID or throw for one.
01:34:06.105 --> 01:34:08.725 If it wasn't there for whatever reason.
01:34:10.505 --> 01:34:13.013 It would actually throw an error, not even return anything,
01:34:13.013 --> 01:34:14.895 which is what we actually want in this case.
01:34:15.955 --> 01:34:19.298 So I'm explicitly setting the account ID you know if for
01:34:19.298 --> 01:34:20.765 whatever reason you know.
01:34:21.735 --> 01:34:25.665 Greg, forgot to, you know, check active. I could also set that up
01:34:25.665 --> 01:34:29.416 there, but generally speaking you want to kind of like keep it
01:34:29.416 --> 01:34:32.989 as low as possible as close to the query. But in this case,
01:34:32.989 --> 01:34:36.383 because the workflow doesn't have access to whatever the
01:34:36.383 --> 01:34:40.075 current account is, we're doing it in the service layer here.
01:34:39.405 --> 01:34:39.785 Yeah.
01:34:40.735 --> 01:34:43.677 Yeah, service layer is the only thing that is session aware. The
01:34:43.677 --> 01:34:45.895 workflows layer has to be told whose things are.
01:34:47.875 --> 01:34:52.408 Uh, bypassing that data through. Also, this is OK in some
01:34:52.408 --> 01:34:57.411 circumstances until you get to a customer that has to have CSRS
01:34:57.411 --> 01:34:58.975 that emulate people.
01:35:00.275 --> 01:35:03.344 That requires a different function call than current
01:35:03.344 --> 01:35:04.735 account ID or throw 401.
01:35:06.485 --> 01:35:09.435 What you'll do instead is await local.
01:35:11.825 --> 01:35:16.125 It will start typing that local admin account ID.
01:35:16.835 --> 01:35:19.395 Or throw 401 and then you'll pass in.
01:35:20.215 --> 01:35:22.275 Uh. Request the.
01:35:22.775 --> 01:35:27.178 Umm current account ID and it do a right click on that that
01:35:27.178 --> 01:35:31.655 function call that local admin and find another usage of it.
01:35:32.715 --> 01:35:35.193 So we can see that the the the correct format to make sure
01:35:35.193 --> 01:35:37.671 we're doing it right. OK. So like that one right there, it
01:35:37.671 --> 01:35:39.435 says 897 on the right bottom right there.
01:35:40.145 --> 01:35:40.425 What?
01:35:40.245 --> 01:35:44.276 That's example of how you would do that is it can take every
01:35:44.276 --> 01:35:48.505 quest over the wire if it's, if it's a CSR emulator, which will
01:35:48.505 --> 01:35:52.801 fall back to current account ID or throw 401 and then inside the
01:35:52.801 --> 01:35:56.172 local admin ID or throw 401 async call it does the
01:35:56.172 --> 01:35:56.965 enforcement.
01:35:57.695 --> 01:35:58.305 Uh on it?
01:36:02.185 --> 01:36:02.765 So.
01:36:03.485 --> 01:36:05.615 Basically just.
01:36:08.815 --> 01:36:09.625 So we can still do.
01:36:10.905 --> 01:36:12.645 Yeah, of course, that account ID equal to that.
01:36:13.635 --> 01:36:17.437 Yeah. And this is like, for example, in pay hub lands. And I
01:36:17.437 --> 01:36:21.363 know a lot of you guys have to deal with it like CSR emulation
01:36:21.363 --> 01:36:24.605 is just by default nothing that we need to support.
01:36:25.285 --> 01:36:28.888 So in that case this is. This would always be what we'd be
01:36:28.888 --> 01:36:29.255 doing.
01:36:31.185 --> 01:36:35.496 Generally speaking and stuff, it's not always a requirement,
01:36:35.496 --> 01:36:39.455 but it's it's good to implement if it's appropriate so.
01:36:38.775 --> 01:36:42.203 Yeah, and and part of what it's doing inside that function is
01:36:42.203 --> 01:36:45.631 it's actually verifying that the account that you are has the
01:36:45.631 --> 01:36:48.893 rights to do things for the account that you're targeting.
01:36:48.893 --> 01:36:52.266 So if the cookie is present and the cookie says that you are
01:36:52.266 --> 01:36:55.528 pointing at this other user, it goes and says, do you have
01:36:55.528 --> 01:36:56.745 rights to this person?
01:36:58.095 --> 01:37:01.580 On it and do you have like the local administrator role and the
01:37:01.580 --> 01:37:04.957 affiliated administrator role on it? Because those things are
01:37:04.957 --> 01:37:08.498 part of the the the requirements that you that you are a CSR and
01:37:08.498 --> 01:37:11.820 not just some random Joe Schmoe trying to screw stuff and be
01:37:11.820 --> 01:37:12.365 malicious.
01:37:13.645 --> 01:37:17.008 Yeah. So for example on the front end and this is still an
01:37:17.008 --> 01:37:20.144 ejs, but there's a user dashboard side menu controller
01:37:20.144 --> 01:37:23.679 that actually sets the cookie right of like, hey, this is the
01:37:23.679 --> 01:37:27.100 account ID I want to emulate. And then on the back end when
01:37:27.100 --> 01:37:30.749 this local admin account ID are throw 401, async gets called it
01:37:30.749 --> 01:37:34.284 again as James says checks your roles, make sure you have the
01:37:34.284 --> 01:37:37.762 appropriate roles, checks the cookie and make sure, hey, can
01:37:37.762 --> 01:37:40.955 you actually does this account one does leave it exist.
01:37:41.505 --> 01:37:45.215 Yeah. And it makes sure you you have, you know, everything you
01:37:45.215 --> 01:37:48.455 need in order to have that level of privileged access.
01:37:50.315 --> 01:37:53.308 Umm, I don't know if we wanna cover anything else other than
01:37:53.308 --> 01:37:54.535 possibly just testing it.
01:37:57.725 --> 01:37:59.065 He thoughts James or Brendan?
01:37:58.505 --> 01:38:00.855 Yeah, I I'd say you're you're good there.
01:38:01.745 --> 01:38:03.705 Yeah, I think we can cover.
01:38:01.975 --> 01:38:02.425 Cool.
01:38:03.825 --> 01:38:07.629 Umm we can cover testing and troubleshooting. I think we have
01:38:07.629 --> 01:38:11.434 a whole training topic set aside for a while from now. That's
01:38:09.735 --> 01:38:09.975 Yeah.
01:38:10.765 --> 01:38:11.045 Umm.
01:38:11.434 --> 01:38:15.177 gonna go over postman slash insomnia and general testing and
01:38:15.177 --> 01:38:16.405 QA type of stuff so.
01:38:17.615 --> 01:38:18.105 Cool.
01:38:17.695 --> 01:38:19.505 I think this is probably covers it.
01:38:20.055 --> 01:38:23.520 And Speaking of which, the one thing you should always do is
01:38:23.520 --> 01:38:26.700 build or whatever. I did a rebuild which was extra. You
01:38:26.700 --> 01:38:30.393 could just done a build, but you wanna make sure whenever you do
01:38:30.393 --> 01:38:32.665 builds cause if it doesn't then that's.
01:38:34.535 --> 01:38:37.730 It doesn't matter how. What? What you're, what you feel like.
01:38:37.455 --> 01:38:39.525 No matter how much testing you do.
01:38:37.730 --> 01:38:40.873 You know, I could be in the best mood of my life. It doesn't
01:38:40.873 --> 01:38:44.171 build. It's not gonna work. So, yeah. There you go. But yeah, I
01:38:44.171 --> 01:38:45.975 think that covers everything that.
01:38:46.655 --> 01:38:49.688 It's thanks for everyone who held on longer than they needed
01:38:49.688 --> 01:38:52.075 to, including you, Greg. I think you had to go.
01:38:53.285 --> 01:38:55.125 But yeah, happy Friday everyone.
01:38:55.735 --> 01:38:56.765 I just got to meet with Charlie.
01:38:57.975 --> 01:38:58.505 So.
01:38:57.985 --> 01:38:59.075 Ohh there you go.
01:39:00.115 --> 01:39:01.615 Yeah. Thanks guys. This was really good.
01:39:02.205 --> 01:39:05.656 Any, uh, any questions or like callouts real quick before we
01:39:02.545 --> 01:39:02.895 Cool.
01:39:05.656 --> 01:39:08.995 wrap up that might be good for somebody who's like new to?
01:39:09.965 --> 01:39:12.871 You know, know about that? I might have, like, danced over
01:39:12.871 --> 01:39:13.265 quickly.
01:39:16.505 --> 01:39:17.475 Not for me, no.
01:39:16.955 --> 01:39:17.345 I'll think.
01:39:18.425 --> 01:39:19.495 Or just a good job.
01:39:21.325 --> 01:39:21.705 Thank you.
01:39:22.765 --> 01:39:24.625 Cool, awesome guys. Well.
01:39:23.955 --> 01:39:25.355 Hopefully it helps somebody out.
01:39:26.005 --> 01:39:29.197 I'm sure it will. I mean, honestly, like what we just did
01:39:27.205 --> 01:39:27.515 Yeah.
01:39:29.197 --> 01:39:32.444 here today? You know, it might seem super straightforward.
01:39:32.444 --> 01:39:35.747 Easy, but especially if they haven't seen this before, it's
01:39:35.747 --> 01:39:39.269 gonna be a little bit daunting. So awesome. Thanks, guys. Happy
01:39:37.335 --> 01:39:37.715 Yeah.
01:39:39.269 --> 01:39:39.655 Friday.
01:39:39.815 --> 01:39:40.455 Thanks a lot.
01:39:41.305 --> 01:39:42.135 Talk to you all later.
01:39:41.965 --> 01:39:43.215 Have a good weekend everybody.
01:39:43.545 --> 01:39:45.175 And have a good one guys. See ya.
01:39:45.065 --> 01:39:45.635 So you guys.
01:39:46.785 --> 01:39:47.965 Yeah. So you guys have a good day.
01:39:49.195 --> 01:39:49.415 Boy.