feat(AppVersion): Add version tracking system for frontend cache invalidation
Build and Deploy to Production / build-and-deploy (push) Successful in 1m37s

- Add AppVersion entity with CurrentVersion, MinRequiredVersion, RequiresFullCacheClear
- Add GetAppVersion query to check app version and compare with client version
- Add GetAllAppVersions query for admin panel
- Add UpdateAppVersion command to update/create app versions
- Add appversion.proto for gRPC communication
- Add AppVersionService for gRPC endpoints
- Add database migration for AppVersions table
This commit is contained in:
masoodafar-web
2025-12-25 18:06:12 +03:30
parent 2e54aa7aca
commit 17c2958b9c
15 changed files with 4244 additions and 0 deletions
@@ -0,0 +1,95 @@
syntax = "proto3";
package appversion;
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.AppVersion";
// Service for tracking app versions and cache invalidation
service AppVersionContract
{
// Get current version for an app - called by frontends to check if cache clear is needed
rpc GetAppVersion(GetAppVersionRequest) returns (GetAppVersionResponse){
option (google.api.http) = {
get: "/AppVersion/Get"
};
};
// Update/Create app version - called by admin when deploying new version
rpc UpdateAppVersion(UpdateAppVersionRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/AppVersion/Update"
body: "*"
};
};
// Get all app versions
rpc GetAllAppVersions(GetAllAppVersionsRequest) returns (GetAllAppVersionsResponse){
option (google.api.http) = {
get: "/AppVersion/GetAll"
};
};
}
// Request to get current version for specific app
message GetAppVersionRequest
{
string app_name = 1; // e.g., "FrontOffice", "BackOffice", "Mobile"
google.protobuf.StringValue current_client_version = 2; // Current version on client for comparison
}
// Response with version info
message GetAppVersionResponse
{
bool found = 1; // Whether the app was found
string app_name = 2;
string current_version = 3;
string min_required_version = 4;
bool requires_full_cache_clear = 5;
bool requires_update = 6; // True if client version < min_required_version
google.protobuf.StringValue update_message = 7;
google.protobuf.StringValue release_notes = 8;
google.protobuf.Timestamp last_updated = 9;
}
// Request to update/create app version
message UpdateAppVersionRequest
{
string app_name = 1;
string current_version = 2;
google.protobuf.StringValue min_required_version = 3;
bool requires_full_cache_clear = 4;
google.protobuf.StringValue update_message = 5;
google.protobuf.StringValue release_notes = 6;
google.protobuf.StringValue update_reason = 7; // For admin logs
}
// Request to get all app versions
message GetAllAppVersionsRequest
{
bool include_inactive = 1;
}
// Response with all app versions
message GetAllAppVersionsResponse
{
repeated AppVersionItem items = 1;
}
message AppVersionItem
{
int64 id = 1;
string app_name = 2;
string current_version = 3;
string min_required_version = 4;
bool requires_full_cache_clear = 5;
string update_message = 6;
string release_notes = 7;
bool is_active = 8;
google.protobuf.Timestamp created = 9;
google.protobuf.Timestamp last_modified = 10;
}