WEBVTT

00:00.120 --> 00:06.000
So let's create the schema for conversation and message.

00:06.680 --> 00:08.600
So let's do that.

00:08.880 --> 00:15.200
Open the project and create the new resource.

00:17.560 --> 00:20.400
The first one we will convert session.

00:30.640 --> 00:34.680
We need to create two class at the same time.

00:40.480 --> 00:41.680
Create a message.

00:49.000 --> 00:49.480
Okay.

00:49.520 --> 00:51.080
Let one one by one.

00:51.600 --> 00:58.120
And I completely forgot to remove the file.

00:59.440 --> 01:00.320
Let's remove.

01:05.860 --> 01:12.180
Okay, now let's go to the conversation and change the name.

01:17.660 --> 01:18.100
Okay.

01:18.100 --> 01:25.100
The first one I will prepare the structures for conversation schema.

01:26.140 --> 01:28.100
Let me copy one of those.

01:32.220 --> 01:33.260
I write a command.

01:34.500 --> 01:36.780
I will copy everything from the command.

01:36.780 --> 01:45.940
And let's start over here and change a little conversation.

01:49.700 --> 01:52.100
Here and here.

01:53.300 --> 01:59.900
And generate conversation schema and conversation document.

02:06.570 --> 02:08.010
And let me remove.

02:11.530 --> 02:14.490
Well, what we need is a conversation.

02:15.250 --> 02:18.170
We need the participant.

02:21.530 --> 02:23.930
Let me show you what exactly does not worry.

02:25.290 --> 02:27.890
Participant can be the user.

02:29.970 --> 02:30.570
All right.

02:30.850 --> 02:34.690
And make sure we grab this type right here inside.

02:34.730 --> 02:35.090
Right.

02:37.170 --> 02:40.610
And we will run it to the user okay.

02:41.250 --> 02:43.850
What exactly about the participant field.

02:44.490 --> 02:46.250
Now let me show you what exactly does.

02:47.690 --> 02:52.930
If you remember in here this is the conversation right.

02:53.250 --> 02:59.330
And inside the conversation we have a multiple users.

02:59.810 --> 03:04.130
Maybe I am logged in with account I.

03:05.250 --> 03:10.190
I want to The conversation with the baby.

03:11.270 --> 03:11.750
Okay.

03:12.430 --> 03:20.510
It means right now the participant array will contain the I and B.

03:20.830 --> 03:21.310
Okay.

03:21.590 --> 03:24.150
Me and my friend.

03:24.430 --> 03:24.950
Okay.

03:25.630 --> 03:30.390
And if we only have two user, we can call this in the private chat.

03:31.030 --> 03:31.550
Okay.

03:32.550 --> 03:38.750
And in order to mark it with group chat we can add mutable U user over here.

03:39.310 --> 03:39.750
Okay.

03:40.310 --> 03:42.150
So that's about participant.

03:42.190 --> 03:43.590
I hope you very clear.

03:44.230 --> 03:52.510
And right here we have one more feature which is group with boolean okay.

03:57.950 --> 03:58.590
And.

04:00.950 --> 04:03.350
With this file okay.

04:05.270 --> 04:07.270
This file will be formed by default.

04:07.270 --> 04:08.750
This is the private chat.

04:13.210 --> 04:13.890
And.

04:16.090 --> 04:21.210
Now let's say we have a avatar, right?

04:21.370 --> 04:26.770
The avatar group name and the message right here.

04:26.970 --> 04:27.250
Okay.

04:27.250 --> 04:36.410
We need that information for library group avatar media file.

04:40.010 --> 04:45.090
I know media.

04:47.130 --> 04:53.450
File media type over here from the global.

04:54.890 --> 04:55.210
Okay.

04:55.210 --> 04:56.210
We need avatar.

04:57.730 --> 05:01.610
And we need the group name screen.

05:01.930 --> 05:03.850
And we need the message right here.

05:03.890 --> 05:04.370
Okay.

05:04.970 --> 05:07.170
This we will call the last message.

05:07.210 --> 05:07.490
Okay.

05:07.530 --> 05:13.080
The last message right here will be somehow Show, right?

05:13.520 --> 05:16.240
The last message will be somehow show over here.

05:17.480 --> 05:21.000
But I don't know why this guy is not show in last image.

05:21.200 --> 05:22.960
But don't worry about us, okay?

05:24.080 --> 05:29.800
So in a real messenger application, the last message over here, we may somehow show over here.

05:30.400 --> 05:34.600
Okay, that's what I want to build right here.

05:35.640 --> 05:39.640
Uh, we need to load the last message.

05:40.200 --> 05:42.360
We need to build a message.

05:42.760 --> 05:44.280
Uh, number one.

05:44.320 --> 05:44.760
Right.

05:45.760 --> 05:49.120
We will import that over right here.

05:49.160 --> 05:51.600
Let's go to the prop.

05:58.640 --> 05:59.640
And own up.

05:59.640 --> 06:00.800
That's right.

06:00.800 --> 06:01.840
Here can be.

06:04.120 --> 06:11.560
Undefined because we only have a group avatar and group name if the age group will be true.

06:11.840 --> 06:15.620
Okay, so for that reason, now optional.

06:15.940 --> 06:16.660
Over here.

06:17.500 --> 06:20.140
So let's create the.

06:23.220 --> 06:25.580
Message schema.

06:37.860 --> 06:38.380
Okay.

06:38.900 --> 06:42.940
Now let's copy entire conversation.

06:43.900 --> 06:47.860
Paste that over here and change the name to message.

06:52.780 --> 06:53.220
Here.

06:55.500 --> 07:02.380
And message document and write here message schema.

07:05.820 --> 07:06.300
Okay.

07:08.820 --> 07:15.760
Let me remove follow Inside message.

07:16.480 --> 07:18.000
We want to know the message.

07:18.000 --> 07:20.320
Belong to the conversation.

07:20.600 --> 07:21.760
Write the message here.

07:21.800 --> 07:23.400
Belong to one conversation.

07:24.160 --> 07:28.480
Okay, so for that reason in this guy we need to convert session.

07:30.520 --> 07:32.880
We will convert session.

07:35.720 --> 07:37.280
And remove the array over here.

07:38.400 --> 07:42.760
Now with the conversation document for better.

07:46.920 --> 07:51.480
And right here make sure you change return into the conversation.

07:53.360 --> 07:56.120
Let me remove some unused import.

08:06.960 --> 08:07.440
Okay.

08:08.440 --> 08:11.000
Right here we already have a conversation.

08:11.520 --> 08:16.240
And right here we have a sender okay.

08:16.800 --> 08:18.220
We need the sender.

08:20.100 --> 08:23.620
It will send this message.

08:23.900 --> 08:25.700
Me or my friend.

08:25.740 --> 08:26.060
Okay.

08:26.060 --> 08:27.460
We want to know that, right?

08:27.980 --> 08:32.900
So for that reason, we need to boot the user document over here.

08:34.020 --> 08:36.500
And we need a proper makeup by.

08:40.380 --> 08:41.180
Users.

08:44.060 --> 08:44.420
Okay.

08:44.420 --> 08:51.020
After that we need the prop for test okay.

08:51.060 --> 08:52.420
The test right here.

08:54.100 --> 08:57.260
And we also need the media file.

08:57.300 --> 08:57.780
Right.

09:03.620 --> 09:06.820
We will I sorry.

09:07.260 --> 09:10.180
Media files from the global.

09:10.620 --> 09:11.140
All right.

09:12.100 --> 09:13.580
And boot from over here.

09:15.860 --> 09:17.860
Verify can be optional.

09:18.690 --> 09:19.290
Right.

09:21.330 --> 09:22.050
Okay.

09:23.250 --> 09:26.170
And now this media file.

09:26.210 --> 09:27.010
Let me see.

09:30.690 --> 09:36.050
Uh, we have a is the least messy option over here.

09:37.290 --> 09:39.090
Okay, we will have a message.

09:39.610 --> 09:42.330
The the option for the list, a message.

09:43.290 --> 09:51.050
So for this guy we removed is delete because the message cannot be deleted entirely from database.

09:51.330 --> 09:51.810
Okay.

09:52.090 --> 09:54.490
We only want to delete.

09:54.890 --> 09:55.970
So the list.

09:56.250 --> 09:56.730
Okay.

09:57.610 --> 10:02.730
So here we need to put the property file with the phone.

10:02.850 --> 10:03.330
Okay.

10:03.370 --> 10:06.490
We need to change it but to draw in later.

10:07.730 --> 10:08.130
Okay.

10:08.130 --> 10:09.050
We already have.

10:09.090 --> 10:12.650
And we have one more thing will be a see.

10:14.690 --> 10:15.170
Also.

10:16.090 --> 10:16.650
Okay.

10:16.690 --> 10:18.370
The message right here can be seen.

10:18.890 --> 10:24.270
But I think the best way we can would've seen by right.

10:24.470 --> 10:33.830
And right here we can put the user document because it later inside a group we can seen by another user.

10:34.150 --> 10:34.670
Right.

10:35.150 --> 10:38.790
So let me copy this tile over here.

10:40.350 --> 10:41.750
The tile from user.

10:42.390 --> 10:50.670
Put it over here and wrap it inside a right and user user document okay.

10:50.710 --> 10:58.550
For example inside the group we have a some frame a, B, C and d okay.

11:00.070 --> 11:03.350
With my login with my account and I send a message.

11:03.390 --> 11:03.990
Hi there.

11:05.390 --> 11:05.870
Okay.

11:06.350 --> 11:12.030
But at that time only the be seen.

11:12.070 --> 11:12.950
My message.

11:12.990 --> 11:20.350
It means right here we will create the seen by with the weight over here.

11:20.750 --> 11:21.230
Right.

11:22.510 --> 11:27.210
And we can buy a dog to show it to you.

11:28.890 --> 11:31.210
So that is the general idea about us.

11:31.530 --> 11:32.890
Let me say we have next.

11:34.570 --> 11:34.970
Um.

11:37.970 --> 11:42.290
So I think, uh, that will be enough.

11:42.930 --> 11:47.210
And go back to the conversation and put that over here.

11:51.450 --> 11:51.970
Okay.

11:53.250 --> 11:56.730
And let's import that into the module.

11:58.410 --> 12:02.170
Let me close everything and let's copy.

12:12.290 --> 12:14.570
This imports and.

12:32.920 --> 12:33.880
Oh, sorry.

12:34.120 --> 12:35.680
This is a conversation.

12:36.280 --> 12:36.920
My bad.

12:52.480 --> 12:53.600
Conversations.

12:55.240 --> 12:55.720
Okay.

12:58.640 --> 13:00.680
Go through the message and.

13:02.800 --> 13:03.680
Be back here.

13:11.040 --> 13:11.400
Yeah.

13:14.320 --> 13:14.800
Okay.

13:16.920 --> 13:19.560
So that will be enough.

13:20.160 --> 13:25.040
And I hope you understand why I need to build that.

13:25.400 --> 13:28.200
Okay, so I will see you in the next.
