Added file areas and TIC processing

This commit is contained in:
Deon George
2022-11-01 22:24:36 +11:00
parent 702c5fb4f2
commit 029a8a9d73
20 changed files with 908 additions and 35 deletions

View File

@@ -159,7 +159,29 @@ class Address extends Model
public function echomails()
{
return $this->belongsToMany(Echomail::class,'echomail_seenby')
->withPivot(['sent_at','packet']);
->withPivot(['sent_at','export_at','packet']);
}
/**
* Files that this address has seen
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function files()
{
return $this->belongsToMany(File::class,'file_seenby')
->withPivot(['sent_at','export_at']);
}
/**
* Echoareas this address is subscribed to
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function fileareas()
{
return $this->belongsToMany(Filearea::class)
->withPivot(['subscribed']);
}
/**
@@ -409,7 +431,7 @@ class Address extends Model
}
/**
* Netmail waiting to be sent to this system
* Echomail waiting to be sent to this system
*
* @return Collection
*/
@@ -421,6 +443,19 @@ class Address extends Model
->get();
}
/**
* Files waiting to be sent to this system
*
* @return Collection
*/
public function filesWaiting(): Collection
{
return $this->files()
->whereNull('file_seenby.sent_at')
->whereNotNull('file_seenby.export_at')
->get();
}
/**
* Get echomail for this node
*