﻿1
00:00:01,230 --> 00:00:05,160
‫Let's now upload some sample data to Supabase,

2
00:00:05,160 --> 00:00:09,333
‫so that we have some more real data to actually work with.

3
00:00:10,830 --> 00:00:15,830
‫So here in the data folder, we have three JavaScript files,

4
00:00:16,440 --> 00:00:21,060
‫which contains data about booking, cabins and guests.

5
00:00:21,060 --> 00:00:24,420
‫And then we have this uploader component.

6
00:00:24,420 --> 00:00:26,853
‫So this here does a bunch of stuff.

7
00:00:28,440 --> 00:00:31,770
‫So it has all these different functions to delete

8
00:00:31,770 --> 00:00:35,670
‫and create all of these new resources.

9
00:00:35,670 --> 00:00:38,730
‫But what this does is not really important.

10
00:00:38,730 --> 00:00:42,810
‫What matters is that we can now import this component,

11
00:00:42,810 --> 00:00:45,090
‫and then that will give us two buttons.

12
00:00:45,090 --> 00:00:48,000
‫One will be to upload all sample data,

13
00:00:48,000 --> 00:00:50,160
‫which we'll first delete all of them,

14
00:00:50,160 --> 00:00:52,110
‫and then create new ones.

15
00:00:52,110 --> 00:00:55,533
‫And then we will get a button to only upload the bookings.

16
00:00:57,570 --> 00:01:00,153
‫All right, and so again, that's this,

17
00:01:03,030 --> 00:01:06,000
‫yeah, this uploader component right here.

18
00:01:06,000 --> 00:01:10,230
‫And so we will now include this in our sidebar,

19
00:01:10,230 --> 00:01:13,140
‫so like down here so that during development,

20
00:01:13,140 --> 00:01:14,490
‫we can keep it there,

21
00:01:14,490 --> 00:01:17,973
‫and re-upload our sample data whenever we need it.

22
00:01:20,250 --> 00:01:25,250
‫So here in our sidebar bar,

23
00:01:27,150 --> 00:01:30,483
‫let's include it down here after the navigation.

24
00:01:32,280 --> 00:01:37,280
‫So uploader, and then, there we go.

25
00:01:38,490 --> 00:01:42,303
‫And so let's actually now click on Upload All,

26
00:01:44,490 --> 00:01:46,860
‫and there we get some errors here.

27
00:01:46,860 --> 00:01:48,210
‫And the reason for that is

28
00:01:48,210 --> 00:01:52,050
‫that we didn't set the role-level security policies

29
00:01:52,050 --> 00:01:53,823
‫on the bookings table yet.

30
00:01:55,290 --> 00:02:00,290
‫So let's go do that here in Authentication,

31
00:02:01,230 --> 00:02:03,240
‫and then Policies.

32
00:02:03,240 --> 00:02:08,070
‫And indeed we have this on the cabins and even the settings,

33
00:02:08,070 --> 00:02:11,520
‫but not on the guests and the bookings.

34
00:02:11,520 --> 00:02:14,583
‫And so let's now, again, do all of that.

35
00:02:16,710 --> 00:02:19,620
‫So you'll always start with this template,

36
00:02:19,620 --> 00:02:23,733
‫and Select we already have, so next we use Insert.

37
00:02:25,740 --> 00:02:29,793
‫So then we need to write True and save.

38
00:02:31,740 --> 00:02:36,540
‫And well, it tells me this already exists,

39
00:02:36,540 --> 00:02:38,223
‫but it actually doesn't.

40
00:02:39,150 --> 00:02:44,150
‫So maybe, well, let's try this again.

41
00:02:48,270 --> 00:02:51,513
‫Ah, yeah, I didn't change the name of the policy,

42
00:02:52,530 --> 00:02:53,883
‫so that was the problem.

43
00:02:56,310 --> 00:02:58,053
‫At least, I hope so.

44
00:03:01,140 --> 00:03:02,073
‫And there we go.

45
00:03:04,830 --> 00:03:06,693
‫Now lets add the other ones.

46
00:03:11,340 --> 00:03:15,300
‫And again, we will later then do this only

47
00:03:15,300 --> 00:03:17,313
‫for authenticated users.

48
00:03:20,933 --> 00:03:24,873
‫Okay, and finally to delete as well.

49
00:03:33,450 --> 00:03:36,740
‫And now the same thing on the guests, so Insert.

50
00:03:43,800 --> 00:03:46,383
‫As always, just write True in there.

51
00:03:49,770 --> 00:03:51,933
‫And now only two more to go.

52
00:04:02,760 --> 00:04:07,760
‫And yeah, now we're only missing the delete one.

53
00:04:15,570 --> 00:04:16,413
‫Now, okay.

54
00:04:17,460 --> 00:04:20,880
‫Now let's come back here, let's reload,

55
00:04:20,880 --> 00:04:23,550
‫and let's upload all again.

56
00:04:23,550 --> 00:04:25,800
‫And so that will then delete everything.

57
00:04:25,800 --> 00:04:28,710
‫Then here we get some locks for some reason.

58
00:04:28,710 --> 00:04:33,480
‫And now when I reload this, then beautiful.

59
00:04:33,480 --> 00:04:35,850
‫So we have all of these different bookings here,

60
00:04:35,850 --> 00:04:37,770
‫all in this one table.

61
00:04:37,770 --> 00:04:41,160
‫So basically each cabin has three bookings.

62
00:04:41,160 --> 00:04:42,510
‫And these dates here,

63
00:04:42,510 --> 00:04:46,353
‫they also should be updated to your own dates.

64
00:04:47,250 --> 00:04:50,730
‫So basically these dates here are generated dynamically,

65
00:04:50,730 --> 00:04:53,940
‫and here we can also see the three statuses

66
00:04:53,940 --> 00:04:56,460
‫that a booking can be in.

67
00:04:56,460 --> 00:04:59,730
‫So you see that some of these are checked out,

68
00:04:59,730 --> 00:05:03,780
‫which makes sense because the guest arrived five days ago,

69
00:05:03,780 --> 00:05:05,940
‫but only stayed for three nights,

70
00:05:05,940 --> 00:05:08,973
‫and so by now, they are already gone.

71
00:05:10,020 --> 00:05:12,570
‫Then this one here is checked in

72
00:05:12,570 --> 00:05:15,330
‫because they arrived six days ago,

73
00:05:15,330 --> 00:05:17,220
‫and have a five night stay,

74
00:05:17,220 --> 00:05:19,530
‫which means that they are checking out today,

75
00:05:19,530 --> 00:05:22,563
‫which is actually May 15th right now.

76
00:05:24,060 --> 00:05:27,690
‫Okay, so you can analyze this data if you want.

77
00:05:27,690 --> 00:05:31,593
‫Then here we also have all the eight cabins.

78
00:05:32,790 --> 00:05:36,900
‫Now the images, you need to actually upload them separately,

79
00:05:36,900 --> 00:05:39,690
‫so that doesn't happen automatically,

80
00:05:39,690 --> 00:05:44,073
‫but I believe that we apparently already did that.

81
00:05:45,270 --> 00:05:48,633
‫So otherwise we would get some errors there.

82
00:05:50,100 --> 00:05:53,010
‫And so yeah, indeed, they are here.

83
00:05:53,010 --> 00:05:55,380
‫But if you didn't upload them manually yet,

84
00:05:55,380 --> 00:05:56,820
‫then you need to do that.

85
00:05:56,820 --> 00:05:59,973
‫So our uploader component doesn't do that.

86
00:06:00,990 --> 00:06:03,510
‫But anyway, with this, we are now ready

87
00:06:03,510 --> 00:06:08,490
‫to also implement the Filter and Sort By right here

88
00:06:08,490 --> 00:06:10,290
‫in this bookings table.

89
00:06:10,290 --> 00:06:12,573
‫And so let's now move on and do that.

