From 7087e8cbb317700b2912e1e3291d1b075d48ad0f Mon Sep 17 00:00:00 2001 From: Ali Torabi Date: Sat, 24 Aug 2024 15:43:31 +0200 Subject: [PATCH] Update the actions which might provide some bugs, and wrong soft delete/update (#71) --- modules/workspaces/AppMenuEntity.dyno.go | 4 +- .../workspaces/BackupTableMetaEntity.dyno.go | 4 +- modules/workspaces/CapabilityEntity.dyno.go | 4 +- .../EmailConfirmationEntity.dyno.go | 4 +- .../workspaces/EmailProviderEntity.dyno.go | 4 +- modules/workspaces/EmailSenderEntity.dyno.go | 4 +- modules/workspaces/FileEntity.dyno.go | 8 +- .../workspaces/ForgetPasswordEntity.dyno.go | 4 +- modules/workspaces/GsmProviderEntity.dyno.go | 4 +- .../NotificationConfigEntity.dyno.go | 4 +- modules/workspaces/PassportEntity.dyno.go | 4 +- .../workspaces/PassportMethodEntity.dyno.go | 4 +- .../PendingWorkspaceInviteEntity.dyno.go | 4 +- modules/workspaces/PersonEntity.dyno.go | 4 +- .../PhoneConfirmationEntity.dyno.go | 4 +- modules/workspaces/PreferenceEntity.dyno.go | 4 +- .../workspaces/PublicJoinKeyEntity.dyno.go | 4 +- .../workspaces/RegionalContentEntity.dyno.go | 4 +- modules/workspaces/RoleEntity.dyno.go | 4 +- .../workspaces/TableViewSizingEntity.dyno.go | 4 +- modules/workspaces/TokenEntity.dyno.go | 4 +- modules/workspaces/UserEntity.dyno.go | 4 +- modules/workspaces/UserProfileEntity.dyno.go | 4 +- .../workspaces/UserWorkspaceEntity.dyno.go | 4 +- .../workspaces/WorkspaceConfigEntity.dyno.go | 4 +- modules/workspaces/WorkspaceEntity.dyno.go | 4 +- .../workspaces/WorkspaceInviteEntity.dyno.go | 4 +- modules/workspaces/WorkspaceModule3.yml | 7 ++ .../workspaces/WorkspaceRoleEntity.dyno.go | 4 +- .../workspaces/WorkspaceTypeEntity.dyno.go | 4 +- .../WorkspacesCustomActions.dyno.go | 91 +++++++++++++++++++ modules/workspaces/codegen.go | 42 ++++++++- .../codegen/firebackgo/SharedSnippets.tpl | 47 ++-------- 33 files changed, 209 insertions(+), 98 deletions(-) diff --git a/modules/workspaces/AppMenuEntity.dyno.go b/modules/workspaces/AppMenuEntity.dyno.go index 2fc76174..75b07d11 100644 --- a/modules/workspaces/AppMenuEntity.dyno.go +++ b/modules/workspaces/AppMenuEntity.dyno.go @@ -43,9 +43,9 @@ type AppMenuEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Label *string `json:"label" yaml:"label" translate:"true" ` diff --git a/modules/workspaces/BackupTableMetaEntity.dyno.go b/modules/workspaces/BackupTableMetaEntity.dyno.go index 5402fad2..a549d2c4 100644 --- a/modules/workspaces/BackupTableMetaEntity.dyno.go +++ b/modules/workspaces/BackupTableMetaEntity.dyno.go @@ -42,9 +42,9 @@ type BackupTableMetaEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` TableNameInDb *string `json:"tableNameInDb" yaml:"tableNameInDb" ` diff --git a/modules/workspaces/CapabilityEntity.dyno.go b/modules/workspaces/CapabilityEntity.dyno.go index 1928bf20..b4a202af 100644 --- a/modules/workspaces/CapabilityEntity.dyno.go +++ b/modules/workspaces/CapabilityEntity.dyno.go @@ -42,9 +42,9 @@ type CapabilityEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Name *string `json:"name" yaml:"name" ` diff --git a/modules/workspaces/EmailConfirmationEntity.dyno.go b/modules/workspaces/EmailConfirmationEntity.dyno.go index f7d229c5..97778ad6 100644 --- a/modules/workspaces/EmailConfirmationEntity.dyno.go +++ b/modules/workspaces/EmailConfirmationEntity.dyno.go @@ -42,9 +42,9 @@ type EmailConfirmationEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` User *UserEntity `json:"user" yaml:"user" gorm:"foreignKey:UserId;references:UniqueId" ` diff --git a/modules/workspaces/EmailProviderEntity.dyno.go b/modules/workspaces/EmailProviderEntity.dyno.go index 913e4546..72fcf203 100644 --- a/modules/workspaces/EmailProviderEntity.dyno.go +++ b/modules/workspaces/EmailProviderEntity.dyno.go @@ -42,9 +42,9 @@ type EmailProviderEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Type *string `json:"type" yaml:"type" validate:"required" ` diff --git a/modules/workspaces/EmailSenderEntity.dyno.go b/modules/workspaces/EmailSenderEntity.dyno.go index 8ef65536..c181dffb 100644 --- a/modules/workspaces/EmailSenderEntity.dyno.go +++ b/modules/workspaces/EmailSenderEntity.dyno.go @@ -42,9 +42,9 @@ type EmailSenderEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` FromName *string `json:"fromName" yaml:"fromName" validate:"required" ` diff --git a/modules/workspaces/FileEntity.dyno.go b/modules/workspaces/FileEntity.dyno.go index a792e7c9..b101428e 100644 --- a/modules/workspaces/FileEntity.dyno.go +++ b/modules/workspaces/FileEntity.dyno.go @@ -42,9 +42,9 @@ type FileVariations struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Name *string `json:"name" yaml:"name" ` @@ -66,9 +66,9 @@ type FileEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Name *string `json:"name" yaml:"name" ` diff --git a/modules/workspaces/ForgetPasswordEntity.dyno.go b/modules/workspaces/ForgetPasswordEntity.dyno.go index 4d69ab8d..7625e1aa 100644 --- a/modules/workspaces/ForgetPasswordEntity.dyno.go +++ b/modules/workspaces/ForgetPasswordEntity.dyno.go @@ -42,9 +42,9 @@ type ForgetPasswordEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` User *UserEntity `json:"false" yaml:"user" gorm:"foreignKey:UserId;references:UniqueId" ` diff --git a/modules/workspaces/GsmProviderEntity.dyno.go b/modules/workspaces/GsmProviderEntity.dyno.go index 16fea113..95d4f3f2 100644 --- a/modules/workspaces/GsmProviderEntity.dyno.go +++ b/modules/workspaces/GsmProviderEntity.dyno.go @@ -42,9 +42,9 @@ type GsmProviderEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` ApiKey *string `json:"apiKey" yaml:"apiKey" ` diff --git a/modules/workspaces/NotificationConfigEntity.dyno.go b/modules/workspaces/NotificationConfigEntity.dyno.go index 9c6aa991..b20ef589 100644 --- a/modules/workspaces/NotificationConfigEntity.dyno.go +++ b/modules/workspaces/NotificationConfigEntity.dyno.go @@ -42,9 +42,9 @@ type NotificationConfigEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` CascadeToSubWorkspaces *bool `json:"cascadeToSubWorkspaces" yaml:"cascadeToSubWorkspaces" ` diff --git a/modules/workspaces/PassportEntity.dyno.go b/modules/workspaces/PassportEntity.dyno.go index d09c4d6e..628a18c0 100644 --- a/modules/workspaces/PassportEntity.dyno.go +++ b/modules/workspaces/PassportEntity.dyno.go @@ -42,9 +42,9 @@ type PassportEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Type *string `json:"type" yaml:"type" validate:"required" ` diff --git a/modules/workspaces/PassportMethodEntity.dyno.go b/modules/workspaces/PassportMethodEntity.dyno.go index ae3897cd..2fb7e2f2 100644 --- a/modules/workspaces/PassportMethodEntity.dyno.go +++ b/modules/workspaces/PassportMethodEntity.dyno.go @@ -42,9 +42,9 @@ type PassportMethodEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Name *string `json:"name" yaml:"name" validate:"required" translate:"true" ` diff --git a/modules/workspaces/PendingWorkspaceInviteEntity.dyno.go b/modules/workspaces/PendingWorkspaceInviteEntity.dyno.go index 45c2e55f..02655aa3 100644 --- a/modules/workspaces/PendingWorkspaceInviteEntity.dyno.go +++ b/modules/workspaces/PendingWorkspaceInviteEntity.dyno.go @@ -42,9 +42,9 @@ type PendingWorkspaceInviteEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Value *string `json:"value" yaml:"value" ` diff --git a/modules/workspaces/PersonEntity.dyno.go b/modules/workspaces/PersonEntity.dyno.go index 2ab2742f..8faff0d0 100644 --- a/modules/workspaces/PersonEntity.dyno.go +++ b/modules/workspaces/PersonEntity.dyno.go @@ -42,9 +42,9 @@ type PersonEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` FirstName *string `json:"firstName" yaml:"firstName" validate:"required" ` diff --git a/modules/workspaces/PhoneConfirmationEntity.dyno.go b/modules/workspaces/PhoneConfirmationEntity.dyno.go index d077362f..19edfe02 100644 --- a/modules/workspaces/PhoneConfirmationEntity.dyno.go +++ b/modules/workspaces/PhoneConfirmationEntity.dyno.go @@ -42,9 +42,9 @@ type PhoneConfirmationEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` User *UserEntity `json:"user" yaml:"user" gorm:"foreignKey:UserId;references:UniqueId" ` diff --git a/modules/workspaces/PreferenceEntity.dyno.go b/modules/workspaces/PreferenceEntity.dyno.go index c73ee712..4b7388d9 100644 --- a/modules/workspaces/PreferenceEntity.dyno.go +++ b/modules/workspaces/PreferenceEntity.dyno.go @@ -42,9 +42,9 @@ type PreferenceEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Timezone *string `json:"timezone" yaml:"timezone" ` diff --git a/modules/workspaces/PublicJoinKeyEntity.dyno.go b/modules/workspaces/PublicJoinKeyEntity.dyno.go index 136fabe5..f686612d 100644 --- a/modules/workspaces/PublicJoinKeyEntity.dyno.go +++ b/modules/workspaces/PublicJoinKeyEntity.dyno.go @@ -42,9 +42,9 @@ type PublicJoinKeyEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Role *RoleEntity `json:"role" yaml:"role" gorm:"foreignKey:RoleId;references:UniqueId" ` diff --git a/modules/workspaces/RegionalContentEntity.dyno.go b/modules/workspaces/RegionalContentEntity.dyno.go index 72a1e65f..501c9794 100644 --- a/modules/workspaces/RegionalContentEntity.dyno.go +++ b/modules/workspaces/RegionalContentEntity.dyno.go @@ -42,9 +42,9 @@ type RegionalContentEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Content *string `json:"content" yaml:"content" validate:"required" ` diff --git a/modules/workspaces/RoleEntity.dyno.go b/modules/workspaces/RoleEntity.dyno.go index e91a366e..fe37b07b 100644 --- a/modules/workspaces/RoleEntity.dyno.go +++ b/modules/workspaces/RoleEntity.dyno.go @@ -42,9 +42,9 @@ type RoleEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Name *string `json:"name" yaml:"name" validate:"required,omitempty,min=1,max=200" ` diff --git a/modules/workspaces/TableViewSizingEntity.dyno.go b/modules/workspaces/TableViewSizingEntity.dyno.go index 597fd3aa..2565326d 100644 --- a/modules/workspaces/TableViewSizingEntity.dyno.go +++ b/modules/workspaces/TableViewSizingEntity.dyno.go @@ -42,9 +42,9 @@ type TableViewSizingEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` TableName *string `json:"tableName" yaml:"tableName" validate:"required" ` diff --git a/modules/workspaces/TokenEntity.dyno.go b/modules/workspaces/TokenEntity.dyno.go index f429bce4..7f6f11dd 100644 --- a/modules/workspaces/TokenEntity.dyno.go +++ b/modules/workspaces/TokenEntity.dyno.go @@ -42,9 +42,9 @@ type TokenEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` User *UserEntity `json:"user" yaml:"user" gorm:"foreignKey:UserId;references:UniqueId" ` diff --git a/modules/workspaces/UserEntity.dyno.go b/modules/workspaces/UserEntity.dyno.go index a9852505..5248126c 100644 --- a/modules/workspaces/UserEntity.dyno.go +++ b/modules/workspaces/UserEntity.dyno.go @@ -42,9 +42,9 @@ type UserEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Person *PersonEntity `json:"person" yaml:"person" gorm:"foreignKey:PersonId;references:UniqueId" ` diff --git a/modules/workspaces/UserProfileEntity.dyno.go b/modules/workspaces/UserProfileEntity.dyno.go index bb990a87..e91d0731 100644 --- a/modules/workspaces/UserProfileEntity.dyno.go +++ b/modules/workspaces/UserProfileEntity.dyno.go @@ -42,9 +42,9 @@ type UserProfileEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` FirstName *string `json:"firstName" yaml:"firstName" ` diff --git a/modules/workspaces/UserWorkspaceEntity.dyno.go b/modules/workspaces/UserWorkspaceEntity.dyno.go index 639c30ae..6901d88b 100644 --- a/modules/workspaces/UserWorkspaceEntity.dyno.go +++ b/modules/workspaces/UserWorkspaceEntity.dyno.go @@ -42,9 +42,9 @@ type UserWorkspaceEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` User *UserEntity `json:"user" yaml:"user" gorm:"foreignKey:UserId;references:UniqueId" ` diff --git a/modules/workspaces/WorkspaceConfigEntity.dyno.go b/modules/workspaces/WorkspaceConfigEntity.dyno.go index 44cc1e1a..af20c738 100644 --- a/modules/workspaces/WorkspaceConfigEntity.dyno.go +++ b/modules/workspaces/WorkspaceConfigEntity.dyno.go @@ -42,9 +42,9 @@ type WorkspaceConfigEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` DisablePublicWorkspaceCreation *int64 `json:"disablePublicWorkspaceCreation" yaml:"disablePublicWorkspaceCreation" ` diff --git a/modules/workspaces/WorkspaceEntity.dyno.go b/modules/workspaces/WorkspaceEntity.dyno.go index 671697e3..787bc014 100644 --- a/modules/workspaces/WorkspaceEntity.dyno.go +++ b/modules/workspaces/WorkspaceEntity.dyno.go @@ -43,9 +43,9 @@ type WorkspaceEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Description *string `json:"description" yaml:"description" ` diff --git a/modules/workspaces/WorkspaceInviteEntity.dyno.go b/modules/workspaces/WorkspaceInviteEntity.dyno.go index fd930e79..2377cf08 100644 --- a/modules/workspaces/WorkspaceInviteEntity.dyno.go +++ b/modules/workspaces/WorkspaceInviteEntity.dyno.go @@ -42,9 +42,9 @@ type WorkspaceInviteEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` CoverLetter *string `json:"coverLetter" yaml:"coverLetter" ` diff --git a/modules/workspaces/WorkspaceModule3.yml b/modules/workspaces/WorkspaceModule3.yml index 7158bea2..21744f3d 100644 --- a/modules/workspaces/WorkspaceModule3.yml +++ b/modules/workspaces/WorkspaceModule3.yml @@ -105,6 +105,13 @@ actions: fields: - name: queueId type: string + - name: getOnlineUsersStat2 + url: /users-stats/:country + format: query + out: + fields: + - name: todayOnlineCount + type: int64 - name: sendEmailWithProvider diff --git a/modules/workspaces/WorkspaceRoleEntity.dyno.go b/modules/workspaces/WorkspaceRoleEntity.dyno.go index 94991174..699b1ad4 100644 --- a/modules/workspaces/WorkspaceRoleEntity.dyno.go +++ b/modules/workspaces/WorkspaceRoleEntity.dyno.go @@ -42,9 +42,9 @@ type WorkspaceRoleEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` UserWorkspace *UserWorkspaceEntity `json:"userWorkspace" yaml:"userWorkspace" gorm:"foreignKey:UserWorkspaceId;references:UniqueId" ` diff --git a/modules/workspaces/WorkspaceTypeEntity.dyno.go b/modules/workspaces/WorkspaceTypeEntity.dyno.go index 7f8d3692..5ade9bae 100644 --- a/modules/workspaces/WorkspaceTypeEntity.dyno.go +++ b/modules/workspaces/WorkspaceTypeEntity.dyno.go @@ -42,9 +42,9 @@ type WorkspaceTypeEntity struct { Rank int64 `json:"rank,omitempty" gorm:"type:int;name:rank"` ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty" yaml:"id,omitempty"` UniqueId string `json:"uniqueId,omitempty" gorm:"unique;not null;size:100;" yaml:"uniqueId"` - Updated int64 `json:"updated,omitempty" gorm:"autoUpdateTime:nano"` Created int64 `json:"created,omitempty" gorm:"autoUpdateTime:nano"` - Deleted int64 `json:"deleted,omitempty" gorm:"autoUpdateTime:nano"` + Updated int64 `json:"updated,omitempty"` + Deleted int64 `json:"deleted,omitempty"` CreatedFormatted string `json:"createdFormatted,omitempty" sql:"-" gorm:"-"` UpdatedFormatted string `json:"updatedFormatted,omitempty" sql:"-" gorm:"-"` Title *string `json:"title" yaml:"title" validate:"required,omitempty,min=1,max=250" translate:"true" ` diff --git a/modules/workspaces/WorkspacesCustomActions.dyno.go b/modules/workspaces/WorkspacesCustomActions.dyno.go index f74e35b8..eb96e08d 100644 --- a/modules/workspaces/WorkspacesCustomActions.dyno.go +++ b/modules/workspaces/WorkspacesCustomActions.dyno.go @@ -155,6 +155,47 @@ var SendEmailActionCmd cli.Command = cli.Command{ HandleActionInCli(c, result, err, map[string]map[string]string{}) }, } +var GetOnlineUsersStat2SecurityModel *SecurityModel = nil + +type GetOnlineUsersStat2ActionResDto struct { + TodayOnlineCount *int64 `json:"todayOnlineCount" yaml:"todayOnlineCount" ` +} + +func (x *GetOnlineUsersStat2ActionResDto) RootObjectName() string { + return "Workspaces" +} + +type getOnlineUsersStat2ActionImpSig func( + q QueryDSL) (*GetOnlineUsersStat2ActionResDto, + *QueryResultMeta, + *IError, +) + +var GetOnlineUsersStat2ActionImp getOnlineUsersStat2ActionImpSig + +func GetOnlineUsersStat2ActionFn( + q QueryDSL, +) ( + *GetOnlineUsersStat2ActionResDto, + *QueryResultMeta, + *IError, +) { + if GetOnlineUsersStat2ActionImp == nil { + return nil, nil, nil + } + return GetOnlineUsersStat2ActionImp(q) +} + +var GetOnlineUsersStat2ActionCmd cli.Command = cli.Command{ + Name: "get-online-users-stat2", + Usage: "", + Flags: CommonQueryFlags, + Action: func(c *cli.Context) { + query := CommonCliQueryDSLBuilderAuthorize(c, GetOnlineUsersStat2SecurityModel) + result, _, err := GetOnlineUsersStat2ActionFn(query) + HandleActionInCli(c, result, err, map[string]map[string]string{}) + }, +} var SendEmailWithProviderSecurityModel *SecurityModel = nil type SendEmailWithProviderActionReqDto struct { @@ -907,6 +948,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/user/import", SecurityModel: ImportUserSecurityModel, + Name: "importUser", + Description: "Imports users, and creates their passports, and all details", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -929,6 +972,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/email/send", SecurityModel: SendEmailSecurityModel, + Name: "sendEmail", + Description: "Send a email using default root notification configuration", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -947,10 +992,32 @@ func WorkspacesCustomActions() []Module2Action { Entity: "SendEmailActionReqDto", }, }, + { + Method: "", + Url: "/users-stats/:country", + SecurityModel: GetOnlineUsersStat2SecurityModel, + Name: "getOnlineUsersStat2", + Description: "", + Group: "WorkspacesCustom", + Handlers: []gin.HandlerFunc{ + func(c *gin.Context) { + // QUERY - + // HttpQueryEntity2(c, GetOnlineUsersStat2ActionFn) + }, + }, + Format: "QUERY", + Action: GetOnlineUsersStat2ActionFn, + ResponseEntity: &GetOnlineUsersStat2ActionResDto{}, + Out: &Module2ActionBody{ + Entity: "GetOnlineUsersStat2ActionResDto", + }, + }, { Method: "POST", Url: "/emailProvider/send", SecurityModel: SendEmailWithProviderSecurityModel, + Name: "sendEmailWithProvider", + Description: "Send a text message using an specific gsm provider", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -973,6 +1040,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/workspace/invite", SecurityModel: InviteToWorkspaceSecurityModel, + Name: "inviteToWorkspace", + Description: "Invite a new person (either a user, with passport or without passport)", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -995,6 +1064,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/gsm/send/sms", SecurityModel: GsmSendSmsSecurityModel, + Name: "gsmSendSms", + Description: "Send a text message using default root notification configuration", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -1017,6 +1088,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/gsmProvider/send/sms", SecurityModel: GsmSendSmsWithProviderSecurityModel, + Name: "gsmSendSmsWithProvider", + Description: "Send a text message using an specific gsm provider", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -1039,6 +1112,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/passports/signin/classic", SecurityModel: ClassicSigninSecurityModel, + Name: "classicSignin", + Description: "Signin publicly to and account using class passports (email, password)", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -1061,6 +1136,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/passports/signup/classic", SecurityModel: ClassicSignupSecurityModel, + Name: "classicSignup", + Description: "Signup a user into system via public access (aka website visitors) using either email or phone number", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -1083,6 +1160,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/workspaces/create", SecurityModel: CreateWorkspaceSecurityModel, + Name: "createWorkspace", + Description: "", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -1105,6 +1184,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/workspace/passport/check", SecurityModel: CheckClassicPassportSecurityModel, + Name: "checkClassicPassport", + Description: "Checks if a classic passport (email, phone) exists or not, used in multi step authentication", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -1127,6 +1208,8 @@ func WorkspacesCustomActions() []Module2Action { Method: "POST", Url: "/workspace/passport/otp", SecurityModel: ClassicPassportOtpSecurityModel, + Name: "classicPassportOtp", + Description: "Authenticate the user publicly for classic methods using communication service, such as sms, call, or email", Group: "WorkspacesCustom", Handlers: []gin.HandlerFunc{ func(c *gin.Context) { @@ -1152,6 +1235,7 @@ func WorkspacesCustomActions() []Module2Action { var WorkspacesCustomActionsCli = []cli.Command{ ImportUserActionCmd, SendEmailActionCmd, + GetOnlineUsersStat2ActionCmd, SendEmailWithProviderActionCmd, InviteToWorkspaceActionCmd, GsmSendSmsActionCmd, @@ -1172,6 +1256,7 @@ var WorkspacesCliActionsBundle = &CliActionsBundle{ Subcommands: cli.Commands{ ImportUserActionCmd, SendEmailActionCmd, + GetOnlineUsersStat2ActionCmd, SendEmailWithProviderActionCmd, InviteToWorkspaceActionCmd, GsmSendSmsActionCmd, @@ -1213,6 +1298,12 @@ var WorkspacesCliActionsBundle = &CliActionsBundle{ }, } +func GetWorkspacesActionsBundle() *ModuleActionsBundle { + return &ModuleActionsBundle{ + Actions: WorkspacesCustomActions(), + CliAction: WorkspacesCliActionsBundle, + } +} func GetWorkspacesActionsCli() []cli.Command { return WorkspacesCustomActionsCli } diff --git a/modules/workspaces/codegen.go b/modules/workspaces/codegen.go index b08a2ea0..0fcccd8c 100644 --- a/modules/workspaces/codegen.go +++ b/modules/workspaces/codegen.go @@ -154,6 +154,11 @@ func (x *Module2Action) FormatComputed() string { if x.Method == "REACTIVE" || x.Method == "reactive" { return "REACTIVE" } + + if strings.ToLower(x.Method) == "query" { + return "QUERY" + } + if x.Format != "" { return strings.ToUpper(x.Format) } @@ -456,7 +461,7 @@ func (x *Module2Action) ActionResDto() string { return "string" } prefix := "" - if x.Format == "QUERY" { + if strings.ToLower(x.Format) == "query" || strings.ToLower(x.Method) == "query" { prefix = "[]" } if x.Out.Entity != "" { @@ -2777,10 +2782,45 @@ func RemoteQueryAppend(ctx *CodeGenContext, remotes []*Module2Remote, isWorkspac return res } + +func extractRouteParams(route string) []*Module2Field { + // Split the route by '/' + parts := strings.Split(route, "/") + + var params []*Module2Field + + // Iterate over the parts and extract variables + for _, part := range parts { + // Variables start with ':' or '*' + if strings.HasPrefix(part, ":") || strings.HasPrefix(part, "*") { + // Remove ':' or '*' and append to params + param := strings.TrimPrefix(part, ":") + param = strings.TrimPrefix(param, "*") + params = append(params, &Module2Field{ + Name: param, + Type: "string", + }) + } + } + + if len(params) > 0 { + return []*Module2Field{ + { + Name: "pathParams", + Type: "object", + Fields: params, + }, + } + } + + return params +} + func RemoteActionsAppend(ctx *CodeGenContext, remotes []*Module2Action, isWorkspace bool) [][]*Module2Field { res := [][]*Module2Field{} for _, item := range remotes { + item.Query = append(item.Query, extractRouteParams(item.Url)...) if len(item.Query) == 0 { continue } diff --git a/modules/workspaces/codegen/firebackgo/SharedSnippets.tpl b/modules/workspaces/codegen/firebackgo/SharedSnippets.tpl index 49cef07f..0ae5c70c 100644 --- a/modules/workspaces/codegen/firebackgo/SharedSnippets.tpl +++ b/modules/workspaces/codegen/firebackgo/SharedSnippets.tpl @@ -865,38 +865,7 @@ var {{ .e.EntityName }}JsonSchema = {{ .wsprefix }}ExtractEntityFields(reflect.V // intentionally removed this. It's hard to implement it, and probably wrong without // proper on delete cascade {{ end }} -{{ define "entityDeleteEntireChildrenRec2" }} - {{ $fields := index . 0 }} - {{ $prefix := index . 1 }} - {{ $chained := index . 2 }} - - {{ range $fields }} - - {{ if or (eq .Type "object") (eq .Type "array") }} - - if dto{{ $chained }}{{ .PublicName }} != nil { - q := query.Tx. - Model(&dto{{ $chained }}{{ .PublicName }}). - Where(&{{ $prefix }}{{ .PublicName }}{LinkerId: &dto{{ $chained }}UniqueId }). - Delete(&{{ $prefix }}{{ .PublicName }}{}) - - err := q.Error - if err != nil { - return workspaces.GormErrorToIError(err) - } - - {{ $newPrefix := print $prefix .PublicName }} - {{ $newChained := print $chained .PublicName "." }} - {{ template "entityDeleteEntireChildrenRec" (arr .CompleteFields $newPrefix $newChained)}} - } - - {{ end }} - - - {{ end }} - -{{ end }} {{ define "entityDeleteEntireChildren" }} func {{ .e.Upper}}DeleteEntireChildren(query {{ .wsprefix }}QueryDSL, dto *{{.e.EntityName }}) (*{{ .wsprefix }}IError) { @@ -2545,7 +2514,7 @@ type {{ $name }}Msgs struct { {{ range .}} type {{ .FullName }} struct { - {{ template "definitionrow" (arr .Fields $.wsprefix) }} + {{ template "definitionrow" (arr .Fields $wsprefix) }} } {{ end }} @@ -2556,7 +2525,7 @@ type {{ $name }}Msgs struct { {{ range .}} type {{ .FullName }} struct { - {{ template "definitionrow" (arr .Fields $.wsprefix) }} + {{ template "definitionrow" (arr .Fields $wsprefix) }} } {{ end }} @@ -2567,7 +2536,7 @@ type {{ $name }}Msgs struct { {{ range .}} type {{ .FullName }} struct { - {{ template "definitionrow" (arr .Fields $.wsprefix) }} + {{ template "definitionrow" (arr .Fields $wsprefix) }} } {{ end }} @@ -2654,7 +2623,7 @@ type {{ $name }}Msgs struct { type {{ .Name }}ActionImpSig func( {{ if .ComputeRequestEntity }}{{ if ne .ActionReqDto "nil" }}req {{ .ActionReqDto }}, {{ end}}{{end}} q {{ $wsprefix }}QueryDSL) ({{ .ActionResDto }}, - {{ if (eq .FormatComputed "QUERY") }} *workspaces.QueryResultMeta, {{ end }} + {{ if (eq .FormatComputed "QUERY") }} *{{ $wsprefix }}QueryResultMeta, {{ end }} *{{ $wsprefix }}IError, ) var {{ .Upper }}ActionImp {{ .Name }}ActionImpSig @@ -2671,7 +2640,7 @@ type {{ $name }}Msgs struct { q {{ $wsprefix }}QueryDSL, ) ( {{ .ActionResDto }}, - {{ if (eq .FormatComputed "QUERY") }} *workspaces.QueryResultMeta, {{ end }} + {{ if (eq .FormatComputed "QUERY") }} *{{ $wsprefix }}QueryResultMeta, {{ end }} *{{ $wsprefix }}IError, ) { if {{ .Upper }}ActionImp == nil { @@ -2686,7 +2655,7 @@ type {{ $name }}Msgs struct { Name: "{{ .ComputedCliName }}", Usage: "{{ .Description }}", {{ if (eq .FormatComputed "QUERY") }} - Flags: workspaces.CommonQueryFlags, + Flags: {{ $wsprefix }}CommonQueryFlags, {{ end }} {{ if .In }} @@ -2753,6 +2722,10 @@ func {{ $name }}CustomActions() []{{ $wsprefix }}Module2Action { {{ if or (eq .FormatComputed "QUERY")}} {{ $wsprefix }}HttpQueryEntity2(c, {{ .Upper }}ActionFn) {{ end }} + + {{ if or (eq .FormatComputed "GET_ONE")}} + {{ $wsprefix }}HttpGetEntity(c, {{ .Upper }}ActionFn) + {{ end }} }, {{ end }} },