mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1976-Customise-the-mobile-view
This commit is contained in:
commit
a5cbf35f42
3
.dbeaver/credentials-config.json
Normal file
3
.dbeaver/credentials-config.json
Normal file
@ -0,0 +1,3 @@
|
||||
4ƒk׀ךֻ1°,•<EFBFBD>fעbלAלqִ¬cי<EFBFBD>#¾›צ¾ר#s’8-ְ1‰&»;נצד"¢פשל7€d¥jM?‘bljfB¼ƒqֱ=
|
||||
<EFBFBD>ײmyפ¿
|
||||
vת·´V
|
||||
32
.dbeaver/data-sources.json
Normal file
32
.dbeaver/data-sources.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"folders": {},
|
||||
"connections": {
|
||||
"mariaDB-1813fbbc7bc-107c0b3aeaeb91ab": {
|
||||
"provider": "mysql",
|
||||
"driver": "mariaDB",
|
||||
"name": "gradido",
|
||||
"save-password": true,
|
||||
"read-only": false,
|
||||
"configuration": {
|
||||
"host": "localhost",
|
||||
"port": "3306",
|
||||
"url": "jdbc:mariadb://localhost:3306/",
|
||||
"home": "mysql_client",
|
||||
"type": "dev",
|
||||
"auth-model": "native",
|
||||
"handlers": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"connection-types": {
|
||||
"dev": {
|
||||
"name": "Development",
|
||||
"color": "255,255,255",
|
||||
"description": "Regular development database",
|
||||
"auto-commit": true,
|
||||
"confirm-execute": false,
|
||||
"confirm-data-change": false,
|
||||
"auto-close-transactions": false
|
||||
}
|
||||
}
|
||||
}
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
.dbeaver
|
||||
.project
|
||||
*.log
|
||||
*.bak
|
||||
/node_modules/*
|
||||
messages.pot
|
||||
nbproject
|
||||
|
||||
18
.project
Normal file
18
.project
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Gradido</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.jkiss.dbeaver.DBeaverNature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@ -10,7 +10,7 @@ Decimal.set({
|
||||
})
|
||||
|
||||
const constants = {
|
||||
DB_VERSION: '0037-drop_server_user_table',
|
||||
DB_VERSION: '0038-add_contribution_links_table',
|
||||
DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0
|
||||
LOG4JS_CONFIG: 'log4js-config.json',
|
||||
// default log level on production should be info
|
||||
|
||||
@ -0,0 +1,88 @@
|
||||
import Decimal from 'decimal.js-light'
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, DeleteDateColumn } from 'typeorm'
|
||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
||||
|
||||
@Entity('contribution_links')
|
||||
export class ContributionLink extends BaseEntity {
|
||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||
id: number
|
||||
|
||||
@Column({ length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||
name: string
|
||||
|
||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||
memo: string
|
||||
|
||||
@Column({ name: 'valid_from', type: 'datetime', nullable: false })
|
||||
validFrom: Date
|
||||
|
||||
@Column({ name: 'valid_to', type: 'datetime', nullable: true, default: null })
|
||||
validTo: Date | null
|
||||
|
||||
@Column({
|
||||
type: 'decimal',
|
||||
precision: 40,
|
||||
scale: 20,
|
||||
nullable: false,
|
||||
transformer: DecimalTransformer,
|
||||
})
|
||||
amount: Decimal
|
||||
|
||||
@Column({ length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||
cycle: string
|
||||
|
||||
@Column({ name: 'max_per_cycle', unsigned: true, nullable: false, default: 1 })
|
||||
maxPerCycle: number
|
||||
|
||||
@Column({
|
||||
name: 'max_amount_per_month',
|
||||
type: 'decimal',
|
||||
precision: 40,
|
||||
scale: 20,
|
||||
nullable: true,
|
||||
default: null,
|
||||
transformer: DecimalTransformer,
|
||||
})
|
||||
maxAmountPerMonth: Decimal | null
|
||||
|
||||
@Column({
|
||||
name: 'total_max_count_of_contribution',
|
||||
type: 'int',
|
||||
unsigned: true,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
totalMaxCountOfContribution: number | null
|
||||
|
||||
@Column({
|
||||
name: 'max_account_balance',
|
||||
type: 'decimal',
|
||||
precision: 40,
|
||||
scale: 20,
|
||||
nullable: true,
|
||||
default: null,
|
||||
transformer: DecimalTransformer,
|
||||
})
|
||||
maxAccountBalance: Decimal | null
|
||||
|
||||
@Column({
|
||||
name: 'min_gap_hours',
|
||||
type: 'int',
|
||||
unsigned: true,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
minGapHours: number | null
|
||||
|
||||
@Column({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
||||
createdAt: Date
|
||||
|
||||
@DeleteDateColumn({ name: 'deleted_at' })
|
||||
deletedAt: Date | null
|
||||
|
||||
@Column({ length: 24, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||
code: string
|
||||
|
||||
@Column({ name: 'link_enabled', type: 'boolean', default: true })
|
||||
linkEnabled: boolean
|
||||
}
|
||||
1
database/entity/ContributionLink.ts
Normal file
1
database/entity/ContributionLink.ts
Normal file
@ -0,0 +1 @@
|
||||
export { ContributionLink } from './0038-add_contribution_links_table/ContributionLink'
|
||||
@ -1 +1 @@
|
||||
export { User } from './0037-drop_server_user_table/User'
|
||||
export { User } from './0037-drop_user_setting_table/User'
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { ContributionLink } from './ContributionLink'
|
||||
import { LoginElopageBuys } from './LoginElopageBuys'
|
||||
import { LoginEmailOptIn } from './LoginEmailOptIn'
|
||||
import { Migration } from './Migration'
|
||||
@ -8,6 +9,7 @@ import { AdminPendingCreation } from './AdminPendingCreation'
|
||||
|
||||
export const entities = [
|
||||
AdminPendingCreation,
|
||||
ContributionLink,
|
||||
LoginElopageBuys,
|
||||
LoginEmailOptIn,
|
||||
Migration,
|
||||
|
||||
35
database/migrations/0038-add_contribution_links_table.ts
Normal file
35
database/migrations/0038-add_contribution_links_table.ts
Normal file
@ -0,0 +1,35 @@
|
||||
/* MIGRATION TO ADD CONTRIBUTION_LINKS
|
||||
*
|
||||
* This migration adds the table `contribution_links` in order to store all sorts of contribution_links data
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`
|
||||
CREATE TABLE IF NOT EXISTS \`contribution_links\` (
|
||||
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`name\` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
\`memo\` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
\`valid_from\` datetime NOT NULL,
|
||||
\`valid_to\` datetime NULL,
|
||||
\`amount\` bigint(20) NOT NULL,
|
||||
\`cycle\` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ONCE',
|
||||
\`max_per_cycle\` int(10) unsigned NOT NULL DEFAULT '1',
|
||||
\`max_amount_per_month\` bigint(20) NULL DEFAULT NULL,
|
||||
\`total_max_count_of_contribution\` int(10) unsigned NULL DEFAULT NULL,
|
||||
\`max_account_balance\` bigint(20) NULL DEFAULT NULL,
|
||||
\`min_gap_hours\` int(10) unsigned NULL DEFAULT NULL,
|
||||
\`created_at\` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
\`deleted_at\` datetime NULL DEFAULT NULL,
|
||||
\`code\` varchar(24) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
\`link_enabled\` tinyint(4) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
// write downgrade logic as parameter of queryFn
|
||||
await queryFn(`DROP TABLE IF EXISTS \`contribution_links\`;`)
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user