Skip to content

Commit

Permalink
Gh10279 (#10292)
Browse files Browse the repository at this point in the history
* #10279
 - Initial commit

* #10238
 - Intermediary commit.

* #10238
 - Added migration scripts + implemented ad_messages.

* #10279
 - made count variable final.

* #10279
 - added index.

* #10279
 - extracting lookup values as int instead of string.
  • Loading branch information
dragospodariu96 committed Nov 25, 2020
1 parent dbc1c6d commit d39fb0c
Show file tree
Hide file tree
Showing 13 changed files with 2,274 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- 2020-11-24T15:27:59.477Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,545009,0,TO_TIMESTAMP('2020-11-24 17:27:59','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base','Y','Benutzer muss mindestens einen Marketingkanal haben!','E',TO_TIMESTAMP('2020-11-24 17:27:59','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base.userMarketingChannelRemovalError')
;

-- 2020-11-24T15:27:59.480Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Message_ID=545009 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;

-- 2020-11-24T15:28:12.735Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='User must have at least one marketing channel!',Updated=TO_TIMESTAMP('2020-11-24 17:28:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=545009
;

-- 2020-11-24T15:28:57.827Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,545010,0,TO_TIMESTAMP('2020-11-24 17:28:57','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base','Y','Kann nicht löschen. Es gibt Benutzer, die nur diesen Marketingkanal haben.','E',TO_TIMESTAMP('2020-11-24 17:28:57','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base.marketingChannelRemovalError')
;

-- 2020-11-24T15:28:57.829Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Message_ID=545010 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;

-- 2020-11-24T15:29:16.267Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='Can''t delete. There are users only having this marketing channel.',Updated=TO_TIMESTAMP('2020-11-24 17:29:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=545010
;

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
package de.metas.marketing.base.model;

import javax.annotation.Nullable;
import org.adempiere.model.ModelColumn;

/** Generated Interface for AD_User_MKTG_Channels
* @author metasfresh (generated)
*/
public interface I_AD_User_MKTG_Channels
{

String Table_Name = "AD_User_MKTG_Channels";

// /** AD_Table_ID=541553 */
// int Table_ID = org.compiere.model.MTable.getTable_ID(Table_Name);


/**
* Get Client.
* Client/Tenant for this installation.
*
* <br>Type: TableDir
* <br>Mandatory: false
* <br>Virtual Column: false
*/
int getAD_Client_ID();

String COLUMNNAME_AD_Client_ID = "AD_Client_ID";

/**
* Set Organisation.
* Organisational entity within client
*
* <br>Type: TableDir
* <br>Mandatory: false
* <br>Virtual Column: false
*/
void setAD_Org_ID (int AD_Org_ID);

/**
* Get Organisation.
* Organisational entity within client
*
* <br>Type: TableDir
* <br>Mandatory: false
* <br>Virtual Column: false
*/
int getAD_Org_ID();

String COLUMNNAME_AD_Org_ID = "AD_Org_ID";

/**
* Set Contact.
* User within the system - Internal or Business Partner Contact
*
* <br>Type: Search
* <br>Mandatory: false
* <br>Virtual Column: false
*/
void setAD_User_ID (int AD_User_ID);

/**
* Get Contact.
* User within the system - Internal or Business Partner Contact
*
* <br>Type: Search
* <br>Mandatory: false
* <br>Virtual Column: false
*/
int getAD_User_ID();

String COLUMNNAME_AD_User_ID = "AD_User_ID";

/**
* Set AD_User_MKTG_Channels.
*
* <br>Type: ID
* <br>Mandatory: true
* <br>Virtual Column: false
*/
void setAD_User_MKTG_Channels_ID (int AD_User_MKTG_Channels_ID);

/**
* Get AD_User_MKTG_Channels.
*
* <br>Type: ID
* <br>Mandatory: true
* <br>Virtual Column: false
*/
int getAD_User_MKTG_Channels_ID();

ModelColumn<I_AD_User_MKTG_Channels, Object> COLUMN_AD_User_MKTG_Channels_ID = new ModelColumn<>(I_AD_User_MKTG_Channels.class, "AD_User_MKTG_Channels_ID", null);
String COLUMNNAME_AD_User_MKTG_Channels_ID = "AD_User_MKTG_Channels_ID";

/**
* Get Created.
* Date this record was created
*
* <br>Type: DateTime
* <br>Mandatory: false
* <br>Virtual Column: false
*/
@Nullable java.sql.Timestamp getCreated();

ModelColumn<I_AD_User_MKTG_Channels, Object> COLUMN_Created = new ModelColumn<>(I_AD_User_MKTG_Channels.class, "Created", null);
String COLUMNNAME_Created = "Created";

/**
* Get Created By.
* User who created this records
*
* <br>Type: Table
* <br>Mandatory: false
* <br>Virtual Column: false
*/
int getCreatedBy();

String COLUMNNAME_CreatedBy = "CreatedBy";

/**
* Set Active.
* The record is active in the system
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
void setIsActive (boolean IsActive);

/**
* Get Active.
* The record is active in the system
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
boolean isActive();

ModelColumn<I_AD_User_MKTG_Channels, Object> COLUMN_IsActive = new ModelColumn<>(I_AD_User_MKTG_Channels.class, "IsActive", null);
String COLUMNNAME_IsActive = "IsActive";

/**
* Set MKTG_Channel.
*
* <br>Type: Search
* <br>Mandatory: false
* <br>Virtual Column: false
*/
void setMKTG_Channel_ID (int MKTG_Channel_ID);

/**
* Get MKTG_Channel.
*
* <br>Type: Search
* <br>Mandatory: false
* <br>Virtual Column: false
*/
int getMKTG_Channel_ID();

@Nullable de.metas.marketing.base.model.I_MKTG_Channel getMKTG_Channel();

void setMKTG_Channel(@Nullable de.metas.marketing.base.model.I_MKTG_Channel MKTG_Channel);

ModelColumn<I_AD_User_MKTG_Channels, de.metas.marketing.base.model.I_MKTG_Channel> COLUMN_MKTG_Channel_ID = new ModelColumn<>(I_AD_User_MKTG_Channels.class, "MKTG_Channel_ID", de.metas.marketing.base.model.I_MKTG_Channel.class);
String COLUMNNAME_MKTG_Channel_ID = "MKTG_Channel_ID";

/**
* Get Updated.
* Date this record was updated
*
* <br>Type: DateTime
* <br>Mandatory: false
* <br>Virtual Column: false
*/
@Nullable java.sql.Timestamp getUpdated();

ModelColumn<I_AD_User_MKTG_Channels, Object> COLUMN_Updated = new ModelColumn<>(I_AD_User_MKTG_Channels.class, "Updated", null);
String COLUMNNAME_Updated = "Updated";

/**
* Get Updated By.
* User who updated this records
*
* <br>Type: Table
* <br>Mandatory: false
* <br>Virtual Column: false
*/
int getUpdatedBy();

String COLUMNNAME_UpdatedBy = "UpdatedBy";
}

0 comments on commit d39fb0c

Please sign in to comment.