diff --git a/backend/api.rest b/backend/api.rest index 13b1ce70..a32f1121 100644 --- a/backend/api.rest +++ b/backend/api.rest @@ -2,8 +2,9 @@ #Variaveis @baseUrl = http://localhost:8080 +# @baseUrl = https://apidev.pressticket.com.br @token = 6175c0d0-acd5-4776-95a9-592c795da986 -@token2 = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Ik1hc3RlckFkbWluIiwicHJvZmlsZSI6Im1hc3RlcmFkbWluIiwiaWQiOjIsImlhdCI6MTczMzEzNjUxOCwiZXhwIjoxNzMzMTQwMTE4fQ.UOA-goHaIATCvMs_eAXIIR6bjEBuOg1VbF40Q2zxUn0 +@token2 = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Ik1hc3RlckFkbWluIiwicHJvZmlsZSI6Im1hc3RlcmFkbWluIiwiaWQiOjIsImlhdCI6MTczMzY4OTk2NiwiZXhwIjoxNzMzNjkzNTY2fQ.g_jJs3vovlU5i9sS0IUoJ3Ew_m7W8GzqjWd-kieFFpc @refreshToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidG9rZW5WZXJzaW9uIjowLCJpYXQiOjE3MzI4ODUzMzQsImV4cCI6MTczMzQ5MDEzNH0.RwuRIufYUB9dQZQg0aeaVtnOryn-sESNL1mFlShmBM4 diff --git a/backend/src/database/migrations/20241106170332-create-personalizations.ts b/backend/src/database/migrations/20241106170332-create-personalizations.ts index a15f8880..df2a42e2 100644 --- a/backend/src/database/migrations/20241106170332-create-personalizations.ts +++ b/backend/src/database/migrations/20241106170332-create-personalizations.ts @@ -11,31 +11,31 @@ module.exports = { }, theme: { type: DataTypes.STRING, - allowNull: false + allowNull: true }, company: { type: DataTypes.STRING, - allowNull: false + allowNull: true }, url: { type: DataTypes.STRING, - allowNull: false + allowNull: true }, primaryColor: { type: DataTypes.STRING, - allowNull: false + allowNull: true }, secondaryColor: { type: DataTypes.STRING, - allowNull: false + allowNull: true }, backgroundDefault: { type: DataTypes.STRING, - allowNull: false + allowNull: true }, backgroundPaper: { type: DataTypes.STRING, - allowNull: false + allowNull: true }, favico: { type: DataTypes.TEXT, @@ -49,6 +49,34 @@ module.exports = { type: DataTypes.TEXT, allowNull: true }, + toolbarColor: { + type: DataTypes.STRING, + allowNull: true + }, + toolbarIconColor: { + type: DataTypes.STRING, + allowNull: true + }, + menuItens: { + type: DataTypes.STRING, + allowNull: true + }, + sub: { + type: DataTypes.STRING, + allowNull: true + }, + textPrimary: { + type: DataTypes.STRING, + allowNull: true + }, + textSecondary: { + type: DataTypes.STRING, + allowNull: true + }, + divide: { + type: DataTypes.STRING, + allowNull: true + }, createdAt: { type: DataTypes.DATE, allowNull: false, diff --git a/backend/src/database/seeds/20241208171800-create-themes-personalizations.ts b/backend/src/database/seeds/20241208171800-create-themes-personalizations.ts new file mode 100644 index 00000000..3bf77afe --- /dev/null +++ b/backend/src/database/seeds/20241208171800-create-themes-personalizations.ts @@ -0,0 +1,56 @@ +import { QueryInterface } from "sequelize"; + +module.exports = { + up: (queryInterface: QueryInterface) => { + return queryInterface.bulkInsert( + "Personalizations", + [ + { + theme: "light", + company: "Press Ticket", + url: "https://pressticket.com.br", + primaryColor: "#5C4B9B", + secondaryColor: "#D5C6F0", + backgroundDefault: "#FFFFFF", + backgroundPaper: "#F7F7F7", + toolbarColor: "#5C4B9B", + toolbarIconColor: "#FFFFFF", + menuItens: "#FFFFFF", + sub: "#F7F7F7", + textPrimary: "#000000", + textSecondary: "#333333", + divide: "#E0E0E0", + favico: null, + logo: null, + logoTicket: null, + createdAt: new Date(), + updatedAt: new Date() + }, + { + theme: "dark", + primaryColor: "#8A7DCC", + secondaryColor: "#CCCCCC", + backgroundDefault: "#2E2E3A", + backgroundPaper: "#383850", + toolbarColor: "#8A7DCC", + toolbarIconColor: "#FFFFFF", + menuItens: "#181D22", + sub: "#383850", + textPrimary: "#FFFFFF", + textSecondary: "#CCCCCC", + divide: "#2E2E3A", + favico: null, + logo: null, + logoTicket: null, + createdAt: new Date(), + updatedAt: new Date() + } + ], + {} + ); + }, + + down: (queryInterface: QueryInterface) => { + return queryInterface.bulkDelete("Personalizations", {}); + } +}; diff --git a/backend/src/models/Personalization.ts b/backend/src/models/Personalization.ts index 6b081de6..5d18d0fe 100644 --- a/backend/src/models/Personalization.ts +++ b/backend/src/models/Personalization.ts @@ -16,36 +16,57 @@ class Personalization extends Model { @Column id: number; - @Column(DataType.STRING) + @Column({ type: DataType.STRING, allowNull: true }) theme: string; - @Column(DataType.STRING) - company: string; + @Column({ type: DataType.STRING, allowNull: true }) + company: string | null; - @Column(DataType.STRING) - url: string; + @Column({ type: DataType.STRING, allowNull: true }) + url: string | null; - @Column(DataType.STRING) - primaryColor: string; + @Column({ type: DataType.STRING, allowNull: true }) + primaryColor: string | null; - @Column(DataType.STRING) - secondaryColor: string; + @Column({ type: DataType.STRING, allowNull: true }) + secondaryColor: string | null; - @Column(DataType.STRING) - backgroundDefault: string; + @Column({ type: DataType.STRING, allowNull: true }) + backgroundDefault: string | null; - @Column(DataType.STRING) - backgroundPaper: string; + @Column({ type: DataType.STRING, allowNull: true }) + backgroundPaper: string | null; - @Column(DataType.TEXT) + @Column({ type: DataType.TEXT, allowNull: true }) favico: string | null; - @Column(DataType.TEXT) + @Column({ type: DataType.TEXT, allowNull: true }) logo: string | null; - @Column(DataType.TEXT) + @Column({ type: DataType.TEXT, allowNull: true }) logoTicket: string | null; + @Column({ type: DataType.STRING, allowNull: true }) + toolbarColor: string | null; + + @Column({ type: DataType.STRING, allowNull: true }) + toolbarIconColor: string | null; + + @Column({ type: DataType.STRING, allowNull: true }) + menuItens: string | null; + + @Column({ type: DataType.STRING, allowNull: true }) + sub: string | null; + + @Column({ type: DataType.STRING, allowNull: true }) + textPrimary: string | null; + + @Column({ type: DataType.STRING, allowNull: true }) + textSecondary: string | null; + + @Column({ type: DataType.STRING, allowNull: true }) + divide: string | null; + @CreatedAt @Column(DataType.DATE(6)) createdAt: Date;