import { CollectionConfig } from "payload";

export const Habbits: CollectionConfig = {
  slug: 'habbits',
  admin: {
    useAsTitle: 'name',
    group: 'User Data',
  },
  fields: [
    {
      name: 'name',
      type: 'text',
    },
    {
      name: 'description',
      type: 'textarea',
    },
    {
      name: 'category',
      type: 'relationship',
      relationTo: 'habbitCategories',
    },
    {
      name: 'instructions',
      type: 'richText',
    },
    {
      name: 'unitValue',
      type: 'number',
    },
    {
      name: 'unitName',
      type: 'text',
    },
    {
      name: 'user',
      type: 'relationship',
      relationTo: 'users',
      hasMany: false,
    },
  ],
}
