mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
customer registration api integration
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import { BaseEntity } from "@edr/api-common";
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { DropdownSetting } from "./dropdown-setting.entity";
|
||||
|
||||
export interface DropdownOptionMeta {
|
||||
icon?: string;
|
||||
color?: string;
|
||||
badge?: string;
|
||||
}
|
||||
|
||||
@Entity({ name: "dropdown_options" })
|
||||
@Index(["settingId", "value"], { unique: true })
|
||||
export class DropdownOption extends BaseEntity {
|
||||
@ManyToOne(() => DropdownSetting, (setting) => setting.children, {
|
||||
onDelete: "CASCADE",
|
||||
})
|
||||
@JoinColumn({ name: "setting_id" })
|
||||
setting!: DropdownSetting;
|
||||
|
||||
@Column({ name: "setting_id", type: "uuid" })
|
||||
settingId!: string;
|
||||
|
||||
@Column({ name: "value", type: "varchar", length: 256 })
|
||||
value!: string;
|
||||
|
||||
@Column({ name: "label", type: "varchar", length: 256 })
|
||||
label!: string;
|
||||
|
||||
@Column({ name: "note", type: "text", nullable: true })
|
||||
note?: string | null;
|
||||
|
||||
@Column({ name: "is_disabled", type: "boolean", default: false })
|
||||
disabled!: boolean;
|
||||
|
||||
@Column({ name: "display_order", type: "integer", default: 0 })
|
||||
order!: number;
|
||||
|
||||
@Column({ name: "meta", type: "jsonb", nullable: true })
|
||||
meta?: DropdownOptionMeta | null;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import { BaseEntity } from "@edr/api-common";
|
||||
import { Column, Entity, Index, OneToMany } from "typeorm";
|
||||
|
||||
import { DropdownOption } from "./dropdown-option.entity";
|
||||
|
||||
export interface DropdownSettingMeta {
|
||||
icon?: string;
|
||||
color?: string;
|
||||
searchable?: boolean;
|
||||
clearable?: boolean;
|
||||
permissions?: string[];
|
||||
version?: string;
|
||||
}
|
||||
|
||||
@Entity({ name: "dropdown_settings" })
|
||||
@Index(["code"], { unique: true })
|
||||
export class DropdownSetting extends BaseEntity {
|
||||
@Column({ name: "code", type: "varchar", length: 128, unique: true })
|
||||
code!: string;
|
||||
|
||||
@Column({ name: "label", type: "varchar", length: 256 })
|
||||
label!: string;
|
||||
|
||||
@Column({ name: "description", type: "text", nullable: true })
|
||||
description?: string | null;
|
||||
|
||||
@Column({ name: "multiple", type: "boolean", default: false })
|
||||
multiple!: boolean;
|
||||
|
||||
@Column({ name: "meta", type: "jsonb", nullable: true })
|
||||
meta?: DropdownSettingMeta | null;
|
||||
|
||||
@OneToMany(() => DropdownOption, (option) => option.setting, {
|
||||
cascade: true,
|
||||
})
|
||||
children!: DropdownOption[];
|
||||
}
|
||||
Reference in New Issue
Block a user