(
entityId: number,
name: string,
type: string,
value: string = "",
length: number = 0,
style: string = "",
comment: string = "",
inTable = true,
tf?: OmitId<LB.TypeFormat>,
nullable = false,
scale = 0,
)
| 6 | import useDoctrineColumnTypezzStore from "@/Store/useDoctrineColumnTypezzStore" |
| 7 | |
| 8 | export default function createColumnTypeFormat( |
| 9 | entityId: number, |
| 10 | name: string, |
| 11 | type: string, |
| 12 | value: string = "", |
| 13 | length: number = 0, |
| 14 | style: string = "", |
| 15 | comment: string = "", |
| 16 | inTable = true, |
| 17 | tf?: OmitId<LB.TypeFormat>, |
| 18 | nullable = false, |
| 19 | scale = 0, |
| 20 | ): Promise<LB.Column> { |
| 21 | const rozz = getCollectionItemzz("ReadOnlyColumn") |
| 22 | const dct = useDoctrineColumnTypezzStore.getState().findByName(type) |
| 23 | return makeColumnCRUD() |
| 24 | .create( |
| 25 | makeColumn( |
| 26 | entityId, |
| 27 | name, |
| 28 | type, |
| 29 | value, |
| 30 | length, |
| 31 | rozz, |
| 32 | dct, |
| 33 | style, |
| 34 | comment, |
| 35 | inTable, |
| 36 | nullable, |
| 37 | scale, |
| 38 | ), |
| 39 | ) |
| 40 | .then((item) => { |
| 41 | if (tf) { |
| 42 | tf.ownerColumnId = item.id |
| 43 | return makeTypeFormatCRUD() |
| 44 | .create(tf) |
| 45 | .then(() => item) |
| 46 | } |
| 47 | |
| 48 | tf = makeTypeFormat(dct?.oapiType as any, 1, null, null, null, null, item.id, dct?.oapiFormat) |
| 49 | return makeTypeFormatCRUD() |
| 50 | .create(tf) |
| 51 | .then(() => item) |
| 52 | }) |
| 53 | } |
no test coverage detected